I get how the ranged RNG works, because integer always truncate the value towards 0, add the fact that at user-defined max, (255*x)/256, would never land exactly at max (say 256), since it exploits the round-down. For example: a maximum of 4 would be (255*5)/256 gives 4.98046875, which truncates to 4, which is the intended maximum. The maximum in a fixed number of bits is 2n-1, while loading the higher bit/word (which is the same as LSR 8 or 16 times) divide by exactly 2n without the -1. The maximum and the division is really close to each other, therefore doing minimal impact to the result compare to my broken one.
Seems okay, however I made some modifications, namely changed ORA to AND, which should allow for lower ranges in some occassions too. Functionality wise it's okay and allows for making manipulation harder, however the only reason this is better than SMW's is because you'll still get a random value even when you enter a new level (the random seeds still get cleared in level load, but by using the latch/HV counters this really has no effect).
Oh, thanks for telling me that, I often don't look at the already filled entries. The custom range now works with SA-1. If you look in the sa-1 patch, there are multiplication registers you can replace the ppu.