2020-12-11 00:24:05 +00:00
|
|
|
|
|
|
|
;=========================
|
2020-12-14 21:01:47 +00:00
|
|
|
; draw duke
|
2020-12-11 00:24:05 +00:00
|
|
|
;=========================
|
2020-12-14 21:01:47 +00:00
|
|
|
draw_duke:
|
2020-11-28 05:51:57 +00:00
|
|
|
|
2020-12-11 00:24:05 +00:00
|
|
|
lda DUKE_X
|
2020-12-14 21:01:47 +00:00
|
|
|
sta XPOS
|
|
|
|
lda DUKE_Y
|
|
|
|
sta YPOS
|
2020-12-11 00:59:34 +00:00
|
|
|
|
2020-12-14 00:25:30 +00:00
|
|
|
lda DUKE_DIRECTION
|
2020-12-14 21:01:47 +00:00
|
|
|
bmi duke_facing_left
|
2020-12-14 00:25:30 +00:00
|
|
|
|
2020-12-11 05:44:55 +00:00
|
|
|
;=========================
|
2020-12-14 21:01:47 +00:00
|
|
|
; facing right
|
2020-12-13 03:43:52 +00:00
|
|
|
|
2020-12-14 21:01:47 +00:00
|
|
|
duke_facing_right:
|
2020-12-13 03:43:52 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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-13 03:43:52 +00:00
|
|
|
|
2020-12-14 21:01:47 +00:00
|
|
|
check_jumping_right:
|
2020-12-13 03:43:52 +00:00
|
|
|
lda DUKE_JUMPING
|
2020-12-14 21:01:47 +00:00
|
|
|
beq check_shooting_right
|
|
|
|
draw_jumping_right:
|
|
|
|
ldx #<duke_sprite_jumping_right
|
|
|
|
lda #>duke_sprite_jumping_right
|
|
|
|
jmp actually_draw_duke
|
2020-12-11 06:24:47 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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-15 04:37:12 +00:00
|
|
|
dec DUKE_SHOOTING
|
2020-12-14 21:01:47 +00:00
|
|
|
jmp actually_draw_duke
|
2020-12-11 00:59:34 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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-11 00:59:34 +00:00
|
|
|
|
2020-12-14 21:01:47 +00:00
|
|
|
draw_standing_right:
|
|
|
|
ldx #<duke_sprite_stand_right
|
|
|
|
lda #>duke_sprite_stand_right
|
|
|
|
jmp actually_draw_duke
|
2020-12-11 00:59:34 +00:00
|
|
|
|
|
|
|
|
2020-12-14 21:01:47 +00:00
|
|
|
;==================
|
|
|
|
; facing left
|
|
|
|
duke_facing_left:
|
2020-12-11 00:59:34 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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 05:51:57 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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 05:51:57 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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-15 04:37:12 +00:00
|
|
|
dec DUKE_SHOOTING
|
2020-12-14 21:01:47 +00:00
|
|
|
jmp actually_draw_duke
|
2020-11-28 05:51:57 +00:00
|
|
|
|
2020-12-14 21:01:47 +00: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 05:51:57 +00:00
|
|
|
jmp actually_draw_duke
|
|
|
|
|
2020-12-14 21:01:47 +00:00
|
|
|
draw_standing_left:
|
|
|
|
ldx #<duke_sprite_stand_left
|
2020-11-28 05:51:57 +00:00
|
|
|
lda #>duke_sprite_stand_left
|
2020-12-14 21:01:47 +00:00
|
|
|
jmp actually_draw_duke
|
|
|
|
|
|
|
|
|
|
|
|
;====================
|
|
|
|
; actually draw
|
2020-11-28 05:51:57 +00:00
|
|
|
|
|
|
|
actually_draw_duke:
|
2020-12-14 21:01:47 +00:00
|
|
|
stx INL
|
2020-11-28 05:51:57 +00:00
|
|
|
sta INH
|
|
|
|
jsr put_sprite_crop
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|