I'm trying to make a function to generate a random number between 1-100 for a PS1 game. Below is the best I've come up with, but it still seem to return patterned value ranges rather than random. Does anyone have a better random generator, or advice on fixing this one?

`lui r2,0x8001 ;Load seed`

lw r2,0x7818(r2)

li r3, 0x41c64e6d ;Processing for quasi-random generation

mult r2,r3

mflo r2

addiu r2,r2,0x3039

lui r3,0x8001 ;store new seed

sw r2,0x7818(r3)

srl r2,r2,0x10 ;More processing

andi r2,r2,0x3FFF ;mask limit to 1023

addiu r3,r0, 11

divu r2,r3 ;divide by 11 for 0-93 max

jr r31

mflo r2