.inesprg 2 ; 2 banks .ineschr 1 ; .inesmap 0 ; mapper 0 = NROM .inesmir 0 ; background mirroring, horizontal .org $8000 RESET: sei ; Ignore IRQs while starting up cld ; disabled decimal mode (iirc it doesn't work properly on NES anyway) ldx #$40 stx $4017 ; Disable APU frame IRQ ldx #$ff txs ; Set stack pointer to 0x1ff inx ; Set x to zero stx $2000 ; Disable NMI (by writing zero) stx $2001 ; Disable rendering stx $4010 ; Disable DMC IRQs bit $2002 ; Clear vblank flag by reading ppu status VBLANKWAIT1: bit $2002 bpl VBLANKWAIT1 ; VBLANKWAIT2: ; bit $2002 ; bpl VBLANKWAIT2 hlt hlt ERROR_: hlt IGNORE: rti .org $FFFA ; Interrupt vectors go here: .word IGNORE ; NMI .word RESET ; Reset .word IGNORE; IRQ ;;;; NESASM COMPILER STUFF, ADDING THE PATTERN DATA ;;;; .incbin "Sprites.pcx" .incbin "Tiles.pcx"