mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 07:02:27 +01:00
byuu says: Changelog: - fc/controller: added ControllerPort class; removed Peripherals class - md/controller/gamepad: removed X,Y,Z buttons since this isn't a 6-button controller - ms/controller: added ControllerPort class (not used in Game Gear mode); removed Peripherals class - pce/controller: added ControllerPort class; removed Peripherals class - processor/spc700: idle(address) is part of SMP class again, contains flag to detect mov (x)+ edge case - sfc/controller/super-scope,justifier: use CPU frequency instead of hard-coding NTSC frequency - sfc/cpu: move 4x8-bit SMP ports to SMP class - sfc/smp: move APU RAM to DSP class - sfc/smp: improved emulation of TEST registers bits 4-7 [information from nocash] - d4,d5 is RAM wait states (1,2,5,10) - d6,d7 is ROM/IO wait states (1,2,5,10) - sfc/smp: code cleanup to new style (order from lowest to highest bits; use .bit(s) functions) - sfc/smp: $00f8,$00f9 are P4/P5 auxiliary ports; named the registers better
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
struct System {
|
|
enum class Region : uint { NTSCJ, NTSCU, PAL };
|
|
|
|
auto loaded() const -> bool { return information.loaded; }
|
|
auto region() const -> Region { return information.region; }
|
|
auto frequency() const -> double { return information.frequency; }
|
|
|
|
auto run() -> void;
|
|
auto runToSave() -> void;
|
|
|
|
auto load(Emulator::Interface*) -> bool;
|
|
auto save() -> void;
|
|
auto unload() -> void;
|
|
auto power() -> void;
|
|
|
|
auto init() -> void;
|
|
auto term() -> void;
|
|
|
|
//video.cpp
|
|
auto configureVideoPalette() -> void;
|
|
auto configureVideoEffects() -> void;
|
|
|
|
//serialization.cpp
|
|
auto serialize() -> serializer;
|
|
auto unserialize(serializer&) -> bool;
|
|
|
|
auto serialize(serializer&) -> void;
|
|
auto serializeAll(serializer&) -> void;
|
|
auto serializeInit() -> void;
|
|
|
|
private:
|
|
Emulator::Interface* interface = nullptr;
|
|
|
|
struct Information {
|
|
bool loaded = false;
|
|
Region region = Region::NTSCJ;
|
|
double frequency = Emulator::Constants::Colorburst::NTSC * 6.0;
|
|
string manifest;
|
|
} information;
|
|
|
|
uint _serializeSize = 0;
|
|
};
|
|
|
|
extern System system;
|
|
|
|
auto Region::NTSCJ() -> bool { return system.region() == System::Region::NTSCJ; }
|
|
auto Region::NTSCU() -> bool { return system.region() == System::Region::NTSCU; }
|
|
auto Region::PAL() -> bool { return system.region() == System::Region::PAL; }
|