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 $f5c1 ; Unsigned 16-bit sum of ROM
.word $9de ; Complement of checksum
.word $f621 ; Unsigned 16-bit sum of ROM

View File

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