diff --git a/games/peasant/Makefile b/games/peasant/Makefile index e09df6dd..a5b11695 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -31,11 +31,13 @@ peasant.dsk: QBOOT QLOAD VID_LOGO TITLE INTRO \ $(DOS33_RAW) peasant.dsk 25 0 PEASANT3 0 0 $(DOS33_RAW) peasant.dsk 30 0 PEASANT4 0 0 -peasant_side2.dsk: WBOOT2 COPY_CHECK TROGDOR ENDING CLIFF GAME_OVER +peasant_side2.dsk: WBOOT2 COPY_CHECK TROGDOR ENDING CLIFF GAME_OVER INSIDE 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 5 0 INSIDE 0 0 $(DOS33_RAW) peasant_side2.dsk 19 0 TROGDOR 0 0 $(DOS33_RAW) peasant_side2.dsk 24 0 ENDING 0 0 $(DOS33_RAW) peasant_side2.dsk 29 0 CLIFF 0 0 @@ -376,6 +378,24 @@ copy_check.o: copy_check.s graphics_copy/copy_graphics.inc \ copy_check.s ca65 -o copy_check.o copy_check.s -l copy_check.lst +### + +INSIDE: inside.o + ld65 -o INSIDE inside.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +inside.o: inside.s zp.inc inventory.inc \ + parse_input.inc \ + inside_actions.s DIALOG_INSIDE.LZSA dialog_inside.inc \ + graphics_inside/graphics_inside.inc sprites/peasant_sprites.inc \ + graphics_inside/priority_inside.inc \ + sprites/inventory_sprites.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 new_map_location.s \ + peasant_move.s score.s inventory.s loadsave_menu.s + ca65 -o inside.o inside.s -l inside.lst + ### @@ -405,7 +425,7 @@ save3.o: save3.s parse_input.inc: generate_common parse_input ./generate_common -a 0xee00 -s parse_input parse_input.lst > parse_input.inc - ./generate_common -a 0xee00 -s setup_verb_table parse_input.lst >> parse_input.inc + ./generate_common -a 0xee00 -s setup_default_verb_table parse_input.lst >> parse_input.inc ./generate_common -a 0xee00 -s load_custom_verb_table parse_input.lst >> parse_input.inc ./generate_common -a 0xee00 -s partial_message_step parse_input.lst >> parse_input.inc ./generate_common -a 0xee00 -s finish_parse_message parse_input.lst >> parse_input.inc @@ -505,6 +525,11 @@ dialog_inside: dialog_inside.o dialog_inside.o: dialog_inside.s text/inside.inc ca65 -o dialog_inside.o dialog_inside.s -l dialog_inside.lst +### + +dialog_inside.inc: generate_all_symbols dialog_inside + ./generate_all_symbols -a 0xd000 dialog_inside.lst > dialog_inside.inc + #### DIALOG_INN.LZSA: dialog_inn diff --git a/games/peasant/cliff.s b/games/peasant/cliff.s index 2da3a778..4362338a 100644 --- a/games/peasant/cliff.s +++ b/games/peasant/cliff.s @@ -2,8 +2,6 @@ ; Cliff Base -WHICH_PEASANTRY=0 - ; by Vince `deater` Weaver vince@deater.net .include "hardware.inc" @@ -15,7 +13,7 @@ WHICH_PEASANTRY=0 cliff_base: lda #0 - sta GAME_OVER + sta LEVEL_OVER sta FRAME jsr hgr_make_tables @@ -40,7 +38,7 @@ cliff_base: new_location: lda #0 - sta GAME_OVER + sta LEVEL_OVER ;===================== ; load bg @@ -115,7 +113,7 @@ game_loop: jsr check_keyboard - lda GAME_OVER + lda LEVEL_OVER bmi oops_new_location bne game_over diff --git a/games/peasant/game_over.s b/games/peasant/game_over.s index 569aa32f..f7cc4665 100644 --- a/games/peasant/game_over.s +++ b/games/peasant/game_over.s @@ -12,7 +12,7 @@ game_over: lda #0 - sta GAME_OVER + sta LEVEL_OVER sta FRAME jsr hgr_make_tables diff --git a/games/peasant/graphics_inside/Makefile b/games/peasant/graphics_inside/Makefile index 155ea10c..6d1fc1a3 100644 --- a/games/peasant/graphics_inside/Makefile +++ b/games/peasant/graphics_inside/Makefile @@ -5,16 +5,16 @@ PNG2HGR = ../../../utils/hgr-utils/png2hgr LZSA = ~/research/lzsa/lzsa/lzsa B2D = ../../../utils/bmp2dhr/b2d -all: inside_graphics.inc \ +all: graphics_inside.inc \ priority_inside.inc ### -inside_graphics.inc: \ +graphics_inside.inc: \ hidden_glen.lzsa inside_cottage.lzsa inside_nn.lzsa - echo "hidden_glen_lzsa: .incbin \"hidden_glen.lzsa\"" > inside_graphics.inc - echo "inside_cottage_lzsa: .incbin \"inside_cottage.lzsa\"" >> inside_graphics.inc - echo "inside_nn_lzsa: .incbin \"inside_nn.lzsa\"" >> inside_graphics.inc + echo "hidden_glen_lzsa: .incbin \"hidden_glen.lzsa\"" > graphics_inside.inc + echo "inside_cottage_lzsa: .incbin \"inside_cottage.lzsa\"" >> graphics_inside.inc + echo "inside_nn_lzsa: .incbin \"inside_nn.lzsa\"" >> graphics_inside.inc ### @@ -73,5 +73,5 @@ hidden_glen_priority.gr: hidden_glen_priority.png clean: - rm -f *~ inside_graphics.inc priority_inside.inc *.lzsa *.gr *.hgr + rm -f *~ graphics_inside.inc priority_inside.inc *.lzsa *.gr *.hgr diff --git a/games/peasant/inside.s b/games/peasant/inside.s new file mode 100644 index 00000000..01a2762e --- /dev/null +++ b/games/peasant/inside.s @@ -0,0 +1,285 @@ +; Peasant's Quest + +; Inside Graphics + +; inside lady cottage, inside ned cottage, hidden glen + +; by Vince `deater` Weaver vince@deater.net + +; with apologies to everyone + +.include "hardware.inc" +.include "zp.inc" + +.include "qload.inc" +.include "inventory.inc" +.include "parse_input.inc" + +LOCATION_BASE = LOCATION_HIDDEN_GLEN ; index starts here (24) + +inside: + + lda #0 + sta LEVEL_OVER + sta FRAME + + jsr hgr_make_tables ; necessary? + jsr hgr2 ; necessary? + + ; decompress dialog to $D000 + + lda #inside_text_lzsa + sta getsrc_smc+2 + + lda #$D0 + + jsr decompress_lzsa2_fast + + + ; update map location + + jsr update_map_location + + ; update score + + jsr update_score + + + ;============================= + ;============================= + ; new screen location + ;============================= + ;============================= + +new_location: + lda #0 + sta LEVEL_OVER + + ;========================== + ; load updated verb table + + ; we are INSIDE so locations 24...26 map to 0...2 + + lda MAP_LOCATION + sec + sbc #LOCATION_BASE + tax + + lda verb_tables_low,X + sta INL + lda verb_tables_hi,X + sta INH + jsr load_custom_verb_table + + + ;===================== + ; load bg + + ; we are INSIDE so locations 24...26 map to 0...2 + + lda MAP_LOCATION + sec + sbc #LOCATION_BASE + tax + + lda map_backgrounds_low,X + sta getsrc_smc+1 +; sta last_bg_l + lda map_backgrounds_hi,X + sta getsrc_smc+2 +; sta last_bg_h + + lda #$40 + + jsr decompress_lzsa2_fast + + + ; we are INSIDE so locations 24...26 map to 0...2 + + lda MAP_LOCATION + sec + sbc #LOCATION_BASE + tax + + lda map_priority_low,X + sta getsrc_smc+1 + lda map_priority_hi,X + sta getsrc_smc+2 + + lda #$20 + + jsr decompress_lzsa2_fast + + jsr gr_copy_to_page1 + + ; put peasant text + + lda #peasant_text + sta OUTH + + jsr hgr_put_string + + ; put score + + jsr print_score + + ;==================== + ; 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 level_over + + + ; delay + + lda #200 + jsr wait + + + jmp game_loop + +oops_new_location: + jmp new_location + + + ;======================== + ; exit level + ;======================== +level_over: + lda MAP_LOCATION + cmp #LOCATION_OUTSIDE_INN + bne really_level_over + + ; be sure we're in range + lda PEASANT_X + cmp #6 + bcc really_level_over ; fine + + cmp #18 + bcc to_left + cmp #30 + bcc to_right + +really_level_over: + + rts + +to_right: + lda #31 + sta PEASANT_X + rts + +to_left: + lda #5 + sta PEASANT_X + rts + + +.include "draw_peasant.s" + +.include "gr_copy.s" + +.include "new_map_location.s" +.include "peasant_move.s" + +.include "score.s" + +;.include "parse_input.s" + +.include "keyboard.s" + +.include "wait.s" +.include "wait_a_bit.s" + +.include "graphics_inside/graphics_inside.inc" +.include "graphics_inside/priority_inside.inc" + +.include "version.inc" + +;.include "inventory.s" + + + + +; 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 "wait_keypress.s" +;.include "loadsave_menu.s" + + + +map_backgrounds_low: + .byte