Skip to content

Commit

Permalink
Fixing sdlpop
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMartin86 committed May 28, 2024
1 parent f314d84 commit c79122e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion emulators/quickerSDLPoP/quickerSDLPoP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class QuickerSDLPoP final : public Emulator
std::string stateFileData;
if (jaffarCommon::file::loadStringFromFile(stateFileData, _stateFilePath) == false) JAFFAR_THROW_LOGIC("Could not initial state file: %s\n", _stateFilePath.c_str());

jaffarCommon::deserializer::Contiguous deserializer(stateFileData.data(), stateFileData.size());
jaffarCommon::deserializer::Contiguous deserializer(stateFileData.data());
_QuickerSDLPoP->deserializeState(deserializer);
}

Expand All @@ -74,6 +74,14 @@ class QuickerSDLPoP final : public Emulator

__INLINE__ void disableStateProperty(const std::string &property) override {}

__INLINE__ void printInfo() const override {}

__INLINE__ property_t getProperty(const std::string &propertyName) const override
{
if (propertyName == "Game State") return property_t((uint8_t *)_QuickerSDLPoP->getGameState(), _QuickerSDLPoP->getFullStateSize());
JAFFAR_THROW_LOGIC("Property name: '%s' not found in emulator '%s'", propertyName.c_str(), getName().c_str());
}

// This function opens the video output (e.g., window)
void initializeVideoOutput() override
{
Expand Down
1 change: 1 addition & 0 deletions examples/sdlpop/lvl01/lvl01a.jaffar
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{
"Emulator Name": "QuickerSDLPoP",
"Initial State File": "lvl01a.state",
"Disabled State Properties": [],
"SDLPoP Root Path": "../../../extern/quickerSDLPoP/SDLPoPData/",
"Levels File Path": "",
"Game Version": "1.4",
Expand Down
1 change: 1 addition & 0 deletions tests/sdlpop/lvl01a.jaffar
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{
"Emulator Name": "QuickerSDLPoP",
"Initial State File": "lvl01a.state",
"Disabled State Properties": [],
"SDLPoP Root Path": "../../extern/quickerSDLPoP/SDLPoPData/",
"Levels File Path": "",
"Game Version": "1.4",
Expand Down

0 comments on commit c79122e

Please sign in to comment.