second: move around the object

This commit is contained in:
Vince Weaver 2023-10-29 20:27:56 -04:00
parent 0b5b35b7b1
commit dd822670a6
8 changed files with 152 additions and 11 deletions

View File

@ -12,9 +12,14 @@ qload 4k 1 16
; pause to load new music
; and these into primary RAM
03 chess_shapes: 4k 15-16 32
03 tunnel: 4k 16-17 32
03 circles/lines: 4k 18 16
03 chess_shapes: 12k 15-17 48
03 chess_shapes: 8k 15-18 32
03 tunnel: 4k 16-17 32
03 circles/lines:4 k 18 16
18 is free!
04 gorilla: 8k 19-20 32 $7000-$8FFF
05 leaves: 8k 21-22 32 $5000-$6FFF

View File

@ -0,0 +1,18 @@
hgr_page_flip:
lda DRAW_PAGE
beq flip_to_page1
flip_to_page2:
bit PAGE2
lda #0
beq done_hgr_page_flip ; bra
flip_to_page1:
bit PAGE1
lda #$20
done_hgr_page_flip:
sta DRAW_PAGE
rts

View File

@ -46,17 +46,70 @@ chess_start:
sta COUNT
sta DRAW_PAGE
ship_sprite_loop:
lda #$60
lda #$60 ; copy to screen
jsr hgr_copy
bit PAGE1
jsr wait_until_keypress
; load image offscreen $6000
lda #<orange_data
sta zx_src_l+1
lda #>orange_data
sta zx_src_h+1
lda #$60
jsr zx02_full_decomp
ldx #0
stx COUNT
orange_loop:
lda #$60 ; copy to screen
jsr hgr_copy
ldx COUNT
lda object_coords_x,X
cmp #$FF
beq done_orange_loop
sta SPRITE_X
lda object_coords_y,X
sta SPRITE_Y
lda #<object_data
sta INL
lda #>object_data
sta INH
jsr hgr_draw_sprite_big
jsr hgr_page_flip
inc COUNT
lda COUNT
cmp #48
bne no_orange_oflo
lda #0
sta COUNT
no_orange_oflo:
lda KEYPRESS
bpl orange_loop
done_orange_loop:
bit KEYRESET
chess_done:
;==================
;==================
;==================
@ -65,7 +118,38 @@ chess_done:
;==================
;==================
; load image $2000
lda #<tunnel1_data
sta zx_src_l+1
lda #>tunnel1_data
sta zx_src_h+1
lda #$20
jsr zx02_full_decomp
; load image $4000
lda #<tunnel2_data
sta zx_src_l+1
lda #>tunnel2_data
sta zx_src_h+1
lda #$40
jsr zx02_full_decomp
tunnel_loop:
bit PAGE1
lda #8
jsr wait_irq
bit PAGE2
lda #8
jsr wait_irq
lda KEYPRESS
bpl tunnel_loop
main_tunnel_done:
bit KEYRESET
;==================
;==================
@ -75,7 +159,6 @@ main_tunnel_done:
;==================
;==================
jsr interference
@ -91,9 +174,10 @@ main_interference_done:
; .include "../hgr_table.s"
.include "../hgr_clear_screen.s"
.include "../hgr_copy_fast.s"
.include "../hgr_sprite_big.s"
.include "interference.s"
.include "../hgr_page_flip.s"
; wait A * 1/50s
wait_irq:
@ -106,4 +190,33 @@ wait_irq_loop:
chess_data:
.incbin "graphics/chess_object2.hgr.zx02"
orange_data:
.incbin "graphics/orange_bg.hgr.zx02"
object_data:
.include "graphics/object.inc"
tunnel1_data:
.incbin "graphics/tunnel1_cropped.hgr.zx02"
tunnel2_data:
.incbin "graphics/tunnel2_cropped.hgr.zx02"
; object is 15 wide
; this is a triangle pattern
; we could reverse at some point
; 12*4 = 48
object_coords_x:
.byte 13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2
.byte 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12
.byte 13,14,15,16,17,18,19,20,21,22,23,24
.byte 25,24,23,22,21,20,19,18,17,16,15,14
object_coords_y:
.byte 5,10,16,23,30,36,43,49,55,62,68,75
.byte 82,82,82,82,82,82,82,82,82,82,82,82
.byte 82,82,82,82,82,82,82,82,82,82,82,82
.byte 75,68,62,55,49,43,36,30,23,16,10, 5

View File

@ -10,9 +10,10 @@
interference:
bit SET_GR
bit LORES
bit FULLGR ; make it 40x48
bit PAGE1
; bit LORES ; put this off so draw before flip
lda #0
sta FRAME
@ -163,6 +164,8 @@ flip_to_2:
done_flip:
sta DRAW_PAGE
bit LORES ; here so first flip happens after having drawn
;===================================
;===================================

View File

@ -132,7 +132,7 @@ nuts_done:
.include "../zx02_optim.s"
; .include "../hgr_table.s"
.include "../hgr_clear_screen.s"
.include "hgr_sprite_big.s"
.include "../hgr_sprite_big.s"
.include "../hgr_copy_fast.s"

View File

@ -200,7 +200,7 @@ sector_array:
length_array:
.byte 32,48,80,32 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CHESS
.byte 32,48,80,48 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CHESS
.byte 32,32,16,16 ; GORILLA,LEAVES,LENS,PLASMA
.byte 16,16,16,96 ; CUBE,DOTS,SPHERES,OCEAN
.byte 16 ; POLAR

View File

@ -137,6 +137,8 @@ load_program_loop:
;=======================
;=======================
cli
jsr $6000