dos33fsprogs/duke/draw_duke.s

121 lines
2.1 KiB
ArmAsm
Raw Normal View History

2020-12-10 19:24:05 -05:00
;=========================
; draw duke
2020-12-10 19:24:05 -05:00
;=========================
draw_duke:
2020-11-28 00:51:57 -05:00
2020-12-10 19:24:05 -05:00
lda DUKE_X
sta XPOS
lda DUKE_Y
sta YPOS
2020-12-10 19:59:34 -05:00
2020-12-13 19:25:30 -05:00
lda DUKE_DIRECTION
bmi duke_facing_left
2020-12-13 19:25:30 -05:00
2020-12-11 00:44:55 -05:00
;=========================
; facing right
2020-12-12 22:43:52 -05:00
duke_facing_right:
2020-12-12 22:43:52 -05:00
check_falling_right:
lda DUKE_FALLING
beq check_jumping_right
draw_falling_right:
ldx #<duke_sprite_falling_right
lda #>duke_sprite_falling_right
jmp actually_draw_duke
2020-12-12 22:43:52 -05:00
check_jumping_right:
2020-12-12 22:43:52 -05:00
lda DUKE_JUMPING
beq check_shooting_right
draw_jumping_right:
ldx #<duke_sprite_jumping_right
lda #>duke_sprite_jumping_right
jmp actually_draw_duke
2020-12-11 01:24:47 -05:00
check_shooting_right:
lda DUKE_SHOOTING
beq check_walking_right
draw_shooting_right:
ldx #<duke_sprite_shooting_right
lda #>duke_sprite_shooting_right
2020-12-14 23:37:12 -05:00
dec DUKE_SHOOTING
jmp actually_draw_duke
2020-12-10 19:59:34 -05:00
check_walking_right:
lda DUKE_WALKING
beq draw_standing_right
draw_walking_right:
lda FRAMEL
and #$02
beq draw_standing_right
ldx #<duke_sprite_walking_right
lda #>duke_sprite_walking_right
jmp actually_draw_duke
2020-12-10 19:59:34 -05:00
draw_standing_right:
ldx #<duke_sprite_stand_right
lda #>duke_sprite_stand_right
jmp actually_draw_duke
2020-12-10 19:59:34 -05:00
;==================
; facing left
duke_facing_left:
2020-12-10 19:59:34 -05:00
check_falling_left:
lda DUKE_FALLING
beq check_jumping_left
draw_falling_left:
ldx #<duke_sprite_falling_left
lda #>duke_sprite_falling_left
jmp actually_draw_duke
2020-11-28 00:51:57 -05:00
check_jumping_left:
lda DUKE_JUMPING
beq check_shooting_left
draw_jumping_left:
ldx #<duke_sprite_jumping_left
lda #>duke_sprite_jumping_left
jmp actually_draw_duke
2020-11-28 00:51:57 -05:00
check_shooting_left:
lda DUKE_SHOOTING
beq check_walking_left
draw_shooting_left:
ldx #<duke_sprite_shooting_left
lda #>duke_sprite_shooting_left
2020-12-14 23:37:12 -05:00
dec DUKE_SHOOTING
jmp actually_draw_duke
2020-11-28 00:51:57 -05:00
check_walking_left:
lda DUKE_WALKING
beq draw_standing_left
draw_walking_left:
lda FRAMEL
and #$02
beq draw_standing_left
ldx #<duke_sprite_walking_left
lda #>duke_sprite_walking_left
2020-11-28 00:51:57 -05:00
jmp actually_draw_duke
draw_standing_left:
ldx #<duke_sprite_stand_left
2020-11-28 00:51:57 -05:00
lda #>duke_sprite_stand_left
jmp actually_draw_duke
;====================
; actually draw
2020-11-28 00:51:57 -05:00
actually_draw_duke:
stx INL
2020-11-28 00:51:57 -05:00
sta INH
jsr put_sprite_crop
rts