pt3_lib_ch6: add visualization

not a particularly good one
This commit is contained in:
Vince Weaver 2024-01-18 01:50:44 -05:00
parent 8aacb5125e
commit 4ff638f55a
6 changed files with 121 additions and 3 deletions

View File

@ -26,7 +26,7 @@ PT3_TEST: pt3_test.o
pt3_test.o: pt3_test.s \
pt3_lib_detect_model.s \
pt3_lib_init.s pt3_lib_core.s pt3_lib_irq_handler.s \
pt3_lib_common.s pt3_lib_core2.s \
pt3_lib_common.s pt3_lib_core2.s visual.s \
pt3_lib_mockingboard_detect.s pt3_lib_mockingboard_setup.s \
interrupt_handler.s zp.inc
ca65 -o pt3_test.o pt3_test.s -l pt3_test.lst

View File

@ -13,8 +13,8 @@ SET_GR = $C050
SET_TEXT = $C051
FULLGR = $C052
TEXTGR = $C053
PAGE0 = $C054
PAGE1 = $C055
PAGE1 = $C054
PAGE2 = $C055
LORES = $C056 ; Enable LORES graphics
HIRES = $C057 ; Enable HIRES graphics
AN3 = $C05E ; Annunciator 3

View File

@ -109,6 +109,8 @@ mockingboard_found:
jsr print_mocking_found
jsr print_artist_message
;==================================================
; patch the playing code with the proper slot value
;==================================================
@ -147,7 +149,14 @@ start_interrupts:
;============================
; Loop forever
;============================
bit SET_GR
bit LORES
bit TEXTGR
bit PAGE1
forever_loop:
jsr visualization
jmp forever_loop
@ -222,6 +231,24 @@ done_found_message:
rts
print_artist_message:
jsr CROUT1
ldy #0
print_artist_message_loop:
lda artist_message,Y ; load loading message
beq done_artist_message
ora #$80
jsr COUT
iny
jmp print_artist_message_loop
done_artist_message:
rts
;=========
; strings
;=========
@ -231,6 +258,7 @@ mocking_message: .asciiz "LOOKING FOR MOCKINGBOARD: "
not_message: .byte "NOT "
found_message: .asciiz "FOUND SLOT#4"
artist_message: .asciiz "PLAYING: 'DANCE OF THE DEAD' BY DYA"
;=========
@ -254,6 +282,8 @@ found_message: .asciiz "FOUND SLOT#4"
; if you're self patching, detect has to be after interrupt_handler.s
.include "pt3_lib_mockingboard_detect.s"
.include "visual.s"
;=============
; include song
;=============

View File

@ -0,0 +1,74 @@
visualization:
ldx #0
vis_loop_outer:
lda gr_offsets_l,X
sta GBASL
lda gr_offsets_h,X
sta GBASH
lda $70,X
ldy #19
vis_loop_inner:
sta (GBASL),Y
dey
bne vis_loop_inner
inx
cpx #14
bne vis_loop_outer
ldx #0
vis_loop_outer2:
lda gr_offsets_l,X
sta GBASL
lda gr_offsets_h,X
sta GBASH
lda $80,X
ldy #39
vis_loop_inner2:
sta (GBASL),Y
dey
cpy #20
bne vis_loop_inner2
inx
cpx #14
bne vis_loop_outer2
lda #200
jsr wait
rts
gr_offsets_l:
.byte <$400,<$480,<$500,<$580,<$600,<$680,<$700,<$780
.byte <$428,<$4a8,<$528,<$5a8,<$628,<$6a8,<$728,<$7a8
.byte <$450,<$4d0,<$550,<$5d0,<$650,<$6d0,<$750,<$7d0
gr_offsets_h:
.byte >$400,>$480,>$500,>$580,>$600,>$680,>$700,>$780
.byte >$428,>$4a8,>$528,>$5a8,>$628,>$6a8,>$728,>$7a8
.byte >$450,>$4d0,>$550,>$5d0,>$650,>$6d0,>$750,>$7d0
; copy of ROM wait
; because we might disable ROM
wait:
sec
wait2:
pha
wait3:
sbc #$01
bne wait3
pla
sbc #$01
bne wait2
rts
wait_end:
.assert (>wait_end - >wait) < 1 , error, "wait crosses page boundary"

View File

@ -63,3 +63,17 @@ PATTERN_H_2 = $8F
LOOP_2 = $90
DONE_SONG_2 = $91
; visualization
X1 = $F0
Y1 = $F1
X2 = $F2
Y2 = $F3
YY = $F4
COLOR = $30
GBASL = $26
GBASH = $27