From 051d21bebb7f1cd8da1ef56c567a7fb0edd610f5 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Sun, 19 Sep 2021 17:39:17 +0200 Subject: [PATCH] improved TIA randomization --- src/emucore/tia/TIA.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 75d4ac0b4..cf0b35be8 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -200,13 +200,20 @@ void TIA::reset() initialize(); if(myRandomize) + { for(uInt32 i = 0; i < 0x10000; ++i) { uInt16 address = mySystem->randGenerator().next() & 0x3F; - uInt8 value = mySystem->randGenerator().next(); - poke(address, value); - cycle(2); // process delay queue + if(address <= 0x2F) + { + uInt8 value = mySystem->randGenerator().next(); + + poke(address, value); + cycle(2); // process delay queue + } } + cycle(100); // just to be sure :) + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -