dos33fsprogs/games/peasant/intro_cottage.s

268 lines
3.7 KiB
ArmAsm
Raw Normal View History

2021-08-10 18:05:41 +00:00
; THATCHED ROOF COTTAGES
; More specifically, the Dashing Residence
2021-08-10 18:05:41 +00:00
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
; load priority to $400
; indirectly as we can't trash screen holes
lda #<cottage_priority_lzsa
sta getsrc_smc+1
lda #>cottage_priority_lzsa
sta getsrc_smc+2
lda #$20 ; temporarily load to $2000
jsr decompress_lzsa2_fast
; copy to $400
jsr gr_copy_to_page1
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
; jsr hgr_save
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_7x28
2021-08-12 16:57:24 +00:00
2021-08-12 17:10:07 +00:00
cottage_walk_loop:
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x28
2021-08-12 16:57:24 +00:00
;=======================
; draw peasant
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_7x28
jsr draw_peasant
;========================
; handle special
2021-08-12 17:10:07 +00:00
lda FRAME
check_cottage_action1:
cmp #0
bne check_cottage_action2
; display cottage text 1
lda #<cottage_text1
sta OUTL
lda #>cottage_text1
jmp finish_cottage_action
2021-08-12 17:10:07 +00:00
check_cottage_action2:
cmp #1
bne check_cottage_action3
jsr hgr_partial_restore
; display cottage text 2
lda #<cottage_text2
sta OUTL
lda #>cottage_text2
jmp finish_cottage_action
2021-08-12 17:10:07 +00:00
check_cottage_action3:
cmp #13
bne done_cottage_action
jsr hgr_partial_restore
; display cottage text 3
lda #<cottage_text3
sta OUTL
lda #>cottage_text3
finish_cottage_action:
sta OUTH
jsr hgr_text_box
2021-08-12 17:10:07 +00:00
done_cottage_action:
2021-08-12 16:57:24 +00:00
2021-08-12 19:41:39 +00:00
; jsr wait_until_keypress
lda FRAME
bne special2
lda #25
jmp now_wait
special2:
cmp #1
bne regular_wait
lda #12
jmp now_wait
regular_wait:
lda #3
now_wait:
jsr wait_a_bit
2021-08-12 16:57:24 +00:00
2021-08-15 04:02:13 +00:00
lda ESC_PRESSED
bne done_cottage
2021-08-12 16:57:24 +00:00
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
2021-08-12 15:48:12 +00:00
2021-08-12 16:57:24 +00:00
; even odd
; 01234567 01234567
2021-08-12 16:57:24 +00:00
2021-08-11 23:29:47 +00:00
cottage_text1:
.byte 0,52,24, 0,253,82
.byte 9,35,"YOU are Rather Dashing, a",13
.byte "humble peasant living in",13
.byte "the peasant kingdom of",13
.byte "Peasantry.",0
2021-08-11 23:29:47 +00:00
; wait a few seconds
cottage_text2:
.byte 0,41,15, 0,255,96
.byte 8,25,"You return home from a",13
.byte "vacation on Scalding Lake",13
.byte "only to find that TROGDOR",13
.byte "THE BURNINATOR has",13
.byte "burninated your thatched",13
.byte "roof cottage along with all",13
.byte "your goods and services.",0
2021-08-11 23:29:47 +00:00
; wait a few seconds, then start walking toward cottage
cottage_text3:
.byte 0,28,20, 0,252,86
.byte 7,33,"With nothing left to lose,",13
.byte "you swear to get revenge on",13
.byte "the Wingaling Dragon in the",13
.byte "name of burninated peasants",13
.byte "everywhere.",0
2021-08-11 23:29:47 +00:00
; Walk to edge of screen
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