data/claims/tengen-tetris.yamlTetris (NES, Tengen) (zohassadar/TengenTetrisDisasm)
Game: Tetris (NES, Tengen).
getNextTetromino steps the player's 16-bit generator five times and keeps the low three bits, trying again only when they are 0; the result, 1 to 7, is the next piece, with no check against the piece before. tengen-tetris/randomizer
About: Tetris (NES, Tengen) Piece randomizer
Value: 7
CodeTengen NES Tetris Disassembly ·main.asm#L3693-L3705lda player1TetrominoNext,x … sta player1TetrominoCurrent,x … adc #player1RNGSeed … jsr genNextPseudoRandom5x … and #$07 … beq @loopUntilNotZero … sta player1TetrominoNext,xTengen NES Tetris Disassembly · main.asm#L3805-L3832genNextPseudoRandom5x: … jsr genNextPseudoRandom … genNextPseudoRandom: … eor ppuMask,x … rol ppuControl,x … rol ppuMask,xChecked by claude, 2026-10-21 — read getNextTetromino and genNextPseudoRandom at the pinned commit; X points at the player's two seed bytes, so ppuControl,x and ppuMask,x are those bytesWhether the five-step pick is uniform over 1 to 7 hasn't been worked out or measured.
Cited by: Piece randomizer, Tetris (NES, Tengen)
At the start of a game both players' generators are loaded with the same seed, and only getNextTetromino steps them, so in a two-player game both players get the same sequence of pieces. The shared seed itself is stepped on every pass of the main loop before the game. tengen-tetris/same-sequence
About: Tetris (NES, Tengen) Piece randomizer
CodeTengen NES Tetris Disassembly ·main.asm#L3319-L3326lda rngSeed … sta player1RNGSeed … sta player2RNGSeed … lda rngSeed+1 … sta player1RNGSeed+1 … sta player2RNGSeed+1Tengen NES Tetris Disassembly · main.asm#L48-L50mainLoop: … ldx #rngSeed … jsr genNextPseudoRandomChecked by claude, 2026-10-21 — read the seed copy and every genNextPseudoRandom call site at the pinned commit; the others load X with rngSeed ($34), and only getNextTetromino indexes the player seedsCited by: Piece randomizer, Tetris (NES, Tengen)