Allowing defining NTAB size
This commit is contained in:
parent
7b4ff9786a
commit
998a01febc
|
@ -106,6 +106,7 @@ class NESInstanceBase
|
||||||
virtual void doHardReset() = 0;
|
virtual void doHardReset() = 0;
|
||||||
virtual std::string getCoreName() const = 0;
|
virtual std::string getCoreName() const = 0;
|
||||||
virtual void *getInternalEmulatorPointer() = 0;
|
virtual void *getInternalEmulatorPointer() = 0;
|
||||||
|
virtual void setNTABBlockSize(const size_t size) { };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
#include "ppu/ppu.hpp"
|
#include "ppu/ppu.hpp"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdint>
|
||||||
#include <jaffarCommon/serializers/base.hpp>
|
#include <jaffarCommon/serializers/base.hpp>
|
||||||
#include <jaffarCommon/deserializers/base.hpp>
|
#include <jaffarCommon/deserializers/base.hpp>
|
||||||
|
|
||||||
|
@ -84,6 +85,8 @@ class Core : private Cpu
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
size_t _NTABBlockSize = 0x1000;
|
||||||
|
|
||||||
// Flags for lite state storage
|
// Flags for lite state storage
|
||||||
bool TIMEBlockEnabled = true;
|
bool TIMEBlockEnabled = true;
|
||||||
bool CPURBlockEnabled = true;
|
bool CPURBlockEnabled = true;
|
||||||
|
@ -237,9 +240,7 @@ class Core : private Cpu
|
||||||
// NTAB Block
|
// NTAB Block
|
||||||
if (NTABBlockEnabled == true)
|
if (NTABBlockEnabled == true)
|
||||||
{
|
{
|
||||||
size_t nametable_size = 0x1000;
|
const auto inputDataSize = _NTABBlockSize;
|
||||||
|
|
||||||
const auto inputDataSize = nametable_size;
|
|
||||||
const auto inputData = (uint8_t *)ppu.impl->nt_ram;
|
const auto inputData = (uint8_t *)ppu.impl->nt_ram;
|
||||||
serializer.push(inputData, inputDataSize);
|
serializer.push(inputData, inputDataSize);
|
||||||
}
|
}
|
||||||
|
@ -360,10 +361,8 @@ class Core : private Cpu
|
||||||
// NTAB Block
|
// NTAB Block
|
||||||
if (NTABBlockEnabled == true)
|
if (NTABBlockEnabled == true)
|
||||||
{
|
{
|
||||||
size_t nametable_size = 0x1000;
|
|
||||||
|
|
||||||
const auto outputData = (uint8_t*) ppu.impl->nt_ram;
|
const auto outputData = (uint8_t*) ppu.impl->nt_ram;
|
||||||
const auto inputDataSize = nametable_size;
|
const auto inputDataSize = _NTABBlockSize;
|
||||||
deserializer.pop(outputData, inputDataSize);
|
deserializer.pop(outputData, inputDataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,6 +393,8 @@ class Core : private Cpu
|
||||||
if (sram_present) enable_sram(true);
|
if (sram_present) enable_sram(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setNTABBlockSize(const size_t size) { _NTABBlockSize = size; }
|
||||||
|
|
||||||
void enableStateBlock(const std::string& block)
|
void enableStateBlock(const std::string& block)
|
||||||
{
|
{
|
||||||
bool recognizedBlock = false;
|
bool recognizedBlock = false;
|
||||||
|
|
|
@ -50,6 +50,7 @@ class Emu
|
||||||
// Save emulator state variants
|
// Save emulator state variants
|
||||||
void serializeState(jaffarCommon::serializer::Base& serializer) const { emu.serializeState(serializer); }
|
void serializeState(jaffarCommon::serializer::Base& serializer) const { emu.serializeState(serializer); }
|
||||||
void deserializeState(jaffarCommon::deserializer::Base& deserializer) { emu.deserializeState(deserializer); }
|
void deserializeState(jaffarCommon::deserializer::Base& deserializer) { emu.deserializeState(deserializer); }
|
||||||
|
void setNTABBlockSize(const size_t size) { emu.setNTABBlockSize(size); }
|
||||||
void enableStateBlock(const std::string& block) { emu.enableStateBlock(block); };
|
void enableStateBlock(const std::string& block) { emu.enableStateBlock(block); };
|
||||||
void disableStateBlock(const std::string& block) { emu.disableStateBlock(block); };
|
void disableStateBlock(const std::string& block) { emu.disableStateBlock(block); };
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ class NESInstance final : public NESInstanceBase
|
||||||
return serializer.getOutputSize();
|
return serializer.getOutputSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setNTABBlockSize(const size_t size) override { _nes.setNTABBlockSize(size); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool loadROMImpl(const uint8_t* romData, const size_t romSize) override
|
bool loadROMImpl(const uint8_t* romData, const size_t romSize) override
|
||||||
|
|
Loading…
Reference in New Issue