diff --git a/games/sb/Makefile b/games/sb/Makefile index 5cf7b1bd..29f3ab8b 100644 --- a/games/sb/Makefile +++ b/games/sb/Makefile @@ -11,10 +11,11 @@ all: sb.dsk #### -sb.dsk: HELLO SB +sb.dsk: HELLO SB DUCK_POND cp $(EMPTY_DISK) sb.dsk $(DOS33) -y sb.dsk SAVE A HELLO $(DOS33) -y sb.dsk BSAVE -a 0x0c00 SB + $(DOS33) -y sb.dsk BSAVE -a 0x1000 DUCK_POND #### @@ -27,10 +28,20 @@ sb.o: sb.s zx02_optim.s \ #### +DUCK_POND: duck_pond.o + ld65 -o DUCK_POND duck_pond.o -C $(LINKER_SCRIPTS)/apple2_1000.inc + +duck_pond.o: duck_pond.s zx02_optim.s \ + zp.inc hardware.inc + ca65 -o duck_pond.o duck_pond.s -l duck_pond.lst + + +#### + HELLO: hello.bas $(TOKENIZE) < hello.bas > HELLO #### clean: - rm -f *.lst *.o SB *~ + rm -f *.lst *.o SB DUCK_POND *~ diff --git a/games/sb/duck_pond.s b/games/sb/duck_pond.s new file mode 100644 index 00000000..67c92075 --- /dev/null +++ b/games/sb/duck_pond.s @@ -0,0 +1,93 @@ +; gr duck pond +; +; by deater (Vince Weaver) + + +; todo +; videlectrix/ f to feed message +; F feeds +; A anvil (what happens when land on duck) +; Y drain pond +; ESC exit +; S spawn new duck +; N night (twilight?) +; J jump in pond + +; how show score? + +.include "zp.inc" +.include "hardware.inc" + + +duck_pond: + + ;=================== + ; set graphics mode + ;=================== + jsr HOME + + bit LORES + bit FULLGR + bit SET_GR + bit PAGE0 + + + ;=================== + ; Load graphics + ;=================== +load_loop: + + ;============================= + + + ;========================== + ; Load Image + ;=========================== + +load_image: + + lda #title_data + sta ZX0_src+1 + + lda #$4 + + jsr full_decomp + + +wait_until_keypress: + lda KEYPRESS ; 4 + bpl wait_until_keypress ; 3 + bit KEYRESET ; clear the keyboard buffer + +which_ok: + + lda #main_data + sta ZX0_src+1 + + lda #$4 + + jsr full_decomp + + +wait_until_keypress2: + lda KEYPRESS ; 4 + bpl wait_until_keypress2 ; 3 + bit KEYRESET ; clear the keyboard buffer + + jmp load_loop + + + + + .include "zx02_optim.s" + + +title_data: + .incbin "graphics/a2_duckpond_title.gr.zx02" + +main_data: + .incbin "graphics/a2_duckpond.gr.zx02" diff --git a/games/sb/graphics/Makefile b/games/sb/graphics/Makefile index 972ad3ea..d32aa174 100644 --- a/games/sb/graphics/Makefile +++ b/games/sb/graphics/Makefile @@ -1,13 +1,15 @@ include ../../../Makefile.inc -ZX02 = ~/research/6502_compression/zx02.git/build/zx02 +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr LINKER_SCRIPTS = ../../../linker_scripts DOS33 = ../../../utils/dos33fs-utils/dos33 EMPTY_DISK = ../../../empty_disk/empty.dsk TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft +PNG2GR = ../../../utils/gr-utils/png2gr -all: strongbad_sample.hgr.zx02 +all: strongbad_sample.hgr.zx02 \ + a2_duckpond_title.gr.zx02 a2_duckpond.gr.zx02 #### @@ -17,6 +19,24 @@ strongbad_sample.hgr.zx02: strongbad_sample.hgr strongbad_sample.hgr: strongbad_sample.png $(PNG_TO_HGR) strongbad_sample.png > strongbad_sample.hgr +#### + +a2_duckpond_title.gr.zx02: a2_duckpond_title.gr + $(ZX02) a2_duckpond_title.gr a2_duckpond_title.gr.zx02 + +a2_duckpond_title.gr: a2_duckpond_title.png + $(PNG2GR) a2_duckpond_title.png a2_duckpond_title.gr + +#### + +a2_duckpond.gr.zx02: a2_duckpond.gr + $(ZX02) a2_duckpond.gr a2_duckpond.gr.zx02 + +a2_duckpond.gr: a2_duckpond.png + $(PNG2GR) a2_duckpond.png a2_duckpond.gr + + + #### clean: diff --git a/games/sb/graphics/a2_duckpond.png b/games/sb/graphics/a2_duckpond.png new file mode 100644 index 00000000..37bb38fa Binary files /dev/null and b/games/sb/graphics/a2_duckpond.png differ diff --git a/games/sb/graphics/a2_duckpond_title.png b/games/sb/graphics/a2_duckpond_title.png new file mode 100644 index 00000000..9a22fcad Binary files /dev/null and b/games/sb/graphics/a2_duckpond_title.png differ diff --git a/games/sb/hello.bas b/games/sb/hello.bas index 1e8b79a2..3617fbce 100644 --- a/games/sb/hello.bas +++ b/games/sb/hello.bas @@ -1,2 +1,2 @@ 5 HOME - 105 PRINT CHR$ (4)"BRUN SB" + 105 PRINT CHR$ (4)"CATALOG" diff --git a/games/sb/sb.s b/games/sb/sb.s index 4ad72ede..40e95ab3 100644 --- a/games/sb/sb.s +++ b/games/sb/sb.s @@ -36,13 +36,18 @@ load_image: ; size in ldsizeh:ldsizel (f1/f0) -; comp_data = $a000 - out_addr = $2000 + lda #comp_data + sta ZX0_src+1 + + + lda #$20 jsr full_decomp - rts +; rts diff --git a/games/sb/zx02_optim.s b/games/sb/zx02_optim.s index 5f6121f2..1ef24174 100644 --- a/games/sb/zx02_optim.s +++ b/games/sb/zx02_optim.s @@ -20,20 +20,36 @@ bitr = ZP+6 pntr = ZP+7 ; Initial values for offset, source, destination and bitr -zx0_ini_block: - .byte $00, $00, comp_data, out_addr, $80 +;zx0_ini_block: +; .byte $00, $00 +;comp_data: +; .byte $0, $0 +;out_addr: +; .byte $0, $0 +; .byte $80 ;-------------------------------------------------- ; Decompress ZX0 data (6502 optimized format) + ; destination page in A full_decomp: - ; Get initialization block - ldy #7 + sta ZX0_dst+1 -copy_init: lda zx0_ini_block-1, y - sta offset-1, y - dey - bne copy_init + lda #0 + sta ZX0_dst + sta offset + sta offset+1 + + lda #$80 + sta bitr + + ; Get initialization block +; ldy #7 + +;copy_init: lda zx0_ini_block-1, y + ; sta offset-1, y + ; dey + ; bne copy_init ; Decode literal: Ccopy next N bytes from compressed file ; Elias(length) byte[1] byte[2] ... byte[N]