The RNG in munchie attack looks to be an LFSR, though the taps don't look to be quite optimal - it feeds D24 ^ D28 into D0, which repeats after a varying number of iterations.
An optimal 29-bit LFSR repeats after 536,870,911 bits. Depending on the initial value, the Munchie LFSR would repeat after 398,532,477 bits, 132,844,159 bits, or possibly less than 5,494,274 bits for truly suboptimal inputs.
A few minor adjustments would easily transform this LFSR into a 31-bit one of optimal length (2,147,483,647 bits):
Code:
lda random4 ; random bit generator
rol ; written by kevtis
rol ; uses user input from joystick for initial values
rol
rol
eor random4 ; this will XOR two bits together and put the answer in bit 7 of the acc
rol ; this puts the answer into the carry
Remove 1 ROL from the upper half, and add 3 to the bottom half:
Code:
lda random4 ; random bit generator
rol ; written by kevtis
rol ; uses user input from joystick for initial values
rol
eor random4 ; this will XOR two bits together
rol
rol
rol ; and put the answer in bit 7 of the acc
rol ; this puts the answer into the carry