Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mdword=memory.readdwordunsigned
- rshift=bit.rshift
- function next(s)
- local a=0x41C6*(s%65536)+rshift(s,16)*0x4E6D
- local b=0x4E6D*(s%65536)+(a%65536)*65536+0x6073
- local c=b%4294967296
- return c
- end
- function refresh()
- currseed = mdword(0x021BFB14)
- seed = mdword(0x021BFB18)
- initial = mdword(0x021BFB18)
- frame = 1
- end
- frame = 1
- seed = mdword(0x021BFB18)
- initial = mdword(0x021BFB18)
- while true do
- currseed = mdword(0x021BFB14)
- -- Detect initial seeding
- if mdword(0x021BFB18) == currseed then
- if currseed ~= 0x00000000 then
- refresh()
- end
- end
- -- Reset variables on game reset
- if seed == 0 then
- frame = 1
- refresh()
- end
- -- IRNG Frame Counter
- if mdword(0x02100834) >= 624 then
- iframe = 0
- else
- iframe = mdword(0x02100834)
- end
- -- Print variables in corner of bottom screen
- gui.text(0,180,string.format("Initial Seed: %08X", seed))
- gui.text(0,170,string.format("Current Seed: %08X", currseed))
- gui.text(0,160,string.format("IRNG Frame: %d", iframe))
- -- PRNG Frame Counting
- if currseed ~= initial then
- if currseed ~= 0x00000000 then
- while initial ~= currseed do
- initial = next(initial)
- frame = frame+1
- end
- end
- end
- gui.text(0,150,string.format("PRNG Frame: %d", frame))
- gui.text(0,140,string.format("Delay: %d", mdword(0x021BF6A8)+1))
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement