projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b7dec0
)
Added assert macro
origin/simple-enemy-behavior
author
Lukas Krickl
<lukas@krickl.dev>
Sat, 7 Dec 2024 05:39:37 +0000
(06:39 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Sat, 7 Dec 2024 05:39:37 +0000
(06:39 +0100)
src/macros.inc
patch
|
blob
|
history
src/player.s
patch
|
blob
|
history
diff --git
a/src/macros.inc
b/src/macros.inc
index c61197fb1c50355a2e2cd9f7641b3393b0d8fd0b..9523f97ee66955974b10df0fc43a16a58fa9c696 100644
(file)
--- a/
src/macros.inc
+++ b/
src/macros.inc
@@
-86,3
+86,14
@@
srl $1 ; / 8
srl $1 ; / 16
#endmacro
+
+ ; asserts. if $1 != $2 causes a ld b, b
+ ; inputs:
+ ; $1: register to assert
+ ; $2: value to assert
+#macro assert
+ cp $1, $2
+ jr nz, @noassert
+ ld b, b
+@noassert
+#endmacro
diff --git
a/src/player.s
b/src/player.s
index 39a928f7f91949a0409df7501f72e29e556768f6..c3772a141bcef51550bcf0eb36b7fd106c5c61df 100644
(file)
--- a/
src/player.s
+++ b/
src/player.s
@@
-64,7
+64,7
@@
player_init:
push de
; 2) hl = player_y already
-; 3) load correct collision points
+
; 3) load correct collision points
ld de, $1
call collision_tile_table_check
pop de