second: have placeholder dot bounce

This commit is contained in:
Vince Weaver 2023-10-28 20:13:34 -04:00
parent 5126506b04
commit 6e8bfa4181
5 changed files with 134 additions and 4 deletions

View File

@ -149,6 +149,7 @@ qload.inc: generate_common QLOAD
./generate_common -a 0x1200 -s clear_bottom qload.lst >> qload.inc
./generate_common -a 0x1200 -s clear_bottoms qload.lst >> qload.inc
./generate_common -a 0x1200 -s clear_screens qload.lst >> qload.inc
./generate_common -a 0x1200 -s clear_top qload.lst >> qload.inc
# ./generate_common -a 0x1200 -s mockingboard_patch qload.lst >> qload.inc
# ./generate_common -a 0x1200 -s mockingboard_init qload.lst >> qload.inc

47
demos/second/gr_plot.s Normal file
View File

@ -0,0 +1,47 @@
;================================
; plot routine
;================================
; Xcoord in XPOS
; Ycoord in YPOS
; color in COLOR
plot:
lda YPOS ; 3
lsr ; shift bottom bit into carry ; 2
bcc plot_even ; 2nt/3
plot_odd:
ldx #$f0 ; 2
bcs plot_c_done ; 2nt/3
plot_even:
ldx #$0f ; 2
plot_c_done:
stx MASK ; 3
asl ; shift back (now even) ; 2
tay ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc XPOS ; 3
sta GBASL ; 3
lda gr_offsets+1,Y ; 4
adc DRAW_PAGE ; add in draw page offset ; 3
sta GBASH ; 3
ldy #0 ; 2
plot_write:
lda MASK ; 3
eor #$ff ; 2
and (GBASL),Y ; 5+
sta COLOR_MASK ; 3
lda COLOR ; 3
and MASK ; 3
ora COLOR_MASK ; 3
sta (GBASL),Y ; 6
rts ; 6

View File

@ -2,6 +2,13 @@
; this one is a tough one
; TODO:
; 16 of them? Start by falling in, bouncing when hit bottom
; wide, sine wave it up
; narrow, sine wave it up
; at end, just stop deleting them? draw random
;
; by deater (Vince Weaver) <vince@deater.net>
@ -17,18 +24,29 @@ spheres_start:
;===================
; Load graphics
;===================
load_loop:
jsr clear_screens ; clear both pages of LORES
bit SET_GR
bit LORES
bit FULLGR
bit PAGE1
lda #4
sta DRAW_PAGE
dots_loop:
jsr clear_top
jsr clear_bottom
ldx #12
horizon_loop:
lda gr_offsets_l,X
sta OUTL
lda gr_offsets_h,X
clc
adc DRAW_PAGE
sta OUTH
ldy #39
@ -42,10 +60,61 @@ horizon_inner:
cpx #24
bne horizon_loop
lda #15
sta COUNT
dot_loop:
; Xcoord in XPOS
; Ycoord in YPOS
; color in COLOR
jsr wait_until_keypress
ldx COUNT
lda wide_points_x,X
sta XPOS
lda wide_points_y,X
sta YPOS
lda #$66 ; light blue
sta COLOR
jsr plot
dec COUNT
bpl dot_loop
jsr page_flip
; move dots
ldx #15
move_dot_loop:
lda wide_points_y,X
clc
adc dot_direction,X
sta wide_points_y,X
cmp #40
bcs dot_reverse ; bge
cmp #1
bcc dot_reverse ; blt
bcs dot_good
dot_reverse:
lda dot_direction,X
eor #$FF
sta dot_direction,X
inc dot_direction,X
dot_good:
dex
bpl move_dot_loop
lda KEYPRESS
bmi dots_done
jmp dots_loop
dots_done:
bit KEYRESET
rts
@ -55,6 +124,7 @@ dots_done:
.include "../gr_copy.s"
.include "../gr_offsets_split.s"
.include "../gr_offsets.s"
.include "../gr_plot.s"
.include "../wait_keypress.s"
@ -64,4 +134,16 @@ dots_done:
; .include "../hgr_copy_fast.s"
wide_points_x:
.byte 8,11,17,25,30,28,20,13
.byte 9,14,21,28,30,24,17,11
wide_points_y:
; .byte 19,16,12,11,14,18,20,21
; .byte 18,13,11,12,16,19,20,20
.byte 9, 6 ,2,1,4,8,10,11
.byte 15,12, 8,7,10,14,16,17
dot_direction:
.byte 1, 1, 1, 1, 1, 1, 1, 1
.byte 1, 1, 1, 1, 1, 1, 1, 1

View File

@ -174,7 +174,6 @@ start_address:
.byte $D0,$60,$60,$60 ; MUSIC, INTRO, TUNNEL, OCEAN
.byte $80,$80,$80 ; POLAR, SPHERES, DOTS
aux_dest: ;
.byte $D0,$FF,$60,$60 ; MUSIC, INTRO, TUNNEL, OCEAN
.byte $10,$20,$30 ; POLAR, SPHERES, DOTS

View File

@ -182,12 +182,13 @@ RR = $FA
BACKUP_OUTL = $F2
BACKUP_OUTH = $F3
; Nuts/ operner
; Nuts/ opener
SPRITE_Y = $F2
SPRITE_X = $F3
CURRENT_ROW = $F4
COLOR_MASK = $F2