Cleanups - remove code we don't need

This commit is contained in:
twinaphex 2021-10-06 16:13:14 +02:00
parent 1fc7269d55
commit f9171673c1
6 changed files with 5 additions and 140 deletions

View File

@ -30,10 +30,6 @@
#include <string.h>
#include "AppConfig.h"
// PacketFileSystem.h Need to be included after all other includes
#include "PacketFileSystem.h"
typedef struct
{
char key[32];
@ -46,67 +42,6 @@ typedef struct
static AppEntry appEntries[MAX_APP_ENTRIES];
static int appEntryCnt = 0;
void appConfigLoad()
{
FILE* f;
if (appEntryCnt == MAX_APP_ENTRIES) {
return;
}
f = fopen("blueMSX.cfg", "r");
if (f == NULL) {
return;
}
for (;;) {
char* key;
char* value;
char line[100];
if (fgets(line, sizeof(line), f) == NULL) {
break;
}
if (line[0] == '#') {
continue;
}
line[sizeof(line) - 1] = 0;
key = strtok(line, "=");
if (key == NULL) {
continue;
}
value = strtok(NULL, "\r\n");
if (value == NULL) {
continue;
}
key[31] = 0;
value[31] = 0;
strcpy(appEntries[appEntryCnt].key, line);
strcpy(appEntries[appEntryCnt].value, value);
appEntries[appEntryCnt].intVal = atoi(value);
if (++appEntryCnt == MAX_APP_ENTRIES) {
break;
}
}
fclose(f);
}
int appConfigGetInt(const char* key, int defVal)
{
int i;
for (i = 0; i < appEntryCnt; i++) {
if (strcmp(key, appEntries[i].key) == 0) {
return appEntries[i].intVal;
}
}
return defVal;
}
const char* appConfigGetString(const char* key, const char* defVal)
{
int i;
@ -117,4 +52,3 @@ const char* appConfigGetString(const char* key, const char* defVal)
}
return defVal;
}

View File

@ -30,10 +30,6 @@
#include "MsxTypes.h"
void appConfigLoad();
int appConfigGetInt(const char* key, int defVal);
const char* appConfigGetString(const char* key, const char* defVal);
#endif

View File

@ -71,10 +71,9 @@ const char* stripPath(const char* filename) {
return filename;
}
int fileExist(char* fileName, char* zipFile) {
if (fileName == NULL || *fileName == 0) {
static int fileExist(char* fileName, char* zipFile) {
if (fileName == NULL || *fileName == 0)
return 0;
}
if (zipFile == NULL || *zipFile == 0) {
return archFileExists(fileName);
@ -243,7 +242,7 @@ void setExtendedRomName(int drive, const char* name) {
strcpy(extendedName[drive], name);
}
int createSaveFileBaseName(char* fileBase,Properties* properties, int useExtendedName)
static int createSaveFileBaseName(char* fileBase,Properties* properties, int useExtendedName)
{
int done = 0;
int i;
@ -390,7 +389,7 @@ static UInt32 fileWriteTime(const char* filename)
return rv < 0 ? 0 : (UInt32)s.st_mtime;
}
char* generateSaveFilename(Properties* properties, char* directory, char* prefix, char* extension, int digits)
static char* generateSaveFilename(Properties* properties, char* directory, char* prefix, char* extension, int digits)
{
ArchGlob* glob;
static char filename[512];

View File

@ -34,16 +34,10 @@
const char* stripPath(const char* filename);
const char* stripPathExt(const char* filename);
int fileExist(char* filename, char* zipFile);
char* fileGetNext(char* filename, char* zipFile);
void setExtendedRomName(int drive, const char* name);
void updateExtendedRomName(int drive, char* filename, char* zipFile);
void updateExtendedDiskName(int drive, char* filename, char* zipFile);
void updateExtendedCasName(int drive, char* filename, char* zipFile);
int createSaveFileBaseName(char* fileBase,Properties* properties, int useExtendedName);
char* generateSaveFilename(Properties* properties, char* directory, char* prefix, char* extension, int digits);
#endif

View File

@ -125,39 +125,6 @@ ValueNamePair WindowSizePair[] = {
{ -1, "" },
};
#ifdef USE_SDL
ValueNamePair VideoDriverPair[] = {
{ P_VIDEO_DRVSDLGL, "sdlgl" },
{ P_VIDEO_DRVSDLGL_NODIRT, "sdlgl noopt" },
{ P_VIDEO_DRVSDL, "sdl" },
{ -1, "" },
};
#else
ValueNamePair VideoDriverPair[] = {
{ P_VIDEO_DRVDIRECTX_VIDEO, "directx hw" },
{ P_VIDEO_DRVDIRECTX, "directx" },
{ P_VIDEO_DRVGDI, "gdi" },
{ P_VIDEO_DRVDIRECTX_D3D, "directx d3d" },
{ -1, "" },
};
#endif
#ifdef USE_SDL
ValueNamePair SoundDriverPair[] = {
{ P_SOUND_DRVNONE, "none" },
{ P_SOUND_DRVWMM, "sdl" },
{ P_SOUND_DRVDIRECTX, "sdl" },
{ -1, "" },
};
#else
ValueNamePair SoundDriverPair[] = {
{ P_SOUND_DRVNONE, "none" },
{ P_SOUND_DRVWMM, "wmm" },
{ P_SOUND_DRVDIRECTX, "directx" },
{ -1, "" },
};
#endif
ValueNamePair MidiTypePair[] = {
{ P_MIDI_NONE, "none" },
{ P_MIDI_FILE, "file" },
@ -257,7 +224,6 @@ void propInitDefaults(Properties* properties, int langType, PropKeyboardLanguage
properties->video.windowSizeChanged = 0;
properties->video.windowX = -1;
properties->video.windowY = -1;
properties->video.driver = P_VIDEO_DRVDIRECTX_VIDEO;
properties->video.frameSkip = 0;
properties->video.fullscreen.width = 640;
properties->video.fullscreen.height = 480;
@ -283,7 +249,6 @@ void propInitDefaults(Properties* properties, int langType, PropKeyboardLanguage
properties->videoIn.inputIndex = 0;
properties->videoIn.inputName[0] = 0;
properties->sound.driver = P_SOUND_DRVDIRECTX;
properties->sound.bufSize = 100;
properties->sound.stabilizeDSoundTiming = 1;

View File

@ -95,8 +95,7 @@ typedef enum {
PROP_SETTINGS,
PROP_DISK,
PROP_APEARANCE,
PROP_PORTS,
PROP_D3D
PROP_PORTS
} PropPage;
typedef enum {
@ -179,25 +178,6 @@ enum {
P_VIDEO_FREQ_60HZ
};
enum {
P_SOUND_DRVNONE = 0,
P_SOUND_DRVWMM,
P_SOUND_DRVDIRECTX
};
enum {
P_VIDEO_DRVDIRECTX_VIDEO = 0,
P_VIDEO_DRVDIRECTX,
P_VIDEO_DRVGDI,
P_VIDEO_DRVDIRECTX_D3D
};
enum {
P_VIDEO_DRVSDLGL = 0,
P_VIDEO_DRVSDLGL_NODIRT,
P_VIDEO_DRVSDL
};
enum {
P_CDROM_DRVNONE = 0,
P_CDROM_DRVIOCTL,
@ -233,7 +213,6 @@ typedef struct {
int windowSizeChanged;
int windowX;
int windowY;
int driver;
int frameSkip;
struct {
int width;
@ -282,7 +261,6 @@ typedef struct {
} SoundChip;
typedef struct {
int driver;
int bufSize;
int stabilizeDSoundTiming;
SoundChip chip;
@ -290,7 +268,6 @@ typedef struct {
int masterVolume;
int masterEnable;
MixerChannel mixerChannel[MIXER_CHANNEL_TYPE_COUNT];
int log[PROP_MAXPATH];
struct {
int type;
char name[256];