peasant: move score/speaker code to common qload

needed so we can score points from parse_input
	(mostly for wear robe)
This commit is contained in:
Vince Weaver 2021-11-29 00:43:12 -05:00
parent 7cba779963
commit b59d3d0233
17 changed files with 111 additions and 25 deletions

View File

@ -143,6 +143,12 @@ qload.inc: generate_common QLOAD
./generate_common -a 0xb00 -s location_names_h qload.lst >> qload.inc
./generate_common -a 0xb00 -s wait_until_keypress qload.lst >> qload.inc
./generate_common -a 0xb00 -s random16 qload.lst >> qload.inc
./generate_common -a 0xb00 -s score_points qload.lst >> qload.inc
./generate_common -a 0xb00 -s print_score qload.lst >> qload.inc
./generate_common -a 0xb00 -s update_score qload.lst >> qload.inc
./generate_common -a 0xb00 -s speaker_beep qload.lst >> qload.inc
./generate_common -a 0xb00 -s speaker_duration qload.lst >> qload.inc
./generate_common -a 0xb00 -s speaker_frequency qload.lst >> qload.inc
echo "hposn_high = \$$BA00" >> qload.inc
echo "hposn_low = \$$BB00" >> qload.inc
echo "driveoff = \$$A22" >> qload.inc

View File

@ -193,7 +193,7 @@ game_over:
;.include "inventory.s"
.include "score.s"
;.include "score.s"
.include "keyboard.s"

View File

@ -557,12 +557,12 @@ game_over:
.include "hgr_sprite.s"
.include "score.s"
;.include "score.s"
.include "wait.s"
.include "wait_a_bit.s"
;.include "speaker_beeps.s"
.include "speaker_beeps.inc"
.include "graphics_end/ending_graphics.inc"

View File

@ -155,11 +155,11 @@ done_beep:
; jmp forever
.include "hgr_sprite.s"
;.include "speaker_beeps.s"
.include "speaker_beeps.inc"
;.include "wait_keypress.s"
.include "score.s"
;.include "score.s"
.include "wait.s"
.include "wait_a_bit.s"

View File

@ -241,7 +241,6 @@ level_over:
.include "new_map_location.s"
.include "peasant_move.s"
.include "score.s"
;.include "parse_input.s"
@ -276,6 +275,7 @@ level_over:
;.include "hgr_hgr2.s"
;.include "wait_keypress.s"
;.include "loadsave_menu.s"
;.include "score.s"

View File

@ -338,7 +338,7 @@ to_left:
.include "new_map_location.s"
.include "peasant_move.s"
.include "score.s"
;.include "parse_input.s"
@ -373,7 +373,7 @@ to_left:
;.include "hgr_hgr2.s"
;.include "wait_keypress.s"
;.include "loadsave_menu.s"
;.include "score.s"
map_backgrounds_low:

View File

@ -480,9 +480,73 @@ parse_common_version:
parse_common_wear:
lda CURRENT_NOUN
cmp #NOUN_ROBE
beq parse_common_wear_robe
cmp #NOUN_BELT
beq parse_common_wear_belt
cmp #NOUN_MASK
beq parse_common_wear_mask
bne wear_unknown
parse_common_wear_belt:
; first see if have it
lda INVENTORY_1
and #INV1_KERREK_BELT
beq wear_unknown
ldx #<wear_belt_message
ldy #>wear_belt_message
jmp finish_parse_message
parse_common_wear_mask:
; first see if have it
lda INVENTORY_1
and #INV1_MONSTER_MASK
beq wear_unknown
ldx #<wear_mask_message
ldy #>wear_mask_message
jmp finish_parse_message
parse_common_wear_robe:
; first check if have it
lda INVENTORY_2
and #INV2_ROBE
beq parse_common_wear_robe_no_have
; next check if already wearing
lda GAME_STATE_1
and #WEARING_ROBE
beq parse_common_wear_robe_no_have
parse_common_wear_robe_do_have:
; wear the robe
lda GAME_STATE_1
ora #WEARING_ROBE
sta GAME_STATE_1
; get 3 points
lda #3
jsr score_points
ldx #<wear_robe_message
ldy #>wear_robe_message
jsr partial_message_step
jmp finish_parse_message
parse_common_wear_robe_no_have:
ldx #<wear_robe_none_message
ldy #>wear_robe_none_message
jsr partial_message_step

View File

@ -227,7 +227,7 @@ game_over:
;.include "parse_input.s"
.include "score.s"
;.include "score.s"
.include "keyboard.s"

View File

@ -347,7 +347,7 @@ to_left:
.include "new_map_location.s"
.include "peasant_move.s"
.include "score.s"
;.include "parse_input.s"
@ -382,7 +382,7 @@ to_left:
;.include "hgr_hgr2.s"
;.include "wait_keypress.s"
;.include "loadsave_menu.s"
;.include "score.s"
map_backgrounds_low:

View File

@ -214,13 +214,14 @@ game_over:
;.include "hgr_hgr2.s"
;.include "loadsave_menu.s"
;.include "wait_keypress.s"
;.include "score.s"
.include "gr_copy.s"
.include "new_map_location.s"
.include "peasant_move.s"
.include "score.s"
;.include "parse_input.s"

View File

@ -212,7 +212,7 @@ game_loop:
; at cottage, door open, check our co-ords
lda PEASANT_Y ; #$68
cmp #$67
cmp #$64
bcc not_ned_cottage
cmp #$71
bcs not_ned_cottage
@ -287,13 +287,13 @@ game_over:
;.include "hgr_hgr2.s"
;.include "wait_keypress.s"
;.include "loadsave_menu.s"
;.include "score.s"
.include "gr_copy.s"
.include "peasant_move.s"
.include "score.s"
.include "new_map_location.s"
;.include "parse_input.s"

View File

@ -23,13 +23,19 @@ invert_smc1 =$0f61
disp_put_string_cursor =$1696
hgr_put_char_cursor =$0f15
vgi_simple_rectangle =$12ec
peasant_text =$1ebd
peasant_text =$1f94
save_menu =$1914
load_menu =$1909
location_names_l =$1c40
location_names_h =$1c5f
wait_until_keypress =$1e7f
random16 =$1e88
score_points =$1f0d
print_score =$1ebd
update_score =$1ec8
speaker_beep =$1f7b
speaker_duration =$1f92
speaker_frequency =$1f93
hposn_high = $BA00
hposn_low = $BB00
driveoff = $A22

View File

@ -256,6 +256,8 @@ length_array:
.include "loadsave_menu.s"
.include "wait_keypress.s"
.include "random16.s"
.include "score.s"
.include "speaker_beeps.s"
peasant_text:
.byte 25,2,"Peasant's Quest",0

View File

@ -150,4 +150,3 @@ score_text:
score_tail:
.byte " of 150",0
.include "speaker_beeps.s"

View File

@ -3,12 +3,14 @@
;==================
; + get/wear belt (after getting it)
wear_belt_message:
.byte "You're already wearing it.",13
.byte "Too bad you smell like the",13
.byte "trash barge off Peasant",13
.byte "Isle.",0
; + wear mask (after getting it)
wear_mask_message:
.byte "Not on this screen. You've",13
.byte "got your image to think",13
.byte "about. Actually, you might",13
@ -17,7 +19,17 @@
; +3 points
; + wear robe (after getting it)
.byte "You slip into the vintage robe. It smells like grampa's lap. Now you're lookin like a serious peasant.",0
wear_robe_message:
.byte "You slip into the vintage",13
.byte "robe. It smells like",13
.byte "grampa's lap. Now you're",13
.byte "lookin like a serious",13
.byte "peasant.",0
; + wear robe (already wearing)
wear_robe_already_message:
.byte "You're already in the old",13
.byte "skool robe. Represent.",0
; + wear robe (not in inventory)
wear_robe_none_message:
@ -29,9 +41,6 @@ wear_robe_none_message2:
.byte "And pants. Forgot to",13
.byte "mention the pants.",0
; + wear robe (already wearing)
.byte "You're already in the old skool robe. Represent.",0
; + look (when in hay disguise)
.byte "Right now, you see a bunch of hay.",0

View File

@ -311,17 +311,16 @@ game_over:
;.include "clear_bottom.s"
;.include "gr_offsets.s"
;.include "hgr_hgr2.s"
;.include "score.s"
.include "gr_copy.s"
.include "score.s"
.include "wait.s"
.include "wait_a_bit.s"
.include "version.inc"
;.include "speaker_beeps.s"
.include "speaker_beeps.inc"
.include "hgr_sprite.s"

View File

@ -423,7 +423,7 @@ delays:
;.include "decompress_fast_v2.s"
.include "hgr_overlay.s"
.include "speaker_beeps.s"
.include "speaker_beeps.inc"
.include "text_print.s"
.include "gr_offsets.s"