diff --git a/games/peasant/Makefile b/games/peasant/Makefile index c2204bce..219149ac 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -35,12 +35,12 @@ peasant.dsk: QBOOT QLOAD VID_LOGO TITLE INTRO \ $(DOS33_RAW) peasant.dsk 30 0 PEASANT4 0 0 peasant_side2.dsk: WBOOT2 COPY_CHECK TROGDOR ENDING \ - CLIFF GAME_OVER INSIDE INN ARCHERY + CLIFF GAME_OVER INSIDE INN ARCHERY MAP cp $(EMPTY_DISK)/empty.dsk peasant_side2.dsk $(DOS33_RAW) peasant_side2.dsk 0 0 WBOOT2 0 1 $(DOS33_RAW) peasant_side2.dsk 1 0 COPY_CHECK 0 0 $(DOS33_RAW) peasant_side2.dsk 3 0 GAME_OVER 0 0 -# $(DOS33_RAW) peasant_side2.dsk 4 0 MAP 0 0 + $(DOS33_RAW) peasant_side2.dsk 4 0 MAP 0 0 $(DOS33_RAW) peasant_side2.dsk 6 0 ARCHERY 0 0 $(DOS33_RAW) peasant_side2.dsk 9 0 INSIDE 0 0 $(DOS33_RAW) peasant_side2.dsk 14 0 INN 0 0 @@ -264,6 +264,22 @@ archery.o: archery.s zp.inc inventory.inc \ peasant_move.s score.s ca65 -o archery.o archery.s -l archery.lst +### + +MAP: map.o + ld65 -o MAP map.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +map.o: map.s zp.inc inventory.inc \ + parse_input.inc \ + graphics_map/map_graphics.inc \ + draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \ + hgr_1x28_sprite_mask.s hgr_1x5_sprite.s hgr_save_restore.s \ + wait_a_bit.s draw_peasant.s hgr_text_box.s \ + keyboard.s parse_input.s new_map_location.s \ + peasant_move.s score.s + ca65 -o map.o map.s -l map.lst + + ### @@ -612,11 +628,26 @@ dialog_cliff.inc: generate_all_symbols dialog_cliff graphics_archery/archery_graphics.inc: cd graphics_archery && make -graphics_vid/vid_graphics.inc: - cd graphics_vid && make +graphics_cliff/cliff_graphics.inc: + cd graphics_cliff && make -graphics_title/title_graphics.inc: - cd graphics_title && make +graphics_copy/copy_graphics.inc: + cd graphics_copy && make + +graphics_end/ending_graphics.inc: + cd graphics_end && make + +graphics_inn/graphics_inn.inc: + cd graphics_inn && make + +graphics_inside/graphics_inside.inc: + cd graphics_inside && make + +graphics_map/map_graphics.inc: + cd graphics_map && make + +graphics_over/game_over_graphics.inc: + cd graphics_over && make graphics_peasantry/graphics_intro.inc: cd graphics_peasantry && make @@ -624,26 +655,16 @@ graphics_peasantry/graphics_intro.inc: graphics_peasantry/graphics_peasant1.inc: cd graphics_peasantry && make -graphics_cliff/cliff_graphics.inc: - cd graphics_cliff && make - -graphics_copy/copy_graphics.inc: - cd graphics_copy && make - -graphics_over/game_over_graphics.inc: - cd graphics_over && make +graphics_title/title_graphics.inc: + cd graphics_title && make graphics_trogdor/trogdor_graphics.inc: cd graphics_trogdor && make -graphics_end/ending_graphics.inc: - cd graphics_end && make +graphics_vid/vid_graphics.inc: + cd graphics_vid && make -graphics_inside/graphics_inside.inc: - cd graphics_inside && make - -graphics_inn/graphics_inn.inc: - cd graphics_inn && make +#### sprites/inventory_sprites.inc: cd sprites && make @@ -660,12 +681,13 @@ sprites/trogdor_sprites.inc: distclean: make clean cd sprites && make clean + cd graphics_archery && make clean cd graphics_cliff && make clean cd graphics_copy && make clean cd graphics_end && make clean cd graphics_inn && make clean cd graphics_inside && make clean -# cd graphics_map && make clean + cd graphics_map && make clean cd graphics_over && make clean cd graphics_peasantry && make clean cd graphics_title && make clean diff --git a/games/peasant/graphics_map/Makefile b/games/peasant/graphics_map/Makefile new file mode 100644 index 00000000..37a8247b --- /dev/null +++ b/games/peasant/graphics_map/Makefile @@ -0,0 +1,31 @@ + +PNG2RLE = ../../../utils/gr-utils/png2rle +PNG2GR = ../../../utils/gr-utils/png2gr +PNG2HGR = ../../../utils/hgr-utils/png2hgr +LZSA = ~/research/lzsa/lzsa/lzsa +B2D = ../../../utils/bmp2dhr/b2d + +all: map_graphics.inc + + +### + +map_graphics.inc: \ + map.lzsa + echo "map_lzsa: .incbin \"map.lzsa\"" > map_graphics.inc + +### + +map.lzsa: map.hgr + $(LZSA) -r -f2 map.hgr map.lzsa + +map.hgr: map.png + $(PNG2HGR) map.png > map.hgr + + +#### + + +clean: + rm -f *~ map_graphics.inc *.lzsa *.gr *.hgr + diff --git a/games/peasant/map.s b/games/peasant/map.s new file mode 100644 index 00000000..e92ce9d3 --- /dev/null +++ b/games/peasant/map.s @@ -0,0 +1,166 @@ +; Peasant's Quest + +; o/~ It's The Map o/~ + +; by Vince `deater` Weaver vince@deater.net + +.include "hardware.inc" +.include "zp.inc" + +.include "qload.inc" +.include "inventory.inc" +.include "parse_input.inc" + +LOCATION_BASE = LOCATION_MAP + +the_map: + lda #0 + sta LEVEL_OVER + sta FRAME + + jsr hgr_make_tables + jsr hgr2 + + ;============================= + ;============================= + ; new screen location + ;============================= + ;============================= + +new_location: + lda #0 + sta LEVEL_OVER + + ;===================== + ; load bg + + lda MAP_LOCATION + sec + sbc #LOCATION_BASE + tax + + lda #map_lzsa + sta getsrc_smc+2 + + lda #$40 + + jsr decompress_lzsa2_fast + + ; put peasant text + +; lda #peasant_text +; sta OUTH + +; jsr hgr_put_string + + ; put score + +; jsr print_score + + ;===================== + ; move peasant + ; FIXME: don't do this if loading game + +; lda #20 +; sta PEASANT_X +; lda #150 +; sta PEASANT_Y + + ;==================== + ; save background + +; lda PEASANT_X +; sta CURSOR_X +; lda PEASANT_Y +; sta CURSOR_Y + + ;======================= + ; draw initial peasant + +; jsr save_bg_1x28 + +; jsr draw_peasant + +game_loop: + +; jsr move_peasant + + inc FRAME + + jsr check_keyboard + + lda LEVEL_OVER + bmi oops_new_location + bne game_over + + + ; delay + + lda #200 + jsr wait + + + jmp game_loop + +oops_new_location: + jmp new_location + + + ;************************ + ; exit level + ;************************ +game_over: + + rts + + + + +.include "draw_peasant.s" + +.include "gr_copy.s" + +.include "new_map_location.s" + +.include "peasant_move.s" + +;.include "parse_input.s" + +;.include "inventory.s" + +.include "score.s" + +.include "keyboard.s" + +.include "wait.s" +.include "wait_a_bit.s" + +.include "version.inc" + + + +; Moved to qload +;.include "decompress_fast_v2.s" +;.include "hgr_font.s" +;.include "draw_box.s" +;.include "hgr_rectangle.s" +;.include "hgr_1x28_sprite_mask.s" +;.include "hgr_1x5_sprite.s" +;.include "hgr_partial_save.s" +;.include "hgr_input.s" +;.include "hgr_tables.s" +;.include "hgr_text_box.s" +;.include "clear_bottom.s" +;.include "hgr_hgr2.s" +;.include "loadsave_menu.s" +;.include "wait_keypress.s" + +.include "graphics_map/map_graphics.inc" + +;.include "graphics_cliff/priority_cliff.inc" + +