mirror of
https://github.com/libretro/bsnes-libretro-cplusplus98.git
synced 2025-04-07 12:41:32 +00:00
Make the random seed controllable
- This allows eliminating random seed differences from savestates (may be useful for some forms of sync stability testing). - Would also allow (re)recording with randomization enabled, as the seed can be set portably).
This commit is contained in:
parent
7b7d2c89ac
commit
b8d8ffb3bf
@ -22,4 +22,8 @@ time_t Interface::currentTime() {
|
|||||||
return time(0);
|
return time(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t Interface::randomSeed() {
|
||||||
|
return time(0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ struct Interface {
|
|||||||
virtual string path(Cartridge::Slot::e slot, const string &hint) = 0;
|
virtual string path(Cartridge::Slot::e slot, const string &hint) = 0;
|
||||||
virtual void message(const string &text);
|
virtual void message(const string &text);
|
||||||
virtual time_t currentTime();
|
virtual time_t currentTime();
|
||||||
|
virtual time_t randomSeed();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Interface *interface;
|
extern Interface *interface;
|
||||||
|
@ -147,7 +147,7 @@ void System::unload() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void System::power() {
|
void System::power() {
|
||||||
random.seed((unsigned)time(0));
|
random.seed((unsigned)interface->randomSeed());
|
||||||
|
|
||||||
region = config.region;
|
region = config.region;
|
||||||
expansion = config.expansion_port;
|
expansion = config.expansion_port;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user