[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vr/ - Retro Games


View post   

File: 3 KB, 256x224, KabukiQuatumFighter6502CPU.png [View same] [iqdb] [saucenao] [google]
7980175 No.7980175 [Reply] [Original]

Anyone here know 6502 assembly? I'm trying to figure out if the code in the pic actually means anything or if it's just nonsense. What would it do?

Transcribed version:

LDA N2ATBL+0 ;
LDY #2
JMP EMF000

EQU *
LDA #2
JSR FALL

LDA WRKST+6,X ;FAL
BPL TES250

LDA WRKST+6,X ;WAL
BPL TES240
RTS

EQU *
LDA N2ATBL+0 ;MOV
LDY #2 ;BOX NO.
JMP EMF000

EQU *
LDA WRKST+6,X
BPL TES300

AND #$7F
STA WRKST+8,X ;

>> No.7980202

>>7980175
Here you can see for yourself. Just go line by line and you'll know what it does
https://www.masswerk.at/6502/6502_instruction_set.html

>> No.7980225
File: 18 KB, 700x620, seachase_explosion_small.png [View same] [iqdb] [saucenao] [google]
7980225

>>7980175
Looks like valid 6502 code. It's impossible to tell what it does without more context though.

>> No.7980243
File: 339 KB, 527x484, chuck.png [View same] [iqdb] [saucenao] [google]
7980243

>>7980175
> LDA N2ATBL+0 ;
> LDY #2
> JMP EMF000
Loads A with whatever is at N2ATBL and Y with 2 and jumps to label EMF000. We don't know what is at EMF000.
> EQU *
This kind of doesn't make sense. EQU is a string replacement assembler command and * refers to the current memory address. I'm not sure exactly... Probably a command unique to this particular assembler.
> LDA #2
> JSR FALL
Load A register with 2 and jump to subroutine FALL. We don't know what's there.
A JSR will return to the location after the subroutine has ended with an RTS (return to subroutine) command, unlike JMP which does not store a return address on the stack.
> LDA WRKST+6,X ;FAL
> BPL TES250
Load the byte at WRKST plus 6 plus the value of X register, if it is positive (0-127), goto TES240. We don't know what's there.
> LDA WRKST+6,X ;WAL
> BPL TES240
> RTS
Similar to above, if the branch isn't taken, return (from) subroutine to wherever you called JSR from.
> EQU *
> LDA N2ATBL+0 ;MOV
> LDY #2 ;BOX NO.
> JMP EMF000
Similar to the top instructions.
> EQU *
> LDA WRKST+6,X
> BPL TES300
Similar to the others.
> AND #$7F
Take the current value in A and turn bit 7 to 0.
> STA WRKST+8,X
Store it at WRKST plus 8 plus the value of X register.
So yeah, it's valid code, doing ....something. We just cant tell what without more information. I hope that answers your question.

>> No.7980281

>>7980202
I was already trying that, but then I started contemplating if it was worth learning assembler just to understand one snippet

>>7980243
Fantastic explanation, thank you so much for your time anon

>> No.7980519

>>7980175
Is this loading sound data and putting it into the sound registers?

>> No.7980531

Funny thing I made myself a romhack of this game so that the scrolling happens when the character is in the middle of the screen and not 3/4th to the right, just to make the game bearable. It is a simple one byte fix.

Then I kept playing and realize that things like conveyor belts and icy floors still affected the player during jumps when he is above those floors, and that's just fucking wrong. I wanted to fix that too but the ASM in that game was a mess.

>> No.7980596

>>7980531
Human Entertainment did this game. I don't think they ever made a non-shitty game for the NES.

https://en.wikipedia.org/wiki/Human_Entertainment#Nintendo_Entertainment_System

>> No.7980695

>>7980596
Egypt was fun

>> No.7982165

>>7980596
>Kabuki Quantum Fighter
>shitty

:/