diff options
| -rw-r--r-- | simon/items.cpp | 2 | ||||
| -rw-r--r-- | simon/simon.cpp | 2 | ||||
| -rw-r--r-- | simon/simon.h | 3 | 
3 files changed, 6 insertions, 1 deletions
| diff --git a/simon/items.cpp b/simon/items.cpp index d9eb7b8c26..68cb5e9cb9 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -277,7 +277,7 @@ int SimonState::runScript()  				for (;;) {  					uint value_2 = value; -					rand_value = rand() & 0x7FFF; +					rand_value = _rnd.getRandomNumber(0xffff) & 0x7FFF;  					if (value == 0)  						error("Invalid random range"); diff --git a/simon/simon.cpp b/simon/simon.cpp index 20bc397ad8..14937caaef 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -4512,6 +4512,8 @@ void SimonState::delay(uint amount)  	uint32 cur = start;  	const uint vga_period = _fast_mode ? 10 : 50; +	_rnd.getRandomNumber(2); +  	do {  		while (!_in_callback && cur >= _last_vga_tick + vga_period) {  			_last_vga_tick += vga_period; diff --git a/simon/simon.h b/simon/simon.h index c73f7e78f1..8942786d35 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -24,6 +24,7 @@  #include <stdio.h>  #include "common/engine.h" +#include "common/util.h"  #include "simon/midi.h"  #include "sound/mixer.h"  #include "simon/sound.h" @@ -779,6 +780,8 @@ public:  	void show_it(void *buf);  	char *gen_savename(int slot); + +	RandomSource _rnd;  }; | 
