Compare commits

..

2 Commits

Author SHA1 Message Date
Randy Thiemann b387bcebc2 RNG Oopsie 2023-11-07 04:51:54 +01:00
Randy Thiemann 43dce57a20 Brighten gold. 2023-11-07 04:51:35 +01:00
6 changed files with 296 additions and 291 deletions

Binary file not shown.

View File

@ -274,171 +274,172 @@ ROM0 bank #0:
$2394 = SFXPlay.getRegister $2394 = SFXPlay.getRegister
$239e = !26 $239e = !26
$23a8 = SFXPlay.savePlayhead $23a8 = SFXPlay.savePlayhead
SECTION: $23b1-$259e ($01ee bytes) ["RNG Functions"] SECTION: $23b1-$25a5 ($01f5 bytes) ["RNG Functions"]
$23b1 = RNGInit $23b1 = HarvestEntropy
$23e1 = !0 $23b2 = RNGInit
$23fc = RNGInit.complexinit $23e8 = !0
$2413 = !1 $2403 = RNGInit.complexinit
$242d = ShiftHistory $241a = !1
$244a = GetNextHellPiece $2434 = ShiftHistory
$244f = GetNextTGM1Piece $2451 = GetNextHellPiece
$2452 = !2 $2456 = GetNextTGM1Piece
$246a = !3 $2459 = !2
$246c = GetNextTGM2Piece $2471 = !3
$246f = !4 $2473 = GetNextTGM2Piece
$2487 = !5 $2476 = !4
$2489 = GetNextNesPiece $248e = !5
$2497 = GetNextTGM3Piece $2490 = GetNextNesPiece
$249a = !6 $249e = GetNextTGM3Piece
$24bd = !7 $24a1 = !6
$24c0 = !8 $24c4 = !7
$24d0 = !9 $24c7 = !8
$24da = !10 $24d7 = !9
$24e8 = !11 $24e1 = !10
$24f7 = !12 $24ef = !11
$2503 = !13 $24fe = !12
$250f = !14 $250a = !13
$251b = !15 $2516 = !14
$2527 = !16 $2522 = !15
$2533 = !17 $252e = !16
$253f = !18 $253a = !17
$254e = GetNextPiece $2546 = !18
$255c = GetNextPiece.nextpiecejumps $2555 = GetNextPiece
$256b = Next35Piece $2563 = GetNextPiece.nextpiecejumps
$256b = !19 $2572 = Next35Piece
$2575 = Next7Piece $2572 = !19
$2575 = !20 $257c = Next7Piece
$257f = NextByte $257c = !20
SECTION: $259f-$2741 ($01a3 bytes) ["Level Functions"] $2586 = NextByte
$259f = LevelInit SECTION: $25a6-$2748 ($01a3 bytes) ["Level Functions"]
$25ef = LevelUp $25a6 = LevelInit
$2613 = LevelUp.doit $25f6 = LevelUp
$2657 = LevelUp.checknlevel $261a = LevelUp.doit
$2685 = !0 $265e = LevelUp.checknlevel
$269d = !1 $268c = !0
$26a6 = LevelUp.bellmaybe $26a4 = !1
$26b8 = LevelUp.leveljinglemaybe $26ad = LevelUp.bellmaybe
$26c5 = LevelUp.checkspeedup $26bf = LevelUp.leveljinglemaybe
$26d6 = !2 $26cc = LevelUp.checkspeedup
$26e3 = !3 $26dd = !2
$26f4 = !4 $26ea = !3
$2701 = DoSpeedUp $26fb = !4
SECTION: $2742-$288b ($014a bytes) ["Progress Data"] $2708 = DoSpeedUp
$2742 = sProgressData SECTION: $2749-$2892 ($014a bytes) ["Progress Data"]
SECTION: $288c-$296b ($00e0 bytes) ["Score Functions"] $2749 = sProgressData
$288c = ScoreInit SECTION: $2893-$2972 ($00e0 bytes) ["Score Functions"]
$28b4 = IncreaseScore $2893 = ScoreInit
$28ec = IncreaseScore.doConvert $28bb = IncreaseScore
$28ee = !0 $28f3 = IncreaseScore.doConvert
$2904 = IncreaseScore.carry $28f5 = !0
$2906 = IncreaseScore.postConvert $290b = IncreaseScore.carry
$2913 = !1 $290d = IncreaseScore.postConvert
$291a = IncreaseScore.preAddDigit $291a = !1
$2942 = IncreaseScore.addDigit $2921 = IncreaseScore.preAddDigit
$2958 = IncreaseScore.nextDigit $2949 = IncreaseScore.addDigit
SECTION: $296c-$2a38 ($00cd bytes) ["Input Functions"] $295f = IncreaseScore.nextDigit
$296c = InputInit SECTION: $2973-$2a3f ($00cd bytes) ["Input Functions"]
$297e = GetInput $2973 = InputInit
$297e = GetInput.btns $2985 = GetInput
$298b = GetInput.readA $2985 = GetInput.btns
$298f = GetInput.setA $2992 = GetInput.readA
$299a = GetInput.clearA $2996 = GetInput.setA
$299d = GetInput.readB $29a1 = GetInput.clearA
$29a1 = GetInput.setB $29a4 = GetInput.readB
$29ac = GetInput.clearB $29a8 = GetInput.setB
$29af = GetInput.readSelect $29b3 = GetInput.clearB
$29b3 = GetInput.setSelect $29b6 = GetInput.readSelect
$29be = GetInput.clearSelect $29ba = GetInput.setSelect
$29c1 = GetInput.readStart $29c5 = GetInput.clearSelect
$29c5 = GetInput.setStart $29c8 = GetInput.readStart
$29d0 = GetInput.clearStart $29cc = GetInput.setStart
$29d3 = GetInput.dpad $29d7 = GetInput.clearStart
$29e0 = GetInput.readUp $29da = GetInput.dpad
$29e4 = GetInput.setUp $29e7 = GetInput.readUp
$29ef = GetInput.clearUp $29eb = GetInput.setUp
$29f2 = GetInput.readDown $29f6 = GetInput.clearUp
$29f6 = GetInput.setDown $29f9 = GetInput.readDown
$2a01 = GetInput.clearDown $29fd = GetInput.setDown
$2a04 = GetInput.readLeft $2a08 = GetInput.clearDown
$2a08 = GetInput.setLeft $2a0b = GetInput.readLeft
$2a13 = GetInput.clearLeft $2a0f = GetInput.setLeft
$2a16 = GetInput.readRight $2a1a = GetInput.clearLeft
$2a1a = GetInput.setRight $2a1d = GetInput.readRight
$2a25 = GetInput.clearRight $2a21 = GetInput.setRight
$2a28 = GetInput.priorities $2a2c = GetInput.clearRight
$2a33 = GetInput.zero $2a2f = GetInput.priorities
SECTION: $2a39-$2aef ($00b7 bytes) ["SRAM Functions"] $2a3a = GetInput.zero
$2a39 = RestoreSRAM SECTION: $2a40-$2af6 ($00b7 bytes) ["SRAM Functions"]
$2a92 = InitializeSRAM $2a40 = RestoreSRAM
SECTION: $2af0-$2ba1 ($00b2 bytes) ["Progress Functions"] $2a99 = InitializeSRAM
$2af0 = SetProgress SECTION: $2af7-$2ba8 ($00b2 bytes) ["Progress Functions"]
$2afb = SetProgress.loop $2af7 = SetProgress
$2aff = SetProgress.correct $2b02 = SetProgress.loop
$2b26 = SetProgress.wvr_u1 $2b06 = SetProgress.correct
$2b32 = SetProgress.wvr_u2 $2b2d = SetProgress.wvr_u1
$2b40 = SetProgress.wvr_u3 $2b39 = SetProgress.wvr_u2
$2b4c = SetProgress.wvr_u4 $2b47 = SetProgress.wvr_u3
$2b5a = SetProgress.wvr_u5 $2b53 = SetProgress.wvr_u4
$2b66 = SetProgress.wvr_u6 $2b61 = SetProgress.wvr_u5
$2b74 = SetProgress.wvr_u7 $2b6d = SetProgress.wvr_u6
$2b80 = SetProgress.wvr_u8 $2b7b = SetProgress.wvr_u7
$2b8e = SetProgress.wvr_u9 $2b87 = SetProgress.wvr_u8
$2b9a = SetProgress.wvr_u10 $2b95 = SetProgress.wvr_u9
SECTION: $2ba2-$2c45 ($00a4 bytes) ["Code Entry Point"] $2ba1 = SetProgress.wvr_u10
$2ba2 = Main SECTION: $2ba9-$2c4c ($00a4 bytes) ["Code Entry Point"]
$2bb7 = Main.wvr_u1 $2ba9 = Main
$2bc0 = !0 $2bbe = Main.wvr_u1
$2bd0 = Main.notgbc $2bc7 = !0
$2bff = Main.wvb_u2 $2bd7 = Main.notgbc
$2c04 = !1 $2c06 = Main.wvb_u2
$2c0a = EventLoop $2c0b = !1
$2c20 = EventLoop.eventloopjumps $2c11 = EventLoop
$2c29 = EventLoopPostHandler $2c27 = EventLoop.eventloopjumps
$2c2b = EventLoopPostHandler.wvb_u3 $2c30 = EventLoopPostHandler
$2c3d = EventLoopPostHandler.vblankjumps $2c32 = EventLoopPostHandler.wvb_u3
SECTION: $2c46-$2ccd ($0088 bytes) ["Time Functions"] $2c44 = EventLoopPostHandler.vblankjumps
$2c46 = TimeInit SECTION: $2c4d-$2cd4 ($0088 bytes) ["Time Functions"]
$2c5b = ResetGameTime $2c4d = TimeInit
$2c66 = CheckTorikan $2c62 = ResetGameTime
$2c7d = CheckTorikan.failure $2c6d = CheckTorikan
$2c7f = CheckTorikan.success $2c84 = CheckTorikan.failure
$2c82 = HandleTimers $2c86 = CheckTorikan.success
$2caa = HandleTimers.go $2c89 = HandleTimers
SECTION: $2cce-$2d3b ($006e bytes) ["Title Function Trampolines"] $2cb1 = HandleTimers.go
$2cce = SwitchToTitle SECTION: $2cd5-$2d42 ($006e bytes) ["Title Function Trampolines"]
$2cd8 = TitleEventLoopHandler $2cd5 = SwitchToTitle
$2ce2 = TitleVBlankHandler $2cdf = TitleEventLoopHandler
$2cec = DrawOption6 $2ce9 = TitleVBlankHandler
SECTION: $2d3c-$2d8d ($0052 bytes) ["Tile Functions"] $2cf3 = DrawOption6
$2d3c = LoadTitleTiles SECTION: $2d43-$2d94 ($0052 bytes) ["Tile Functions"]
$2d5a = LoadGameplayTiles $2d43 = LoadTitleTiles
$2d70 = LoadGameplayTiles.gbc $2d61 = LoadGameplayTiles
$2d7f = LoadGameplayTiles.dmg $2d77 = LoadGameplayTiles.gbc
SECTION: $2d8e-$2dc9 ($003c bytes) ["Time Data"] $2d86 = LoadGameplayTiles.dmg
$2d8e = sFramesToCS SECTION: $2d95-$2dd0 ($003c bytes) ["Time Data"]
SECTION: $2dca-$2df7 ($002e bytes) ["Memory Functions"] $2d95 = sFramesToCS
$2dca = UnsafeMemCopy SECTION: $2dd1-$2dfe ($002e bytes) ["Memory Functions"]
$2dd3 = SafeMemCopy.wvr_u1 $2dd1 = UnsafeMemCopy
$2dd3 = SafeMemCopy $2dda = SafeMemCopy.wvr_u1
$2de2 = UnsafeMemSet $2dda = SafeMemCopy
$2dea = SafeMemSet $2de9 = UnsafeMemSet
$2dea = SafeMemSet.wvr_u2 $2df1 = SafeMemSet
SECTION: $2df8-$2e1f ($0028 bytes) ["Gameplay Function Trampolines"] $2df1 = SafeMemSet.wvr_u2
$2df8 = SwitchToGameplay SECTION: $2dff-$2e26 ($0028 bytes) ["Gameplay Function Trampolines"]
$2e02 = SwitchToGameplayBig $2dff = SwitchToGameplay
$2e0c = GamePlayEventLoopHandler $2e09 = SwitchToGameplayBig
$2e16 = GamePlayBigEventLoopHandler $2e13 = GamePlayEventLoopHandler
SECTION: $2e20-$2e41 ($0022 bytes) ["OAM Functions"] $2e1d = GamePlayBigEventLoopHandler
$2e20 = CopyOAMHandler SECTION: $2e27-$2e48 ($0022 bytes) ["OAM Functions"]
$2e2c = ClearOAM $2e27 = CopyOAMHandler
SECTION: $2e42-$2e5a ($0019 bytes) ["Interrupt Initialization Functions"] $2e33 = ClearOAM
$2e42 = IntrInit SECTION: $2e49-$2e61 ($0019 bytes) ["Interrupt Initialization Functions"]
$2e46 = InitializeLCDCInterrupt $2e49 = IntrInit
SECTION: $2e5b-$2e64 ($000a bytes) ["OAM DMA Code"] $2e4d = InitializeLCDCInterrupt
$2e5b = OAMDMA SECTION: $2e62-$2e6b ($000a bytes) ["OAM DMA Code"]
$2e65 = OAMDMAEnd $2e62 = OAMDMA
EMPTY: $2e65-$3fff ($119b bytes) $2e6c = OAMDMAEnd
TOTAL EMPTY: $11a6 bytes EMPTY: $2e6c-$3fff ($1194 bytes)
TOTAL EMPTY: $119f bytes
ROMX bank #1: ROMX bank #1:
SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"] SECTION: $4000-$4007 ($0008 bytes) ["Bank ID BANK_OTHER"]
@ -2463,7 +2464,7 @@ HRAM bank #0:
TOTAL EMPTY: $0003 bytes TOTAL EMPTY: $0003 bytes
SUMMARY: SUMMARY:
ROM0: 11866 bytes used / 4518 free ROM0: 11873 bytes used / 4511 free
ROMX: 56523 bytes used / 41781 free in 6 banks ROMX: 56523 bytes used / 41781 free in 6 banks
SRAM: 14 bytes used / 8178 free in 1 bank SRAM: 14 bytes used / 8178 free in 1 bank
WRAM0: 3515 bytes used / 581 free WRAM0: 3515 bytes used / 581 free

Binary file not shown.

View File

@ -209,122 +209,123 @@
00:2388 SFXPlay.play 00:2388 SFXPlay.play
00:2394 SFXPlay.getRegister 00:2394 SFXPlay.getRegister
00:23a8 SFXPlay.savePlayhead 00:23a8 SFXPlay.savePlayhead
00:23b1 RNGInit 00:23b1 HarvestEntropy
00:23fc RNGInit.complexinit 00:23b2 RNGInit
00:242d ShiftHistory 00:2403 RNGInit.complexinit
00:244a GetNextHellPiece 00:2434 ShiftHistory
00:244f GetNextTGM1Piece 00:2451 GetNextHellPiece
00:246c GetNextTGM2Piece 00:2456 GetNextTGM1Piece
00:2489 GetNextNesPiece 00:2473 GetNextTGM2Piece
00:2497 GetNextTGM3Piece 00:2490 GetNextNesPiece
00:254e GetNextPiece 00:249e GetNextTGM3Piece
00:255c GetNextPiece.nextpiecejumps 00:2555 GetNextPiece
00:256b Next35Piece 00:2563 GetNextPiece.nextpiecejumps
00:2575 Next7Piece 00:2572 Next35Piece
00:257f NextByte 00:257c Next7Piece
00:259f LevelInit 00:2586 NextByte
00:25ef LevelUp 00:25a6 LevelInit
00:2613 LevelUp.doit 00:25f6 LevelUp
00:2657 LevelUp.checknlevel 00:261a LevelUp.doit
00:26a6 LevelUp.bellmaybe 00:265e LevelUp.checknlevel
00:26b8 LevelUp.leveljinglemaybe 00:26ad LevelUp.bellmaybe
00:26c5 LevelUp.checkspeedup 00:26bf LevelUp.leveljinglemaybe
00:2701 DoSpeedUp 00:26cc LevelUp.checkspeedup
00:2742 sProgressData 00:2708 DoSpeedUp
00:288c ScoreInit 00:2749 sProgressData
00:28b4 IncreaseScore 00:2893 ScoreInit
00:28ec IncreaseScore.doConvert 00:28bb IncreaseScore
00:2904 IncreaseScore.carry 00:28f3 IncreaseScore.doConvert
00:2906 IncreaseScore.postConvert 00:290b IncreaseScore.carry
00:291a IncreaseScore.preAddDigit 00:290d IncreaseScore.postConvert
00:2942 IncreaseScore.addDigit 00:2921 IncreaseScore.preAddDigit
00:2958 IncreaseScore.nextDigit 00:2949 IncreaseScore.addDigit
00:296c InputInit 00:295f IncreaseScore.nextDigit
00:297e GetInput 00:2973 InputInit
00:297e GetInput.btns 00:2985 GetInput
00:298b GetInput.readA 00:2985 GetInput.btns
00:298f GetInput.setA 00:2992 GetInput.readA
00:299a GetInput.clearA 00:2996 GetInput.setA
00:299d GetInput.readB 00:29a1 GetInput.clearA
00:29a1 GetInput.setB 00:29a4 GetInput.readB
00:29ac GetInput.clearB 00:29a8 GetInput.setB
00:29af GetInput.readSelect 00:29b3 GetInput.clearB
00:29b3 GetInput.setSelect 00:29b6 GetInput.readSelect
00:29be GetInput.clearSelect 00:29ba GetInput.setSelect
00:29c1 GetInput.readStart 00:29c5 GetInput.clearSelect
00:29c5 GetInput.setStart 00:29c8 GetInput.readStart
00:29d0 GetInput.clearStart 00:29cc GetInput.setStart
00:29d3 GetInput.dpad 00:29d7 GetInput.clearStart
00:29e0 GetInput.readUp 00:29da GetInput.dpad
00:29e4 GetInput.setUp 00:29e7 GetInput.readUp
00:29ef GetInput.clearUp 00:29eb GetInput.setUp
00:29f2 GetInput.readDown 00:29f6 GetInput.clearUp
00:29f6 GetInput.setDown 00:29f9 GetInput.readDown
00:2a01 GetInput.clearDown 00:29fd GetInput.setDown
00:2a04 GetInput.readLeft 00:2a08 GetInput.clearDown
00:2a08 GetInput.setLeft 00:2a0b GetInput.readLeft
00:2a13 GetInput.clearLeft 00:2a0f GetInput.setLeft
00:2a16 GetInput.readRight 00:2a1a GetInput.clearLeft
00:2a1a GetInput.setRight 00:2a1d GetInput.readRight
00:2a25 GetInput.clearRight 00:2a21 GetInput.setRight
00:2a28 GetInput.priorities 00:2a2c GetInput.clearRight
00:2a33 GetInput.zero 00:2a2f GetInput.priorities
00:2a39 RestoreSRAM 00:2a3a GetInput.zero
00:2a92 InitializeSRAM 00:2a40 RestoreSRAM
00:2af0 SetProgress 00:2a99 InitializeSRAM
00:2afb SetProgress.loop 00:2af7 SetProgress
00:2aff SetProgress.correct 00:2b02 SetProgress.loop
00:2b26 SetProgress.wvr_u1 00:2b06 SetProgress.correct
00:2b32 SetProgress.wvr_u2 00:2b2d SetProgress.wvr_u1
00:2b40 SetProgress.wvr_u3 00:2b39 SetProgress.wvr_u2
00:2b4c SetProgress.wvr_u4 00:2b47 SetProgress.wvr_u3
00:2b5a SetProgress.wvr_u5 00:2b53 SetProgress.wvr_u4
00:2b66 SetProgress.wvr_u6 00:2b61 SetProgress.wvr_u5
00:2b74 SetProgress.wvr_u7 00:2b6d SetProgress.wvr_u6
00:2b80 SetProgress.wvr_u8 00:2b7b SetProgress.wvr_u7
00:2b8e SetProgress.wvr_u9 00:2b87 SetProgress.wvr_u8
00:2b9a SetProgress.wvr_u10 00:2b95 SetProgress.wvr_u9
00:2ba2 Main 00:2ba1 SetProgress.wvr_u10
00:2bb7 Main.wvr_u1 00:2ba9 Main
00:2bd0 Main.notgbc 00:2bbe Main.wvr_u1
00:2bff Main.wvb_u2 00:2bd7 Main.notgbc
00:2c0a EventLoop 00:2c06 Main.wvb_u2
00:2c20 EventLoop.eventloopjumps 00:2c11 EventLoop
00:2c29 EventLoopPostHandler 00:2c27 EventLoop.eventloopjumps
00:2c2b EventLoopPostHandler.wvb_u3 00:2c30 EventLoopPostHandler
00:2c3d EventLoopPostHandler.vblankjumps 00:2c32 EventLoopPostHandler.wvb_u3
00:2c46 TimeInit 00:2c44 EventLoopPostHandler.vblankjumps
00:2c5b ResetGameTime 00:2c4d TimeInit
00:2c66 CheckTorikan 00:2c62 ResetGameTime
00:2c7d CheckTorikan.failure 00:2c6d CheckTorikan
00:2c7f CheckTorikan.success 00:2c84 CheckTorikan.failure
00:2c82 HandleTimers 00:2c86 CheckTorikan.success
00:2caa HandleTimers.go 00:2c89 HandleTimers
00:2cce SwitchToTitle 00:2cb1 HandleTimers.go
00:2cd8 TitleEventLoopHandler 00:2cd5 SwitchToTitle
00:2ce2 TitleVBlankHandler 00:2cdf TitleEventLoopHandler
00:2cec DrawOption6 00:2ce9 TitleVBlankHandler
00:2d3c LoadTitleTiles 00:2cf3 DrawOption6
00:2d5a LoadGameplayTiles 00:2d43 LoadTitleTiles
00:2d70 LoadGameplayTiles.gbc 00:2d61 LoadGameplayTiles
00:2d7f LoadGameplayTiles.dmg 00:2d77 LoadGameplayTiles.gbc
00:2d8e sFramesToCS 00:2d86 LoadGameplayTiles.dmg
00:2dca UnsafeMemCopy 00:2d95 sFramesToCS
00:2dd3 SafeMemCopy.wvr_u1 00:2dd1 UnsafeMemCopy
00:2dd3 SafeMemCopy 00:2dda SafeMemCopy.wvr_u1
00:2de2 UnsafeMemSet 00:2dda SafeMemCopy
00:2dea SafeMemSet 00:2de9 UnsafeMemSet
00:2dea SafeMemSet.wvr_u2 00:2df1 SafeMemSet
00:2df8 SwitchToGameplay 00:2df1 SafeMemSet.wvr_u2
00:2e02 SwitchToGameplayBig 00:2dff SwitchToGameplay
00:2e0c GamePlayEventLoopHandler 00:2e09 SwitchToGameplayBig
00:2e16 GamePlayBigEventLoopHandler 00:2e13 GamePlayEventLoopHandler
00:2e20 CopyOAMHandler 00:2e1d GamePlayBigEventLoopHandler
00:2e2c ClearOAM 00:2e27 CopyOAMHandler
00:2e42 IntrInit 00:2e33 ClearOAM
00:2e46 InitializeLCDCInterrupt 00:2e49 IntrInit
00:2e5b OAMDMA 00:2e4d InitializeLCDCInterrupt
00:2e65 OAMDMAEnd 00:2e62 OAMDMA
00:2e6c OAMDMAEnd
01:4008 sDMGTSpeedCurve 01:4008 sDMGTSpeedCurve
01:4210 sDMGTSpeedCurveEnd 01:4210 sDMGTSpeedCurveEnd
01:4212 sTGM1SpeedCurve 01:4212 sTGM1SpeedCurve

View File

@ -72,7 +72,7 @@ INCLUDE "globals.asm"
; Field colors ; Field colors
DEF_RGB555_FROM24 BLACK_F, $20, $20, $20 DEF_RGB555_FROM24 BLACK_F, $20, $20, $20
DEF_RGB555_FROM24 GOLD_0, $36, $2C, $05 DEF_RGB555_FROM24 GOLD_0, $36, $2C, $05
DEF_RGB555_FROM24 GOLD_1, $5B, $4A, $08 DEF_RGB555_FROM24 GOLD_1, $99, $73, $16
SECTION "GBC Shadow Tilemap", WRAM0, ALIGN[8] SECTION "GBC Shadow Tilemap", WRAM0, ALIGN[8]

View File

@ -38,22 +38,25 @@ wTGM3WorstDroughtIdx: ds 1
section "RNG Functions", ROM0 section "RNG Functions", ROM0
HarvestEntropy::
ret
; Snapshots the initial seed for a game, then initializes the history and piece queue. ; Snapshots the initial seed for a game, then initializes the history and piece queue.
RNGInit:: RNGInit::
; Do some bit fuckery on the seed using the gameboy's free-running timers. ; Do some bit fuckery on the seed using the gameboy's free-running timers.
ldh a, [rDIV] ld hl, rDIV
ldh a, [hRNGSeed]
xor a, [hl] xor a, [hl]
ldh [hRNGSeed], a ldh [hRNGSeed], a
ldh a, [hRNGSeed+2]
ldh a, [rTIMA]
xor a, [hl]
ldh [hRNGSeed+1], a
ldh a, [rDIV]
xor a, [hl] xor a, [hl]
ldh [hRNGSeed+2], a ldh [hRNGSeed+2], a
ldh a, [rTIMA] ld hl, rTIMA
ldh a, [hRNGSeed+1]
xor a, [hl]
ldh [hRNGSeed+1], a
ldh a, [hRNGSeed+3]
xor a, [hl] xor a, [hl]
ldh [hRNGSeed+3], a ldh [hRNGSeed+3], a