A couple things that will cause catastrophe; change:
Code:
.org $0300 ; OAM copy location
Sprite1_Y: .db 0 ; sprite #1's Y value
Sprite1_T: .db 0 ; sprite #1's tile number
Sprite1_S: .db 0 ; sprite #1's special byte
Sprite1_X: .db 0 ; sprite #1's X value
UnusedSprites: .db 0
lda #0
sta Sprite1_Y
sta Sprite1_T
sta Sprite1_S
sta Sprite1_X
sta VBlankOrNo
sta BKGset
sta UnusedSprites
lda #$FF
ldx #0
ClearSprites:
sta UnusedSprites, x
inx
cpx #252
bne ClearSprites
.org $8000 ; program code location
To
Code:
.org $0300 ; OAM copy location
Sprite1_Y: .db 0 ; sprite #1's Y value
Sprite1_T: .db 0 ; sprite #1's tile number
Sprite1_S: .db 0 ; sprite #1's special byte
Sprite1_X: .db 0 ; sprite #1's X value
UnusedSprites: .db 0
.org $8000 ; program code location
Start:
sei ;Just some stuff that's standard to do at reset.
cld
ldx #$FF
txs
lda #0
sta Sprite1_Y
sta Sprite1_T
sta Sprite1_S
sta Sprite1_X
sta VBlankOrNo
sta BKGset
sta UnusedSprites
lda #$FF
ldx #0
ClearSprites:
sta UnusedSprites, x
inx
cpx #252
bne ClearSprites
Also, this:
Code:
wait1:
lda $2002
bpl wait1
wait2:
lda $2002
bpl wait2
VBlank_Routine: ; /////VBlank Routine/////
inc VBlankOrNo ; add 1 to VBlankOrNo (1 if VBlank, 0 if not)
rti ; return from interrupt
CRASH. In your Reset routine, you'll execute an RTI, which is not good. At all. Move "Vblank_Routine" to a place where it will never be executed unless there is an NMI executed. So like right here:
Code:
NOTHINGdown:
jmp infinite
VBlank_Routine: ; /////VBlank Routine/////
inc VBlankOrNo ; add 1 to VBlankOrNo (1 if VBlank, 0 if not)
rti ; return from interrupt
would be just fine. Oh, and change this:
Code:
infinite:
lda #%10001000 ; screen pattern table = $0000, sprite pattern table = $1000, name table = $2000
sta $2000
lda #%00011110 ; BG = black, show sprites, screen on, don't clip anything, color display
sta $2001
To
Code:
lda #%10001000 ; screen pattern table = $0000, sprite pattern table = $1000, name table = $2000
sta $2000
lda #%00011110 ; BG = black, show sprites, screen on, don't clip anything, color display
sta $2001
infinite:
I don't think there's any need to do write to $2000/$2001 constantly because the value never changes.