mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-22 06:02:28 +01:00
byuu says: A minor WIP to get us started. Changelog: - System::Video merged to PPU::Video - System::Audio merged to DSP::Audio - System::Configuration merged to Interface::Settings - created emulator/emulator.cpp and accompanying object file for shared code between all cores Currently, emulator.cpp just holds a videoColor() function that takes R16G16B16, performs gamma/saturation/luma adjust, and outputs (currently) A8R8G8B8. It's basically an internal function call for cores to use when generating palette entries. This code used to exist inside ui-tomoko/program/interface.cpp, but we have to move it internal for software display emulation. But in the future, we could add other useful cross-core functionality here.
15 lines
293 B
C++
15 lines
293 B
C++
Random random;
|
|
|
|
auto Random::seed(uint seed) -> void {
|
|
iter = seed;
|
|
}
|
|
|
|
auto Random::operator()(uint result) -> uint {
|
|
if(!settings.random) return result;
|
|
return iter = (iter >> 1) ^ (((iter & 1) - 1) & 0xedb88320);
|
|
}
|
|
|
|
auto Random::serialize(serializer& s) -> void {
|
|
s.integer(iter);
|
|
}
|