From: Lukas Krickl Date: Tue, 3 Feb 2026 05:01:29 +0000 (+0100) Subject: math: wip 16 bit math X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=5fb648b4350c148a5586615d7cbc9aa3ac2eb96d;p=gbrg%2F.git math: wip 16 bit math Reduced tick rate --- diff --git a/src/actor.s b/src/actor.s index ab27f0f..8a31e56 100644 --- a/src/actor.s +++ b/src/actor.s @@ -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 diff --git a/src/defs.s b/src/defs.s index 7584686..77b46a8 100644 --- a/src/defs.s +++ b/src/defs.s @@ -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 diff --git a/src/math.s b/src/math.s index caec838..524586c 100644 --- a/src/math.s +++ b/src/math.s @@ -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