mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-08-15 05:27:32 +00:00
better random
This commit is contained in:
@@ -723,11 +723,14 @@ static void c_initialize_firsttime()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void c_read_random() {
|
void c_read_random() {
|
||||||
random_value = (unsigned char)(rand() >> 8);
|
static unsigned int seed=0;
|
||||||
|
if (!seed) {
|
||||||
|
seed = time(NULL);
|
||||||
|
}
|
||||||
|
random_value = (unsigned char)rand_r(&seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_thread(void *dummyptr) {
|
static void cpu_thread(void *dummyptr) {
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
cpu65_run();
|
cpu65_run();
|
||||||
|
Reference in New Issue
Block a user