mirror of
https://github.com/deater/tb1.git
synced 2025-03-11 21:41:52 +00:00
snes: finish commenting svmwgraph code
This commit is contained in:
parent
5e938abc53
commit
41c2eef853
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user