keen: fix some hard to find scrolling bugs

This commit is contained in:
Vince Weaver 2024-04-15 01:10:39 -04:00
parent bc6f040d71
commit 1eed019e50
3 changed files with 10 additions and 10 deletions

View File

@ -365,7 +365,7 @@ done_parts:
; snapshot tile map ; snapshot tile map
;=============================== ;===============================
;=============================== ;===============================
; copy currnet tilemap graphics ; copy current tilemap graphics
; to $c00 for fade-in/fade-out ; to $c00 for fade-in/fade-out
snapshot_tilemap: snapshot_tilemap:
@ -579,8 +579,9 @@ recenter_map:
lda MARS_TILEX lda MARS_TILEX
cmp #10 cmp #10
bcc mars_tilex_fine bcc mars_tilex_fine ; if MARS_TILEX < 10, leave tilemap 0
sec
sec ; otherwise tilemap=mars_tilex-10
sbc #10 sbc #10
sta TILEMAP_X sta TILEMAP_X
@ -588,8 +589,9 @@ mars_tilex_fine:
lda MARS_TILEY lda MARS_TILEY
cmp #6 cmp #6
bcc mars_tiley_fine bcc mars_tiley_fine ; if MARS_TILEY < 6 leave tilemap 0
sec
sec ; otherwise tilemap_y=mars_tiley-6
sbc #6 sbc #6
sta TILEMAP_Y sta TILEMAP_Y
@ -597,7 +599,6 @@ mars_tiley_fine:
rts rts
location_x: location_x:
.byte 19,22, 9,22,13,16,25,38 .byte 19,22, 9,22,13,16,25,38
.byte 36,43,52,36,44,60,38,29 .byte 36,43,52,36,44,60,38,29

View File

@ -286,9 +286,8 @@ up_pressed:
beq move_keen_up beq move_keen_up
sec sec
lda TILEMAP_Y lda MARS_TILEY
sbc MARS_TILEY sbc TILEMAP_Y
cmp #4 cmp #4
bcc scroll_keen_up bcc scroll_keen_up

View File

@ -13,7 +13,7 @@ tilemap_lookup_high:
.byte (>big_tilemap)+ 7,(>big_tilemap)+ 7 ; 14,15 .byte (>big_tilemap)+ 7,(>big_tilemap)+ 7 ; 14,15
.byte (>big_tilemap)+ 8,(>big_tilemap)+ 8 ; 16,17 .byte (>big_tilemap)+ 8,(>big_tilemap)+ 8 ; 16,17
.byte (>big_tilemap)+ 9,(>big_tilemap)+ 9 ; 18,19 .byte (>big_tilemap)+ 9,(>big_tilemap)+ 9 ; 18,19
.byte (>big_tilemap)+10,(>big_tilemap)+ 0 ; 20,21 .byte (>big_tilemap)+10,(>big_tilemap)+10 ; 20,21
.byte (>big_tilemap)+11,(>big_tilemap)+11 ; 22,23 .byte (>big_tilemap)+11,(>big_tilemap)+11 ; 22,23
.byte (>big_tilemap)+12,(>big_tilemap)+12 ; 24,25 .byte (>big_tilemap)+12,(>big_tilemap)+12 ; 24,25
.byte (>big_tilemap)+13,(>big_tilemap)+13 ; 26,27 .byte (>big_tilemap)+13,(>big_tilemap)+13 ; 26,27