math: wip 16 bit math
authorLukas Krickl <lukas@krickl.dev>
Tue, 3 Feb 2026 05:01:29 +0000 (06:01 +0100)
committerLukas Krickl <lukas@krickl.dev>
Tue, 3 Feb 2026 05:01:29 +0000 (06:01 +0100)
Reduced tick rate

src/actor.s
src/defs.s
src/math.s

index ab27f0fc973c00a61dc52b257e05038890a6ec67..8a31e56f96463f8a1f3f34b4babcecafe2169799 100644 (file)
@@ -104,7 +104,7 @@ act_draw_all:
 act_r_bat:
        push de
        call rand ; pick a random direction
-       and a, 3
+       and a, 7 ; 0-3 direction 4-7 noop
        pop de
        ld hl, act_pos_y
        add hl, de
index 7584686cae9fed1ebd34f7d6d258068c7cd6ef32..77b46a88f0780e2ae04eceacf68976f6e8aaff87 100644 (file)
@@ -7,7 +7,7 @@
 
        ; how often should turns auto-end
        ; frame timer
-#define TICK_RATE 10
+#define TICK_RATE 30
 
 .def int OAMDMAFN = 0xFF80 
 #define WRAM 0xC000
index caec83841b5a132bbec1061dda25f5fd52800be7..524586cbaeb434f9b1fb2a2aab4f7dcd255ec4fc 100644 (file)
@@ -76,7 +76,9 @@ m16_add:
        ret nc ; no carry? good to exit
 
        ; when carry is set -> set flag
-       ld a, M16_CARRY
+       ld b, M16_CARRY
+       ld a, [m16_flags]
+       or a, b
        ld [m16_flags], a
 
        ret
@@ -109,7 +111,9 @@ m16_sub:
        ret nc
 
        ; when carry is set -> set flag
-       ld a, M16_CARRY
+       ld b, M16_CARRY
+       ld a, [m16_flags]
+       or a, b
        ld [m16_flags], a
 
        ret