dos33fsprogs/games/peasant/cottage.s

326 lines
4.4 KiB
ArmAsm
Raw Normal View History

2021-08-10 18:05:41 +00:00
; THATCHED ROOF COTTAGES
cottage:
;************************
; Cottage
;************************
2021-08-12 16:57:24 +00:00
lda #0
sta FRAME
;=========================
; init peasant position
; draw at 70,117
lda #10
sta PEASANT_X
lda #117
sta PEASANT_Y
2021-08-12 18:07:19 +00:00
lda #PEASANT_DIR_RIGHT
sta PEASANT_DIR
2021-08-12 16:57:24 +00:00
;==================
; draw background
2021-08-10 18:05:41 +00:00
lda #<(cottage_lzsa)
sta getsrc_smc+1
lda #>(cottage_lzsa)
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
2021-08-12 16:57:24 +00:00
;===================
; print title
2021-08-10 18:05:41 +00:00
lda #<peasant_text
sta OUTL
lda #>peasant_text
sta OUTH
jsr hgr_put_string
2021-08-12 17:10:07 +00:00
; jsr display_cottage_text3
2021-08-12 16:57:24 +00:00
;====================
; save background
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
;=======================
; walking
jsr save_bg_7x30
2021-08-12 17:10:07 +00:00
cottage_walk_loop:
2021-08-12 16:57:24 +00:00
jsr restore_bg_7x30
2021-08-12 17:10:07 +00:00
lda FRAME
check_cottage_action1:
cmp #0
bne check_cottage_action2
jsr display_cottage_text1
jmp done_cottage_action
check_cottage_action2:
cmp #1
bne check_cottage_action3
jsr display_cottage_text2
jmp done_cottage_action
check_cottage_action3:
cmp #13
bne done_cottage_action
jsr display_cottage_text3
done_cottage_action:
2021-08-12 16:57:24 +00:00
lda FRAME
asl
tax
lda cottage_path,X
bmi done_cottage
sta PEASANT_X
sta CURSOR_X
inx
lda cottage_path,X
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr draw_peasant
jsr wait_until_keypress
inc FRAME
2021-08-12 17:10:07 +00:00
jmp cottage_walk_loop
2021-08-12 16:57:24 +00:00
;===================
; done
done_cottage:
rts
;============================
; display cottage text 1
;============================
display_cottage_text1:
;====================
; draw text box
2021-08-12 04:42:12 +00:00
lda #0
sta BOX_X1H
lda #53
sta BOX_X1L
lda #24
sta BOX_Y1
lda #0
sta BOX_X2H
lda #253
sta BOX_X2L
lda #82
sta BOX_Y2
2021-08-12 02:07:33 +00:00
jsr draw_box
2021-08-12 04:42:12 +00:00
2021-08-12 16:57:24 +00:00
lda #<cottage_text1
sta OUTL
lda #>cottage_text1
sta OUTH
2021-08-12 17:10:07 +00:00
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
2021-08-12 16:57:24 +00:00
jsr hgr_put_string
rts
2021-08-12 15:48:12 +00:00
;============================
2021-08-12 16:57:24 +00:00
; display cottage text 2
;============================
display_cottage_text2:
2021-08-12 15:48:12 +00:00
2021-08-12 16:57:24 +00:00
;====================
; draw text box
2021-08-12 15:48:12 +00:00
2021-08-12 16:57:24 +00:00
lda #0
sta BOX_X1H
lda #40
sta BOX_X1L
lda #15
sta BOX_Y1
2021-08-12 15:48:12 +00:00
2021-08-12 16:57:24 +00:00
lda #0
sta BOX_X2H
lda #255
sta BOX_X2L
lda #96
sta BOX_Y2
2021-08-12 15:48:12 +00:00
2021-08-12 16:57:24 +00:00
jsr draw_box
lda #<cottage_text2
sta OUTL
lda #>cottage_text2
sta OUTH
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
rts
;============================
; display cottage text 3
;============================
display_cottage_text3:
;====================
; draw text box
lda #0
sta BOX_X1H
lda #30
sta BOX_X1L
lda #20
sta BOX_Y1
lda #0
sta BOX_X2H
lda #253
sta BOX_X2L
lda #86
sta BOX_Y2
jsr draw_box
lda #<cottage_text3
sta OUTL
lda #>cottage_text3
sta OUTH
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
rts
;============================
; draw peasant
;============================
draw_peasant:
lda PEASANT_X
2021-08-12 15:48:12 +00:00
sta CURSOR_X
2021-08-12 16:57:24 +00:00
lda PEASANT_Y
2021-08-12 15:48:12 +00:00
sta CURSOR_Y
lda #<peasant_right1_sprite
sta INL
lda #>peasant_right1_sprite
sta INH
jsr hgr_draw_sprite_7x30
2021-08-10 18:05:41 +00:00
rts
2021-08-11 23:29:47 +00:00
2021-08-10 18:05:41 +00:00
peasant_text:
.byte 25,2,"Peasant's Quest",0
2021-08-11 23:29:47 +00:00
cottage_text1:
2021-08-12 02:07:33 +00:00
.byte 9,35,"YOU are Rather Dashing, a",0
.byte 9,44,"humble peasant living in",0
.byte 9,53,"the peasant kingdom of",0
.byte 9,62,"Peasantry.",0
2021-08-11 23:29:47 +00:00
; wait a few seconds
cottage_text2:
2021-08-12 16:57:24 +00:00
.byte 8,25,"You return home from a",0
.byte 8,33,"vacation on Scalding Lake",0
.byte 8,41,"only to find that TROGDOR",0
.byte 8,49,"THE BURNINATOR has",0
.byte 8,57,"burninated your thatched",0
.byte 8,65,"roof cottage along with all",0
.byte 8,73,"your goods and services.",0
2021-08-11 23:29:47 +00:00
; wait a few seconds, then start walking toward cottage
cottage_text3:
2021-08-12 16:57:24 +00:00
.byte 7,33,"With nothing left to lose,",0
.byte 7,41,"you swear to get revenge on",0
.byte 7,49,"the Wingaling Dragon in the",0
.byte 7,57,"name of burninated peasants",0
.byte 7,65,"everywhere.",0
2021-08-11 23:29:47 +00:00
; Walk to edge of screen
2021-08-12 15:48:12 +00:00
.include "sprites/peasant_sprite.inc"
2021-08-12 16:57:24 +00:00
cottage_path:
.byte 10,117 ; 0 ; 5s, text 1
.byte 10,117 ; 1 ; 3s, text 2
.byte 11,122
.byte 12,127
.byte 13,132
.byte 14,137
.byte 15,142
.byte 16,147
.byte 17,147
.byte 18,147
.byte 19,147
.byte 20,147
.byte 21,147
.byte 22,147
.byte 23,147 ; text 3
.byte 24,147
.byte 25,147
.byte 26,147
.byte 27,147
.byte 28,147
.byte 29,147
.byte 30,147
.byte 31,147
.byte 32,147
.byte 33,147
.byte 34,147
.byte 35,147
.byte 36,147
.byte 37,147
.byte 38,147
.byte $FF,$FF