dos33fsprogs/games/peasant/intro_knight.s

181 lines
2.1 KiB
ArmAsm
Raw Normal View History

; o/~ One knight in Bangkok makes a hard man humble o/~
;************************
; Knight
;************************
knight:
2021-08-12 19:23:05 +00:00
lda #0
sta FRAME
;=========================
; init peasant position
; draw at 0,107
lda #0
sta PEASANT_X
lda #107
sta PEASANT_Y
lda #PEASANT_DIR_RIGHT
sta PEASANT_DIR
;=====================
; load bg
lda #<(knight_lzsa)
sta getsrc_smc+1
lda #>(knight_lzsa)
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
lda #<peasant_text
sta OUTL
lda #>peasant_text
sta OUTH
jsr hgr_put_string
; jsr hgr_save
2021-08-12 19:23:05 +00:00
;====================
; save background
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
;=======================
; walking
jsr save_bg_7x28
2021-08-12 19:23:05 +00:00
knight_walk_loop:
lda PEASANT_X
sta CURSOR_X
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x28
2021-08-12 19:23:05 +00:00
; draw peasant
lda FRAME
asl
tax
lda knight_path,X
bmi done_knight
sta PEASANT_X
sta CURSOR_X
inx
lda knight_path,X
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x28
jsr draw_peasant
2021-08-12 19:23:05 +00:00
lda FRAME
check_knight_action1:
cmp #0
bne check_knight_action2
lda #<river_message1
sta OUTL
lda #>river_message1
sta OUTH
jsr hgr_text_box
2021-08-12 19:23:05 +00:00
jmp done_knight_action
check_knight_action2:
cmp #8
bne check_knight_action3
jsr hgr_partial_restore
2021-08-12 19:23:05 +00:00
jmp done_knight_action
check_knight_action3:
cmp #17
bne done_knight_action
lda #<knight_message1
sta OUTL
lda #>knight_message1
sta OUTH
jsr hgr_text_box
2021-08-12 19:23:05 +00:00
done_knight_action:
2021-08-12 19:41:39 +00:00
; jsr wait_until_keypress
lda #3
jsr wait_a_bit
2021-08-15 04:02:13 +00:00
lda ESC_PRESSED
bne done_knight
2021-08-12 19:23:05 +00:00
inc FRAME
jmp knight_walk_loop
;===================
; done
done_knight:
rts
2021-08-11 23:29:47 +00:00
; continues displaying previous message
; stops as approach knight
knight_message1:
.byte 0,35,34, 0,253,72
2021-08-12 19:23:05 +00:00
.byte 7,49,"OK go for it.",0
2021-08-11 23:29:47 +00:00
2021-08-12 19:23:05 +00:00
knight_path:
.byte 0,107
.byte 1,107
.byte 2,107
.byte 3,107
.byte 4,107
.byte 5,107
.byte 6,107
.byte 7,107
.byte 8,107
.byte 9,107
.byte 10,107
.byte 11,107
.byte 12,107
.byte 13,107
.byte 14,107
.byte 15,107
.byte 16,107
.byte 17,107
.byte 18,107
.byte $FF,$FF
2021-08-11 23:29:47 +00:00
2021-08-12 19:23:05 +00:00
score_text:
.byte 0,2,"Score: 0 of 150",0