From 64479cd64205d611a66698f447aa42c16c334b2d Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 24 May 2014 11:40:38 -0700 Subject: Rename random number function and hram labels. GenRandom -> Random GenRandomInBattle -> BattleRandom H_RAND1 -> hRandomAdd H_RAND2 -> hRandomSub --- engine/rng.asm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engine/rng.asm') diff --git a/engine/rng.asm b/engine/rng.asm index a0e0daa7..2fc83f6f 100755 --- a/engine/rng.asm +++ b/engine/rng.asm @@ -1,13 +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] +Random_:: +; Generate a random 16-bit value. + ld a, [rDIV] + ld b, a + ld a, [hRandomAdd] adc b - ld [H_RAND1],a - ld a,[rDIV] - ld b,a - ld a,[H_RAND2] + ld [hRandomAdd], a + ld a, [rDIV] + ld b, a + ld a, [hRandomSub] sbc b - ld [H_RAND2],a + ld [hRandomSub], a ret -- cgit v1.3.1-sl0p From 7911bc130943392a9aa901139c924aa9658e015f Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 24 May 2014 11:44:12 -0700 Subject: Rename engine/rng.asm to engine/random.asm. --- engine/random.asm | 13 +++++++++++++ engine/rng.asm | 13 ------------- main.asm | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100755 engine/random.asm delete mode 100755 engine/rng.asm (limited to 'engine/rng.asm') 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 diff --git a/engine/rng.asm b/engine/rng.asm deleted file mode 100755 index 2fc83f6f..00000000 --- a/engine/rng.asm +++ /dev/null @@ -1,13 +0,0 @@ -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 diff --git a/main.asm b/main.asm index af60fe1b..e7f888c5 100755 --- a/main.asm +++ b/main.asm @@ -15982,7 +15982,7 @@ INCLUDE "engine/items/tms.asm" INCLUDE "engine/battle/4_2.asm" -INCLUDE "engine/rng.asm" +INCLUDE "engine/random.asm" SECTION "bank5",ROMX,BANK[$5] -- cgit v1.3.1-sl0p