From f275790aec4a796ed969b099364abfdf25385967 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 2 Jul 2020 23:30:21 -0400 Subject: Add subdirectories to engine/ similar to pokecrystal --- engine/math/random.asm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 engine/math/random.asm (limited to 'engine/math/random.asm') diff --git a/engine/math/random.asm b/engine/math/random.asm new file mode 100755 index 00000000..2fc83f6f --- /dev/null +++ b/engine/math/random.asm @@ -0,0 +1,13 @@ +Random_:: +; Generate a random 16-bit value. + ld a, [rDIV] + ld b, a + ld a, [hRandomAdd] + adc b + ld [hRandomAdd], a + ld a, [rDIV] + ld b, a + ld a, [hRandomSub] + sbc b + ld [hRandomSub], a + ret -- cgit v1.3.1-sl0p