Code: Select all
include "nesdefs.dasm"
NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, horiz. mirror
;;;;; START OF CODE
Start:
; wait for PPU warmup; clear CPU RAM
NES_INIT
ldx #8
jmp s1
.endless
jmp .endless ; endless loop
s1:
dex
rts
Code: Select all
0BE5 FFFFFF ISB $FFFF,x
0BE8 FFFFFF ISB $FFFF,x
0BEB FFFFFF ISB $FFFF,x
0BEE FFFFFF ISB $FFFF,x
0BF1 FFFFFF ISB $FFFF,x
0BF4 FFFFFF ISB $FFFF,x
0BF7 FFFFFF ISB $FFFF,x
0BFA FFFFFF ISB $FFFF,x
0BFD FFFFFF ISB $FFFF,x
0C00 FFFFFF ISB $FFFF,x
0C03 FFFFFF ISB $FFFF,x
0C06 FFFFFF ISB $FFFF,x and I've tried fiddling with it in various ways, but no luck. I started with 8bitworkshop's minimal initialization example and got rid of as much of it as possible, but given that the included subroutine .endless does work, I'm not sure what I'm doing wrong.
the only code from nesdefs.dasm that's actually run when I use the code with the jmp instruction commented out is the following. I have some more code still in there I haven't deleted, but I don't think it's relevant.
Code: Select all
MAC NES_INIT
sei ;disable IRQs
cld ;decimal mode not supported
ldx #$ff
txs ;set up stack pointer
inx ;increment X to 0
stx PPU_MASK ;disable rendering
stx DMC_FREQ ;disable DMC interrupts
stx PPU_CTRL ;disable NMI interrupts
bit PPU_STATUS ;clear VBL flag
bit APU_CHAN_CTRL ;ack DMC IRQ bit 7
lda #$40
sta APU_FRAME ;disable APU Frame IRQ
lda #$0F
sta APU_CHAN_CTRL ;disable DMC, enable/init other channels.
ENDMSorry my code examples don't have syntax highlighting, haven't learned how to do that yet. Thanks in advance!