diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 42b457aa..c2204bce 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -35,14 +35,15 @@ 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 + CLIFF GAME_OVER INSIDE INN ARCHERY 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 10 0 INN 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 $(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 @@ -233,7 +234,6 @@ music.o: music.s zp.inc \ ### - CLIFF: cliff.o ld65 -o CLIFF cliff.o -C $(LINKER_SCRIPTS)/apple2_6000.inc @@ -251,6 +251,22 @@ cliff.o: cliff.s zp.inc inventory.inc \ ### +ARCHERY: archery.o + ld65 -o ARCHERY archery.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +archery.o: archery.s zp.inc inventory.inc \ + parse_input.inc \ + graphics_archery/archery_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 archery.o archery.s -l archery.lst + + +### + GAME_OVER: game_over.o ld65 -o GAME_OVER game_over.o -C $(LINKER_SCRIPTS)/apple2_6000.inc @@ -593,6 +609,9 @@ 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 diff --git a/games/peasant/archery.s b/games/peasant/archery.s new file mode 100644 index 00000000..35439e0b --- /dev/null +++ b/games/peasant/archery.s @@ -0,0 +1,166 @@ +; Peasant's Quest + +; Archery Minigame + +; 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_ARCHERY ; (20) + +archery: + 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 #target_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_archery/archery_graphics.inc" + +;.include "graphics_cliff/priority_cliff.inc" + + diff --git a/games/peasant/loadsave_menu.s b/games/peasant/loadsave_menu.s index 1e7b55d8..9e718660 100644 --- a/games/peasant/loadsave_menu.s +++ b/games/peasant/loadsave_menu.s @@ -705,6 +705,9 @@ location_names_l: .byte lname_inside_nn .byte >lname_inside_inn + .byte >lname_archery_game + .byte >lname_map + .byte >lname_empty @@ -774,6 +780,9 @@ lname_inside_lady: .byte "Inside Baby Lady Cottage",0 ; LOCATION_INSIDE_LADY lname_inside_nn: .byte "Inside Mysterious Cottage",0 ; LOCATION_INSIDE_NN lname_inside_inn: .byte "Inside Giant Inn",0 ; LOCATION_INSIDE_INN +lname_archery_game: .byte "Archery Game",0 ; LOCATION_INSIDE_INN +lname_map: .byte "Map",0 ; LOCATION_INSIDE_INN + lname_empty: .byte "Empty",0 location_names_end: diff --git a/games/peasant/qload.inc b/games/peasant/qload.inc index 7c6c8cce..cc7ffe43 100644 --- a/games/peasant/qload.inc +++ b/games/peasant/qload.inc @@ -23,13 +23,13 @@ invert_smc1 =$0f61 disp_put_string_cursor =$1696 hgr_put_char_cursor =$0f15 vgi_simple_rectangle =$12ec -peasant_text =$1d44 +peasant_text =$1d59 save_menu =$17b0 load_menu =$17a5 location_names_l =$1adc -location_names_h =$1af9 -wait_until_keypress =$1d06 -random16 =$1d0f +location_names_h =$1afb +wait_until_keypress =$1d1b +random16 =$1d24 hposn_high = $BA00 hposn_low = $BB00 driveoff = $A22 diff --git a/games/peasant/qload.s b/games/peasant/qload.s index 2b032522..5c067f3b 100644 --- a/games/peasant/qload.s +++ b/games/peasant/qload.s @@ -197,9 +197,8 @@ which_disk_array: .byte 1,1,1,1 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4 .byte 2,2,1,2 ; TROGDOR, ENDING, MUSIC, CLIFF .byte 2,1,1,2 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN - .byte 2 ; INSIDE - .byte 1,1,1,1 ; SAVE1, SAVE2, SAVE3 - .byte 1 + .byte 2,2,2 ; INSIDE, ARCHERY, MAP + .byte 1,1,1 ; SAVE1, SAVE2, SAVE3 .byte $f ; disk detect load_address_array: @@ -207,18 +206,17 @@ load_address_array: .byte $60,$60,$60,$60 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4 .byte $60,$60,$D0,$60 ; TROGDOR, ENDING, MUSIC, CLIFF .byte $60,$D0,$20,$60 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN - .byte $60 ; INSIDE - .byte $BC,$BC,$BC,$0A ; SAVE1, SAVE2, SAVE3 - .byte $0A ; + .byte $60,$60,$60 ; INSIDE, ARCHERY, MAP + .byte $BC,$BC,$BC ; SAVE1, SAVE2, SAVE3 .byte $BC ; disk detect track_array: .byte 4, 6, 9,1 ; VID_LOGO, TITLE, INTRO, COPY_CHECK .byte 15,20,25,30 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4 .byte 19,24, 3,29 ; TROGDOR, ENDING, MUSIC, CLIFF - .byte 3,14,13,10 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN - .byte 5 ; INSIDE - .byte 0, 0, 0, 0, 0 ; SAVE1, SAVE2, SAVE3 + .byte 3,14,13,14 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN + .byte 9,6,4 ; INSIDE, ARCHERY, MAP + .byte 0, 0, 0 ; SAVE1, SAVE2, SAVE3 .byte 0 ; disk detect sector_array: @@ -226,8 +224,8 @@ sector_array: .byte 0, 0, 0, 0 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4 .byte 0, 0, 0, 0 ; TROGDOR, ENDING, MUSIC, CLIFF .byte 0, 0, 0, 0 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN - .byte 0 ; INSIDE - .byte 11,12,13,14,15 ; SAVE1, SAVE2, SAVE3 + .byte 0, 0, 0 ; INSIDE, ARCHERY, MAP + .byte 11,12,13 ; SAVE1, SAVE2, SAVE3 .byte 0 ; disk detect length_array: @@ -235,8 +233,8 @@ length_array: .byte 80, 88, 88, 80 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4 .byte 80, 80, 16, 80 ; TROGDOR, ENDING, MUSIC, CLIFF .byte 16, 16, 18, 80 ; GAME_OVER, INVENTORY, PARSE_INPUT, INN - .byte 80 ; INSIDE - .byte 1,1,1,1,1 ; SAVE1, SAVE2, SAVE3 + .byte 80, 64, 16 ; INSIDE, ARCHERY, MAP + .byte 1,1,1 ; SAVE1, SAVE2, SAVE3 .byte 1 ; disk detect .include "qkumba_popwr.s" diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc index 239cf752..5dd70109 100644 --- a/games/peasant/zp.inc +++ b/games/peasant/zp.inc @@ -243,10 +243,12 @@ LOAD_INVENTORY = 13 LOAD_PARSE_INPUT= 14 LOAD_INN = 15 LOAD_INSIDE = 16 +LOAD_ARCHERY = 17 +LOAD_MAP = 18 -LOAD_SAVE1 = 17 -LOAD_SAVE2 = 18 -LOAD_SAVE3 = 19 +LOAD_SAVE1 = 19 +LOAD_SAVE2 = 20 +LOAD_SAVE3 = 21 VGI_RCOLOR = P0 @@ -287,6 +289,7 @@ LOCATION_HIDDEN_GLEN = 24 LOCATION_INSIDE_LADY = 25 LOCATION_INSIDE_NN = 26 LOCATION_INSIDE_INN = 27 +LOCATION_ARCHERY_GAME = 28 +LOCATION_MAP = 29 - -LOCATION_EMPTY = 28 +LOCATION_EMPTY = 30