And this article describes a simplified version of the NES Tetris randomiser. The actual one is barely distinguishable from the described one, but is technically a bit biased[0]. I made a small script to compare randomiser probabilities a couple of months ago[1], in which I wrote a vaguely readable version of the NES randomiser.