I am trying to make a generator that shows level message 1 if the extra bit is clear and level message 2 if the extra bit is set.
For some reason it always displays message 2. I have read through the code several times but can't find what I did wrong. The code is pretty short so I just pasted it in the post.
I saved some of the data to $58 since the RAM map said it was unused. I don't know if you're supposed to do that...
I'm also pretty new to ASM, so maybe I am missing something really basic...
For some reason it always displays message 2. I have read through the code several times but can't find what I did wrong. The code is pretty short so I just pasted it in the post.
I saved some of the data to $58 since the RAM map said it was unused. I don't know if you're supposed to do that...
I'm also pretty new to ASM, so maybe I am missing something really basic...
Code
dcb "INIT" RTL dcb "MAIN" LDA $7FAB10,x AND #$04 ;Checks if the extra bit is set, determing weither message 1 or 2 should show BNE Message2 ;Message1: LDA $58 AND #$01 ;Checks if message 1 has already been shown BNE MessageShown LDA #$01 STA $1426 ;Spawns a message box containing message 1 LDA #$01 TSB $58 ;Sets bit 1, flagging that message 1 has already been shown RTL Message2: LDA $58 AND #$02 ;Checks if message 2 has already been shown BNE MessageShown LDA #$02 STA $1426 ;Spawns a message box containing message 2 LDA #$02 TSB $58 ;Sets bit 2, flagging that message 2 has already been shown RTL MessageShown: RTL
allow shy guy emojis in post footers you cowards!