I'm trying to convert a project I'm working on to asm6 (specifically asm6f [https://github.com/freem/asm6f]) from nesasm3 but I'm running into difficulties. I followed the guidance given in viewtopic.php?t=12219&start=0#p138851 and the NES file compiles without any issues. But when I run in Mesen, it doesn't work. I've been comparing the nesasm3-generated NES to the asm6-generated NES and I'm seeing some weird issues where chunks of code that are interpreted by Mesen's debugger as valid 6502 statements when looking at the nesasm3 file are interpreted as "unidentified data" when looking at the asm6 file, even though the opcodes are the same.
For example, in my RESET handler, I had the following, with VBlankWait as a subroutine later in the program:
Code: Select all
.org $C000
RESET:
SEI ; disable IRQs
CLD ; disable decimal mode
LDX #$40
STX $4017 ; disable APU frame IRQ
LDX #$FF
TXS ; Set up stack
INX ; now X = 0
STX $2000 ; disable NMI
STX $2001 ; disable rendering
STX $4010 ; disable DMC IRQs
JSR VBlankWait ; First wait for vblank to make sure PPU is ready
LDX #$00
clrmem:
LDA #$00
STA $0000, x
STA $0100, x
;STA $01F0, x
STA $0300, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0200, x
INX
CPX #$00
BNE clrmem
JSR VBlankWait ; Second wait for vblank, PPU is ready after this
LDA <palette
STA paletteLo
LDA >palette
STA paletteHi
JSR LoadPalettes
if I replace the JSR and just copy-and-paste the VBlankWait function into those two spots and compile with asm6, then Mesen's debugger correctly interprets it. But this is happening in other places as well, and I'm not sure what to do, because I sure can't replace every single JMP or JSR with inlined code!
I also tested the asm6-generated NES file with fceux, and it doesn't work either, so it's not just a Mesen issue. Apparently there's some change I need to make to my code to get it to appropriately assembly with asm6, but reading the included documentation, I'm not sure what it is.
Thanks!