From 6f0a76fccce2bd8cbe74975623b28f0201b2610a Mon Sep 17 00:00:00 2001 From: Astatin Date: Thu, 26 Sep 2024 20:17:33 +0900 Subject: [WIP and completely broken] Reworking the bunny movements & display to decorelate the bunny from moving animation --- entity/display.gbasm | 81 ++++++++++++++++++---------------------------------- 1 file changed, 27 insertions(+), 54 deletions(-) (limited to 'entity/display.gbasm') diff --git a/entity/display.gbasm b/entity/display.gbasm index 2a54e76..25cd759 100644 --- a/entity/display.gbasm +++ b/entity/display.gbasm @@ -83,6 +83,7 @@ Display_Entity: LD A, $mem_bunny_direction BIT 3, A JR Z, =Display_Entity.Viewport_offset_end + LD A, $mem_bunny_direction AND $07 CP $enum_direction_down JR Z, =Display_Entity.Viewport_offset_down @@ -139,71 +140,43 @@ Display_Entity: LD A, (HL+) BIT 3, A LD D, A - LD A, $00 - JR Z, =Display_Entity.Not_Moving_Animation - - LD A, D - AND $07 + Display_Entity.Moving_Animation: + JR Z, =Display_Entity.Moving_Animation.end - CP $enum_direction_down - JR Z, =Display_Entity.moving_offset_down - CP $enum_direction_right - JR Z, =Display_Entity.moving_offset_right - CP $enum_direction_up - JR Z, =Display_Entity.moving_offset_up - - Display_Entity.moving_offset_left: LD A, $mem_moving_animation_step - XOR $ff - ADD B - LD B, A - - JR =Display_Entity.moving_offset_end + .ADD_A_TO_DIRECTION_BC + Display_Entity.Moving_Animation.end: - Display_Entity.moving_offset_right: - LD A, $mem_moving_animation_step - INC A - ADD B - LD B, A - - JR =Display_Entity.moving_offset_end + Display_Entity.Action_Animation: + LD A, D + AND $f0 + CP $10 + JR NZ, =Display_Entity.Action_Animation.end - Display_Entity.moving_offset_up: LD A, $mem_moving_animation_step + SUB $08 + .ABS XOR $ff - ADD C - LD C, A + INC A + ADD $08 + .ADD_A_TO_DIRECTION_BC + Display_Entity.Action_Animation.end: - JR =Display_Entity.moving_offset_end + Display_Entity.Moving_Hops: + LD A, D + BIT 3, A + LD A, $00 + JR Z, =Display_Entity.Moving_Hops.not_moving - Display_Entity.moving_offset_down: LD A, $mem_moving_animation_step - INC A + Display_Entity.Moving_Hops.not_moving: + SUB $08 + .ABS + SUB $04 + .ABS ADD C LD C, A - - Display_Entity.moving_offset_end: - - - LD A, $mem_moving_animation_step - Display_Entity.Not_Moving_Animation: - - SUB $08 - BIT 7, A - JR Z, =Display_Entity.Hop_ABS1_end - - ; Adding hop animation to Y - XOR $ff - INC A - Display_Entity.Hop_ABS1_end: - SUB $04 - BIT 7, A - JR Z, =Display_Entity.Hop_ABS2_end - XOR $ff - INC A - Display_Entity.Hop_ABS2_end: - ADD C - LD C, A + Display_Entity.Moving_Hops.end: LD A, D AND $07 -- cgit v1.2.3-70-g09d2