Alright. Things have been fine for a while, but in chat I have learned about sprites and conflicts. This has only come into play now that I've been trying to add NSF support to the game.
What basically happens is that some graphics don't show up and others are "moved over". I've even gotten an interesting attribute table being wrong.
So... I didn't get everything, so I figured I'd try doing a step-by-step look at this problem.
One thing that was mentioned involved how I'm clearing the memory. Basically, I'm doing this right now:
I recall hearing that $0200 should have all $FE's in there instead of $00. When I do that, the graphical things seem to go away, but the triangle wave starts playing low notes for no reason, leading me to believe something's wrong.
Another person had mentioned trying to put in code to skip the NMI routine a couple of times if a flag was set.
Anyway, is what I'm saying making sense and are there any easy answers?
Thanks and this'll be the last time I bug you this year!
What basically happens is that some graphics don't show up and others are "moved over". I've even gotten an interesting attribute table being wrong.
So... I didn't get everything, so I figured I'd try doing a step-by-step look at this problem.
One thing that was mentioned involved how I'm clearing the memory. Basically, I'm doing this right now:
Code:
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
LDA #$00
STA $2003 ; set the low byte (00) of the RAM address
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 $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
STA $0200, x ;FLAGGED CODE
LDA #$FE
STA $0300, x
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
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
LDA #$00
STA $2003 ; set the low byte (00) of the RAM address
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 $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
STA $0200, x ;FLAGGED CODE
LDA #$FE
STA $0300, x
INX
BNE clrmem
vblankwait2: ; Second wait for vblank, PPU is ready after this
BIT $2002
BPL vblankwait2
I recall hearing that $0200 should have all $FE's in there instead of $00. When I do that, the graphical things seem to go away, but the triangle wave starts playing low notes for no reason, leading me to believe something's wrong.
Another person had mentioned trying to put in code to skip the NMI routine a couple of times if a flag was set.
Anyway, is what I'm saying making sense and are there any easy answers?
Thanks and this'll be the last time I bug you this year!