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
li r3, 0x41c64e6d ;Processing for quasi-random generation
lui r3,0x8001 ;store new seed
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