snes: finish commenting svmwgraph code

This commit is contained in:
Vince Weaver 2013-02-05 16:16:43 -05:00
parent 5e938abc53
commit 41c2eef853
2 changed files with 23 additions and 20 deletions

View File

@ -1,2 +1,2 @@
.word $a3e ; Complement of checksum .word $9de ; Complement of checksum
.word $f5c1 ; Unsigned 16-bit sum of ROM .word $f621 ; Unsigned 16-bit sum of ROM

View File

@ -381,33 +381,36 @@ activate_sprite:
; assumes high sprite table at $0400 ; assumes high sprite table at $0400
; sets carry if active ; sets carry if active
; clears carry if not ; clears carry if not
; sprite number in X ; sprite number in Y
deactivate_sprite: deactivate_sprite:
php php ; save status on stack
phx phx ; save X
phy phy ; save Y
lda #$0 tyx ; copy Y to X
xba
tyx rep #$20 ; set A to 16-bit
.a16
; address=$0400 + Y/4 ; address=$0400 + Y/4
txa tya ; copy Y to A
lsr ; divide by 4
lsr lsr
lsr tay ; copy back to Y
tay
txa txa ; get low bits into X
and #$3 and #$3 ; Mask
tax tax
lda SPRITE_HIGH_LOOKUP,X
sep #$20 ; set A to 8-bit
.a8
lda SPRITE_HIGH_LOOKUP,X ; lookup bits in table
ora $0400,Y ; sprite off screen when bit is 1 ora $0400,Y ; sprite off screen when bit is 1
sta $0400,Y sta $0400,Y ; save value back out
ply ply ; restore Y
plx plx ; restore X
plp plp ; restore status
rts rts ; return