Fixed libretro errors preventing a successful build.

Still TODO is actually test this functionality.
This commit is contained in:
Stephen Anthony 2019-04-20 19:24:17 -02:30
parent 36da2bcabc
commit 9d287666f9
4 changed files with 558 additions and 569 deletions

View File

@ -41,7 +41,7 @@ StellaLIBRETRO::StellaLIBRETRO()
video_aspect_pal = 0;
video_palette = "standard";
video_filter = NTSCFilter::PRESET_OFF;
video_filter = NTSCFilter::Preset::OFF;
video_ready = false;
audio_samples = 0;
@ -49,7 +49,7 @@ StellaLIBRETRO::StellaLIBRETRO()
video_phosphor = "byrom";
video_phosphor_blend = 60;
rom_image = make_unique<uInt8[]>(getROMMax());
system_ready = false;
@ -108,7 +108,7 @@ bool StellaLIBRETRO::create(bool logging)
//fastscbios
// Fast loading of Supercharger BIOS
settings.setValue("tv.filter", video_filter);
settings.setValue("tv.filter", static_cast<int>(video_filter));
settings.setValue("tv.phosphor", video_phosphor);
settings.setValue("tv.phosblend", video_phosphor_blend);
@ -214,11 +214,11 @@ void StellaLIBRETRO::updateAudio()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool StellaLIBRETRO::loadState(const void* data, uInt32 size)
bool StellaLIBRETRO::loadState(const void* data, size_t size)
{
Serializer state;
state.putByteArray(reinterpret_cast<const uInt8*>(data), size);
state.putByteArray(reinterpret_cast<const uInt8*>(data), static_cast<uInt32>(size));
if (!myOSystem->state().loadState(state))
return false;
@ -227,7 +227,7 @@ bool StellaLIBRETRO::loadState(const void* data, uInt32 size)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool StellaLIBRETRO::saveState(void* data, uInt32 size)
bool StellaLIBRETRO::saveState(void* data, size_t size)
{
Serializer state;
@ -262,7 +262,7 @@ float StellaLIBRETRO::getVideoAspect()
{
if (!video_aspect_ntsc)
// non-interlace square pixel clock -- 1.0 pixel @ color burst -- double-width pixels
par = (6.1363635 / 3.579545454) / 2;
par = (6.1363635f / 3.579545454f) / 2;
else
par = video_aspect_ntsc / 100.0;
}
@ -270,7 +270,7 @@ float StellaLIBRETRO::getVideoAspect()
{
if (!video_aspect_pal)
// non-interlace square pixel clock -- 0.8 pixel @ color burst -- double-width pixels
par = (7.3750000 / (4.43361875 * 4/5)) / 2;
par = (7.3750000f / (4.43361875f * 4/5)) / 2;
else
par = video_aspect_pal / 100.0;
}
@ -313,11 +313,11 @@ bool StellaLIBRETRO::getVideoResize()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StellaLIBRETRO::setROM(const void* data, uInt32 size)
void StellaLIBRETRO::setROM(const void* data, size_t size)
{
memcpy(rom_image.get(), data, size);
rom_size = size;
rom_size = static_cast<uInt32>(size);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -341,20 +341,10 @@ void StellaLIBRETRO::setConsoleFormat(uInt32 mode)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StellaLIBRETRO::setVideoFilter(uInt32 mode)
{
switch (mode)
if (system_ready && mode <= 5)
{
case 0: video_filter = NTSCFilter::PRESET_OFF; break;
case 1: video_filter = NTSCFilter::PRESET_COMPOSITE; break;
case 2: video_filter = NTSCFilter::PRESET_SVIDEO; break;
case 3: video_filter = NTSCFilter::PRESET_RGB; break;
case 4: video_filter = NTSCFilter::PRESET_BAD; break;
case 5: video_filter = NTSCFilter::PRESET_CUSTOM; break;
}
if (system_ready)
{
myOSystem->settings().setValue("tv.filter", static_cast<int>(video_filter));
myOSystem->frameBuffer().tiaSurface().setNTSC(video_filter);
myOSystem->settings().setValue("tv.filter", mode);
myOSystem->frameBuffer().tiaSurface().setNTSC(static_cast<NTSCFilter::Preset>(mode));
}
}

View File

@ -49,8 +49,8 @@ class StellaLIBRETRO
void runFrame();
bool loadState(const void* data, uInt32 size);
bool saveState(void* data, uInt32 size);
bool loadState(const void* data, size_t size);
bool saveState(void* data, size_t size);
public:
const char* getCoreName() { return "Stella"; }
@ -93,7 +93,7 @@ class StellaLIBRETRO
Int16* getAudioBuffer() { return audio_buffer.get(); }
public:
void setROM(const void* data, uInt32 size);
void setROM(const void* data, size_t size);
void setConsoleFormat(uInt32 mode);

File diff suppressed because it is too large Load Diff

View File

@ -294,8 +294,8 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\yacc;..\emucore;..\emucore\tia;..\emucore\tia\frame-manager;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -1399,4 +1399,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>