climb: fix issue that crashed on real hardware

we were indexing off the end of the sprite and on real hardware the
uninitialied pointers there indexed into bad places
This commit is contained in:
Vince Weaver 2024-09-19 21:55:02 -04:00
parent 8391455d46
commit 345214d6b4

View File

@ -52,6 +52,24 @@ hgr_draw_sprite_bg_mask:
sta hdsb_ysize_smc+1 sta hdsb_ysize_smc+1
clc clc
adc CURSOR_Y adc CURSOR_Y
cmp #192
bcc hdsb_ysize_ok
hdsb_ysize_not_ok:
; adjust self modify
; want it to be (192-SPRITE_Y)
; lda #192
; sec
; sbc SPRITE_Y
; sta sprite_ysize_smc+1 ; self modify for end row
lda #191 ; max out yend
hdsb_ysize_ok:
sta save_yend,Y sta save_yend,Y
;================================ ;================================