From ca0c839e6f38a7120757de96a0b7d9921168fb0a Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 8 Oct 2024 13:46:52 -0400 Subject: [PATCH] peasant: hook up cliff can actually climb it, though birds/rocks not working currently for some reason --- games/peasant/Makefile | 1 + games/peasant/TODO | 31 +++- games/peasant/cliff_base/cliff_base_actions.s | 4 +- games/peasant/cliff_heights/cliff_heights.s | 6 +- games/peasant/climb/climb.s | 169 ++++++------------ games/peasant/intro/intro_cottage.s | 16 ++ 6 files changed, 96 insertions(+), 131 deletions(-) diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 7f5f8c34..c39000ec 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -67,6 +67,7 @@ peasant.2mg: dts_block PROBOOTHD QLOAD_HD \ ./music/MUSIC ./copy/COPY_CHECK ./inventory/INVENTORY \ ./map/MAP ./archery/ARCHERY ./inside/INSIDE ./inn/INN \ ./trogdor/TROGDOR ./ending/ENDING ./cliff_base/CLIFF_BASE \ + ./climb/CLIMB \ ./cliff_heights/CLIFF_HEIGHTS \ SAVE1 SAVE2 SAVE3 PARSE_INPUT.ZX02 ./game_over/GAME_OVER $(PRODOSDIR)/mkprodosfs peasant.2mg -n PeasantsQ -b 2800 -2 diff --git a/games/peasant/TODO b/games/peasant/TODO index 0619df09..8f439bac 100644 --- a/games/peasant/TODO +++ b/games/peasant/TODO @@ -1,3 +1,10 @@ +current: + finish base (mostly walk_to) + fix/add sound effects for rocks/lightning + add lightning + +=============================== + Sound effects: + Rocks make noise when crash + di-dit-da-do when falling @@ -47,10 +54,7 @@ General: + background priority mask not working when at far top of screen + fix issue where walking stops when you cross to screen w priority (most visible, mountain pass to river) -+ More frames in peasant sprites -+ Let disk 2 live in the 2nd drive? - LDA $C08A,X to select first drive - LDA $C08B,X to select second drive + Peasant sprites: @@ -63,8 +67,6 @@ Peasant sprites: Text parsing: ~~~~~~~~~~~~~ -+ get rid ot wasd, make it more like original - for Apple II+ use :,/ for up,down + always load CURERENT_NOUN into A before calling into parsing routines @@ -211,15 +213,26 @@ Inside Inn: + Animate getting room (sleeping in bed, waking up) + Animate night falling -Cliff: -~~~~~~ +Cliff_Base: +~~~~~~~~~~~ ++ Walk to + +Cliff Climb +~~~~~~~~~~~ ++ Hook up ++ Sound effects for rocks falling ++ Sound effect for falling ++ Message upon hitting ground + +Cliff Heights +~~~~~~~~~~~~~ + Hook up points/message for arriving at cliff -+ Cliff minigame + Animate lightning + Fix the priority/entry points for the various entrances + Hook up dialog with keepers + Animate keepers + Animate the three deaths ++ peasant sprites for the various outfits Trogdor: ~~~~~~~~ diff --git a/games/peasant/cliff_base/cliff_base_actions.s b/games/peasant/cliff_base/cliff_base_actions.s index f554cafa..d0490b48 100644 --- a/games/peasant/cliff_base/cliff_base_actions.s +++ b/games/peasant/cliff_base/cliff_base_actions.s @@ -49,10 +49,10 @@ cliff_base_climb: cliff_base_do_climb: - lda #LOAD_HEIGHTS + lda #LOAD_CLIMB sta WHICH_LOAD - lda #LOCATION_CLIFF_HEIGHTS + lda #LOCATION_CLIMB sta MAP_LOCATION lda #NEW_FROM_DISK diff --git a/games/peasant/cliff_heights/cliff_heights.s b/games/peasant/cliff_heights/cliff_heights.s index f12eb206..44d0d885 100644 --- a/games/peasant/cliff_heights/cliff_heights.s +++ b/games/peasant/cliff_heights/cliff_heights.s @@ -167,7 +167,11 @@ col_copy_loop: jsr zx02_full_decomp + ; clear the keyboard in case we were holding it down + bit KEYRESET + + ; See if we need to give points lda GAME_STATE_3 and #CLIFF_CLIMBED @@ -207,8 +211,6 @@ col_copy_loop: cliff_already_climbed: - - ;=========================== ;=========================== ;=========================== diff --git a/games/peasant/climb/climb.s b/games/peasant/climb/climb.s index 900f7bb7..b4786a15 100644 --- a/games/peasant/climb/climb.s +++ b/games/peasant/climb/climb.s @@ -41,7 +41,7 @@ cliff_climb: sta PEASANT_FALLING sta MAX_HEIGHT - lda #22 ; starting location + lda #19 ; starting location sta PEASANT_X lda #86 sta PEASANT_Y @@ -127,7 +127,7 @@ draw_bird: jsr hgr_draw_sprite done_draw_bird: - +.if 0 ;===================== ; draw rock ;===================== @@ -383,7 +383,7 @@ rock_good: lda CURRENT_ROCK cmp #MAX_ROCKS bne move_rock_loop - +.endif ;===================== ; increment frame @@ -429,62 +429,55 @@ flame_good: jmp game_loop + + + + ;======================= + ; here if fell + ;======================= cliff_game_over: -; jsr clear_gr_all -; bit SET_TEXT -; bit PAGE1 - - ; update max height attained - -; lda MAX_HEIGHT -; and #$f -; clc -; adc #$30 -; sta losing_number+1 - -; lda MAX_HEIGHT -; lsr -; lsr -; lsr -; lsr -; clc -; adc #$30 -; sta losing_number - -; lda #losing_text -; sta OUTH - -; jsr move_and_print_list - -; bit KEYRESET - -;wait_until_keypress2: -; lda KEYPRESS ; 4 -; bpl wait_until_keypress2 ; 3 - -; cmp #'N'|$80 -; beq exit_game - -; cmp #'n'|$80 -; beq exit_game - -; bit KEYRESET ; clear the keyboard buffer - -; jmp restart_game - -exit_game: - ; FIXME - - lda #0 + lda #LOAD_GAME_OVER sta WHICH_LOAD + lda #NEW_FROM_DISK + sta LEVEL_OVER + + ; FIXME: there actually is a message I think + +; ldx #die_message +; jmp finish_parse_message + rts ; will this work? + + ;========================== + ; here if off top of screen + ;========================== + cliff_reload_bg: + lda MAP_LOCATION + cmp #3 + bcc keep_on_climbing ; blt + + ; hit the top! + + lda #LOCATION_CLIFF_HEIGHTS + sta MAP_LOCATION + + lda #LOAD_HEIGHTS + sta WHICH_LOAD + + lda #NEW_FROM_DISK + sta LEVEL_OVER + + rts + + + +keep_on_climbing: jsr reset_enemy_state jsr load_graphics @@ -495,6 +488,10 @@ cliff_reload_bg: jmp game_loop + ;================================ + ; load graphics + ;================================ + load_graphics: @@ -504,25 +501,6 @@ load_graphics: ;======================== ldx MAP_LOCATION - - cpx #2 - bcc priority_normal - - ; here if map_location above 2 - ; for coach z version make it harder in this case - - lda #$f - sta bird_freq_smc+1 - sta rock_freq_smc+1 - - txa - sta rock_speed_smc+1 ; rock speed prop to level - - ldx #2 - -priority_normal: - - lda priority_data_l,X sta zx_src_l+1 lda priority_data_h,X @@ -552,19 +530,11 @@ col_copy_loop: ;========================== ; Load Background Graphics ;=========================== + ; one of the three map locations + ldx MAP_LOCATION - ; extra for Z variant - ; repeat level 2 over and over - - cpx #2 - bcc bg_normal - - ldx #2 - -bg_normal: - lda bg_data_l,X sta zx_src_l+1 lda bg_data_h,X @@ -585,18 +555,11 @@ bg_normal: ;==================================== ; includes -; .include "hgr_tables.s" - .include "../hgr_sprite.s" - -; .include "zx02_optim.s" - - .include "../wait.s" - - .include "keyboard_climb.s" + .include "../wait.s" .include "draw_peasant_climb.s" @@ -604,14 +567,9 @@ bg_normal: .include "../hgr_partial_restore.s" - -; .include "text_print.s" ; for z version - .include "../gr_copy.s" .include "../hgr_copy.s" -; .include "random16.s" - .include "../gr_offsets.s" .include "../hgr_sprite_bg_mask.s" @@ -694,31 +652,6 @@ sprites_mask_h: .byte >smallrock2_mask,>smallrock3_mask .byte >smallrock_crash0_mask,>smallrock_crash1_mask -.if 0 - ;======================================== - - ; background restore parameters - ; currently 5, should check this and error if we overflow - - ; tried to dynamically do this, but in the end hard-coded - - ; 0 = bird - ; 1,2,3 = boulders - ; 4 = peasant - ; 5 = flame - -save_valid: - .byte 0, 0, 0, 0, 0, 0 -save_xstart: - .byte 0, 0, 0, 0, 0, 0 -save_xend: - .byte 0, 0, 0, 0, 0, 0 -save_ystart: - .byte 0, 0, 0, 0, 0, 0 -save_yend: - .byte 0, 0, 0, 0, 0, 0 - -.endif ;======================================== ; data for the enemies diff --git a/games/peasant/intro/intro_cottage.s b/games/peasant/intro/intro_cottage.s index dec7353c..1c8803e7 100644 --- a/games/peasant/intro/intro_cottage.s +++ b/games/peasant/intro/intro_cottage.s @@ -252,12 +252,14 @@ done_cottage: cottage_path: .byte 10,117 ; 0 ; 5s, text 1 .byte 10,117 ; 1 ; 3s, text 2 + ; diagonal .byte 11,122 .byte 12,127 .byte 13,132 .byte 14,137 .byte 15,142 .byte 16,147 + ; horizontal .byte 17,147 .byte 18,147 .byte 19,147 @@ -282,3 +284,17 @@ cottage_path: .byte 38,147 .byte $FF,$FF + + + ;===================================== + ; walk to + ; go one step from PEASANT_X, PEASANT_Y + ; to WALK_DEST_X, WALK_DEST_Y + ; if PEASANT_X>WALK_DEST_X face left + ; else WALK_DEST_X face right + ; if PEASANT_X==WALK_DEST_X + ; if PEASANT_Y>WALK_DEST_Y face up + ; else WALK_DEST_Y face down + +walk_to: +