second: add tv effect for gorilla

This commit is contained in:
Vince Weaver 2023-11-01 20:06:47 -04:00
parent 94c3c05d45
commit 06acbd819e
3 changed files with 123 additions and 2 deletions

View File

@ -17,6 +17,7 @@ GORILLA: gorilla.o
gorilla.o: gorilla.s \
../zx02_optim.s \
../hgr_copy_fast.s \
tv_effect.s \
../zp.inc ../hardware.inc ../qload.inc \
graphics/mntscrl3.hgr.zx02
ca65 -o gorilla.o gorilla.s -l gorilla.lst

View File

@ -68,8 +68,10 @@ gorilla_wait:
; TODO: TV_shutoff effect
lda #0
jsr hgr_page1_clearscreen
; lda #0
; jsr hgr_page1_clearscreen
jsr tv_effect
gorilla_wait2:
lda #30
@ -89,6 +91,7 @@ gorilla_done:
.include "../hgr_clear_screen.s"
.include "../hgr_copy_fast.s"
.include "tv_effect.s"
.include "../irq_wait.s"
gorilla_data:

View File

@ -0,0 +1,117 @@
;===========================
; tv turning off effect
;===========================
tv_effect:
ldx #0
lda #191
sta COUNT ; count = bottom
compact_loop:
stx SAVEX ; X = top
;=======================
; zero out bottom line
ldx COUNT
lda hposn_low,X
sta GBASL
lda hposn_high,X
sta GBASH
lda #0
ldy #39
compact_inner_loop2:
sta (GBASL),Y
dey
bpl compact_inner_loop2
dec COUNT
;=======================
; zero out top line
ldx SAVEX
compact_not_even:
lda hposn_low,X
sta GBASL
lda hposn_high,X
sta GBASH
lda #0
ldy #39
compact_inner_loop:
sta (GBASL),Y
dey
bpl compact_inner_loop
lda #10
jsr wait
inx
cpx #95
bne compact_loop
lda #100
jsr wait
;=================================
; now close it down horizontally
ldx #95
lda hposn_low,X
sta GBASL
lda hposn_high,X
sta GBASH
inx
lda hposn_low,X
sta OUTL
lda hposn_high,X
sta OUTH
lda #39
sta COUNT
ldy #0
zappo_outer_loop:
ldx #0
zappo_inner_loop:
lda pixel_pattern_left,X
sta (OUTL),Y
sta (GBASL),Y
tya
pha
ldy COUNT
lda pixel_pattern_right,X
sta (OUTL),Y
sta (GBASL),Y
pla
tay
inx
cpx #8
bne zappo_inner_loop
lda #75
jsr wait
dec COUNT
iny
cpy #20
bne zappo_outer_loop
rts
pixel_pattern_left:
.byte $7f,$7e,$7c,$78,$70,$60,$40,$00
pixel_pattern_right:
.byte $7F,$3F,$1F,$0F,$07,$03,$01,$00