aboutsummaryrefslogtreecommitdiff
path: root/rng.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-08-22 18:17:04 +0900
committerAstatin <astatin@redacted>2024-08-22 18:17:04 +0900
commitf0d9de7afa943ebd41c1b202690b2ab3e387f708 (patch)
treeffd085c9a6182b67ef44a506a2728057f72f5d12 /rng.gbasm
parent358e97cc2628d4617543d20d2c40111699f067d6 (diff)
Stored the rooms + spawn the bunny at the top left (sometimes) of the room
Diffstat (limited to 'rng.gbasm')
-rw-r--r--rng.gbasm15
1 files changed, 14 insertions, 1 deletions
diff --git a/rng.gbasm b/rng.gbasm
index 38de99f..5a45286 100644
--- a/rng.gbasm
+++ b/rng.gbasm
@@ -7,7 +7,7 @@ Debug_RNG:
RET
Initialize_RNG:
- LD A, $43
+ LD A, $0c
LD $mem_rng_state_1, A
LD A, $15
LD $mem_rng_state_2, A
@@ -67,4 +67,17 @@ RNG_Step:
POP BC
RET
+RNG_Bound: ; generate a number where 0 < new_A <= Old A
+ PUSH BC
+ PUSH DE
+
+ LD B, A
+ CALL =RNG_Step
+ LD C, A
+ CALL =MUL
+ LD A, E
+
+ POP DE
+ POP BC
+ RET