Just getting my feet wet, so bear with me...
As the title suggests, I was attempting to translate bunny's first NESASM tutorial into ASM6 syntax. After rearranging and fiddling a bit, I was able to get my source to compile, but it doesn't produce the proper output. More specifically, it produces a blank gray screen in the emulator (it should be blue). The tutorial is basically flipping an emphasis bit to change the background color.
Here's my source:
; iNES identifier
.byte "NES",$1a
.byte $01 ; 1 PRG-ROM block
.byte $01 ; 1 CHR-ROM block
.byte $00 ; unsure about these...which is mapper?
.byte $00 ;
;;;;;;;;;;;;;;
.org $0000
.incbin mario.chr ;includes 8KB graphics file from SMB1
;;;;;;;;;;;;;;
.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
vblankwait1: ; First wait for vblank to make sure PPU is ready
BIT $2002
BPL vblankwait1
clrmem:
LDA #$00
STA $0000, x
STA $0100, x
STA $0200, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0300, x
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
LDA #%01000000 ;intensify emphasis bit
STA $2001
Forever:
JMP Forever ;jump back to Forever, infinite loop
NMI:
RTI
.org $FFFA ;first of the three vectors starts here
.dw NMI ;when an NMI happens (once per frame if enabled) the
;processor will jump to the label NMI:
.dw RESET ;when the processor first turns on or is reset, it will jump
;to the label RESET:
.dw 0 ;external interrupt IRQ is not used in this tutorial
So I'm not sure what's going wrong here. I omitted the 'bank' directives, as I understand that ASM6 doesn't require them. The header was cobbled together from a different tutorial (which also explains why chr data is there as well). I'm not sure how this should look in ASM6. The source also wouldn't compile until I put my .org statements in order.
This is all elementary, but where am I screwing up?
As the title suggests, I was attempting to translate bunny's first NESASM tutorial into ASM6 syntax. After rearranging and fiddling a bit, I was able to get my source to compile, but it doesn't produce the proper output. More specifically, it produces a blank gray screen in the emulator (it should be blue). The tutorial is basically flipping an emphasis bit to change the background color.
Here's my source:
Code:
; iNES identifier
.byte "NES",$1a
.byte $01 ; 1 PRG-ROM block
.byte $01 ; 1 CHR-ROM block
.byte $00 ; unsure about these...which is mapper?
.byte $00 ;
;;;;;;;;;;;;;;
.org $0000
.incbin mario.chr ;includes 8KB graphics file from SMB1
;;;;;;;;;;;;;;
.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
vblankwait1: ; First wait for vblank to make sure PPU is ready
BIT $2002
BPL vblankwait1
clrmem:
LDA #$00
STA $0000, x
STA $0100, x
STA $0200, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
LDA #$FE
STA $0300, x
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
LDA #%01000000 ;intensify emphasis bit
STA $2001
Forever:
JMP Forever ;jump back to Forever, infinite loop
NMI:
RTI
.org $FFFA ;first of the three vectors starts here
.dw NMI ;when an NMI happens (once per frame if enabled) the
;processor will jump to the label NMI:
.dw RESET ;when the processor first turns on or is reset, it will jump
;to the label RESET:
.dw 0 ;external interrupt IRQ is not used in this tutorial
So I'm not sure what's going wrong here. I omitted the 'bank' directives, as I understand that ASM6 doesn't require them. The header was cobbled together from a different tutorial (which also explains why chr data is there as well). I'm not sure how this should look in ASM6. The source also wouldn't compile until I put my .org statements in order.
This is all elementary, but where am I screwing up?