SDL: added preliminary dendy support (set SDL.PAL to 2 to enable.. for now)

This commit is contained in:
punkrockguy318 2015-06-09 01:20:47 +00:00
parent 1df598e34d
commit 97437c8da4
7 changed files with 33 additions and 9 deletions

View File

@ -19,6 +19,7 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <math.h>
#include "scalebit.h" #include "scalebit.h"
#include "hq2x.h" #include "hq2x.h"
#include "hq3x.h" #include "hq3x.h"

View File

@ -401,7 +401,7 @@ InitConfig()
void void
UpdateEMUCore(Config *config) UpdateEMUCore(Config *config)
{ {
int ntsccol, ntsctint, ntschue, flag, start, end; int ntsccol, ntsctint, ntschue, flag, region, start, end;
std::string cpalette; std::string cpalette;
config->getOption("SDL.NTSCpalette", &ntsccol); config->getOption("SDL.NTSCpalette", &ntsccol);
@ -414,8 +414,8 @@ UpdateEMUCore(Config *config)
LoadCPalette(cpalette); LoadCPalette(cpalette);
} }
config->getOption("SDL.PAL", &flag); config->getOption("SDL.PAL", &region);
FCEUI_SetVidSystem(flag ? 1 : 0); FCEUI_SetRegion(region);
config->getOption("SDL.GameGenie", &flag); config->getOption("SDL.GameGenie", &flag);
FCEUI_SetGameGenie(flag ? 1 : 0); FCEUI_SetGameGenie(flag ? 1 : 0);

View File

@ -40,6 +40,8 @@ extern int _sound;
extern long soundrate; extern long soundrate;
extern long soundbufsize; extern long soundbufsize;
extern int pal_emulation;
int CLImain(int argc, char *argv[]); int CLImain(int argc, char *argv[]);
// Device management defaults // Device management defaults

View File

@ -72,6 +72,11 @@ int mutecapture;
#endif #endif
static int noconfig; static int noconfig;
int pal_emulation;
int dendy;
// TODO: actually implement swapDuty
int swapDuty;
// -Video Modes Tag- : See --special // -Video Modes Tag- : See --special
static const char *DriverUsage= static const char *DriverUsage=
"Option Value Description\n" "Option Value Description\n"
@ -213,10 +218,23 @@ int LoadGame(const char *path)
// set pal/ntsc // set pal/ntsc
int id; int id;
g_config->getOption("SDL.PAL", &id); g_config->getOption("SDL.PAL", &id);
if(id) switch(id)
FCEUI_SetVidSystem(1); {
else case 0:
FCEUI_SetVidSystem(0); FCEUI_SetVidSystem(0);
pal_emulation = 0;
dendy = 0;
break;
case 1:
FCEUI_SetVidSystem(1);
pal_emulation = 1;
dendy = 0;
break;
case 2:
FCEUI_SetVidSystem(0);
pal_emulation = 0;
dendy = 1;
}
std::string filename; std::string filename;
g_config->getOption("SDL.Sound.RecordFile", &filename); g_config->getOption("SDL.Sound.RecordFile", &filename);

View File

@ -20,6 +20,9 @@ const int INVALID_STATE = 99;
extern int noGui; extern int noGui;
extern int isloaded; extern int isloaded;
extern int dendy;
extern int pal_emulation;
int LoadGame(const char *path); int LoadGame(const char *path);
int CloseGame(void); int CloseGame(void);
void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count); void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count);

View File

@ -1,2 +1,2 @@
void RefreshThrottleFPS(void); void RefreshThrottleFPS();
int SpeedThrottle(void); int SpeedThrottle(void);

View File

@ -56,8 +56,8 @@ extern bool isTaseditorRecording();
extern int32 fps_scale; extern int32 fps_scale;
extern int32 fps_scale_unpaused; extern int32 fps_scale_unpaused;
extern int32 fps_scale_frameadvance; extern int32 fps_scale_frameadvance;
extern void RefreshThrottleFPS();
#endif #endif
extern void RefreshThrottleFPS();
#ifdef _S9XLUA_H #ifdef _S9XLUA_H
#include "fceulua.h" #include "fceulua.h"