mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-27 02:31:00 +00:00
peasant: split out the draw peasant routine
This commit is contained in:
parent
f00749f6b8
commit
80747fd82d
@ -71,7 +71,7 @@ PEASANT: peasant.o
|
||||
peasant.o: peasant.s graphics/graphics.inc sprites/peasant_sprite.inc \
|
||||
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
|
||||
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
|
||||
wait_a_bit.s \
|
||||
wait_a_bit.s draw_peasant.s \
|
||||
title.s directions.s \
|
||||
cottage.s lake_w.s lake_e.s river.s knight.s \
|
||||
ending.s
|
||||
|
@ -246,65 +246,6 @@ display_cottage_text3:
|
||||
|
||||
rts
|
||||
|
||||
;============================
|
||||
; draw peasant
|
||||
;============================
|
||||
draw_peasant:
|
||||
lda PEASANT_X
|
||||
sta CURSOR_X
|
||||
lda PEASANT_Y
|
||||
sta CURSOR_Y
|
||||
|
||||
lda PEASANT_DIR
|
||||
cmp #PEASANT_DIR_RIGHT
|
||||
beq peasant_right
|
||||
|
||||
;=====================
|
||||
; up up up up
|
||||
peasant_up:
|
||||
|
||||
lda FRAME
|
||||
and #1
|
||||
beq peasant_up1
|
||||
|
||||
|
||||
peasant_up2:
|
||||
lda #<peasant_up2_sprite
|
||||
sta INL
|
||||
lda #>peasant_up2_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
peasant_up1:
|
||||
lda #<peasant_up1_sprite
|
||||
sta INL
|
||||
lda #>peasant_up1_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
|
||||
peasant_right:
|
||||
lda CURSOR_X
|
||||
and #1
|
||||
bne draw_right1
|
||||
|
||||
draw_right2:
|
||||
lda #<peasant_right2_sprite
|
||||
sta INL
|
||||
lda #>peasant_right2_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
draw_right1:
|
||||
lda #<peasant_right1_sprite
|
||||
sta INL
|
||||
lda #>peasant_right1_sprite
|
||||
|
||||
done_pick_draw:
|
||||
sta INH
|
||||
|
||||
jsr hgr_draw_sprite_7x30
|
||||
|
||||
rts
|
||||
|
||||
|
||||
peasant_text:
|
||||
.byte 25,2,"Peasant's Quest",0
|
||||
|
||||
@ -338,9 +279,6 @@ cottage_text3:
|
||||
; Walk to edge of screen
|
||||
|
||||
|
||||
.include "sprites/peasant_sprite.inc"
|
||||
|
||||
|
||||
|
||||
cottage_path:
|
||||
.byte 10,117 ; 0 ; 5s, text 1
|
||||
|
61
games/peasant/draw_peasant.s
Normal file
61
games/peasant/draw_peasant.s
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
;============================
|
||||
; draw peasant
|
||||
;============================
|
||||
draw_peasant:
|
||||
lda PEASANT_X
|
||||
sta CURSOR_X
|
||||
lda PEASANT_Y
|
||||
sta CURSOR_Y
|
||||
|
||||
lda PEASANT_DIR
|
||||
cmp #PEASANT_DIR_RIGHT
|
||||
beq peasant_right
|
||||
|
||||
;=====================
|
||||
; up up up up
|
||||
peasant_up:
|
||||
|
||||
lda FRAME
|
||||
and #1
|
||||
beq peasant_up1
|
||||
|
||||
|
||||
peasant_up2:
|
||||
lda #<peasant_up2_sprite
|
||||
sta INL
|
||||
lda #>peasant_up2_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
peasant_up1:
|
||||
lda #<peasant_up1_sprite
|
||||
sta INL
|
||||
lda #>peasant_up1_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
|
||||
peasant_right:
|
||||
lda CURSOR_X
|
||||
and #1
|
||||
bne draw_right1
|
||||
|
||||
draw_right2:
|
||||
lda #<peasant_right2_sprite
|
||||
sta INL
|
||||
lda #>peasant_right2_sprite
|
||||
jmp done_pick_draw
|
||||
|
||||
draw_right1:
|
||||
lda #<peasant_right1_sprite
|
||||
sta INL
|
||||
lda #>peasant_right1_sprite
|
||||
|
||||
done_pick_draw:
|
||||
sta INH
|
||||
|
||||
jsr hgr_draw_sprite_7x30
|
||||
|
||||
rts
|
||||
|
||||
|
||||
.include "sprites/peasant_sprite.inc"
|
@ -87,6 +87,8 @@ peasant_quest:
|
||||
.include "river.s"
|
||||
.include "knight.s"
|
||||
|
||||
.include "draw_peasant.s"
|
||||
|
||||
.include "hgr_font.s"
|
||||
.include "draw_box.s"
|
||||
.include "hgr_rectangle.s"
|
||||
|
Loading…
Reference in New Issue
Block a user