Ive having problems loading my nametables and palletes and all the good stuff upon a reset. I heard its best to use a reset in your code when working with NMI's. I cant get those to work so I figured id start using resets. Well heres my code
Everything works fine if i take all the JMPs out. I just want to do resets like i see on everyelses demos, so i can focus on getting my NMI's to work.
Thanks for the Help,
EL
Code:
.org $8000
RESET:
sei
cld
jmp WVB
jmp CHECK
JMP LDNT
NOTHINGAD
JMP NOTHINGAD
WVB
lda #%00001000 ; do the setup of PPU
sta $2000 ; that we
lda #%00011110 ; talked about
sta $2001 ; on a previous day
RTS
CHECK
ldx #$00 ; clear X
lda #$3F ; have $2006 tell
sta $2006 ; $2007 to start
lda #$00 ; at $3F00 (pallete).
sta $2006
loadpal: ; this is a freaky loop
lda tilepal, x ; that gives 32 numbers
sta $2007 ; to $2007, ending when
inx ; X is 32, meaning we
cpx #32 ; are done.
bne loadpal ; if X isn't =32, goto "loadpal:" line.
RTS
LDNT
lda #$20
sta $2006 ; give $2006 both parts of address $2020.
sta $2006
ldx #$00
loadNames1:
lda ourMap, X
sta $2007
inx
bne loadNames1
loadNames2:
lda ourMap+$100, X
sta $2007
inx
bne loadNames2
loadNames3:
lda ourMap+$200, X
sta $2007
inx
bne loadNames3
loadNames4:
lda ourMap+$300, X
sta $2007
inx
cpx #$80
bne loadNames4
RTS
RESET:
sei
cld
jmp WVB
jmp CHECK
JMP LDNT
NOTHINGAD
JMP NOTHINGAD
WVB
lda #%00001000 ; do the setup of PPU
sta $2000 ; that we
lda #%00011110 ; talked about
sta $2001 ; on a previous day
RTS
CHECK
ldx #$00 ; clear X
lda #$3F ; have $2006 tell
sta $2006 ; $2007 to start
lda #$00 ; at $3F00 (pallete).
sta $2006
loadpal: ; this is a freaky loop
lda tilepal, x ; that gives 32 numbers
sta $2007 ; to $2007, ending when
inx ; X is 32, meaning we
cpx #32 ; are done.
bne loadpal ; if X isn't =32, goto "loadpal:" line.
RTS
LDNT
lda #$20
sta $2006 ; give $2006 both parts of address $2020.
sta $2006
ldx #$00
loadNames1:
lda ourMap, X
sta $2007
inx
bne loadNames1
loadNames2:
lda ourMap+$100, X
sta $2007
inx
bne loadNames2
loadNames3:
lda ourMap+$200, X
sta $2007
inx
bne loadNames3
loadNames4:
lda ourMap+$300, X
sta $2007
inx
cpx #$80
bne loadNames4
RTS
Everything works fine if i take all the JMPs out. I just want to do resets like i see on everyelses demos, so i can focus on getting my NMI's to work.
Thanks for the Help,
EL