2021-08-10 19:30:02 +00:00
|
|
|
; o/~ At the beautiful, the beautiful, River o/~
|
|
|
|
|
|
|
|
;************************
|
|
|
|
; River
|
|
|
|
;************************
|
2021-12-30 05:46:21 +00:00
|
|
|
intro_river:
|
2021-08-12 19:08:48 +00:00
|
|
|
lda #0
|
|
|
|
sta FRAME
|
|
|
|
|
|
|
|
;=========================
|
|
|
|
; init peasant position
|
|
|
|
; draw at 33,157
|
|
|
|
|
|
|
|
lda #33
|
|
|
|
sta PEASANT_X
|
|
|
|
lda #157
|
|
|
|
sta PEASANT_Y
|
|
|
|
|
|
|
|
lda #PEASANT_DIR_UP
|
|
|
|
sta PEASANT_DIR
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
;========================
|
|
|
|
; load priority to $400
|
|
|
|
; indirectly as we can't trash screen holes
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
lda #<river_priority_lzsa
|
2021-08-10 19:30:02 +00:00
|
|
|
sta getsrc_smc+1
|
2021-12-30 05:46:21 +00:00
|
|
|
lda #>river_priority_lzsa
|
2021-08-10 19:30:02 +00:00
|
|
|
sta getsrc_smc+2
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
lda #$20 ; temporarily load to $2000
|
2021-08-10 19:30:02 +00:00
|
|
|
|
|
|
|
jsr decompress_lzsa2_fast
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
; copy to $400
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
jsr gr_copy_to_page1
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-10-02 18:43:58 +00:00
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
;====================
|
|
|
|
; load bg
|
2021-10-02 18:43:58 +00:00
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
|
|
|
|
lda #<(river_lzsa)
|
2021-10-02 18:43:58 +00:00
|
|
|
sta getsrc_smc+1
|
2021-12-30 05:46:21 +00:00
|
|
|
lda #>(river_lzsa)
|
2021-10-02 18:43:58 +00:00
|
|
|
sta getsrc_smc+2
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
lda #$20
|
2021-10-02 18:43:58 +00:00
|
|
|
|
|
|
|
jsr decompress_lzsa2_fast
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
jsr hgr_copy
|
2021-10-02 18:43:58 +00:00
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
;================
|
|
|
|
; print title
|
|
|
|
|
|
|
|
jsr intro_print_title
|
2021-10-02 18:43:58 +00:00
|
|
|
|
2021-08-12 19:08:48 +00:00
|
|
|
;====================
|
|
|
|
; save background
|
|
|
|
|
2021-12-30 05:46:21 +00:00
|
|
|
; lda PEASANT_X
|
|
|
|
; sta CURSOR_X
|
|
|
|
; lda PEASANT_Y
|
|
|
|
; sta CURSOR_Y
|
2021-08-12 19:08:48 +00:00
|
|
|
|
|
|
|
;=======================
|
|
|
|
; walking
|
|
|
|
|
2021-12-29 06:27:37 +00:00
|
|
|
; jsr save_bg_1x28
|
2021-08-12 19:08:48 +00:00
|
|
|
|
|
|
|
river_walk_loop:
|
2021-08-16 05:31:49 +00:00
|
|
|
|
|
|
|
lda PEASANT_X
|
|
|
|
sta CURSOR_X
|
|
|
|
lda PEASANT_Y
|
|
|
|
sta CURSOR_Y
|
|
|
|
|
2021-10-05 04:13:31 +00:00
|
|
|
jsr restore_bg_1x28
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-08-16 05:31:49 +00:00
|
|
|
; draw peasant
|
|
|
|
|
|
|
|
lda FRAME
|
|
|
|
asl
|
|
|
|
tax
|
|
|
|
|
|
|
|
lda river_path,X
|
|
|
|
bmi done_river
|
|
|
|
sta PEASANT_X
|
|
|
|
sta CURSOR_X
|
|
|
|
|
|
|
|
inx
|
|
|
|
lda river_path,X
|
|
|
|
sta PEASANT_Y
|
|
|
|
sta CURSOR_Y
|
|
|
|
|
2021-12-29 06:27:37 +00:00
|
|
|
; jsr save_bg_1x28
|
2021-08-16 05:31:49 +00:00
|
|
|
|
|
|
|
jsr draw_peasant
|
|
|
|
|
|
|
|
|
2021-08-12 19:08:48 +00:00
|
|
|
lda FRAME
|
|
|
|
check_river_action1:
|
|
|
|
cmp #10
|
|
|
|
bne check_river_action2
|
2021-08-15 01:10:56 +00:00
|
|
|
|
|
|
|
lda #<river_message1
|
|
|
|
sta OUTL
|
|
|
|
lda #>river_message1
|
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
jsr hgr_text_box
|
|
|
|
|
2021-08-12 19:08:48 +00:00
|
|
|
jmp done_river_action
|
|
|
|
|
|
|
|
check_river_action2:
|
|
|
|
cmp #15
|
|
|
|
bne done_river_action
|
|
|
|
; jsr hgr_restore
|
|
|
|
lda #PEASANT_DIR_RIGHT
|
|
|
|
sta PEASANT_DIR
|
|
|
|
|
|
|
|
done_river_action:
|
|
|
|
|
2021-12-31 01:03:27 +00:00
|
|
|
jsr animate_river
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-08-10 19:30:02 +00:00
|
|
|
|
2021-08-12 19:41:39 +00:00
|
|
|
; jsr wait_until_keypress
|
|
|
|
|
|
|
|
lda #3
|
|
|
|
jsr wait_a_bit
|
2021-08-10 19:30:02 +00:00
|
|
|
|
2021-08-15 04:02:13 +00:00
|
|
|
lda ESC_PRESSED
|
|
|
|
bne done_river
|
|
|
|
|
2021-08-12 19:08:48 +00:00
|
|
|
inc FRAME
|
|
|
|
|
|
|
|
jmp river_walk_loop
|
|
|
|
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; done
|
|
|
|
|
|
|
|
done_river:
|
|
|
|
|
2021-08-10 19:30:02 +00:00
|
|
|
rts
|
2021-08-11 23:29:47 +00:00
|
|
|
|
|
|
|
|
2021-08-12 19:08:48 +00:00
|
|
|
|
2021-08-11 23:29:47 +00:00
|
|
|
; walk up a bit
|
|
|
|
|
2021-11-16 17:42:28 +00:00
|
|
|
;river_message1:
|
|
|
|
; .byte 0,35,34, 0,253,82
|
|
|
|
; .byte 7,49,"You can start playing in a",13
|
|
|
|
; .byte "second here.",0
|
2021-08-11 23:29:47 +00:00
|
|
|
|
|
|
|
; walks behind tree
|
2021-08-12 19:08:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
river_path:
|
|
|
|
.byte 32,157
|
|
|
|
.byte 32,153
|
|
|
|
.byte 32,149
|
|
|
|
.byte 32,145
|
|
|
|
.byte 32,141
|
|
|
|
.byte 32,137
|
|
|
|
.byte 32,133
|
|
|
|
.byte 32,129
|
|
|
|
.byte 32,125
|
|
|
|
.byte 32,121 ; message
|
|
|
|
.byte 32,117
|
|
|
|
.byte 32,113
|
|
|
|
.byte 32,109
|
|
|
|
.byte 32,105
|
|
|
|
.byte 32,105 ; turn right
|
|
|
|
.byte 33,105
|
|
|
|
.byte 34,105
|
|
|
|
.byte 35,105
|
|
|
|
.byte 36,105
|
2021-10-12 23:25:53 +00:00
|
|
|
.byte 37,105
|
|
|
|
.byte 38,105
|
2021-08-12 19:08:48 +00:00
|
|
|
.byte $FF,$FF
|
|
|
|
|
|
|
|
|
2021-12-31 01:03:27 +00:00
|
|
|
.include "animate_river.s"
|