dos33fsprogs/games/peasant/peasant2.s

287 lines
4.5 KiB
ArmAsm
Raw Normal View History

; Peasant's Quest
; Peasantry Part 2 (second line of map)
2021-09-29 20:53:41 +00:00
; haystack, puddle, archery, river, knight (pass)
WHICH_PEASANTRY=1
2021-08-15 04:23:41 +00:00
; by Vince `deater` Weaver vince@deater.net
; with apologies to everyone
.include "hardware.inc"
.include "zp.inc"
.include "qload.inc"
.include "inventory.inc"
2021-08-15 04:23:41 +00:00
peasant_quest:
2021-08-15 05:12:43 +00:00
lda #0
sta GAME_OVER
2021-08-15 04:23:41 +00:00
sta FRAME
2021-09-27 20:44:40 +00:00
jsr hgr_make_tables ; necessary?
jsr hgr2 ; necessary?
; update map location
2021-08-15 04:23:41 +00:00
jsr update_map_location
2021-10-20 04:47:40 +00:00
2021-08-29 03:05:36 +00:00
; update score
jsr update_score
;=============================
;=============================
; new screen location
;=============================
;=============================
new_location:
lda #0
sta GAME_OVER
;==========================
; load updated verb table
; we are PEASANT2 so locations 5...9 map to 0...4
lda MAP_LOCATION
sec
sbc #5
tax
lda verb_tables_low,X
sta INL
lda verb_tables_hi,X
sta INH
jsr load_custom_verb_table
2021-08-15 04:23:41 +00:00
;=====================
; load bg
; we are PEASANT2 so locations 5...9 map to 0...4
lda MAP_LOCATION
sec
sbc #5
tax
lda map_backgrounds_low,X
2021-08-15 04:23:41 +00:00
sta getsrc_smc+1
; sta last_bg_l
lda map_backgrounds_hi,X
2021-08-15 04:23:41 +00:00
sta getsrc_smc+2
; sta last_bg_h
2021-08-15 04:23:41 +00:00
lda #$40
jsr decompress_lzsa2_fast
2021-08-24 17:38:03 +00:00
; we are PEASANT2 so locations 5...9 map to 0...4
lda MAP_LOCATION
sec
sbc #5
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
2021-08-15 04:23:41 +00:00
lda #<peasant_text
sta OUTL
lda #>peasant_text
sta OUTH
jsr hgr_put_string
; put score
2021-08-29 03:05:36 +00:00
jsr print_score
2021-08-15 04:23:41 +00:00
;====================
; save background
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
;=======================
; draw initial peasant
jsr save_bg_1x28
2021-08-15 05:19:26 +00:00
2021-08-15 04:23:41 +00:00
jsr draw_peasant
game_loop:
2021-08-24 17:52:11 +00:00
jsr move_peasant
2021-08-15 04:23:41 +00:00
inc FRAME
jsr check_keyboard
2021-08-15 05:12:43 +00:00
lda GAME_OVER
bmi oops_new_location
bne level_over
2021-08-15 05:12:43 +00:00
2021-08-15 05:19:26 +00:00
; delay
lda #200
jsr wait
2021-08-15 05:19:26 +00:00
2021-08-15 04:23:41 +00:00
jmp game_loop
oops_new_location:
jmp new_location
2021-08-15 04:23:41 +00:00
2021-08-15 05:12:43 +00:00
;************************
; exit level
2021-08-15 05:12:43 +00:00
;************************
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
2021-08-15 05:12:43 +00:00
really_level_over:
rts
to_right:
lda #31
sta PEASANT_X
2021-08-15 05:12:43 +00:00
rts
to_left:
lda #5
sta PEASANT_X
rts
2021-08-15 05:12:43 +00:00
2021-08-15 04:23:41 +00:00
.include "wait_keypress.s"
.include "draw_peasant.s"
2021-08-24 17:38:03 +00:00
.include "gr_copy.s"
.include "new_map_location.s"
2021-08-24 17:52:11 +00:00
.include "peasant_move.s"
2021-08-29 03:05:36 +00:00
.include "score.s"
.include "parse_input.s"
2021-08-15 04:23:41 +00:00
.include "keyboard.s"
.include "wait.s"
2021-08-15 04:23:41 +00:00
.include "wait_a_bit.s"
.include "graphics_peasantry/graphics_peasant2.inc"
.include "graphics_peasantry/priority_peasant2.inc"
2021-08-15 04:23:41 +00:00
2021-08-24 03:02:23 +00:00
.include "version.inc"
2021-08-15 04:23:41 +00:00
;.include "inventory.s"
2021-08-29 05:07:16 +00:00
.include "loadsave_menu.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"
2021-08-15 05:12:43 +00:00
map_backgrounds_low:
.byte <haystack_lzsa ; 5 -- haystack
2021-08-23 02:02:11 +00:00
.byte <puddle_lzsa ; 6 -- puddle
.byte <archery_lzsa ; 7 -- archery
2021-08-17 04:04:04 +00:00
.byte <river_lzsa ; 8 -- river
.byte <knight_lzsa ; 9 -- knight
map_backgrounds_hi:
.byte >haystack_lzsa ; 5 -- haystack
2021-08-23 02:02:11 +00:00
.byte >puddle_lzsa ; 6 -- puddle
.byte >archery_lzsa ; 7 -- archery
2021-08-17 04:04:04 +00:00
.byte >river_lzsa ; 8 -- river
.byte >knight_lzsa ; 9 -- knight
2021-08-24 17:38:03 +00:00
map_priority_low:
.byte <haystack_priority_lzsa ; 5 -- haystack
.byte <puddle_priority_lzsa ; 6 -- puddle
.byte <archery_priority_lzsa ; 7 -- archery
.byte <river_priority_lzsa ; 8 -- river
.byte <knight_priority_lzsa ; 9 -- knight
map_priority_hi:
.byte >haystack_priority_lzsa ; 5 -- haystack
.byte >puddle_priority_lzsa ; 6 -- puddle
.byte >archery_priority_lzsa ; 7 -- archery
.byte >river_priority_lzsa ; 8 -- river
.byte >knight_priority_lzsa ; 9 -- knight
verb_tables_low:
.byte <river_stone_verb_table ; 5 -- haystack
.byte <river_stone_verb_table ; 6 -- puddle
.byte <river_stone_verb_table ; 7 -- archery
.byte <river_stone_verb_table ; 8 -- river
.byte <mountain_pass_verb_table ; 9 -- knight
verb_tables_hi:
.byte >river_stone_verb_table ; 5 -- haystack
.byte >river_stone_verb_table ; 6 -- puddle
.byte >river_stone_verb_table ; 7 -- archery
.byte >river_stone_verb_table ; 8 -- river
.byte >mountain_pass_verb_table ; 9 -- knight
;peasant2_text_lzsa:
;.incbin "DIALOG_PEASANT2.LZSA"
;.include "dialog_peasant2.inc"
2021-10-20 04:47:40 +00:00
.include "peasant2_actions.s"