snes: fix sprite copy routine

urgh the 8/16 bit rep/sep strikes again
This commit is contained in:
Vince Weaver 2013-01-21 12:05:57 -05:00
parent 50596ea3b4
commit b77a08de38
3 changed files with 17 additions and 34 deletions

View File

@ -1,2 +1,2 @@
.word $6e57 ; Complement of checksum
.word $91a8 ; Unsigned 16-bit sum of ROM
.word $762f ; Complement of checksum
.word $89d0 ; Unsigned 16-bit sum of ROM

View File

@ -125,37 +125,12 @@ level_1:
lda #%01110000
sta $0003
; rep #$20 ; mem/A = 16 bit
;.a16
lda #%01010100
sta $0200
jsr svmw_transfer_sprite
SetupVideo:
rep #$10
sep #$20
; stz $2102
; stz $2103
;=============================
;*********transfer sprite data
;=============================
stz $2102 ; set OAM address to 0
stz $2103
ldy #$0400
sty $4300 ; CPU -> PPU, auto increment, write 1 reg, $2104 (OAM Write)
stz $4302
stz $4303 ; source offset
ldy #$0220
sty $4305 ; number of bytes to transfer
lda #$7E
sta $4304 ; bank address = $7E (work RAM)
lda #$01
sta $420B ; start DMA transfer
; Enable sprite
; sssnnbbb
; ss = size (8x8 in our case)
@ -164,6 +139,13 @@ SetupVideo:
lda #%00000000
sta $2101
jsr svmw_transfer_sprite
SetupVideo:
rep #$10
sep #$20
lda #%00010001 ; Enable BG1 and sprites
sta $212C
stz $212d
@ -176,11 +158,11 @@ SetupVideo:
; sta $4200 ;
main_loop:
level1_loop:
; all work done in interrupt handler
bra main_loop
bra level1_loop
;=============================

View File

@ -57,9 +57,10 @@ set_top:
svmw_transfer_sprite:
php ; save status word
rep #$30 ; 16bit mem/A, 16 bit X/Y
.a16
rep #$10 ; 16 bit X/Y
.i16
sep #$20 ; 8 bit A
.a8
; p------b p=special object priority
; aaaaaaaa baaaaaaaa = OAM address