summaryrefslogtreecommitdiff
path: root/engine/random.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2014-05-24 11:44:12 -0700
committeryenatch <yenatch@gmail.com>2014-05-24 11:44:12 -0700
commit7911bc130943392a9aa901139c924aa9658e015f (patch)
tree18e8ab49d3c0db0efa487dea1b83c57d9b5e9511 /engine/random.asm
parent64479cd64205d611a66698f447aa42c16c334b2d (diff)
Rename engine/rng.asm to engine/random.asm.
Diffstat (limited to 'engine/random.asm')
-rwxr-xr-xengine/random.asm13
1 files changed, 13 insertions, 0 deletions
diff --git a/engine/random.asm b/engine/random.asm
new file mode 100755
index 00000000..2fc83f6f
--- /dev/null
+++ b/engine/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