diff --git a/games/Makefile b/games/Makefile new file mode 100644 index 00000000..e8731462 --- /dev/null +++ b/games/Makefile @@ -0,0 +1,22 @@ +all: + cd duke && make + cd glados3.3 && make + cd ksp && make + cd mist && make + cd monkey && make + cd ootw && make + cd space_bars && make + cd tb_6502 && make + cd tfv && make + +clean: + cd duke && make clean + cd glados3.3 && make clean + cd ksp && make clean + cd mist && make clean + cd monkey && make clean + cd ootw && make clean + cd space_bars && make clean + cd tb_6502 && make clean + cd tfv && make clean + rm -f *~ diff --git a/games/README b/games/README new file mode 100644 index 00000000..94bf9b1b --- /dev/null +++ b/games/README @@ -0,0 +1,28 @@ +Various Games/Demakes by VMW Productions + ++ duke + proof of concept demake of Duke Nukem1 + ++ glados3.3 + Applesoft BASIC demo of "Portal" + ++ ksp + Applesoft BASIC demo of Kerbal Space Program + ++ mist + Full demak of Myst, fitting on 3 disks + ++ monkey + proof of concept demake of Secret of Monkey Island + ++ ootw + partial demake of Out of this World / Another World + ++ space_bars + vapor-lock/cycle counted proof of concept game + ++ tb_6502 + Tom Bombem for Apple II, scrolling space shooter + ++ tfv + Talbot Fantasy 7 RPG game diff --git a/games/duke/Makefile b/games/duke/Makefile index dee84067..99d28cad 100644 --- a/games/duke/Makefile +++ b/games/duke/Makefile @@ -1,10 +1,12 @@ -include ../Makefile.inc +include ../../Makefile.inc -DOS33 = ../dos33fs-utils/dos33 -DOS33_RAW = ../dos33fs-utils/dos33_raw -B2D = ../bmp2dhr/b2d -PNG2GR = ../gr-utils/png2gr +DOS33 = ../../utils/dos33fs-utils/dos33 +DOS33_RAW = ../../utils/dos33fs-utils/dos33_raw +B2D = ../../utils/bmp2dhr/b2d +PNG2GR = ../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft + all: duke.dsk @@ -20,12 +22,12 @@ duke.dsk: HELLO LOADER DUKE_TITLE DUKE_LEVEL1 DUKE_LEVEL2 ### HELLO: hello.bas - ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + $(TOKENIZE) < hello.bas > HELLO #### LOADER: loader.o - ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1000.inc + ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc loader.o: loader.s ca65 -o loader.o loader.s -l loader.lst @@ -33,7 +35,7 @@ loader.o: loader.s #### DUKE_TITLE: duke_title.o - ld65 -o DUKE_TITLE duke_title.o -C ../linker_scripts/apple2_4000.inc + ld65 -o DUKE_TITLE duke_title.o -C ../../linker_scripts/apple2_4000.inc duke_title.o: duke_title.s zp.inc hardware.inc init_vars.s ca65 -o duke_title.o duke_title.s -l duke_title.lst @@ -41,7 +43,7 @@ duke_title.o: duke_title.s zp.inc hardware.inc init_vars.s #### DUKE_LEVEL1: duke_level1.o - ld65 -o DUKE_LEVEL1 duke_level1.o -C ../linker_scripts/apple2_2000.inc + ld65 -o DUKE_LEVEL1 duke_level1.o -C ../../linker_scripts/apple2_2000.inc duke_level1.o: duke_level1.s zp.inc hardware.inc \ print_help.s gr_fast_clear.s quit_yn.s text_drawbox.s level_end.s \ @@ -57,7 +59,7 @@ duke_level1.o: duke_level1.s zp.inc hardware.inc \ #### DUKE_LEVEL2: duke_level2.o - ld65 -o DUKE_LEVEL2 duke_level2.o -C ../linker_scripts/apple2_2000.inc + ld65 -o DUKE_LEVEL2 duke_level2.o -C ../../linker_scripts/apple2_2000.inc duke_level2.o: duke_level2.s zp.inc hardware.inc \ print_help.s gr_fast_clear.s quit_yn.s text_drawbox.s level_end.s \ diff --git a/games/duke/README b/games/duke/README new file mode 100644 index 00000000..27662c54 --- /dev/null +++ b/games/duke/README @@ -0,0 +1,2 @@ +demake proof-of-concept of Duke Nukem1 for Apple II + diff --git a/games/duke/graphics/Makefile b/games/duke/graphics/Makefile index c1aa53ac..6beaec95 100644 --- a/games/duke/graphics/Makefile +++ b/games/duke/graphics/Makefile @@ -1,5 +1,5 @@ -PNG2GR = ../../gr-utils/png2gr +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: level1_graphics.inc level2_graphics.inc diff --git a/games/glados3.3/Makefile b/games/glados3.3/Makefile index 8601c169..af93c204 100644 --- a/games/glados3.3/Makefile +++ b/games/glados3.3/Makefile @@ -1,7 +1,10 @@ -DOS33 = ../dos33fs-utils/dos33 -TXT2BAS = ../asoft_basic-utils/tokenize_asoft -SHAPETABLE = ../hgr-utils/shape_table -SOUNDCONVERT = ../asoft_sound/asoft_sound +DOS33 = ../../utils/dos33fs-utils/dos33 +TXT2BAS = ../../utils/asoft_basic-utils/tokenize_asoft +SHAPETABLE = ../../utils/hgr-utils/shape_table +SOUNDCONVERT = ../../utils/asoft_sound/asoft_sound + +]TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft + all: glados33.dsk diff --git a/games/ksp/applesoft/Makefile b/games/ksp/applesoft/Makefile index 3ffe0513..1491ad62 100644 --- a/games/ksp/applesoft/Makefile +++ b/games/ksp/applesoft/Makefile @@ -1,19 +1,19 @@ -PCX2HGR = ../../hgr-utils/pcx2hgr -DOS33 = ../../dos33fs-utils/dos33 -TXT2BAS = ../../asoft_basic-utils/tokenize_asoft -SHAPETABLE = ../../hgr-utils/shape_table +PCX2HGR = ../../../utils/hgr-utils/pcx2hgr +DOS33 = ../../../utils/dos33fs-utils/dos33 +TXT2BAS = ../../../utils/asoft_basic-utils/tokenize_asoft +SHAPETABLE = ../../../utils/hgr-utils/shape_table all: ksp.dsk $(TXT2BAS): - cd ../../asoft_basic-utils && make + cd ../../../utils/asoft_basic-utils && make $(SHAPETABLE): - cd ../../hgr-utils && make + cd ../../../utils/hgr-utils && make $(PCX2HGR): - cd ../../hgr-utils && make + cd ../../../utils/hgr-utils && make ACMPLX.BAS: acmplx.bas $(TXT2BAS) $(TXT2BAS) < acmplx.bas > ACMPLX.BAS diff --git a/games/ksp/asm/Makefile b/games/ksp/asm/Makefile index ab8892cd..4a36a582 100644 --- a/games/ksp/asm/Makefile +++ b/games/ksp/asm/Makefile @@ -1,8 +1,8 @@ -PCX2HGR = ../../hgr-utils/pcx2hgr -DOS33 = ../../dos33fs-utils/dos33 -TXT2BAS = ../../asoft_basic-utils/tokenize_asoft -SHAPETABLE = ../../hgr-utils/shape_table -MAKEB = ../../dos33fs-utils/make_b +PCX2HGR = ../../../utils/hgr-utils/pcx2hgr +DOS33 = ../../../utils/dos33fs-utils/dos33 +TXT2BAS = ../../../utils/asoft_basic-utils/tokenize_asoft +SHAPETABLE = ../../../utils/hgr-utils/shape_table +MAKEB = ../../../utils/dos33fs-utils/make_b LD65 = /usr/local/bin/ld65 CA65 = /usr/local/bin/ca65 diff --git a/games/mist/Makefile b/games/mist/Makefile index ad28aeec..5e47f3d3 100644 --- a/games/mist/Makefile +++ b/games/mist/Makefile @@ -1,11 +1,14 @@ -include ../Makefile.inc +include ../../Makefile.inc + +DOS33 = ../../utils/dos33fs-utils/dos33 +DOS33_RAW = ../../utils/dos33fs-utils/dos33_raw +PNG_TO_40x96 = ../../utils/gr-utils/png_to_40x96 +PNG_TO_40x48D = ../../utils/gr-utils/png_to_40x48d +PNG2RLE = ../../utils/gr-utils/png2rle +B2D = ../../utils/bmp2dhr/b2d + +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft -DOS33 = ../dos33fs-utils/dos33 -DOS33_RAW = ../dos33fs-utils/dos33_raw -PNG_TO_40x96 = ../gr-utils/png_to_40x96 -PNG_TO_40x48D = ../gr-utils/png_to_40x48d -PNG2RLE = ../gr-utils/png2rle -B2D = ../bmp2dhr/b2d all: mist.dsk mist_side2.dsk mist_side3.dsk @@ -88,7 +91,7 @@ mist_side3.dsk: WBOOT3 MECHE SELENA STONEY SUB ### WBOOT2: wrong_boot2.o - ld65 -o WBOOT2 wrong_boot2.o -C ../linker_scripts/apple2_800.inc + ld65 -o WBOOT2 wrong_boot2.o -C ../../linker_scripts/apple2_800.inc wrong_boot2.o: wrong_boot2.s ca65 -o wrong_boot2.o wrong_boot2.s -l wrong_boot2.lst @@ -96,7 +99,7 @@ wrong_boot2.o: wrong_boot2.s ### WBOOT3: wrong_boot3.o - ld65 -o WBOOT3 wrong_boot3.o -C ../linker_scripts/apple2_800.inc + ld65 -o WBOOT3 wrong_boot3.o -C ../../linker_scripts/apple2_800.inc wrong_boot3.o: wrong_boot3.s ca65 -o wrong_boot3.o wrong_boot3.s -l wrong_boot3.lst @@ -105,7 +108,7 @@ wrong_boot3.o: wrong_boot3.s ### QBOOT: qboot_sector.o - ld65 -o QBOOT qboot_sector.o -C ../linker_scripts/apple2_800.inc + ld65 -o QBOOT qboot_sector.o -C ../../linker_scripts/apple2_800.inc qboot_sector.o: qboot_sector.s qboot_stage2.s ca65 -o qboot_sector.o qboot_sector.s -l qboot_sector.lst @@ -113,7 +116,7 @@ qboot_sector.o: qboot_sector.s qboot_stage2.s ### TEXT_TITLE: text_title.o - ld65 -o TEXT_TITLE text_title.o -C ../linker_scripts/apple2_800.inc + ld65 -o TEXT_TITLE text_title.o -C ../../linker_scripts/apple2_800.inc text_title.o: text_title.s text_print.s wait_a_bit.s ca65 -o text_title.o text_title.s -l text_title.lst @@ -122,7 +125,7 @@ text_title.o: text_title.s text_print.s wait_a_bit.s ### QLOAD: qload.o - ld65 -o QLOAD qload.o -C ../linker_scripts/apple2_1200.inc + ld65 -o QLOAD qload.o -C ../../linker_scripts/apple2_1200.inc qload.o: qload.s qboot.inc \ gr_copy.s gr_offsets.s gr_pageflip.s gr_putsprite_crop.s \ @@ -135,7 +138,7 @@ qload.o: qload.s qboot.inc \ ### LOADER: loader.o - ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1000.inc + ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc loader.o: loader.s \ gr_copy.s gr_offsets.s gr_pageflip.s gr_putsprite_crop.s \ @@ -147,7 +150,7 @@ loader.o: loader.s \ ### SAVE1: save1.o - ld65 -o SAVE1 save1.o -C ../linker_scripts/apple2_e00.inc + ld65 -o SAVE1 save1.o -C ../../linker_scripts/apple2_e00.inc save1.o: save1.s ca65 -o save1.o save1.s -l save1.lst @@ -155,7 +158,7 @@ save1.o: save1.s ### SAVE2: save2.o - ld65 -o SAVE2 save2.o -C ../linker_scripts/apple2_e00.inc + ld65 -o SAVE2 save2.o -C ../../linker_scripts/apple2_e00.inc save2.o: save2.s ca65 -o save2.o save2.s -l save2.lst @@ -163,7 +166,7 @@ save2.o: save2.s ### SAVE3: save3.o - ld65 -o SAVE3 save3.o -C ../linker_scripts/apple2_e00.inc + ld65 -o SAVE3 save3.o -C ../../linker_scripts/apple2_e00.inc save3.o: save3.s ca65 -o save3.o save3.s -l save3.lst @@ -171,7 +174,7 @@ save3.o: save3.s ### SAVE4: save4.o - ld65 -o SAVE4 save4.o -C ../linker_scripts/apple2_e00.inc + ld65 -o SAVE4 save4.o -C ../../linker_scripts/apple2_e00.inc save4.o: save4.s ca65 -o save4.o save4.s -l save4.lst @@ -179,7 +182,7 @@ save4.o: save4.s ### SAVE5: save5.o - ld65 -o SAVE5 save5.o -C ../linker_scripts/apple2_e00.inc + ld65 -o SAVE5 save5.o -C ../../linker_scripts/apple2_e00.inc save5.o: save5.s ca65 -o save5.o save5.s -l save5.lst @@ -208,7 +211,7 @@ common_routines.inc: qload.lst generate_common #### MIST_TITLE: mist_title.o - ld65 -o MIST_TITLE mist_title.o -C ../linker_scripts/apple2_4000.inc + ld65 -o MIST_TITLE mist_title.o -C ../../linker_scripts/apple2_4000.inc mist_title.o: mist_title.s zp.inc hardware.inc common_defines.inc \ common_routines.inc \ diff --git a/games/mist/books/Makefile b/games/mist/books/Makefile index 7110264c..9a9cffaa 100644 --- a/games/mist/books/Makefile +++ b/games/mist/books/Makefile @@ -1,8 +1,8 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr -TEXT2GR = ../../gr-utils/text2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr +TEXT2GR = ../../../utils/gr-utils/text2gr LZSA = ~/research/lzsa/lzsa/lzsa all: octagon_books.inc diff --git a/games/mist/graphics_arbor/Makefile b/games/mist/graphics_arbor/Makefile index f897df98..7a5af0c2 100644 --- a/games/mist/graphics_arbor/Makefile +++ b/games/mist/graphics_arbor/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: arbor_graphics.inc diff --git a/games/mist/graphics_cabin/Makefile b/games/mist/graphics_cabin/Makefile index b15ad572..1304aeae 100644 --- a/games/mist/graphics_cabin/Makefile +++ b/games/mist/graphics_cabin/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: cabin_graphics.inc diff --git a/games/mist/graphics_channel/Makefile b/games/mist/graphics_channel/Makefile index a417023b..64990647 100644 --- a/games/mist/graphics_channel/Makefile +++ b/games/mist/graphics_channel/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: channel_graphics.inc diff --git a/games/mist/graphics_dentist/Makefile b/games/mist/graphics_dentist/Makefile index d2e0dae5..83fe0ef2 100644 --- a/games/mist/graphics_dentist/Makefile +++ b/games/mist/graphics_dentist/Makefile @@ -1,5 +1,5 @@ -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: dentist_graphics.inc diff --git a/games/mist/graphics_dni/Makefile b/games/mist/graphics_dni/Makefile index 8fe5cc8d..b1768449 100644 --- a/games/mist/graphics_dni/Makefile +++ b/games/mist/graphics_dni/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: dni_graphics.inc diff --git a/games/mist/graphics_generator/Makefile b/games/mist/graphics_generator/Makefile index 9e8aa99a..a58ffe20 100644 --- a/games/mist/graphics_generator/Makefile +++ b/games/mist/graphics_generator/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: generator_graphics.inc diff --git a/games/mist/graphics_meche/Makefile b/games/mist/graphics_meche/Makefile index f5d7bbce..568ea491 100644 --- a/games/mist/graphics_meche/Makefile +++ b/games/mist/graphics_meche/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: meche_graphics.inc diff --git a/games/mist/graphics_mist/Makefile b/games/mist/graphics_mist/Makefile index ee110be7..b1ccfb1c 100644 --- a/games/mist/graphics_mist/Makefile +++ b/games/mist/graphics_mist/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: mist_graphics.inc diff --git a/games/mist/graphics_nibel/Makefile b/games/mist/graphics_nibel/Makefile index ad4da7e0..6e606cf9 100644 --- a/games/mist/graphics_nibel/Makefile +++ b/games/mist/graphics_nibel/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: nibel_graphics.inc diff --git a/games/mist/graphics_octagon/Makefile b/games/mist/graphics_octagon/Makefile index fc0ccf5d..d9057c68 100644 --- a/games/mist/graphics_octagon/Makefile +++ b/games/mist/graphics_octagon/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: octagon_graphics.inc diff --git a/games/mist/graphics_selena/Makefile b/games/mist/graphics_selena/Makefile index 4889acec..72fb6378 100644 --- a/games/mist/graphics_selena/Makefile +++ b/games/mist/graphics_selena/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: selena_graphics.inc diff --git a/games/mist/graphics_ship/Makefile b/games/mist/graphics_ship/Makefile index d694e3c0..a18641a6 100644 --- a/games/mist/graphics_ship/Makefile +++ b/games/mist/graphics_ship/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: ship_graphics.inc diff --git a/games/mist/graphics_stoney/Makefile b/games/mist/graphics_stoney/Makefile index 413038d1..729aa32e 100644 --- a/games/mist/graphics_stoney/Makefile +++ b/games/mist/graphics_stoney/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: stoney_graphics.inc diff --git a/games/mist/graphics_sub/Makefile b/games/mist/graphics_sub/Makefile index f83bc53d..4ce493b9 100644 --- a/games/mist/graphics_sub/Makefile +++ b/games/mist/graphics_sub/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: sub_graphics.inc diff --git a/games/mist/graphics_viewer/Makefile b/games/mist/graphics_viewer/Makefile index bb24d9df..f9d698bc 100644 --- a/games/mist/graphics_viewer/Makefile +++ b/games/mist/graphics_viewer/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: viewer_graphics.inc diff --git a/games/monkey/Makefile b/games/monkey/Makefile index bc3472bc..f21f0110 100644 --- a/games/monkey/Makefile +++ b/games/monkey/Makefile @@ -1,11 +1,13 @@ -include ../Makefile.inc +include ../../Makefile.inc + +DOS33 = ../../utils/dos33fs-utils/dos33 +DOS33_RAW = ../../utils/dos33fs-utils/dos33_raw +PNG_TO_40x96 = ../../utils/gr-utils/png_to_40x96 +PNG_TO_40x48D = ../../utils/gr-utils/png_to_40x48d +PNG2RLE = ../../utils/gr-utils/png2rle +B2D = ../../utils/bmp2dhr/b2d +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft -DOS33 = ../dos33fs-utils/dos33 -DOS33_RAW = ../dos33fs-utils/dos33_raw -PNG_TO_40x96 = ../gr-utils/png_to_40x96 -PNG_TO_40x48D = ../gr-utils/png_to_40x48d -PNG2RLE = ../gr-utils/png2rle -B2D = ../bmp2dhr/b2d all: monkey.dsk @@ -19,14 +21,14 @@ monkey.dsk: HELLO LOADER TITLE MONKEY ### HELLO: hello.bas - ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + $(TOKENIZE) < hello.bas > HELLO #### ### LOADER: loader.o - ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1000.inc + ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc loader.o: loader.s ca65 -o loader.o loader.s -l loader.lst @@ -34,7 +36,7 @@ loader.o: loader.s ### TITLE: title.o - ld65 -o TITLE title.o -C ../linker_scripts/apple2_2000.inc + ld65 -o TITLE title.o -C ../../linker_scripts/apple2_2000.inc title.o: title.s \ graphics_intro/title_graphics.inc \ @@ -47,7 +49,7 @@ title.o: title.s \ MONKEY: monkey.o - ld65 -o MONKEY monkey.o -C ../linker_scripts/apple2_2000.inc + ld65 -o MONKEY monkey.o -C ../../linker_scripts/apple2_2000.inc monkey.o: monkey.s zp.inc hardware.inc common_defines.inc \ graphics/graphics.inc \ diff --git a/games/monkey/graphics/Makefile b/games/monkey/graphics/Makefile index 9ff2f752..eafa4bf7 100644 --- a/games/monkey/graphics/Makefile +++ b/games/monkey/graphics/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: graphics.inc diff --git a/games/monkey/graphics_intro/Makefile b/games/monkey/graphics_intro/Makefile index 724874bb..b4a89057 100644 --- a/games/monkey/graphics_intro/Makefile +++ b/games/monkey/graphics_intro/Makefile @@ -1,7 +1,7 @@ #include ../Makefile.inc -PNG2RLE = ../../gr-utils/png2rle -PNG2GR = ../../gr-utils/png2gr +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr LZSA = ~/research/lzsa/lzsa/lzsa all: title_graphics.inc diff --git a/games/ootw/Makefile b/games/ootw/Makefile index 25cef853..d6d18921 100644 --- a/games/ootw/Makefile +++ b/games/ootw/Makefile @@ -1,8 +1,9 @@ -include ../Makefile.inc +include ../../Makefile.inc -DOS33 = ../dos33fs-utils/dos33 -PNG2RLE = ../gr-utils/png2rle -PNG2LZ4 = ../gr-utils/png2lz4 +DOS33 = ../../utils/dos33fs-utils/dos33 +PNG2RLE = ../../utils/gr-utils/png2rle +PNG2LZ4 = ../../utils/gr-utils/png2lz4 +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft all: ootw.dsk ootw_side2.dsk ootw_side3.dsk @@ -48,7 +49,7 @@ ootw_side3.dsk: HELLO TITLE ENDING \ #### OOTW_C1: ootw_c1.o - ld65 -o OOTW_C1 ootw_c1.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C1 ootw_c1.o -C ../../linker_scripts/apple2_1700.inc ootw_c1.o: ootw_c1.s \ gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -79,7 +80,7 @@ ootw_c1.o: ootw_c1.s \ #### OOTW_C2: ootw_c2.o - ld65 -o OOTW_C2 ootw_c2.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C2 ootw_c2.o -C ../../linker_scripts/apple2_1700.inc ootw_c2.o: ootw_c2.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -102,7 +103,7 @@ ootw_c2.o: ootw_c2.s \ #### OOTW_C3: ootw_c3.o - ld65 -o OOTW_C3 ootw_c3.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C3 ootw_c3.o -C ../../linker_scripts/apple2_1700.inc ootw_c3.o: ootw_c3.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -116,7 +117,7 @@ ootw_c3.o: ootw_c3.s \ ### OOTW_C4: ootw_c4.o - ld65 -o OOTW_C4 ootw_c4.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C4 ootw_c4.o -C ../../linker_scripts/apple2_1700.inc ootw_c4.o: ootw_c4.s \ gr_copy.s gr_twoscreen_scroll.s gr_fast_clear.s gr_pageflip.s \ @@ -133,7 +134,7 @@ ootw_c4.o: ootw_c4.s \ ### OOTW_C5: ootw_c5.o - ld65 -o OOTW_C5 ootw_c5.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C5 ootw_c5.o -C ../../linker_scripts/apple2_1700.inc ootw_c5.o: ootw_c5.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -147,7 +148,7 @@ ootw_c5.o: ootw_c5.s \ ### OOTW_C6: ootw_c6.o - ld65 -o OOTW_C6 ootw_c6.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C6 ootw_c6.o -C ../../linker_scripts/apple2_1700.inc ootw_c6.o: ootw_c6.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -160,7 +161,7 @@ ootw_c6.o: ootw_c6.s \ ### OOTW_C7: ootw_c7.o - ld65 -o OOTW_C7 ootw_c7.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C7 ootw_c7.o -C ../../linker_scripts/apple2_1700.inc ootw_c7.o: ootw_c7.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -173,7 +174,7 @@ ootw_c7.o: ootw_c7.s \ ### OOTW_C8: ootw_c8.o - ld65 -o OOTW_C8 ootw_c8.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C8 ootw_c8.o -C ../../linker_scripts/apple2_1700.inc ootw_c8.o: ootw_c8.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -187,7 +188,7 @@ ootw_c8.o: ootw_c8.s \ ### OOTW_C9: ootw_c9.o - ld65 -o OOTW_C9 ootw_c9.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C9 ootw_c9.o -C ../../linker_scripts/apple2_1700.inc ootw_c9.o: ootw_c9.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -201,7 +202,7 @@ ootw_c9.o: ootw_c9.s \ ### OOTW_C10: ootw_c10.o - ld65 -o OOTW_C10 ootw_c10.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C10 ootw_c10.o -C ../../linker_scripts/apple2_1700.inc ootw_c10.o: ootw_c10.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -215,7 +216,7 @@ ootw_c10.o: ootw_c10.s \ ### OOTW_C11: ootw_c11.o - ld65 -o OOTW_C11 ootw_c11.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C11 ootw_c11.o -C ../../linker_scripts/apple2_1700.inc ootw_c11.o: ootw_c11.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -229,7 +230,7 @@ ootw_c11.o: ootw_c11.s \ ### OOTW_C12: ootw_c12.o - ld65 -o OOTW_C12 ootw_c12.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C12 ootw_c12.o -C ../../linker_scripts/apple2_1700.inc ootw_c12.o: ootw_c12.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -243,7 +244,7 @@ ootw_c12.o: ootw_c12.s \ ### OOTW_C13: ootw_c13.o - ld65 -o OOTW_C13 ootw_c13.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C13 ootw_c13.o -C ../../linker_scripts/apple2_1700.inc ootw_c13.o: ootw_c13.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -260,7 +261,7 @@ ootw_c13.o: ootw_c13.s \ ### OOTW_C14: ootw_c14.o - ld65 -o OOTW_C14 ootw_c14.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C14 ootw_c14.o -C ../../linker_scripts/apple2_1700.inc ootw_c14.o: ootw_c14.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -274,7 +275,7 @@ ootw_c14.o: ootw_c14.s \ ### OOTW_C15: ootw_c15.o - ld65 -o OOTW_C15 ootw_c15.o -C ../linker_scripts/apple2_1700.inc + ld65 -o OOTW_C15 ootw_c15.o -C ../../linker_scripts/apple2_1700.inc ootw_c15.o: ootw_c15.s \ gr_copy.s gr_copy_offset.s gr_fast_clear.s gr_pageflip.s gr_unrle.s \ @@ -296,7 +297,7 @@ ootw_c15.o: ootw_c15.s \ #### AUDIO_TEST: audio.o - ld65 -o AUDIO_TEST audio.o -C ../linker_scripts/apple2_1700.inc + ld65 -o AUDIO_TEST audio.o -C ../../linker_scripts/apple2_1700.inc audio.o: audio.s ca65 -o audio.o audio.s -l audio.lst @@ -305,7 +306,7 @@ audio.o: audio.s #### INTRO: intro.o - ld65 -o INTRO intro.o -C ../linker_scripts/apple2_1700_9000.inc + ld65 -o INTRO intro.o -C ../../linker_scripts/apple2_1700_9000.inc intro.o: intro.s \ gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \ @@ -352,7 +353,7 @@ intro_data_01.lz4: intro_data_01 truncate -s-8 intro_data_01.lz4 intro_data_01: intro_data_01.o - ld65 -o intro_data_01 intro_data_01.o -C ../linker_scripts/apple2_9000.inc + ld65 -o intro_data_01 intro_data_01.o -C ../../linker_scripts/apple2_9000.inc intro_data_01.o: intro_data_01.s ca65 -o intro_data_01.o intro_data_01.s -l intro_data_01.lst @@ -363,7 +364,7 @@ intro_data_04.lz4: intro_data_04 truncate -s-8 intro_data_04.lz4 intro_data_04: intro_data_04.o - ld65 -o intro_data_04 intro_data_04.o -C ../linker_scripts/apple2_9000.inc + ld65 -o intro_data_04 intro_data_04.o -C ../../linker_scripts/apple2_9000.inc intro_data_04.o: intro_data_04.s ca65 -o intro_data_04.o intro_data_04.s -l intro_data_04.lst @@ -374,7 +375,7 @@ intro_data_06.lz4: intro_data_06 truncate -s-8 intro_data_06.lz4 intro_data_06: intro_data_06.o - ld65 -o intro_data_06 intro_data_06.o -C ../linker_scripts/apple2_9000.inc + ld65 -o intro_data_06 intro_data_06.o -C ../../linker_scripts/apple2_9000.inc intro_data_06.o: intro_data_06.s ca65 -o intro_data_06.o intro_data_06.s -l intro_data_06.lst @@ -385,7 +386,7 @@ intro_data_08.lz4: intro_data_08 truncate -s-8 intro_data_08.lz4 intro_data_08: intro_data_08.o - ld65 -o intro_data_08 intro_data_08.o -C ../linker_scripts/apple2_9000.inc + ld65 -o intro_data_08 intro_data_08.o -C ../../linker_scripts/apple2_9000.inc intro_data_08.o: intro_data_08.s ca65 -o intro_data_08.o intro_data_08.s -l intro_data_08.lst @@ -396,7 +397,7 @@ intro_data_09.lz4: intro_data_09 truncate -s-8 intro_data_09.lz4 intro_data_09: intro_data_09.o - ld65 -o intro_data_09 intro_data_09.o -C ../linker_scripts/apple2_9000.inc + ld65 -o intro_data_09 intro_data_09.o -C ../../linker_scripts/apple2_9000.inc intro_data_09.o: intro_data_09.s ca65 -o intro_data_09.o intro_data_09.s -l intro_data_09.lst @@ -407,7 +408,7 @@ intro_data_09.o: intro_data_09.s #### LOADER: loader.o - ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1400.inc + ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1400.inc loader.o: loader.s ca65 -o loader.o loader.s -l loader.lst @@ -415,7 +416,7 @@ loader.o: loader.s #### LOADER2: loader2.o - ld65 -o LOADER2 loader2.o -C ../linker_scripts/apple2_1400.inc + ld65 -o LOADER2 loader2.o -C ../../linker_scripts/apple2_1400.inc loader2.o: loader2.s ca65 -o loader2.o loader2.s -l loader2.lst @@ -423,7 +424,7 @@ loader2.o: loader2.s #### TITLE: title.o - ld65 -o TITLE title.o -C ../linker_scripts/apple2_d00.inc + ld65 -o TITLE title.o -C ../../linker_scripts/apple2_d00.inc title.o: title.s loader.s ca65 -o title.o title.s -l title.lst @@ -434,19 +435,19 @@ title.o: title.s loader.s HELLO: hello.bas - ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + $(TOKENIZE) < hello.bas > HELLO #### HELLO2: hello2.bas - ../asoft_basic-utils/tokenize_asoft < hello2.bas > HELLO2 + $(TOKENIZE) < hello2.bas > HELLO2 ##### ENDING: ending.o - ld65 -o ENDING ending.o -C ../linker_scripts/apple2_1700.inc + ld65 -o ENDING ending.o -C ../../linker_scripts/apple2_1700.inc ending.o: ending.s \ pt3_lib_core.s pt3_lib_init.s pt3_lib_mockingboard_detect.s \ @@ -462,7 +463,7 @@ compress_test.inc: intro_graphics/07_soda/drinking01.png $(PNG2LZ4) asm intro_graphics/07_soda/drinking01.png test_lz4 >> compress_test.inc COMPRESS-TEST: compress_test.o - ld65 -o COMPRESS-TEST compress_test.o -C ../linker_scripts/apple2_2000.inc + ld65 -o COMPRESS-TEST compress_test.o -C ../../linker_scripts/apple2_2000.inc compress_test.o: compress_test.s lz4_decode.s compress_test.inc ca65 -o compress_test.o compress_test.s -l compress_test.lst diff --git a/games/space_bars/Makefile b/games/space_bars/Makefile index b0d10dce..d4a58c59 100644 --- a/games/space_bars/Makefile +++ b/games/space_bars/Makefile @@ -1,8 +1,9 @@ -include ../Makefile.inc +include ../../Makefile.inc -DOS33 = ../dos33fs-utils/dos33 -PNG_TO_40x48D = ../gr-utils/png_to_40x48d -B2D = ../bmp2dhr/b2d +DOS33 = ../../utils/dos33fs-utils/dos33 +PNG_TO_40x48D = ../../utils/gr-utils/png_to_40x48d +B2D = ../../utils/bmp2dhr/b2d +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft all: space_bars.dsk @@ -14,7 +15,7 @@ space_bars.dsk: SPACE_BARS HELLO #### SPACE_BARS: space_bars.o - ld65 -o SPACE_BARS space_bars.o -C ../linker_scripts/apple2_4000.inc + ld65 -o SPACE_BARS space_bars.o -C ../../linker_scripts/apple2_4000.inc space_bars.o: space_bars.s instructions.s \ level3_earth.s level6_saturn.s \ diff --git a/games/space_bars/README b/games/space_bars/README new file mode 100644 index 00000000..abf62b0e --- /dev/null +++ b/games/space_bars/README @@ -0,0 +1,5 @@ +proof of concept of a game that uses vapor-lock/cycle counting +to have mid-screen mode switches + +this is hard to do + diff --git a/games/tb_6502/Changelog b/games/tb_6502/Changelog new file mode 100644 index 00000000..05bf55e2 --- /dev/null +++ b/games/tb_6502/Changelog @@ -0,0 +1,134 @@ +8 April 2003 ++ Got simple hello world to compile and run when entered in hex + by hand [ od -t x1 hello ] into apple emulator. ++ start work on add-file-to-disk-image program + +10 April 2003 ++ Add to disk program now lets you add arbitrary files to a disk image. ++ Hello World program now works from "BRUN TB_6502" + +11 April 2003 ++ Move from default Apple start addy of $800 to $c00 so we can + use low-res page flipping (page1 is from $800-$bff) ++ Got print_text_xy routine working ++ Got blit working! VMW opening screen now comes up! + +14 April 2003 ++ RLE compress the sprites ++ get title screen displaying after figuring out minor problem + [was > 256 bytes] + +15 April 2003 ++ Add support for in-line x and y on put_text_xy + +16 April 2003 ++ Worked on dos3.3 utils rather than any useful menu stuff + +9 May 2003 ++ Have menu partially working, plus the about and phobos sprites loading + +15 May 2003 ++ Have "ABOUT" running the way I like, and not as cluttered as it was. + +28 May 2003 ++ Fix up printxy to correctly wrap at 8-byte boundary ++ have the story output text set up correctly. ++ add a "clear_bottom_ function. + +1 June 2003 ++ Story works ++ Spent 3 hours figuring out why put_text_xy have sporadic problem. + Stupid 6502 and no-16-bit addition. So very tired... + +12 June 2003 ++ Add arrow key support ++ Faster clear-screen + +13 June 2003 ++ Fix arrow keys being backwards, add escape key support + +21 June 2003 ++ Get normal TB left/right support, and clipping. ++ Add missile support ++ Fix various minor bugs. ++ Set up page flipping. Make clear_screen, clear_bottom, and blit + handle this properly ++ Get preliminary shields/level/score indicator working ++ (yes my gf was out of town, how can you guess) + + +11 July 2003 ++ Got an enemy to appear in upper left + +14 July 2003 ++ Enemy moving back and forth, but major heisenbug. Why, why, why? + +15 July 2003 ++ Not heisenbug at all. Was running the move-enemy routine when + no enemy.out. Glad I didn't post on usenet asking why my code + was broken! + +16 July 2003 ++ Minimal y movement implemented + +17 July 2003 ++ Added random number generator + +18 July 2003 ++ Re structure enemy handling code to do a copy to zero page first, + thus streamlining things ++ Have missile <-> enemy collision detection working ++ Have minimal score keeping working ++ Have minimal enemy spawning working ++ (Yes gf was out on work related business, how did you guess) + +29 August 2003 ++ Long delay due to move to Ithaca ++ Annoying work getting 16-bit BCD printing to work. Harder than + it looks! + +30 August 2003 ++ Implement Proper Collision detection ++ Enemies can actually damage you ++ Explosions no longer move ++ Have "GAME OVER" print when you die + +7 September 2003 ++ Have it print "Level 1" at start of level + +27 September 2003 ++ HUGELY busy with grad school. Trying to get this + done for minigames competition + +28 September 2003 ++ Actual varied levels working. Trying to adjust speed for playability. ++ Added two more enemies, as having 8 is easier to do with mask instructions + ;) ++ Attempting to add Boss. ++ Added shield increment every 100 points ++ S now toggles sound ++ P now pauses ++ While waiting for keypress, random number gen seeded ++ Updated timinings. yae is too slow :( am trusting + xapple2 as it seems to play most other games properly. + Should fire up my _real_ IIe. + +11 July 2004 ++ Finally got around to uploading on my real IIe. + Subjective delay timing, seems to work. ++ Boss seems to act irregularly? + +13 July 2004 ++ Scrolling stars implemented. + +18 July 2004 ++ "Ending" for end of level 1 ported over. ++ Bonuses added ++ Hi-score (though not to disk) implemented ++ Final balancing on my Apple IIe Platinum ++ Fix some minor bugs ++ Fixed bug where unitialized memory was causing star scrolling to mess up ++ Bumped version number to 1.0 + +24 July 2004 ++ Added sort-of-working paddle/joystick code. diff --git a/games/tb_6502/FAQ.tb_6502 b/games/tb_6502/FAQ.tb_6502 new file mode 100644 index 00000000..e21f368a --- /dev/null +++ b/games/tb_6502/FAQ.tb_6502 @@ -0,0 +1,233 @@ +FAQ. Some questions shamelessly stolen from the tb_asm FAQ + + +Q. Why? + +A. My friend John got a Gameboy + Advance for Christmas. He suggested I port my game + Tom Bombem to it. + + In actuality the specs of the GBA are similar to the machine I + originally wrote TB1 on. It was on a 386-33 with 320x200x256 graphics + and constrained to 640kB of RAM. The game was written in 16-bit + PASCAL with some 32-bit assembly. + + I somehow got side-tracked into an 8k Linux x86 text-mode version first, + and then it seemed obvious to port it to the 6502. Finally the disks + full of poorly written way-to-slow BASIC space games I wrote when + I was in elementary school have been vindicated! + + +Q. The game runs too fast/too slow! It is unplayable! + +A. The game has been balanced and tested on an actual Apple IIe platinum. + If you are running on an emulator, your emulator probably isn't + emulating 100% accurately. + If you are on a real Apple IIe... well it's probably my fault. + If you're clever you can find the timing code in the source + and fix it yourself. + + + +Q. Why did it take you so long to finish? + +A. I originally rushed to get this game entered in the 2003 Minigames + Competition in the 4k game section. I had to cut down on the + features a lot to get it to fit in 4k. + + Despite all this work, I finished 53rd or so. Most of the + complaints were negative because there aren't that many good Apple ][ + emulators out there, but a highlight was the infamous "blocky graphics" + comment by the Atari 2600 programmer. + + Anyway this experience burned me out on the whole concept for a bit, + plus I started grad school which sucked up most of my time. + + But anyway I got a chance to finish it this summer. + + +Q. How did you do the graphics? + +A. With The Gimp. Used 16 color indexed + palette. Saved as xpm. Edited with text editor. + + + +Q. Why LOW-RES graphics mode? + +A. Because I like 16 colors. High-res on the Apple ][ really isn't all + that great and can only do 4 colors or so with weird placement rules. + + And all of you people with Atari 800s and Commodore's feel free to laugh. + But my code here will run in full 16 color mode even on the Original + Apple ][ released in 1977. + + In any case I like blocky graphics, probably dating to my time doing + ANSI graphics for BBS's in the early 90s. + + And don't think low-res mode was a cheating way out. The Apple ][ + framebuffer is _horribly_ convoluted and non-linear. Apparently + this saved some chips on the memory refresh... but man is it a pain + to program. + + +Q. Why is all the text in this game SHOUTING AT ME? + +A. For extra perversity, I want the game to work on all machines + back to the original 1977 Apple ][. Lower-case letters were an + optional add-on until the Apple //e came out much later. + + + +Q. What is the high score? + +A. A bit of a silly question as its impossible to prove. + + The highest _possible_ score is 9999 I am pretty sure, due + to the limitations of a 16 bit BCD number (which is how the + score is stored). + + +Q. Why does the ship have its engines constantly on, even though + it is moving at a constant velocity? + +A. Ummmm... friction. Yeah... space friction. + + + +Q. Why are the stars moving so quickly? Are you going faster than light? + +A. If you look closely you'll notice the stars repeat. Hence you + are really flying very fast in a big circle. Hey, maybe that's + why the engine is constantly firing! + + + +Q. Where in that tiny ship are all of those missiles stored? + +A. In the seventh dimension. + + +Q. Why the seventh dimension? + +A. The others were all full. + + +Q. Why is there a guinea pig in the game? + +A. A local guinea pig threatened me with violence if I did not include + a picture of her. + + +Q. What have you learned from all this assembly programming? + +A. I'm just reminded what Professor Bruce Jacob always said... + A computer is just a state machine. + + + +Q. Why are there only 6 enemies / 2 missiles / shields go up at 100/ etc? + +A. Game balance. Just trying to keep it challenging yet not overwhlmingly + so. [For the original tb1 it was "because my 386 can't keep up" but + that should be less of a problem these days]. + + If you _must_ have it some other way, feel free to mess with the constants + on the first page of the tb_6502.s file, but I cannot guarantee what + the consequences might be! + + +Q. Will there be a sequel? + +A. Yes, it will be released shortly before either the release of + "Duke Nukem Forever (tm)" or the heat death of the universe, + which ever happens first. + + +Q. Why can't Vince stay consitent between "HISCORE" and "HIGH SCORE" + including all possibly variations of "HI-SCORE" "HIGH_SCORE" usw? + +A. The world may never know. + + +Q. What does "usw" mean? + +A. Und So Weiter. + + +Q. That wasn't helpful. + +A. This isn't a question. + + +Q. What's the highest level you can get to? + +A. No matter how you try, once you get to level 7 it will + keep repeating. This is because I multiply the level + by 16 in various places for enemy movement, and it it goes + above 7 then the byte will be negative causing + Bad Things(tm) to happen. + + +Q. Well why don't you modify the code so it doesn't go haywire + after level 7? + +A. I am lazy. Also it should be too hard to get to level 7 anyway + + +Q. What are the enemies supposed to be? + +A. An envelope, a clip-board, a cigarette, a telephone, a dollar-bill, + and an un-identified yellow thing, possibly a banana. All things + malicious marketers might have in excess. + The apple II version has in addition a green toothbrush and a + purple toupe. Those wacky marketers! + +Q. How come the stars appear in straight bands insteas of scattered in the + sky? + +A. Because my pseudo-random number algorithm is at times more pseudo + than random. + + +Q. Why does vince use the stack so often, when it would make much more + sense to backup the Y register to the zero page? + +A. Too much intel x86 programming has warped my mind into thinking + stack usage is a good way of mitigating limited register count. + + Must remind myself the zero page is like a 256-byte register file. + + + +Q. Why is the 6502 instruction set so obtuse? + +A. I HAVE NO IDEA. In coding I keep stumbling across instructions + that I think would be _so_ useful. But they don't exist. But + apparently the instructions I pine for are fairly obvious... + an enhanced 65C02 was released with "bonus" opcodes. Sadly + I cannot use them because of the aforementioned want of Apple ][ + compatibility [the 65C02 wasn't around until the //e. + + ABS (IND), X indexing : would be great working with structs. + BRA -- Branch Always : a great opcode name, but also remove + the need for 16-bit absolute JMP's when + a short branch would do + DEA -- Decrement Accumulator : + That's right, there's no way to decrement + the accumulator. You have to CLC clear + carry then ADC $FF. Yet you can dec + X or Y with one-byte. Weird. + INA -- Incrememnt Accumlator: + See DEA. Yes, even more perverse. Taking + 3 bytes to do what should be a common task. + PHX/PLX + PHY/PLY -- Push/Pop X/Y : + These would be so useful. Otherwise + you can only push/pop the accumulator. + STZ -- Store Zero to Memory : + Would save a lot of LDA #$0 / STA pairs. + TRB/TSB -- Test and Set/Reset bit: + Wow, getting even more CISC here. Atomic + test/set bit instructions. We're ready + for SMP now. diff --git a/games/tb_6502/Makefile b/games/tb_6502/Makefile new file mode 100644 index 00000000..b5e4db60 --- /dev/null +++ b/games/tb_6502/Makefile @@ -0,0 +1,21 @@ +include ../../Makefile.inc + +DOS33 = ../../utils/dos33fs-utils/dos33 +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft + +all: tb_6502.dsk + +tb_6502.dsk: TB_6502 + $(DOS33) -y tb_6502.dsk BSAVE -a 0x0C00 TB_6502 + +#TB_6502: tb_6502 +# make_b ./tb_6502 ./TB_6502 0xC00 + +TB_6502: tb_6502.o + ld65 -o TB_6502 tb_6502.o -C ./apple2_c00.inc + +tb_6502.o: tb_6502.s + ca65 -o tb_6502.o tb_6502.s -l tb_6502.lst + +clean: + rm -f *.lst *.o tb_6502 *~ add_to_disk TB_6502 a.out diff --git a/games/tb_6502/README.tb_6502 b/games/tb_6502/README.tb_6502 new file mode 100644 index 00000000..97a0a7e1 --- /dev/null +++ b/games/tb_6502/README.tb_6502 @@ -0,0 +1,130 @@ +TOM BOMBEM: Merciless Marauding Malicious Marketers + 6502 Apple IIe Edition +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +http://www.deater.net/weave/vmwprod/tb1/tb_6502.html + + by Vince Weaver + + version 1.1 -- 24 July 2004 + + +Quotes about tb_6502: +~~~~~~~~~~~~~~~~~~~~~ + + "The graphics are crude and blocky." + -- random Atari 2600 developer + + +System Requirements: +~~~~~~~~~~~~~~~~~~~~ + Apple ][ Computer + At least 32kB of RAM + Disk drive, or Super Serial Card to load game + + +Background: +~~~~~~~~~~~ + You are Tom Bombem, a shy new intern on Moonbase Alpha. + Somewhat against your will it has become your job to + defend Earth! See the "Story" option in the game + for the rest of the story. + + tb_6502 comes before "tb1: Invasion of the Inanimate Objects" + chronologically, for those who might care. + + +Keybindings: +~~~~~~~~~~~ + Use arrow keys, or i,j,k,m to manuever and navigate menus. + ' ' shoots and selects. + 'h' displays help. 's' toggles sound 'p' pauses + +Options/Hiscore File: +~~~~~~~~~~~~~~~~~~~~~ + + not implemented yet + +Game Play: +~~~~~~~~~~ + Manuever your ship avoiding the falling objects. Shoot them. + + Only 2 missiles can be in the air at the time [this is _not_ a bug. + it's a limit of your ship's missile guidance system]. + + Every 100 points your shields will increase. + + There are special bonuses you can earn at the end of each level. + + + No Shields Hit : going through an entire level without + having an enemy hit your ship + + All Enemies Destroyed : all enemies were destroyed before + scrolling off the screen. [Note, + ramming an enemy with your ship + _DOES_ count as destroying it. Just + don't let them get by you] + + Perfect Shot: Every missile fired hits an enemy. + + + At the end each level you fight the boss. Then the game starts over + with the enemies moving faster! + + +Compiling / Running: +~~~~~~~~~~~~~~~~~~~~ + + RUNNING: + Just obtain an apple emulator. Point it to the tb_6502.dsk image. + Upon booting it should run! + + Also, you can get a real Apple II computer and download the disk + image to a real floppy. That is a bit more complicated. + + COMPILING: + + The following compile instructions assume you are using Linux. + + * first you need the c65 package from: + http://www.cc65.org/ + + To install cc65 you need to unpack, and do a + "make -f make/gcc.mak" from the cc65/src directory. + + The utils we need are ca65 and ld65. Copy them somewhere in your + path (ie /usr/local/bin). + + * To make the disk image you will need the dos33fsprogs package + of mine, available from: + http://www.deater.net/weave/vmwprod/apple/dos33fs.html + Unpack and instal. "make; make install" + + * Now hopefully just type "make" in the tb_6502 directory and + the program should be assembled. "make disk" should copy + the new version to the disk image, assuming all the tools + are installed properly. + + + +About: +~~~~~~ + + When I was much younger, I would type in BASIC games on the Apple II. + I always wanted to write games myself, but the ones I wrote in BASIC + were too slow. I was just starting to learn assembly when we got + a 386 and I moved on to other things. + + But now, only 25 years too late, I finally wrote a playable game! + + The hope is maybe eventually using this as a stepping-board to + creating a Game Boy Advance TomBombem game. + + This game was originally written for the 4k mini-game competition. + It finished embarassingly low in the standings. I've added some + more features now so it is well over the 4k mark. + +Author: +~~~~~~~ + Vince Weaver + http://www.deater.net/weave/ + Special Thanks to KRG + 24 July 2004 + diff --git a/games/tb_6502/SINCOS b/games/tb_6502/SINCOS new file mode 100644 index 00000000..c467de3a Binary files /dev/null and b/games/tb_6502/SINCOS differ diff --git a/games/tb_6502/TODO b/games/tb_6502/TODO new file mode 100644 index 00000000..9babbe0a --- /dev/null +++ b/games/tb_6502/TODO @@ -0,0 +1,3 @@ +Save high score to disk. + +OPTIMIZE! diff --git a/games/tb_6502/apple2_c00.inc b/games/tb_6502/apple2_c00.inc new file mode 100644 index 00000000..72588b0d --- /dev/null +++ b/games/tb_6502/apple2_c00.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $C00, size = $8E00, file = %O; +} + +SEGMENTS { +CODE: load = RAM, type = ro; +RODATA: load = RAM, type = ro; +DATA: load = RAM, type = rw; +BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = zp; +} diff --git a/games/tb_6502/tb_6502.dsk b/games/tb_6502/tb_6502.dsk new file mode 100644 index 00000000..820c2013 Binary files /dev/null and b/games/tb_6502/tb_6502.dsk differ diff --git a/games/tb_6502/tb_6502.s b/games/tb_6502/tb_6502.s new file mode 100644 index 00000000..14ea471c --- /dev/null +++ b/games/tb_6502/tb_6502.s @@ -0,0 +1,4291 @@ +.define EQU = + +; blt = bcc +; bge = bcs + +;; ZERO PAGE +CH EQU $24 +CV EQU $25 +BASL EQU $28 +BASH EQU $29 +H2 EQU $2C +COLOR EQU $30 +YSAV EQU $34 +YSAV1 EQU $35 +RANDOM_SEED EQU $43 + +;; Our Zero Page Allocations + +PADDLE_STATUS EQU $CA +HISCORE_1 EQU $CB +HISCORE_2 EQU $CC +HISCORE_3 EQU $CD +HISCORE_H EQU $CE +HISCORE_L EQU $CF + +BOSS_X EQU $D0 +BOSS_XADD EQU $D1 +BOSS_COUNT EQU $D2 +BOSS_SMOKE EQU $D3 +BOSS_EXPLODING EQU $D4 +BOSS_WAITING EQU $D5 +BOSS_HITS EQU $D6 +BOSS_SHOOTING EQU $D7 + +ENEMIES_SPAWNED EQU $D8 +ENEMY_TYPE EQU $D9 +ENEMY_WAVE EQU $DA +CURRENT_INIT_X EQU $DB +CURRENT_ENEMY_KIND EQU $DC +TOTAL_ENEMIES_OUT EQU $DD +SCROLL EQU $DE +SOUND_ON EQU $DF + +SHIPX EQU $E0 +SHIPXADD EQU $E1 +ENEMY_PL EQU $E2 +ENEMY_PH EQU $E3 +MISSILE_PL EQU $E4 +MISSILE_PH EQU $E5 +GR_PAGE EQU $E6 +LEVEL EQU $E7 +SHIELDS EQU $E8 +SCOREL EQU $E9 +SCOREH EQU $EA +BONUS_FLAGS EQU $EB + +BCD_BYTEH EQU $EC +BCD_BYTE EQU $ED + +COL_X1 EQU $EC +COL_X2 EQU $ED +COL_X3 EQU $EE +COL_X4 EQU $EF + +ENEMY_EXPLODING EQU $F0 +ENEMY_KIND EQU $F1 +ENEMY_X EQU $F2 +ENEMY_Y EQU $F3 +ENEMY_XADD EQU $F4 +ENEMY_YADD EQU $F5 +ENEMY_XMIN EQU $F6 +ENEMY_XMAX EQU $F7 + +BETWEEN_DELAY EQU $F8 +ENEMY_WAIT EQU $F9 + +STRINGL EQU $FA +STRINGH EQU $FB +PARAM2 EQU $FC +RESULT EQU $FD +LASTKEY EQU $FE +TEMP EQU $FF + +;; VECTORS +BASIC EQU $3D0 ;; VECTOR for return to Applesoft + +KEYPRESS EQU $C000 +KEYRESET EQU $C010 + +SPEAKER EQU $C030 + +;; SOFT SWITCHES +GR EQU $C050 +TEXT EQU $C051 +FULLGR EQU $C052 +TEXTGR EQU $C053 +PAGE0 EQU $C054 +PAGE1 EQU $C055 +LORES EQU $C056 +HIRES EQU $C057 + +PADDLE_BUTTON0 EQU $C061 +PADDL0 EQU $C064 +PTRIG EQU $C070 + +;; MONITOR ROUTINES +HLINE EQU $F819 ;; HLINE Y,$2C at A +VLINE EQU $F828 ;; VLINE A,$2D at Y +CLRSCR EQU $F832 ;; Clear low-res screen +CLRTOP EQU $F836 ;; clear only top of low-res screen +SETCOL EQU $F864 ;; COLOR=A +BASCALC EQU $FBC1 ;; +HOME EQU $FC58 ;; Clear the text screen +WAIT EQU $FCA8 ;; delay 1/2(26+27A+5A^2) us +SETINV EQU $FE80 ;; INVERSE +SETNORM EQU $FE84 ;; NORMAL +COUT1 EQU $FDF0 ;; output A to screen + + +;; GAME PARAMETERS +NUM_MISSILES EQU 2 +NUM_ENEMIES EQU 6 +UP_SHIELDS EQU 32 +WAVE_SIZE EQU 16 +WAVES_TILL_BOSS EQU 5 + +;; BONUS_FLAGS +PERFECT_SHIELDS EQU $80 +PERFECT_KILLS EQU $40 +PERFECT_AIM EQU $1 + + +;========================================================== +; MAIN() +;========================================================== + + + ;============================== + ; back up part of the zero page + ;============================== + + lda #>zero_page_save + sta BASH + lda #(score_string+31) + sta STRINGH + lda #<(score_string+31) + sta STRINGL + jsr print_high_score + + ;============= + ; put vmw logo + ;============= + + lda #$7 ; y=7 + sta CV + lda #$8 ; x=8 + sta CH + lda #>vmw_sprite + sta STRINGH + lda #vmw_string ; string = vmw_string + sta STRINGH + lda #opener_sprite + sta STRINGH + lda #opener_sprite_2 + sta STRINGH + lda #mercy_string ; string = MMMM + sta STRINGH + lda #help_string ; string = "H FOR HELP" + sta STRINGH + lda #zero_page_save + sta BASH + lda #new_game_string ; string starts at "NEW GAME" + sta STRINGH + lda #vince_sprite + sta STRINGH + lda #about_lines + sta STRINGH + lda #help_lines + sta STRINGH + lda #phobos_sprite + sta STRINGH + lda #story_lines + sta STRINGH + lda #evil_ship_sprite + sta STRINGH + lda #tom_sprite + sta STRINGH + lda #you_are_tom + sta STRINGH + lda #earth_sprite + sta STRINGH + lda #ending_lines + sta STRINGH + lda #susie_sprite + sta STRINGH + lda #susie_lines + sta STRINGH + lda #tom_head_sprite + sta STRINGH + lda #tom_sigh + sta STRINGH + lda #missile_0 ; clear the missile struct + sta MISSILE_PH ; should make this clear all BSS + lda #enemy_0 + sta ENEMY_PH + lda #(level_string+9) + sta STRINGH + lda #<(level_string+9) + sta STRINGL + + lda #0 + sta BCD_BYTEH + lda LEVEL + sta BCD_BYTE + jsr print_bcd_byte + + + ;====================== + ; Print level on screen + ;====================== + + lda #>(level_string_xy) + sta STRINGH + lda #<(level_string_xy) + sta STRINGL + + jsr print_text_xy + + ldx #20 + jsr wait_X_100msec ; pause for 3 seconds + bit KEYRESET ; clear keyboard + + ;================================== + ; Enter graphics mode, clear screen + ;================================== + + jsr set_page0_gr ; set graphics mode + jsr clear_screen ; clear screen + + +draw_stars: + + ;===================== + ; Setup star field + ;===================== + + lda #>(star_field) + sta STRINGH + lda #<(star_field) + sta STRINGL + + ldy #$0 +star_init: + jsr random_number + and #$9f + clc + adc #$4 + sta (STRINGL),Y + iny + lda #$0 + sta (STRINGL),Y + iny + bne star_init + + lda #$0 + sta SCROLL + + + ;/========================\ + ;+ + + ;+ MAIN GAME LOOP + + ;+ + + ;\========================/ + +main_game_loop: + jsr clear_screen ; clear screen + jsr show_stars + + + + + +done_scrolling: + + ; ================================ + ; put out new enemies (if needed) + ; ================================ + + inc BETWEEN_DELAY ; inc how long we've delayed + lda BETWEEN_DELAY ; load it in + cmp ENEMY_WAIT ; have we waited long enough? + beq reset_delay + + jmp move_enemies ; if not, go on to movement +reset_delay: + + ; delay==wait, so attempt to put out new enemy + + lda BETWEEN_DELAY + and #$1 + sta BETWEEN_DELAY ; reset delay + + ; special case for boss + + lda #$9 ; if boss, don't keep track of + cmp ENEMY_TYPE ; how many enemies were spawned + bne not_boss_dont_clear + + lda #$1 ; store 1 so we don't increment wave + sta ENEMIES_SPAWNED + +not_boss_dont_clear: + + ; see if we are at a new wave + ; basically, if 16 have been spawned, change + + lda ENEMIES_SPAWNED + and #$0f + bne same_enemy_type ; if not 16 gone by, move on + + ;======================= + ; change the enemy type + + inc ENEMIES_SPAWNED + + jsr random_number + and #$7 ; get a random number 0-7 + sta ENEMY_TYPE + + inc ENEMY_WAVE + + lda ENEMY_WAVE ; have we gone enough waves to reach boss? + cmp #WAVES_TILL_BOSS + bne not_boss_yet + + lda #$8 + sta ENEMY_TYPE + + + +not_boss_yet: + + ; set various constants + ; these may be overriden later + + + lda #20 + sec + sbc LEVEL + sta ENEMY_WAIT ; enemy_wait=20-level + + ; set kind and init x to be random by default + + lda #$ff + sta CURRENT_ENEMY_KIND + sta CURRENT_INIT_X + + + +same_enemy_type: + + ; find empty enemy slot + + ldy #$0 ; point to enemies[0] + tya + +find_empty_enemy: + pha + lda (ENEMY_PL),Y ; get enemy[y].out + beq add_enemy + + pla + clc + adc #$9 + tay + cpy #(NUM_ENEMIES*9) + bne find_empty_enemy + + + jmp move_enemies ; no empty, slots, move on + + +add_enemy: + pla + + ;============================================== + ; First see if we must wait for enemy to clear + ; types 2 and 8 + + lda ENEMY_TYPE + cmp #$2 + + bne check_type_8 + + lda TOTAL_ENEMIES_OUT + beq change_to_type_3 + jmp move_enemies +change_to_type_3: + lda #$3 + sta ENEMY_TYPE + + jsr random_number + and #$8 + sta CURRENT_ENEMY_KIND + + jsr random_number + and #$1F ; mask off so 0-31 + clc + adc #$2 + asl A + sta CURRENT_INIT_X + jmp setup_enemy_defaults + +check_type_8: + + cmp #$8 + beq before_boss_stuff + jmp check_type_9 + +before_boss_stuff: + + ;====================== + ; before boss stuff + + lda TOTAL_ENEMIES_OUT + beq prepare_for_boss + jmp move_enemies + +prepare_for_boss: + + ;=============== + ; HANDLE BONUSES + ;=============== + + ; Set text mode + + jsr set_page0_text + jsr HOME + + ; Print "BONUS POINTS" + + lda #>bonus_string + sta STRINGH + lda #bonus_shields + sta STRINGH + lda #bonus_kills + sta STRINGH + lda #bonus_aim + sta STRINGH + lda #no_bonus_string + sta STRINGH + lda #34 + + lda CURRENT_INIT_X + bpl store_init_x + + jsr random_number + and #$1f + clc + adc #$2 + asl + +store_init_x: + iny ; X + sta (ENEMY_PL),Y + + ; enemy_y is always 0 by default + + iny ; Y + lda #$0 + sta (ENEMY_PL),Y + + lda #$0 + iny + sta (ENEMY_PL),Y ; xadd + iny + sta (ENEMY_PL),Y ; yadd + lda #$2 + iny + sta (ENEMY_PL),Y ; xmin + iny + lda #$24 + sta (ENEMY_PL),Y ; ymin + + dey ; xmin + dey ; yadd + dey ; xadd + + + ;=========================================== + ; Enemy specific inits + + lda ENEMY_TYPE + beq enemy_type_0 + cmp #$1 + beq enemy_type_1 + jmp enemy_type_2 + +enemy_type_0: +enemy_type_1: + + ;================================ + ; ENEMY TYPE 0 and 1 + ; diagonal, no wait + ; movement proportional to level + + lda LEVEL ; xadd = level + sta (ENEMY_PL),Y + + iny + + lsr A + ora #$1 + sta (ENEMY_PL),Y ; yadd = level/2 + jmp move_enemies + +enemy_type_2: + ;===================== + ; Enemy Type 2 + ; just a place-holder + ; waits for enemies to die then moves on to 3 + + cmp #$2 + bne enemy_type_3 + jmp move_enemies + + +enemy_type_3: + + cmp #$3 + bne enemy_type_4 + + ;====================== + ; Enemy type 3 + + lda #$1 + sta (ENEMY_PL),Y ; xadd=1 + + iny + + lda LEVEL + sta (ENEMY_PL),Y ; yadd=level + + jmp move_enemies + +enemy_type_4: + + cmp #$4 + bne enemy_type_5 + + + ;========================= + ; Enemy Type 4 + ; Horizontal, then fall + + lda #$2 + sta (ENEMY_PL),Y ; xadd = 2 + + iny + + jsr random_number + ora #$80 ; set negative + sta (ENEMY_PL),y ; yadd = -(random%128) + ; this means bop back and forth a random + ; time, then drop + + jmp move_enemies + + +enemy_type_5: + cmp #$5 + bne enemy_type_6 + + ;======================== + ; Enemy Type 5 + ; "wiggle" + + lda #$1 + sta (ENEMY_PL),y ; xadd=1 + + iny + lda LEVEL + sta (ENEMY_PL),y ; yadd=2 + + iny + jsr random_number + and #$0f + clc + adc #$2 + sta (ENEMY_PL),y ; xmin=(rand%16)+2 + + + dey ; yadd + dey ; xadd + dey ; y + dey ;x + asl A + sta (ENEMY_PL),y + iny ;y + iny ; xadd + iny ; yadd + iny ; xmin + + jsr random_number + and #$0f + clc + adc (ENEMY_PL),Y + adc #$02 + iny + sta (ENEMY_PL),Y ; xmax = xmin+(rand%16)+2 + + jmp move_enemies + + +enemy_type_6: + cmp #$6 + beq enemy_type_7 + cmp #$7 + beq enemy_type_7 + jmp enemy_type_8 +enemy_type_7: + ;===================== + ; Enemy Types 6+7 + ; "Rain" + + + + jsr random_number + and #6 + bne no_use_own_x + + dey ; y + dey ; x + + lda SHIPX + cmp #$2 + bpl shipx_ok + lda #$2 ; stupid bug where gets stuck is < xmin + +shipx_ok: + + asl A + sta (ENEMY_PL),Y ; one-in-four chance we use shipx as X + + iny ; y + iny ; xadd + +no_use_own_x: + + lda #$0 + sta (ENEMY_PL),Y ; xadd=0 + iny + lda #$1 + sta (ENEMY_PL),Y ; yadd = 1 + + jmp move_enemies + +enemy_type_8: +enemy_type_9: + + ;====================== + ; Things flung by boss + + + dey ; y + dey ; x + + lda BOSS_X + clc + adc #$5 + asl A + sta (ENEMY_PL),Y ; enemy_x=boss_x+5 + + iny + lda #$3 + asl A + asl A + sta (ENEMY_PL),Y ; enemy_y=3 + + + iny + lda #$0 + sta (ENEMY_PL),Y ; xadd=0 + + iny + lda #$2 + sta (ENEMY_PL),Y ; yadd=2 + + + + + +move_enemies: + + ;============================================== + ; Move Enemies! (first thing, if no new added) + ;============================================== + + ldy #$0 ; point to enemies[0] +handle_enemies: + + tya + pha ; store y on stack + + lda (ENEMY_PL),Y ; get enemy[y].out + bne load_enemy_zero_page ; if enemy.out then we are good + + jmp skip_to_next_enemy ; enemy is not out, so skip to next + + + + ;========================================== + ; load this enemy stuff into zero page for + ; easier access + ;========================================== + +load_enemy_zero_page: + ldx #ENEMY_EXPLODING +load_to_zero_page: + iny ; point to exploding + lda (ENEMY_PL),Y + sta 0,X ; store to zero page + inx + cpx #(ENEMY_XMAX+1) ; see if reached end + bne load_to_zero_page ; if not keep copying + + ;================================ + ; skip all movement and collision + ; if exploding + ;================================ + + lda ENEMY_EXPLODING + beq move_enemy_x + jmp draw_enemy + + ;================================ + ; Start the enemy movement engine + ;================================ + + + ;======== + ; Move X + ;======== + +move_enemy_x: + clc + lda ENEMY_X ; X + adc ENEMY_XADD ; x+=xadd + sta ENEMY_X + + lsr A + + cmp ENEMY_XMIN ; are we less than xmin? + bmi switch_dir_enemy_x ; if so, switch direction + + cmp ENEMY_XMAX ; are we greater than xmax? + bpl switch_dir_enemy_x ; if so, switch direction + + jmp move_enemy_y + + +switch_dir_enemy_x: + + ; switch X direction + + lda #$0 ; load zero + sec + sbc ENEMY_XADD ; 0 - ENEMY_XADD + sta ENEMY_XADD ; store it back out, negated + jmp move_enemy_x ; re-add it in + + ;======== + ; Move Y + ;======== + +move_enemy_y: + + lda #$0 ; load in zero + cmp ENEMY_YADD ; compare to YADD + + bmi no_y_special_case ; if minus, we have special case + + inc ENEMY_YADD + bne done_enemy_y + + lda #$0 + sta ENEMY_XADD + lda #$2 + sta ENEMY_YADD + + ; increment y + ; is it > 0? + ; if not keep going + ; if so, yadd=level*2 + + jmp done_enemy_y + +no_y_special_case: + clc + lda ENEMY_Y ; get Y + adc ENEMY_YADD ; y+=yadd + sta ENEMY_Y ; store back out + + lsr A + lsr A + + cmp #$12 ; is y<=12? + bmi done_enemy_y ; if so no need to do anything + beq done_enemy_y + + ; off screen + + pla ; pop saved Y off stack + tay + pha ; push y back on stack + + lda #$0 + sta (ENEMY_PL),Y ; set enemy[i].out=0 + + dec TOTAL_ENEMIES_OUT + + lda BONUS_FLAGS + and #<(~PERFECT_KILLS) + sta BONUS_FLAGS + + jmp skip_to_next_enemy ; skip to next enemy + + +done_enemy_y: + + ;=============== + ; Done Movement + ;=============== + + + ;====================== + ; Check for Collisions + ;====================== + + + ;================================== + ; Check ENEMY <> MISSILE collision + ;================================== + +check_enemy_missile_collision: + + ldy #$0 + sty YSAV +check_missile_loop: + lda (MISSILE_PL),Y + beq missile_not_out + + iny ; point to missile.x + lda (MISSILE_PL),Y ; load missile.x + + sta COL_X1 + sta COL_X2 + + lda ENEMY_X + lsr A + sta COL_X3 + clc + adc #3 + sta COL_X4 + + jsr check_inside + + bcc missile_done + +x_in_range: + + iny + lda (MISSILE_PL),Y ; load missile.y + + sta COL_X3 + clc + adc #2 + sta COL_X4 + + lda ENEMY_Y + lsr A + lsr A + sta COL_X1 + clc + adc #1 + sta COL_X2 + + jsr check_inside + + bcc missile_done + + +horrible_explosion: + + ; clear missile + + ldy YSAV + lda #$0 + sta (MISSILE_PL),Y + + ; clear enemy + + lda #$1 + sta ENEMY_EXPLODING + lda #$40 + sta ENEMY_KIND + + jsr inc_score + + jmp draw_enemy + + +missile_done: +missile_not_out: + ldy YSAV + iny + iny + iny + sty YSAV + cpy #(NUM_MISSILES*3) + bne check_missile_loop + + ;================================= + ; Done missile <> enemy collision + ;================================= + + + ;==================================== + ; check for ship <-> enemy collision + ;==================================== + + lda SHIPX + sta COL_X3 + clc + adc #8 + sta COL_X4 ; big check is shipx - shipx+8 + + lda ENEMY_X + lsr A + sta COL_X1 + clc + adc #2 + sta COL_X2 ; small check enemy_x - enemy_x+2 + + jsr check_inside ; check if overlap + + bcc draw_enemy ; if not, move ahead + + lda #16 + sta COL_X3 + lda #18 + sta COL_X4 ; big check is 16 - 18 + + lda ENEMY_Y + lsr A + lsr A + sta COL_X1 + clc + adc #$1 + sta COL_X2 ; little check is enemy_y - enemy_y+1 + + jsr check_inside ; check if overlap + + bcc draw_enemy ; if not, move ahead + + ; make the enemy explode + + lda #$1 + sta ENEMY_EXPLODING + lda #$40 + sta ENEMY_KIND + + dec SHIELDS + jsr update_shields ; move shields down + + lda #<(~PERFECT_SHIELDS) ; (~PERFECT_SHIELDS) + and BONUS_FLAGS ; remove perfect shield bonus + sta BONUS_FLAGS + + + ;===================================== + ; Done ship <> enemy collision detect + ;===================================== + + +draw_enemy: + + ; See if the enemy is currently exploding + ; if so, do explosion stuff + +check_enemy_explode: + lda ENEMY_EXPLODING ; load enemy[i].exploding + beq not_exploding ; if 0 then not exploding + +handle_exploding: + + jsr click ; make some noise + + clc + lda ENEMY_KIND ; move to next step in explosion + adc #$4 + sta ENEMY_KIND + + cmp #$58 ; have we cycles through explosion? + bne draw_enemy_sprite ; if not, we are still exploding + + dec TOTAL_ENEMIES_OUT ; total_enemies_out-- + + pla + tay ; load y + pha + + lda #$0 ; enemy[i].out=0 + sta (ENEMY_PL),Y + + jmp skip_to_next_enemy + + + ; point to enemies_x + ; goto enemies_xy + + +not_exploding: + + + +draw_enemy_sprite: + + ; point to proper sprite + + lda #>enemy_sprite0 ; point to the missile sprite + sta STRINGH + lda #boss_sprite + sta STRINGH + lda #smoke_sprite0 ; point to the missile sprite + sta STRINGH + lda #laser_sprite0 ; point to the missile sprite + sta STRINGH + lda #smoke_sprite0 ; point to the missile sprite + sta STRINGH + lda #missile_sprite ; point to the missile sprite + sta STRINGH + lda #ship_sprite + sta STRINGH + lda #shields_string + sta STRINGH + lda #score_string + sta STRINGH + lda #level_string + sta STRINGH + lda #game_over_string + sta STRINGH + lda #(score_string+31) + sta STRINGH + lda #<(score_string+31) + sta STRINGL + jsr print_high_score + + jsr HOME + + ; print new high score message + + lda #>new_high_score_string + sta STRINGH + lda #high_score_string + sta STRINGH + lda #shields_string + sta STRINGH + lda #(score_string+7) + sta STRINGH + lda #<(score_string+7) + sta STRINGL + + tya + pha ; save Y on stack + + + ldy #$0 + + lda SCOREH + sta BCD_BYTEH + + lda SCOREL + sta BCD_BYTE + jsr print_bcd_word + + pla ; restore Y + tay + + rts + +;====================== +; print high_score +;====================== + ; location to output to in STRINGH/STRINGL + +print_high_score: + tya + pha ; save Y on stack + + ldy #$0 + + lda HISCORE_H + sta BCD_BYTEH + + lda HISCORE_L + sta BCD_BYTE + jsr print_bcd_word + + pla ; restore Y + tay + + rts + +;========================================================== +; print_bcd_word +;========================================================== + ; string to output in STRINGH/STRINGL + ; byte to output in BCD_BYTE + +print_bcd_word: + + + lda BCD_BYTEH + lsr A + lsr A + lsr A + lsr A + and #$f ; mask low nybble + bne to_ascii_thou + + lda #$A0 ; load a space + + jmp write_thousands +to_ascii_thou: + adc #$B0 ; covert to ascii + +write_thousands: + sta (STRINGL),Y ; store output + + iny + + lda BCD_BYTEH + + and #$f + bne to_ascii_hun + + cmp BCD_BYTEH + + bne to_ascii_hun + + lda #$A0 + jmp write_hundreds + +to_ascii_hun: + adc #$B0 +write_hundreds: + sta (STRINGL),Y + + iny + + +print_bcd_byte: + + lda BCD_BYTE + lsr A + lsr A + lsr A + lsr A + and #$f ; mask low nybble + bne to_ascii_tens ; if not zero, convert to ascii + + cmp BCD_BYTEH + + bne to_ascii_tens + + lda #$A0 + + jmp write_tens +to_ascii_tens: + adc #$B0 ; covert to ascii + +write_tens: + sta (STRINGL),Y ; store output + + iny ; point one lower + + + lda BCD_BYTE + clc + and #$f + adc #$B0 + + sta (STRINGL),Y + + + rts + +;========================================================== +; check inside +;========================================================== + ; Simple collision detection. Have small line x1<->x2 + ; Want to see if it overlaps long line x3<---------->x4 + ; so: + ; if ((x1>x3)&&(x1x3) && (x2 40? + bmi bottom_loop ; if not, loop + + lda #$80 ; go to next line [they are $80 apart] + clc + adc BASL ; increment base + sta BASL ; store it out + lda #$0 ; load 0 into A + adc BASH ; carry into top byte if need be + sta BASH ; and store out + + inx ; increment line count + cpx #$4 ; have we done 4 + bcc bottom_y ; if not, loop + + rts + + +;========================================================== +; print X strings +;========================================================== + ; + ; +print_x_strings: + stx TEMP + jsr print_text_xy + ldx TEMP + dex + bne print_x_strings + rts + + +;========================================================== +; Print text x,y +;========================================================== + ; x=ch y=cv + ; string=string_addr + +print_text_xy: + ldy #$0 ; clear IY + lda (STRINGL),Y ; load x from memory + sta CH ; store to CH + iny ; point to next value + + lda (STRINGL),Y ; load y from memory + sta CV ; store to CV + ; point to beginning of string + + clc + lda #$2 + adc STRINGL + sta STRINGL + lda #$0 + adc STRINGH + sta STRINGH + +print_text: + ldy #$0 + lda CV + jsr BASCALC ; get the address of y in BASH:BASL + clc ; clear the carry + lda BASL ; load BASL + adc CH ; add x + sta BASL ; store BASL back out + +output_loop: + lda (STRINGL),Y ; load char from string_addr+y + beq print_done ; if null terminated, done + sta (BASL),Y ; store to BASH:BASL + iny ; IY++ + jmp output_loop ; loop + +print_done: + iny + tya ; transfer y to accumulator + + + adc STRINGL ; add y and stringl + sta STRINGL ; and store it out + lda #$0 ; clear accumulator + adc STRINGH ; add with carry from prev stringh + sta STRINGH ; and save it + + + rts + + + + +;========================================================== +; clear_screen +;========================================================== + ; + +clear_screen: + + ldx #$0 +clear_0: + cpx #$0 + bne clear_1 + lda GR_PAGE + sta BASH + lda #$0 + sta BASL + ldy #$78 + jmp clear_it +clear_1: + cpx #$1 + bne clear_2 + lda #$80 + sta BASL + ldy #$78 + jmp clear_it +clear_2: + cpx #$2 + bne clear_3 + clc + lda #$1 + adc GR_PAGE + + sta BASH + ldy #$78 + jmp clear_it +clear_3: + cpx #$3 + bne clear_4 + lda #$0 + sta BASL + ldy #$78 + jmp clear_it +clear_4: + cpx #$4 + bne clear_5 + clc + lda #$2 + adc GR_PAGE + sta BASH + ldy #$50 + jmp clear_it +clear_5: + cpx #$5 + bne clear_6 + lda #$80 + sta BASL + ldy #$50 + jmp clear_it +clear_6: + cpx #$6 + bne clear_7 + clc + lda #$3 + adc GR_PAGE + sta BASH + ldy #$50 + jmp clear_it +clear_7: + cpx #$7 + bne clear_8 + lda #$0 + sta BASL + ldy #$50 + jmp clear_it +clear_8: + + rts + +clear_it: + lda #$00 +clear_loop: + dey + + sta (BASL),Y + + bne clear_loop + + inx + jmp clear_0 + +;========================================================== +; show_stars +;========================================================== +; + +show_stars: + + + lda #>star_field ; Load the star offsets + sta STRINGH ; array into + lda # +#include /* strncpy() */ +#include /* isdigit() */ +#include /* open() */ +#include /* close() */ + +char dos_color_to_apple[16]= +{0, /* 0 black */ + 2, /* 1 blue */ + 4, /* 2 green */ + 7, /* 3 cyan */ + 1, /* 4 red */ + 3, /* 5 purple */ + 8, /* 6 brown */ + 10,/* 7 l grey */ + 5, /* 8 d grey */ + 6, /* 9 l blue */ +12, /*10 l green */ +14, /*11 l cyan */ + 9, /*12 l red */ +11, /*13 pink */ +13, /*14 yellow */ +15, /* 15 white */ +} +; + +int get_number(char *string, int *pointer) { + + int temp_number; + + + if (string[*pointer]=='0') { + + /* Hexadecimal */ + if (string[*pointer+1]=='x') { + (*pointer)++; + + (*pointer)++; + temp_number=0; + while(isxdigit(string[*pointer])) { + if ((string[*pointer]>='a') && (string[*pointer]<='f')) + temp_number=16*temp_number+(10+(string[*pointer]-'a')); + if ((string[*pointer]>='A') && (string[*pointer]<='F')) + temp_number=16*temp_number+(10+(string[*pointer]-'A')); + if ((string[*pointer]>='0') && (string[*pointer]<='9')) + temp_number=16*temp_number+(string[*pointer]-'0'); + (*pointer)++; + } + } + else { + /* Octal */ + temp_number=0; + while(isdigit(string[*pointer])) { + temp_number=8*temp_number+(string[*pointer]-'0'); + (*pointer)++; + } + } + + } + else { + /* Decimal */ + temp_number=0; + while(isdigit(string[*pointer])) { + temp_number=10*temp_number+(string[*pointer]-'0'); + (*pointer)++; + } + } + + return temp_number; + +} + + +int main(int argc, char **argv) { + + FILE *input,*output; + + char input_filename[]="sprites"; + int pointer,temp_pointer; + char input_line[BUFSIZ]; + char temp_string[BUFSIZ]; + int color=0,oldcolor,run; + + input=fopen(input_filename,"r"); + if (input==NULL) goto file_error; + + + while(1) { + + if ( fgets(input_line,BUFSIZ,input) ==NULL) goto close_file; + + pointer=0; + + while(pointer14)) { + printf("$%X,",(run<<4)+dos_color_to_apple[oldcolor]); + run=0; + } + run++; + oldcolor=color; + + while(!isdigit(input_line[pointer])) pointer++; + } + if (color!=0) { + printf("$%X,",(run<<4)+dos_color_to_apple[color]); + } + + + printf("$00\n"); + goto done_with_string; + } + + else { + printf("Unknown directive!\n"); + goto close_file; + } + + } + /* end of label */ + if (input_line[pointer]==':') { + + temp_pointer=pointer; + while( (temp_pointer>0) && + (input_line[temp_pointer]!='\t') && + (input_line[temp_pointer]!=' ')) temp_pointer--; + + strncpy(temp_string,input_line+temp_pointer,pointer-temp_pointer); + temp_string[pointer]='\0'; + printf("\t.byte $00\n"); + printf("%s:\n",temp_string); + + } + + + + + pointer++; + } +done_with_string: ; + + + } + + + +close_file: + if (input!=NULL) fclose(input); + +file_error: + return 0; +} diff --git a/games/tb_6502/tools/string_to_apple.c b/games/tb_6502/tools/string_to_apple.c new file mode 100644 index 00000000..b6de2bb7 --- /dev/null +++ b/games/tb_6502/tools/string_to_apple.c @@ -0,0 +1,26 @@ +#include +#include + +int main(int argc, char **argv) { + + char string[BUFSIZ]; + int i; + + while(1) { + fgets(string,BUFSIZ,stdin); + if (feof(stdin)) goto done; + + printf(";# %s\n",string); + printf(".byte\t"); + + printf("$%X",string[0]+128); + + for (i=1;i + +int random_num(int seed) +{ + + static int our_seed; + + if (seed!=-1) our_seed=seed; + + if (our_seed==0) our_seed=13; + + our_seed<<=1; + if (our_seed & 0x100) our_seed^=0x87; + + our_seed&=0xff; + + return our_seed; + +} + +int main(int argc, char **argv) +{ +int i; + int frequency[256]; + for(i=0;i<256;i++) frequency[i]=0; + + for(i=0;i<4096;i++) + frequency[random_num(-1)]++; + + for(i=0;i<256;i++) + printf("%i : %i\n",i,frequency[i]); + + +} + diff --git a/games/tb_6502/tools/wait.c b/games/tb_6502/tools/wait.c new file mode 100644 index 00000000..a28a8f37 --- /dev/null +++ b/games/tb_6502/tools/wait.c @@ -0,0 +1,15 @@ +#include + +int main(int argc, char **argv) { + + int i; + + for(i=0;i<256;i++) { + printf("%i = %x = %i\n",i,i,(26+27*i+5*i*i)/2); + } + + return 0; + + + +} diff --git a/games/tfv/Makefile b/games/tfv/Makefile index 924a0c14..929ceab5 100644 --- a/games/tfv/Makefile +++ b/games/tfv/Makefile @@ -1,15 +1,18 @@ -include ../Makefile.inc +include ../../Makefile.inc + +DOS33 = ../../utils/dos33fs-utils/dos33 +PNG2GR = ../../utils/gr-utils/png2gr +PNG2RLE = ../../utils/gr-utils/png2rle + +TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft -DOS33 = ../dos33fs-utils/dos33 -PNG2GR = ../gr-utils/png2gr -PNG2RLE = ../gr-utils/png2rle ARTDIR = ./art all: tfv.dsk $(DOS33): - cd ../dos33fs-utils && make + cd ../../utils/dos33fs-utils && make tfv.dsk: $(DOS33) HELLO LOADER TFV_TITLE TFV_FLYING TFV_WORLD $(DOS33) -y tfv.dsk SAVE A HELLO @@ -21,12 +24,12 @@ tfv.dsk: $(DOS33) HELLO LOADER TFV_TITLE TFV_FLYING TFV_WORLD ### HELLO: hello.bas - ../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO + $(TOKENIZE) < hello.bas > HELLO #### LOADER: loader.o - ld65 -o LOADER loader.o -C ../linker_scripts/apple2_1000.inc + ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc loader.o: loader.s init_vars.s common_defines.inc ca65 -o loader.o loader.s -l loader.lst @@ -34,7 +37,7 @@ loader.o: loader.s init_vars.s common_defines.inc ### TFV_TITLE: tfv_title.o - ld65 -o TFV_TITLE tfv_title.o -C ../linker_scripts/apple2_2000.inc + ld65 -o TFV_TITLE tfv_title.o -C ../../linker_scripts/apple2_2000.inc tfv_title.o: tfv_title.s \ gr_vlin.s tfv_opener.s \ @@ -47,7 +50,7 @@ tfv_title.o: tfv_title.s \ ### TFV_FLYING: tfv_flying.o - ld65 -o TFV_FLYING tfv_flying.o -C ../linker_scripts/apple2_2000.inc + ld65 -o TFV_FLYING tfv_flying.o -C ../../linker_scripts/apple2_2000.inc tfv_flying.o: tfv_flying.s \ zp.inc \ @@ -59,7 +62,7 @@ tfv_flying.o: tfv_flying.s \ ### TFV_WORLD: tfv_world.o - ld65 -o TFV_WORLD tfv_world.o -C ../linker_scripts/apple2_2000.inc + ld65 -o TFV_WORLD tfv_world.o -C ../../linker_scripts/apple2_2000.inc tfv_world.o: tfv_world.s \ tfv_overworld.s tfv_drawmap.s tfv_battle.s \ diff --git a/utils/Makefile b/utils/Makefile index 281bf8c9..1ed84f05 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -3,7 +3,7 @@ include ../Makefile.inc all: cd asoft_basic-utils && make cd asoft_presenter && make -# cd asoft_sound && make + cd asoft_sound && make # cd bmp2dhr && make # cd dos33fs-linux2.4 && make cd dos33fs-utils && make @@ -14,7 +14,7 @@ all: install: cd asoft_basic-utils && make install cd asoft_presenter && make install -# cd asoft_sound && make install + cd asoft_sound && make install # cd bmp2dhr && make install # cd dos33fs-linux2.4 && make install cd dos33fs-utils && make install