From 12448e1d75c747eb38f8eb6fcf1776802ef12e7b Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 27 Nov 2024 18:18:24 -0500 Subject: [PATCH] snake_boxer5: initial commit --- games/sb/snake_boxer5/Makefile | 44 +++ games/sb/snake_boxer5/graphics/Makefile | 43 +++ games/sb/snake_boxer5/graphics/gameplay.png | Bin 0 -> 837 bytes .../sb/snake_boxer5/graphics/videlectrix.png | Bin 0 -> 717 bytes games/sb/snake_boxer5/hello.bas | 2 + games/sb/snake_boxer5/snake_boxer5.s | 272 ++++++++++++++++++ 6 files changed, 361 insertions(+) create mode 100644 games/sb/snake_boxer5/Makefile create mode 100644 games/sb/snake_boxer5/graphics/Makefile create mode 100644 games/sb/snake_boxer5/graphics/gameplay.png create mode 100644 games/sb/snake_boxer5/graphics/videlectrix.png create mode 100644 games/sb/snake_boxer5/hello.bas create mode 100644 games/sb/snake_boxer5/snake_boxer5.s diff --git a/games/sb/snake_boxer5/Makefile b/games/sb/snake_boxer5/Makefile new file mode 100644 index 00000000..595dce79 --- /dev/null +++ b/games/sb/snake_boxer5/Makefile @@ -0,0 +1,44 @@ +include ../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 +PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr +LINKER_SCRIPTS = ../../../linker_scripts +DOS33 = ../../../utils/dos33fs-utils/dos33 +DOS33_RAW = ../../../utils/dos33fs-utils/dos33_raw +EMPTY_DISK = ../../../empty_disk/empty.dsk +TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft + +all: snake_boxer5.dsk + +#### + +snake_boxer5.dsk: HELLO SNAKE_BOXER5 + cp $(EMPTY_DISK) snake_boxer5.dsk + $(DOS33) -y snake_boxer5.dsk SAVE A HELLO + $(DOS33) -y snake_boxer5.dsk BSAVE -a 0x6000 SNAKE_BOXER5 + +### + +SNAKE_BOXER5: snake_boxer5.o + ld65 -o SNAKE_BOXER5 snake_boxer5.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +snake_boxer5.o: snake_boxer5.s ../zx02_optim.s \ + ../zp.inc ../hardware.inc\ + graphics/videlectrix.gr.zx02 \ + graphics/gameplay.gr.zx02 + ca65 -o snake_boxer5.o snake_boxer5.s -l snake_boxer5.lst + +graphics/videlectrix.gr.zx02: + cd graphics && make + + +#### + +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO + +#### + +clean: + rm -f *.lst *.o HELLO SNAKE_BOXER5 + diff --git a/games/sb/snake_boxer5/graphics/Makefile b/games/sb/snake_boxer5/graphics/Makefile new file mode 100644 index 00000000..bd5a6293 --- /dev/null +++ b/games/sb/snake_boxer5/graphics/Makefile @@ -0,0 +1,43 @@ +include ../../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f +PNG2GR = ../../../../utils/gr-utils/png2gr +PNG2SPRITES = ../../../../utils/gr-utils/png2sprites + +all: videlectrix.gr.zx02 \ + gameplay.gr.zx02 + +#### + +sundae_sprites.inc: a2_sundae_sprites.png a2_sundae_masks.png + $(PNG2SPRITES) a2_sundae_sprites.png tree1_sprite 0 0 6 20 > sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_sprites.png tree2_sprite 7 0 5 18 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_sprites.png cherry_sprite 13 0 3 12 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_sprites.png sundae1_sprite 0 24 15 24 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_masks.png tree1_mask 0 0 6 20 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_masks.png tree2_mask 7 0 5 18 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_masks.png cherry_mask 13 0 3 12 >> sundae_sprites.inc + $(PNG2SPRITES) a2_sundae_masks.png sundae1_mask 0 24 15 24 >> sundae_sprites.inc + +#### + +videlectrix.gr.zx02: videlectrix.gr + $(ZX02) videlectrix.gr videlectrix.gr.zx02 + +videlectrix.gr: videlectrix.png + $(PNG2GR) videlectrix.png videlectrix.gr + +#### + +gameplay.gr.zx02: gameplay.gr + $(ZX02) gameplay.gr gameplay.gr.zx02 + +gameplay.gr: gameplay.png + $(PNG2GR) gameplay.png gameplay.gr + + +#### + +clean: + rm -f *~ *.o *.lst *.zx02 *.gr *.inc + diff --git a/games/sb/snake_boxer5/graphics/gameplay.png b/games/sb/snake_boxer5/graphics/gameplay.png new file mode 100644 index 0000000000000000000000000000000000000000..d9f83e473cbad15033f18803a04368c4ff9bb6b4 GIT binary patch literal 837 zcmV-L1G@Z)P)EX>4Tx04R}tkv&MmKpe$i(@I4v4i*$~$WWauh>AGYDionYs1;guFuC*#nlvOW zE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JWDYS_3;J6>}?mh0_0Yan9G%FATG`(u3 z5^*t;T@{0`=*1xXm_R^gmN6$uNqCO0d-(Wz7v)*r=l&dhYR+PSPb7{p!>kf-5YKE@ z4bJ<-VOEq?;&bA0lP*a7$aTf#H_ioz1)do;)2VslFtJ$ZV5Ngu(bR~ii6g3}Q@)UK zS>?RNSu59A>z@3Dp`5<5%ypV0NMI35kRU=q4JDLOMU+;Z6bmWZk9+us9lt~_goSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02oXF02p)u zpQu0}00007bV*G`2j~kM7ZE2ZvGGm-000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0002+NklHiDZNk-~ffoS2Gz?eQs9n>!!qBMbWtw`Ev-PVtl>f69In(X#AIVL9Yxn1E!4 zJYbx0b;>dz>pkSRTpo!482%FOHdnx~${0Y>?nz*D6f)JqAb^0wQgMjx5)ALf8BWtN zL+&t&K)^w%{Zobl`_49n43&V&=ffu*iSMefvNmAo)OetJ%eGVFfm-?jm2yjWdU~7q P00000NkvXXu0mjfvB-H~ literal 0 HcmV?d00001 diff --git a/games/sb/snake_boxer5/graphics/videlectrix.png b/games/sb/snake_boxer5/graphics/videlectrix.png new file mode 100644 index 0000000000000000000000000000000000000000..ac280e7b00340ab65dcdd3dc7b4ec8eb91c05abb GIT binary patch literal 717 zcmV;;0y6!HP)EX>4Tx04R}tkv&MmKpe$i(@I4v4i*$~$WWauh>AGYDionYs1;guFuC*#nlvOW zE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JWDYS_3;J6>}?mh0_0Yan9G%FATG`(u3 z5^*t;T@{0`=*1xXm_R^gmN6$uNqCO0d-(Wz7v)*r=l&dhYR+PSPb7{p!>kf-5YKE@ z4bJ<-VOEq?;&bA0lP*a7$aTf#H_ioz1)do;)2VslFtJ$ZV5Ngu(bR~ii6g3}Q@)UK zS>?RNSu59A>z@3Dp`5<5%ypV0NMI35kRU=q4JDLOMU+;Z6bmWZk9+us9lt~_goSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02oXF02p)u zpQu0}00007bV*G`2j~kM7X~rd=D>*n000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0001ZNklIDJ^~`EXB|6Gl9^Gp9+_9z`x(C4*L(O#YMTsmg%GAZPgtz3+M82 zlV!$L*JCS=q`h#CfiSwVS1qng2qA + + +.include "../zp.inc" +.include "../hardware.inc" + + +sundae_driver: + + ;=================== + ; set graphics mode + ;=================== + jsr HOME + + bit LORES + bit FULLGR + bit SET_GR + bit PAGE1 + + lda #$4 + sta DRAW_PAGE + + lda #$0 + sta FRAME + sta FRAMEH + sta DISP_PAGE + + ;=================== + ; Intro + ;=================== + ; TODO: animation + +intro: + + lda #videlectrix_data + sta ZX0_src+1 + + lda #$4 ; load at $400 + + jsr full_decomp + + jsr wait_until_keypress + + + + ;=================== + ; TITLE SCREEN + ;=================== + +title_screen: + + lda #gameplay_data + sta ZX0_src+1 + + lda #$4 ; load at $400 + + jsr full_decomp + + jsr wait_until_keypress +.if 0 + ;=================== + ; Setup Gameplay + ;=================== + + lda #17 + sta CHERRY_X + lda #8 + sta CHERRY_Y + + lda #4 + sta TREE1_X + lda #0 + sta TREE1_Y + + lda #32 + sta TREE2_X + lda #10 + sta TREE2_Y + + lda #13 + sta SUNDAE_X + lda #24 + sta SUNDAE_Y + + + + + ; load graphic to $c00 + + lda #bg_data + sta ZX0_src+1 + + lda #$c ; load at $c00 + + jsr full_decomp + +game_loop: + ;======================= + ; copy over background + + jsr gr_copy_to_current + + ;======================== + ; draw things + + jsr draw_cherry + jsr draw_tree1 + jsr draw_tree2 + jsr draw_sundae + + + ;======================== + ; move + + inc SUNDAE_X + inc TREE1_Y + inc TREE1_Y + inc TREE2_Y + inc TREE2_Y + inc CHERRY_Y + inc CHERRY_Y + + ;======================== + ; page flip + + jsr page_flip + + jsr wait_until_keypress + + jmp game_loop + + + + ;====================== + ; game over + ;====================== + +james_screen: + + lda #james_data + sta ZX0_src+1 + + lda #$4 ; load at $400 + + jsr full_decomp + + + jsr wait_until_keypress +.endif + +done: + jmp done + + + + +wait_until_keypress: + lda KEYPRESS ; 4 + bpl wait_until_keypress ; 3 + bit KEYRESET ; clear the keyboard buffer + + rts + +.include "../zx02_optim.s" + +.include "../gr_offsets.s" +.include "../gr_pageflip.s" +.include "../gr_copy.s" +.include "../gr_putsprite_mask.s" + +.if 0 + ;==================== + ; draw cherry +draw_cherry: + lda CHERRY_X + sta XPOS + lda CHERRY_Y + sta YPOS + + lda #cherry_mask + sta MASKH + + lda #cherry_sprite + sta INH + jsr gr_put_sprite_mask + rts + + ;==================== + ; draw tree1 +draw_tree1: + lda TREE1_X + sta XPOS + lda TREE1_Y + sta YPOS + + lda #tree1_mask + sta MASKH + + lda #tree1_sprite + sta INH + jsr gr_put_sprite_mask + rts + + ;==================== + ; draw tree2 +draw_tree2: + lda TREE2_X + sta XPOS + lda TREE2_Y + sta YPOS + + lda #tree2_mask + sta MASKH + + lda #tree2_sprite + sta INH + jsr gr_put_sprite_mask + rts + + ;==================== + ; draw sundae +draw_sundae: + lda SUNDAE_X + sta XPOS + lda SUNDAE_Y + sta YPOS + + lda #sundae1_mask + sta MASKH + + lda #sundae1_sprite + sta INH + jsr gr_put_sprite_mask + rts + +.endif + + +videlectrix_data: + .incbin "graphics/videlectrix.gr.zx02" + +gameplay_data: + .incbin "graphics/gameplay.gr.zx02" +