[gens-sdl] EmuLoop: Set auto-fix-checksum and sprite-limits properties.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Mon, 7 Sep 2015 16:29:08 +0000 (12:29 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Mon, 7 Sep 2015 16:29:08 +0000 (12:29 -0400)
src/gens-sdl/EmuLoop.cpp

index 8a60620..4e54fe0 100644 (file)
@@ -41,8 +41,10 @@ using GensSdl::VBackend;
 // LibGens
 #include "libgens/Rom.hpp"
 #include "libgens/Util/MdFb.hpp"
+#include "libgens/Vdp/Vdp.hpp"
 using LibGens::Rom;
 using LibGens::MdFb;
+using LibGens::Vdp;
 
 // Emulation Context.
 #include "libgens/EmuContext/EmuContext.hpp"
@@ -577,6 +579,9 @@ int EmuLoop::run(const Options *options)
        // Set the SRAM/EEPROM path.
        EmuContext::SetPathSRam(getConfigDir("SRAM").c_str());
 
+       // Set some static EmuContext properties.
+       EmuContext::SetAutoFixChecksum(options->auto_fix_checksum());
+
        // Create the emulation context.
        d->emuContext = EmuContextFactory::createContext(d->rom);
        if (!d->emuContext || !d->emuContext->isRomOpened()) {
@@ -587,6 +592,11 @@ int EmuLoop::run(const Options *options)
                return EXIT_FAILURE;
        }
 
+       // Set VDP properties.
+       // TODO: More properties?
+       Vdp *vdp = d->emuContext->m_vdp;
+       vdp->options.spriteLimits = options->sprite_limits();
+
        // Initialize the SDL handlers.
        d->sdlHandler = new SdlHandler();
        if (d->sdlHandler->init_video() < 0)