diff options
author | yenatch <yenatch@gmail.com> | 2014-05-24 11:44:12 -0700 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2014-05-24 11:44:12 -0700 |
commit | 7911bc130943392a9aa901139c924aa9658e015f (patch) | |
tree | 18e8ab49d3c0db0efa487dea1b83c57d9b5e9511 /engine/random.asm | |
parent | 64479cd64205d611a66698f447aa42c16c334b2d (diff) |
Rename engine/rng.asm to engine/random.asm.
Diffstat (limited to 'engine/random.asm')
-rwxr-xr-x | engine/random.asm | 13 |
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 |