I got some time to look at this game, and the RNG address is at 0xC4468
It follows the default PSX RNG formula:
NextRN = (CurrentRN * 0x41C64E6D + 0x3039) mod 0x100000000
If you want to know how many RNs were used since the beginning, you can use this script:
local RNG = {}
local i, j
local MAXLIM
local CUR_RN
local a, b, c
RNG = {0} --First RN value
local MAXLIM = 10000 --Number of RNs to calculate
for j=2, MAXLIM do
-- RNG[j] = (0x3039 + 0x41C64E6D*RNG[j-1]) % 0X100000000
-- Very convoluted way to calculate the next RN without any big number rounding issue
-- 0x41C64E6D = 1103515245
a = (0000005245*RNG[j-1]) % 0X100000000
b = (0003510000*RNG[j-1]) % 0X100000000
c = (0010000000*RNG[j-1]) % 0X100000000
c = c * 110
RNG[j] = (0x3039 + a + b + c) % 0X100000000
end
local BASE = RNG[1]
local INDEX = 1
while true do
CUR_RN = memory.read_u32_le(0xC4468)
if BASE~=CUR_RN then
for i=math.max(INDEX-100, 1), INDEX+100 do
if RNG[i]==CUR_RN then
INDEX = i
BASE = CUR_RN
break
end
end
end
if BASE~=CUR_RN then
for i=1, MAXLIM do
if RNG[i]==CUR_RN then
INDEX = i
BASE = CUR_RN
break
end
dummy = i
end
end
gui.text(0, 100, "RNG")
gui.text(0, 120, "#" .. string.format("%07d", INDEX))
emu.frameadvance()
end