second: finally got gorilla scroll working

this was much more of a pain than needed
This commit is contained in:
Vince Weaver 2023-11-03 15:37:38 -04:00
parent e410bcc31c
commit 38a56a4686
3 changed files with 123 additions and 7 deletions

View File

@ -17,7 +17,7 @@ GORILLA: gorilla.o
gorilla.o: gorilla.s \
../zx02_optim.s \
../hgr_copy_fast.s \
tv_effect.s \
tv_effect.s horiz_scroll_simple.s \
../zp.inc ../hardware.inc ../qload.inc \
audio/a_pboy.btc.zx02 \
graphics/mntscrl3.hgr.zx02

View File

@ -50,18 +50,33 @@ gorilla_start:
sta COUNT
sta DRAW_PAGE
lda #$60
jsr hgr_copy
;=======================
; scroll in from right
;=======================
bit PAGE1
bit PAGE1 ; draw on visible page
; flipping while scrolling is hard
jsr horiz_scroll_left
; lda #$60
; jsr hgr_copy
; bit PAGE1
;==============================
; todo, possibly flash at end?
;==============================
gorilla_wait:
lda #29
jsr wait_for_pattern
bcc gorilla_wait
; TODO: TV_shutoff effect
;======================
; TV_shutoff effect
;======================
; lda #0
; jsr hgr_page1_clearscreen
@ -110,15 +125,17 @@ gorilla_done:
rts
.align $100
;.align $100
.include "../wait_keypress.s"
; .include "../zx02_optim.s"
; .include "../hgr_table.s"
.include "../hgr_clear_screen.s"
.include "../hgr_copy_fast.s"
.include "../hgr_page_flip.s"
.include "tv_effect.s"
.include "../irq_wait.s"
.include "horiz_scroll_simple.s"
gorilla_data:
.incbin "graphics/mntscrl3.hgr.zx02"

View File

@ -0,0 +1,99 @@
; no page flip currently, that's hard
; scrolls two at a time to preserve colors
horiz_scroll_left:
scroll_left_loop:
lda #0
sta COUNT
scroll_left_outer_outer_loop:
ldx #191 ; end is 191
scroll_left_outer_loop:
; high
lda hposn_high,X
clc
adc DRAW_PAGE
sta hsl_smc1+2 ; SMC1 = $2000+2
sta hsl_smc2+2 ; SMC2 = $2000
sta hsl_smc4+2 ; SMC4 = $2000
sta hsl_smc6+2 ; SMC6 = $2000
ora #$40 ; convert to $6000 range
sta hsl_smc3+2 ; SMC3 = $6000+COUNT
sta hsl_smc5+2 ; SMC5 = $6000+COUNT+1
;=========================
; low
lda hposn_low,X
sta hsl_smc2+1 ; SMC2 = $2000
sta hsl_smc4+1 ; SMC4 = $2000
sta hsl_smc6+1 ; SMC6 = $2000
sta hsl_smc1+1 ; SMC1 = $2000+2
inc hsl_smc1+1
inc hsl_smc1+1
clc
adc COUNT
sta hsl_smc3+1 ; SMC3 = $6000+COUNT
sta hsl_smc5+1 ; SMC5 = $6000+COUNT+1
inc hsl_smc5+1
ldy #0
scroll_left_inner_loop:
hsl_smc1:
lda $2000+2,Y
hsl_smc2:
sta $2000,Y
iny
cpy #38
bne scroll_left_inner_loop
; get new data to scroll in
hsl_smc3:
lda $6000 ; 6000+COUNT
hsl_smc4:
sta $2000,Y ; Y=38
iny
hsl_smc5:
lda $6000+1 ; 6000+COUNT+1
hsl_smc6:
sta $2000,Y ; Y=39
dex
cpx #$FF ; end at top of screen
bne scroll_left_outer_loop
; jsr hgr_page_flip
inc COUNT
inc COUNT
lda COUNT
cmp #40
bne scroll_left_outer_outer_loop
rts