aboutsummaryrefslogtreecommitdiff
path: root/entity
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-01-24 18:49:12 +0900
committerAstatin <[email protected]>2025-01-24 18:49:12 +0900
commitcf80989154bbb8985bec1d2e089c680714b9b804 (patch)
tree4dd903e51d5a8f997ae84ce5dd4bd78bec8c30bf /entity
parent1a6621e5b1da42ee4b6b9132790ec744efc009c2 (diff)
Fix XY/YX/BC/CB issue thingy
Diffstat (limited to 'entity')
-rw-r--r--entity/actions.gbasm3
-rw-r--r--entity/bunny.gbasm6
-rw-r--r--entity/collisions.gbasm18
-rw-r--r--entity/utils.gbasm7
4 files changed, 15 insertions, 19 deletions
diff --git a/entity/actions.gbasm b/entity/actions.gbasm
index f97fbc4..f44e41b 100644
--- a/entity/actions.gbasm
+++ b/entity/actions.gbasm
@@ -283,7 +283,8 @@ Fox_Turn:
CALL =Laser_sight_check
LD A, E
CP $00
- JR Z, =.nyo_basic_attack
+ ;JR Z, =.nyo_basic_attack
+ JR =.nyo_basic_attack
; CALL =Basic_Attack
LD A, L
diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm
index 7e9afa5..3804b6a 100644
--- a/entity/bunny.gbasm
+++ b/entity/bunny.gbasm
@@ -66,7 +66,6 @@ Move_Bunny:
LD A, D
CALL =Get_Position_After_Move
- LD A, C
CALL =Is_Collisionable
CALL =Carve_Entity_Collision_Map
CP $00
@@ -86,13 +85,8 @@ Move_Bunny:
JR Z, =.Start_action_or_movement.end
PUSH BC
- LD A, B
- LD B, C
- LD C, A
LD A, $01
- DBG
.ADD_A_TO_DIRECTION_BC
- DBG
LD A, B
LD $mem_bunny_predicted_x, A
LD A, C
diff --git a/entity/collisions.gbasm b/entity/collisions.gbasm
index 13120a6..d19bf08 100644
--- a/entity/collisions.gbasm
+++ b/entity/collisions.gbasm
@@ -1,9 +1,12 @@
-Carve_Entity_Collision_Map: ; X in C, Y in B
+Carve_Entity_Collision_Map: ; XY in BC
PUSH BC
PUSH HL
PUSH AF
- LD A, C
+ LD A, B
+ LD B, C
+ LD C, A
+
AND $e0
JR NZ, =Carve_Entity_Collision_Map.end
@@ -38,18 +41,21 @@ Carve_Entity_Collision_Map: ; X in C, Y in B
POP BC
RET
-Is_Collisionable: ; X in A, Y in B, Result A
+Is_Collisionable: ; XY in BC, Result A
PUSH BC
PUSH HL
+ LD A, B
CP $20
JR NC, =Is_Collisionable.Solid
- LD C, A
- LD A, B
+ LD A, C
CP $20
JR NC, =Is_Collisionable.Solid
- LD A, C
+
+ LD A, B
+ LD B, C
+ LD C, A
LD H, $00
CP $10
diff --git a/entity/utils.gbasm b/entity/utils.gbasm
index e2b7c1c..8a44d6d 100644
--- a/entity/utils.gbasm
+++ b/entity/utils.gbasm
@@ -43,7 +43,7 @@
$end:
.END
-Get_Position_After_Move: ; entity (whatever alignement) in HL, direction to test in A, X Result in C, Y result in B, E being how much tile entity will move
+Get_Position_After_Move: ; entity (whatever alignement) in HL, direction to test in A, XY result in BC, E being how much tile entity will move
PUSH HL
PUSH DE
LD D, A
@@ -77,11 +77,6 @@ Get_Position_After_Move: ; entity (whatever alignement) in HL, direction to test
.ADD_A_TO_DIRECTION_BC
Get_Position_After_Move.Skip_Move:
-
- LD A, C
- LD C, B
- LD B, A
-
POP DE
POP HL
RET