Hello!
I googled and read the asm6 loopy's readme but I couldn't find an answer how to correctly use the IF ELSE directive.
I'm using fceux hex editor for debugging and I can see the updateDirection value set correctly. But it will never execute the update code.
If I do it without the ELSE IF directive it works correctly.
I guess I could keep using the old code but I really like the IF ELSE more because it makes reading the code much easier.
I have a feeling it's comparing the updateDirection addresses not the values stored at updateDirection but I have no idea how to fix it.
Any help is appreciated
I googled and read the asm6 loopy's readme but I couldn't find an answer how to correctly use the IF ELSE directive.
Code:
...
;define variable
updateDirection = $45
...
IF updateDirection = 1
.include "updateUp.asm"
ELSEIF updateDirection = 2
.include "updateDown.asm"
ENDIF
;define variable
updateDirection = $45
...
IF updateDirection = 1
.include "updateUp.asm"
ELSEIF updateDirection = 2
.include "updateDown.asm"
ENDIF
I'm using fceux hex editor for debugging and I can see the updateDirection value set correctly. But it will never execute the update code.
If I do it without the ELSE IF directive it works correctly.
Code:
LDA updateDirection
CMP #$01
BNE SetDownRender
SetUpRender:
.include "updateUp.asm"
JMP EndSetUp
SetDownRender:
.include "updateDown.asm"
EndSetUp:
CMP #$01
BNE SetDownRender
SetUpRender:
.include "updateUp.asm"
JMP EndSetUp
SetDownRender:
.include "updateDown.asm"
EndSetUp:
I guess I could keep using the old code but I really like the IF ELSE more because it makes reading the code much easier.
I have a feeling it's comparing the updateDirection addresses not the values stored at updateDirection but I have no idea how to fix it.
Any help is appreciated