trogdor: scroll in cottage

also move things around as we hit the 16k limit
This commit is contained in:
Vince Weaver 2024-01-25 00:19:13 -05:00
parent e6924d8dd0
commit 626121ef29
4 changed files with 82 additions and 22 deletions

View File

@ -37,6 +37,12 @@ QLOAD: qload.o
ld65 -o QLOAD qload.o -C $(LINKER_SCRIPTS)/apple2_1200.inc
qload.o: zp.inc hardware.inc music.inc qload.s \
hgr_sprite_big_mask.s \
horiz_scroll_simple.s \
horiz_scroll_skip.s \
hgr_copy_magnify.s \
vertical_scroll.s \
hgr_copy_part.s \
gr_offsets.s \
wait.s wait_a_bit.s \
lc_detect.s \
@ -92,6 +98,13 @@ qload.inc: generate_common QLOAD
./generate_common -a 0x1200 -s hgr_clear_screen qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_copy_fast qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_page_flip qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_copy_part qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_draw_sprite_big_mask qload.lst >> qload.inc
./generate_common -a 0x1200 -s horiz_pan qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_vertical_scroll_right qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_vertical_scroll_left qload.lst >> qload.inc
./generate_common -a 0x1200 -s horiz_pan_skip qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_copy_magnify qload.lst >> qload.inc
####

View File

@ -211,6 +211,12 @@ hposn_low = $1e00
hposn_high = $1f00
.include "hgr_table.s"
.include "hgr_sprite_big_mask.s"
.include "horiz_scroll_simple.s"
.include "horiz_scroll_skip.s"
.include "hgr_copy_magnify.s"
.include "vertical_scroll.s"
.include "hgr_copy_part.s"
qload_end:

View File

@ -280,13 +280,13 @@ left_flame_animate2:
scroll_in_loop:
jsr hgr_vertical_scroll
jsr hgr_vertical_scroll_left
lda COUNT
clc
adc #8
cmp #192
cmp #200
bne scroll_in_loop
lda #10
@ -537,6 +537,35 @@ up_down_animate:
; white screen
; scroll up cottage, takes roughly 90 frames (3s)
ldy #$7f
jsr hgr_clear_screen
jsr hgr_page_flip
lda #<trog04_graphics
sta zx_src_l+1
lda #>trog04_graphics
sta zx_src_h+1
lda #$60
jsr zx02_full_decomp
lda #0
sta COUNT
scroll_in_loop2:
jsr hgr_vertical_scroll_right
lda COUNT
clc
adc #8
cmp #200
bne scroll_in_loop2
lda #10
jsr wait_ticks
;======================================
; draw SCENE 13
;======================================
@ -598,15 +627,15 @@ trog04_graphics:
.include "irq_wait.s"
hposn_low = $1e00
hposn_high = $1f00
;hposn_low = $1e00
;hposn_high = $1f00
.include "hgr_sprite_big_mask.s"
.include "horiz_scroll_simple.s"
.include "horiz_scroll_skip.s"
.include "hgr_copy_magnify.s"
.include "vertical_scroll.s"
.include "hgr_copy_part.s"
;.include "hgr_sprite_big_mask.s"
;.include "horiz_scroll_simple.s"
;.include "horiz_scroll_skip.s"
;.include "hgr_copy_magnify.s"
;.include "vertical_scroll.s"
;.include "hgr_copy_part.s"
;===============================
; draw_flame_small

View File

@ -1,20 +1,31 @@
;=======================================
; scrolls to PAGE1
; relies on going off the edge...
; hgr_vertical scroll
;=======================================
; scrolls from $6000 to page1
; jumps increments of 8 for speed
;=======================================
; offset line in $6000 to copy in from in COUNT
hgr_vertical_scroll_left:
lda #0
beq hgr_vertical_scroll_common
hgr_vertical_scroll_right:
lda #20
hgr_vertical_scroll_common:
sta vscroll_offset_smc+1
hgr_vertical_scroll:
ldx #0
ldx #0 ; start at top
outer_vscroll_loop:
lda hposn_low,X
sta OUTL
lda hposn_low,X ; get page1 address
sta OUTL ; set as output
lda hposn_high,X
sta OUTH
txa
clc
txa ; get address of X+8
clc ; and set as input
adc #8
tay
lda hposn_low,y
@ -22,7 +33,7 @@ outer_vscroll_loop:
lda hposn_high,Y
sta INH
ldy #29
ldy #29 ; only scroll from 9..29
inner_vscroll_loop:
lda (INL),Y
sta (OUTL),Y
@ -41,12 +52,12 @@ inner_vscroll_loop:
; for now from 0..19
hgr_vertical_scroll2:
ldx #184
ldx #184 ; start 8 from bottom
outer_vscroll_loop2:
lda hposn_low,X
clc
adc #10
adc #10 ; copy to middle of screen
sta OUTL
lda hposn_high,X
@ -54,6 +65,9 @@ outer_vscroll_loop2:
ldy COUNT
lda hposn_low,Y
clc
vscroll_offset_smc:
adc #$0
sta INL
lda hposn_high,Y
clc
@ -73,7 +87,5 @@ inner_vscroll_loop2:
cpx #192
bne outer_vscroll_loop2
rts