Skip to content

Commit

Permalink
Putting state block loading into the common emulator class
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMartin86 committed May 23, 2024
1 parent ba188c2 commit 0defd7c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 24 deletions.
4 changes: 0 additions & 4 deletions emulators/quickerGPGX/quickerGPGX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class QuickerGPGX final : public Emulator
QuickerGPGX(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting initial state file from the configuration
_initialStateFilePath = jaffarCommon::json::getString(config, "Initial State File Path");

Expand Down
4 changes: 0 additions & 4 deletions emulators/quickerNES/quickerNES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class QuickerNES final : public Emulator
QuickerNES(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting initial state file from the configuration
_initialStateFilePath = jaffarCommon::json::getString(config, "Initial State File Path");

Expand Down
4 changes: 0 additions & 4 deletions emulators/quickerRAW/quickerRAW.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class QuickerRAW final : public Emulator
QuickerRAW(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting initial state file from the configuration
_initialStateFilePath = jaffarCommon::json::getString(config, "Initial State File Path");

Expand Down
4 changes: 0 additions & 4 deletions emulators/quickerSMBC/quickerSMBC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class QuickerSMBC final : public Emulator
QuickerSMBC(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting initial state file from the configuration
_initialStateFilePath = jaffarCommon::json::getString(config, "Initial State File Path");

Expand Down
4 changes: 0 additions & 4 deletions emulators/quickerSnes9x/quickerSnes9x.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class QuickerSnes9x final : public Emulator
QuickerSnes9x(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting initial state file from the configuration
_initialStateFilePath = jaffarCommon::json::getString(config, "Initial State File Path");

Expand Down
4 changes: 0 additions & 4 deletions emulators/quickerStella/quickerStella.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class QuickerStella final : public Emulator
QuickerStella(const nlohmann::json &config)
: Emulator(config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Parsing controller configuration
_controller1Type = jaffarCommon::json::getString(config, "Controller 1 Type");
_controller2Type = jaffarCommon::json::getString(config, "Controller 2 Type");
Expand Down
4 changes: 4 additions & 0 deletions source/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Emulator
// Constructor must only do configuration parsing to perform dry runs
Emulator(const nlohmann::json &config)
{
// Getting disabled state properties
const auto disabledStateProperties = jaffarCommon::json::getArray<std::string>(config, "Disabled State Properties");
for (const auto &property : disabledStateProperties) _disabledStateProperties.push_back(property);

// Getting emulator name (for runtime use)
_emulatorName = jaffarCommon::json::getString(config, "Emulator Name");
};
Expand Down

0 comments on commit 0defd7c

Please sign in to comment.