snes: make star scrolling wrap properly

This commit is contained in:
Vince Weaver 2013-01-25 17:37:24 -05:00
parent 0ee9573daa
commit e9aa81ccda
2 changed files with 20 additions and 6 deletions

View File

@ -1,2 +1,2 @@
.word $a832 ; Complement of checksum
.word $57cd ; Unsigned 16-bit sum of ROM
.word $a4b0 ; Complement of checksum
.word $5b4f ; Unsigned 16-bit sum of ROM

View File

@ -4,6 +4,8 @@
joypad1 = $0000
joypad2 = $0001
shipx = $0002
star_scroll = $0003
star_scroll_h = $0004 ; 0004 too, 16-bit
.setcpu "65816"
@ -242,18 +244,30 @@ level1_setup_video:
jsr svmw_fade_in
; lda #$0f
; sta $2100 ; Turn on screen, full Brightness
; init vars
lda #104
sta shipx
stz star_scroll
stz star_scroll_h
level1_loop:
wai ; wait for interrupt
; scroll background
lda star_scroll
sta $2110
lda star_scroll_h
sta $2110
rep #$20 ; A/mem=16 bit
.a16
dec star_scroll
sep #$20 ; A/mem=8 bit
.a8
; handle keypress
lda joypad1
check_left: