diff options
author | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2014-05-22 18:13:20 -0400 |
---|---|---|
committer | U-Fish-PC\Daniel <corrnondacqb@yahoo.com> | 2014-05-22 18:13:20 -0400 |
commit | 15427f532085846ab6b51719be687951a094cb6c (patch) | |
tree | edea9b189e91641a12dd521756894df84aeeace7 /engine/rng.asm | |
parent | ea3ba4cde3706b7c77efb705555ec0c86321cbe2 (diff) |
Pull a lot of engine out of main.asm
Diffstat (limited to 'engine/rng.asm')
-rwxr-xr-x | engine/rng.asm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/engine/rng.asm b/engine/rng.asm new file mode 100755 index 00000000..a0e0daa7 --- /dev/null +++ b/engine/rng.asm @@ -0,0 +1,13 @@ +GenRandom_: ; 13a8f (4:7a8f) +; generate a random 16-bit integer and store it at $FFD3,$FFD4 + ld a,[rDIV] + ld b,a + ld a,[H_RAND1] + adc b + ld [H_RAND1],a + ld a,[rDIV] + ld b,a + ld a,[H_RAND2] + sbc b + ld [H_RAND2],a + ret |