mirror of
https://github.com/libretro/FBNeo.git
synced 2025-02-15 23:29:59 +00:00
Streamlined pi & SDL builds
This commit is contained in:
parent
7e78b7e683
commit
4937227c84
@ -1,35 +0,0 @@
|
||||
alldir += burner burner/pi burner/sdl dep/libs/libpng dep/libs/lib7z dep/libs/zlib intf intf/video \
|
||||
intf/video/scalers intf/video/pi intf/audio intf/audio/sdl intf/input intf/input/pi intf/cd intf/cd/sdl \
|
||||
intf/perfcount intf/perfcount/pi dep/generated dep/pi/cjson dep/pi/gles dep/sdl/dynhuff
|
||||
|
||||
depobj += neocdlist.o \
|
||||
\
|
||||
conc.o cong.o dat.o gamc.o gami.o image.o ioapi.o misc.o sshot.o state.o statec.o unzip.o zipfn.o \
|
||||
\
|
||||
adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o \
|
||||
trees.o uncompr.o zutil.o \
|
||||
\
|
||||
png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o \
|
||||
pngwrite.o pngwtran.o pngwutil.o \
|
||||
\
|
||||
aud_dsp.o aud_interface.o cd_interface.o inp_interface.o interface.o lowpass2.o vid_interface.o \
|
||||
vid_softfx.o vid_support.o \
|
||||
\
|
||||
2xpm.o 2xsai.o ddt3x.o epx.o hq2xs.o hq2xs_16.o xbr.o \
|
||||
\
|
||||
inp_udev.o inp_pi.o inp_pi_keys.o aud_sdl.o support_paths.o ips_manager.o scrn.o cJSON.o \
|
||||
cd_isowav.o cdsound.o config_pi.o main_pi.o run_pi.o stringset.o bzip.o drv.o media.o \
|
||||
inpdipsw.o phl_gles.o matrix.o vid_pi.o dynhuff.o replay.o
|
||||
|
||||
ifdef INCLUDE_7Z_SUPPORT
|
||||
depobj += un7z.o \
|
||||
\
|
||||
7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zFile.o 7zStream.o Bcj2.o Bra.o Bra86.o BraIA64.o CpuArch.o \
|
||||
Delta.o LzmaDec.o Lzma2Dec.o Ppmd7.o Ppmd7Dec.o Sha256.o Xz.o XzCrc64.o XzCrc64Opt.o XzDec.o
|
||||
endif
|
||||
|
||||
autobj += $(depobj)
|
||||
|
||||
ifdef BUILD_X86_ASM
|
||||
autobj += eagle_fm.o 2xsaimmx.o hq2x32.o hq3x32.o hq4x32.o superscale.o
|
||||
endif
|
64
makefile.pi
64
makefile.pi
@ -23,10 +23,10 @@ endif
|
||||
# Specify the name of the executable file, without ".exe"
|
||||
NAME = fbneo
|
||||
|
||||
undefine BUILD_X86_ASM
|
||||
undefine INCLUDE_AVI_RECORDING
|
||||
undefine BUILD_A68K
|
||||
undefine UNICODE
|
||||
BUILD_X86_ASM=
|
||||
INCLUDE_AVI_RECORDING=
|
||||
BUILD_A68K=
|
||||
UNICODE=
|
||||
|
||||
|
||||
#
|
||||
@ -37,7 +37,50 @@ objdir = obj/
|
||||
srcdir = src/
|
||||
|
||||
include makefile.burn_rules
|
||||
include makefile.burner_pi_rules
|
||||
# Platform-specific
|
||||
alldir += burner burner/pi burner/sdl dep/libs/libpng dep/libs/lib7z \
|
||||
dep/libs/zlib intf intf/video intf/video/scalers intf/video/pi \
|
||||
intf/audio intf/audio/sdl intf/input intf/input/pi intf/cd \
|
||||
intf/cd/sdl intf/perfcount intf/perfcount/pi dep/generated \
|
||||
dep/pi/cjson dep/pi/gles dep/dynhuff
|
||||
|
||||
depobj += neocdlist.o \
|
||||
\
|
||||
conc.o cong.o dat.o gamc.o gami.o image.o ioapi.o misc.o \
|
||||
sshot.o state.o statec.o unzip.o zipfn.o \
|
||||
\
|
||||
adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o \
|
||||
gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o \
|
||||
trees.o uncompr.o zutil.o \
|
||||
\
|
||||
png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o \
|
||||
pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o \
|
||||
pngwrite.o pngwtran.o pngwutil.o \
|
||||
\
|
||||
aud_dsp.o aud_interface.o cd_interface.o inp_interface.o \
|
||||
interface.o lowpass2.o vid_interface.o vid_softfx.o \
|
||||
vid_support.o \
|
||||
\
|
||||
2xpm.o 2xsai.o ddt3x.o epx.o hq2xs.o hq2xs_16.o xbr.o \
|
||||
\
|
||||
inp_udev.o inp_pi.o inp_pi_keys.o aud_sdl.o support_paths.o \
|
||||
ips_manager.o scrn.o cJSON.o cd_isowav.o cdsound.o config.o \
|
||||
main_pi.o run_pi.o stringset.o bzip.o drv.o media.o inpdipsw.o \
|
||||
phl_gles.o matrix.o vid_pi.o dynhuff.o replay.o
|
||||
|
||||
ifdef INCLUDE_7Z_SUPPORT
|
||||
depobj += un7z.o 7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o \
|
||||
7zDec.o 7zFile.o 7zStream.o Bcj2.o Bra.o Bra86.o BraIA64.o \
|
||||
CpuArch.o Delta.o LzmaDec.o Lzma2Dec.o Ppmd7.o Ppmd7Dec.o
|
||||
Sha256.o Xz.o XzCrc64.o XzCrc64Opt.o XzDec.o
|
||||
endif
|
||||
|
||||
autobj += $(depobj)
|
||||
|
||||
ifdef BUILD_X86_ASM
|
||||
autobj += eagle_fm.o 2xsaimmx.o hq2x32.o hq3x32.o hq4x32.o superscale.o
|
||||
endif
|
||||
# End platform-specific
|
||||
|
||||
incdir = $(foreach dir,$(alldir),-I$(srcdir)$(dir)) -I$(objdir)dep/generated \
|
||||
-I/local/include -I$(srcdir)dep/pi/include -I$(srcdir)intf/input/sdl \
|
||||
@ -77,7 +120,7 @@ allobj = $(objdir)cpu/m68k/m68kcpu.o $(objdir)cpu/m68k/m68kops.o \
|
||||
$(foreach file,$(autobj:.o=.rc), \
|
||||
$(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \
|
||||
$(firstword $(subst .rc,.o,$(wildcard $(srcdir)$(dir)/$(file)))))))
|
||||
|
||||
|
||||
ifdef BUILD_A68K
|
||||
allobj += $(a68k.o)
|
||||
endif
|
||||
@ -91,7 +134,7 @@ alldep = $(foreach file,$(autobj:.o=.c), \
|
||||
$(foreach file,$(autobj:.o=.rc), \
|
||||
$(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \
|
||||
$(firstword $(subst .rc,.d,$(wildcard $(srcdir)$(dir)/$(file)))))))
|
||||
|
||||
|
||||
autdrv := $(drvsrc:.cpp=.o)
|
||||
|
||||
#
|
||||
@ -414,7 +457,7 @@ $(pgm_sprite.h): pgm_sprite_create.cpp
|
||||
-o $(subst $(srcdir),$(objdir),$(<D))/$(<F:.cpp=.exe)
|
||||
@$(subst $(srcdir),$(objdir),$(<D))/$(<F:.cpp=.exe) >$@
|
||||
|
||||
|
||||
|
||||
ifeq ($(MAKELEVEL),2)
|
||||
ifdef DEPEND
|
||||
|
||||
@ -507,9 +550,8 @@ touch:
|
||||
-@for dir in $(alldir); do touch -c -r $(NAME).exe $(objdir)$$dir/*; done
|
||||
|
||||
clean:
|
||||
@echo Removing all files from $(objdir)...
|
||||
-@rm -f -r $(objdir)
|
||||
-@rm -f -r $(ctv.h)
|
||||
@echo Removing build files...
|
||||
-@rm -fr $(objdir) $(ctv.h) $(dep)generated $(NAME)
|
||||
|
||||
ifdef PERL
|
||||
@echo Removing all files generated with perl scripts...
|
||||
|
16
makefile.sdl
16
makefile.sdl
@ -46,7 +46,7 @@ include makefile.burn_rules
|
||||
# Platform stuff
|
||||
alldir += burner burner/sdl burner/sdl dep/libs/libpng dep/libs/lib7z dep/libs/zlib intf intf/video \
|
||||
intf/video/scalers intf/video/sdl intf/audio intf/audio/sdl intf/input intf/input/sdl intf/cd intf/cd/sdl \
|
||||
intf/perfcount intf/perfcount/sdl dep/generated dep/sdl/dynhuff
|
||||
intf/perfcount intf/perfcount/sdl dep/generated dep/dynhuff
|
||||
|
||||
depobj += neocdlist.o \
|
||||
\
|
||||
@ -65,7 +65,7 @@ depobj += neocdlist.o \
|
||||
\
|
||||
inp_sdl.o aud_sdl.o support_paths.o ips_manager.o scrn.o \
|
||||
cd_isowav.o cdsound.o config.o main.o run.o stringset.o bzip.o drv.o media.o \
|
||||
inpdipsw.o vid_sdlfx.o dynhuff.o replay.o vid_sdlopengl.o
|
||||
inpdipsw.o vid_sdlfx.o dynhuff.o replay.o vid_sdlopengl.o
|
||||
|
||||
ifdef INCLUDE_7Z_SUPPORT
|
||||
depobj += un7z.o \
|
||||
@ -73,7 +73,7 @@ depobj += un7z.o \
|
||||
7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zFile.o 7zStream.o Bcj2.o Bra.o Bra86.o BraIA64.o CpuArch.o \
|
||||
Delta.o LzmaDec.o Lzma2Dec.o Ppmd7.o Ppmd7Dec.o Sha256.o Xz.o XzCrc64.o XzCrc64Opt.o XzDec.o
|
||||
endif
|
||||
|
||||
|
||||
autobj += $(depobj)
|
||||
|
||||
ifdef BUILD_X86_ASM
|
||||
@ -86,10 +86,10 @@ incdir = $(foreach dir,$(alldir),-I$(srcdir)$(dir)) -I$(objdir)dep/generated \
|
||||
-I/local/include -I$(srcdir)dep/sdl/include \
|
||||
-I$(srcdir)intf/input/sdl `sdl-config --cflags`
|
||||
|
||||
lib = -lstdc++ -lSDL `sdl-config --libs` -lGL
|
||||
lib = -lstdc++ -lSDL `sdl-config --libs` -lGL -lm
|
||||
|
||||
ifdef DARWIN
|
||||
lib += -L/System/Library/Frameworks/OpenGL.framework/Libraries/
|
||||
lib += -L/System/Library/Frameworks/OpenGL.framework/Libraries/
|
||||
endif
|
||||
|
||||
autdep = $(depobj:.o=.d)
|
||||
@ -122,7 +122,7 @@ allobj = $(objdir)cpu/m68k/m68kcpu.o $(objdir)cpu/m68k/m68kops.o \
|
||||
$(foreach file,$(autobj:.o=.rc), \
|
||||
$(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \
|
||||
$(firstword $(subst .rc,.o,$(wildcard $(srcdir)$(dir)/$(file)))))))
|
||||
|
||||
|
||||
ifdef BUILD_A68K
|
||||
allobj += $(a68k.o)
|
||||
endif
|
||||
@ -136,7 +136,7 @@ alldep = $(foreach file,$(autobj:.o=.c), \
|
||||
$(foreach file,$(autobj:.o=.rc), \
|
||||
$(foreach dir,$(alldir),$(subst $(srcdir),$(objdir), \
|
||||
$(firstword $(subst .rc,.d,$(wildcard $(srcdir)$(dir)/$(file)))))))
|
||||
|
||||
|
||||
autdrv := $(drvsrc:.cpp=.o)
|
||||
|
||||
#
|
||||
@ -465,7 +465,7 @@ $(pgm_sprite.h): pgm_sprite_create.cpp
|
||||
-o $(subst $(srcdir),$(objdir),$(<D))/$(<F:.cpp=.exe)
|
||||
@$(subst $(srcdir),$(objdir),$(<D))/$(<F:.cpp=.exe) >$@
|
||||
|
||||
|
||||
|
||||
ifeq ($(MAKELEVEL),2)
|
||||
ifdef DEPEND
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
#ifndef PI_CONFIG_H
|
||||
#define PI_CONFIG_H
|
||||
|
||||
int piLoadConfig();
|
||||
int piSaveConfig();
|
||||
|
||||
#endif
|
@ -1,105 +0,0 @@
|
||||
// Burner Config file module
|
||||
#include "burner.h"
|
||||
|
||||
int piLoadConfig()
|
||||
{
|
||||
FILE *f;
|
||||
if ((f = fopen("fbneo.ini","r")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define VAR(x) { char *szValue = LabelCheck(line, #x); \
|
||||
if (szValue) x = strtol(szValue, NULL, 0); }
|
||||
#define FLT(x) { char *szValue = LabelCheck(line, #x); \
|
||||
if (szValue) x = atof(szValue); }
|
||||
#define STR(x) { char *szValue = LabelCheck(line, #x " "); \
|
||||
if (szValue) strcpy(x,szValue); }
|
||||
|
||||
char line[256];
|
||||
while (fgets(line, sizeof(line), f)) {
|
||||
// Get rid of the linefeed at the end
|
||||
int len = strlen(line);
|
||||
if (line[len - 1] == 10) {
|
||||
line[len - 1] = 0;
|
||||
len--;
|
||||
}
|
||||
|
||||
VAR(bVidScanlines);
|
||||
|
||||
// Other
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
VAR(nAudSampleRate[0]);
|
||||
}
|
||||
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int piSaveConfig()
|
||||
{
|
||||
FILE *f;
|
||||
if ((f = fopen("fbapi.ini", "w")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#define VAR(x) fprintf(f, #x " %d\n", x)
|
||||
#define FLT(x) fprintf(f, #x " %f\n", x)
|
||||
#define STR(x) fprintf(f, #x " %s\n", x)
|
||||
|
||||
fprintf(f,"\n// If non-zero, enable scanlines\n");
|
||||
VAR(bVidScanlines);
|
||||
|
||||
fprintf(f,"// ROM paths (include trailing slash)\n");
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
VAR(nAudSampleRate[0]);
|
||||
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
piLoadConfig();
|
||||
ConfigAppLoad();
|
||||
SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO);
|
||||
BurnLibInit();
|
||||
|
||||
@ -218,7 +218,7 @@ int main(int argc, char *argv[])
|
||||
DrvExit();
|
||||
MediaExit();
|
||||
|
||||
piSaveConfig();
|
||||
ConfigAppSave();
|
||||
BurnLibExit();
|
||||
SDL_Quit();
|
||||
|
||||
|
@ -1,139 +1,142 @@
|
||||
// Burner Config file module
|
||||
#include "burner.h"
|
||||
int nIniVersion = 0;
|
||||
|
||||
static void CreateConfigName(char* szConfig)
|
||||
{
|
||||
memcpy(szConfig, "fbneo.ini", 12);
|
||||
return;
|
||||
}
|
||||
|
||||
// Read in the config file for the whole application
|
||||
int ConfigAppLoad()
|
||||
{
|
||||
char szConfig[MAX_PATH];
|
||||
char szLine[256];
|
||||
FILE *h;
|
||||
|
||||
CreateConfigName(szConfig);
|
||||
|
||||
if ((h = fopen(szConfig,"rt")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Go through each line of the config file
|
||||
while (fgets(szLine, sizeof(szLine), h)) {
|
||||
int nLen;
|
||||
|
||||
nLen = strlen(szLine);
|
||||
|
||||
// Get rid of the linefeed at the end
|
||||
if (szLine[nLen - 1] == 10) {
|
||||
szLine[nLen - 1] = 0;
|
||||
nLen--;
|
||||
}
|
||||
|
||||
#define VAR(x) { char *szValue = LabelCheck(szLine,#x); \
|
||||
if (szValue) x = strtol(szValue, NULL, 0); }
|
||||
#define FLT(x) { char *szValue = LabelCheck(szLine,#x); \
|
||||
if (szValue) x = atof(szValue); }
|
||||
#define STR(x) { char *szValue = LabelCheck(szLine,#x " "); \
|
||||
if (szValue) strcpy(x,szValue); }
|
||||
|
||||
VAR(nIniVersion);
|
||||
VAR(nVidSelect); // video mode select
|
||||
VAR(bVidFullStretch);
|
||||
|
||||
VAR(nAutoFireRate);
|
||||
|
||||
// Other
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
}
|
||||
|
||||
fclose(h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Write out the config file for the whole application
|
||||
int ConfigAppSave()
|
||||
{
|
||||
char szConfig[MAX_PATH];
|
||||
FILE *h;
|
||||
|
||||
CreateConfigName(szConfig);
|
||||
|
||||
if ((h = fopen(szConfig, "wt")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#define VAR(x) fprintf(h, #x " %d\n", x)
|
||||
#define FLT(x) fprintf(h, #x " %f\n", x)
|
||||
#define STR(x) fprintf(h, #x " %s\n", x)
|
||||
|
||||
fprintf(h,"\n// The application version this file was saved from\n");
|
||||
// We can't use the macros for this!
|
||||
fprintf(h, "nIniVersion 0x%06X", nBurnVer);
|
||||
|
||||
fprintf(h,"\n// video mode 0 = standard SDL 1= (very expiermental) opengl\n");
|
||||
VAR(nVidSelect); // video mode select
|
||||
|
||||
fprintf(h,"\n// If non-zero, allow stretching of the image to any size\n");
|
||||
VAR(bVidFullStretch);
|
||||
|
||||
fprintf(h,"\n// Auto-Fire Rate, non-linear - use the GUI to change this setting!\n");
|
||||
VAR(nAutoFireRate);
|
||||
|
||||
fprintf(h,"\n// The paths to search for rom zips. (include trailing backslash)\n");
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
|
||||
fprintf(h,"\n\n\n");
|
||||
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
|
||||
fclose(h);
|
||||
return 0;
|
||||
}
|
||||
// Burner Config file module
|
||||
#include "burner.h"
|
||||
int nIniVersion = 0;
|
||||
|
||||
static void CreateConfigName(char* szConfig)
|
||||
{
|
||||
memcpy(szConfig, "fbneo.ini", 12);
|
||||
return;
|
||||
}
|
||||
|
||||
// Read in the config file for the whole application
|
||||
int ConfigAppLoad()
|
||||
{
|
||||
char szConfig[MAX_PATH];
|
||||
FILE *f;
|
||||
|
||||
CreateConfigName(szConfig);
|
||||
|
||||
if ((f = fopen(szConfig,"rt")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define VAR(x) { char *szValue = LabelCheck(szLine, #x); \
|
||||
if (szValue) x = strtol(szValue, NULL, 0); }
|
||||
#define FLT(x) { char *szValue = LabelCheck(szLine, #x); \
|
||||
if (szValue) x = atof(szValue); }
|
||||
#define STR(x) { char *szValue = LabelCheck(szLine, #x " "); \
|
||||
if (szValue) strcpy(x,szValue); }
|
||||
|
||||
// Go through each line of the config file
|
||||
char szLine[256];
|
||||
while (fgets(szLine, sizeof(szLine), f)) {
|
||||
// Get rid of the linefeed at the end
|
||||
int nLen = strlen(szLine);
|
||||
if (szLine[nLen - 1] == 10) {
|
||||
szLine[nLen - 1] = 0;
|
||||
nLen--;
|
||||
}
|
||||
|
||||
VAR(nIniVersion);
|
||||
#ifndef BUILD_PI
|
||||
VAR(nVidSelect); // video mode select
|
||||
VAR(bVidFullStretch);
|
||||
VAR(nAutoFireRate);
|
||||
#endif
|
||||
VAR(bVidScanlines);
|
||||
VAR(nAudSampleRate[0]);
|
||||
|
||||
// Other
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Write out the config file for the whole application
|
||||
int ConfigAppSave()
|
||||
{
|
||||
char szConfig[MAX_PATH];
|
||||
FILE *f;
|
||||
|
||||
CreateConfigName(szConfig);
|
||||
|
||||
if ((f = fopen(szConfig, "wt")) == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#define VAR(x) fprintf(f, #x " %d\n", x)
|
||||
#define FLT(x) fprintf(f, #x " %f\n", x)
|
||||
#define STR(x) fprintf(f, #x " %s\n", x)
|
||||
|
||||
fprintf(f,"\n// The application version this file was saved from\n");
|
||||
// We can't use the macros for this!
|
||||
fprintf(f, "nIniVersion 0x%06X", nBurnVer);
|
||||
|
||||
#ifndef BUILD_PI
|
||||
fprintf(f,"\n// video mode 0 = standard SDL 1= (very expiermental) opengl\n");
|
||||
VAR(nVidSelect); // video mode select
|
||||
fprintf(f,"\n// If non-zero, allow stretching of the image to any size\n");
|
||||
VAR(bVidFullStretch);
|
||||
fprintf(f,"\n// Auto-Fire Rate, non-linear - use the GUI to change this setting!\n");
|
||||
VAR(nAutoFireRate);
|
||||
#endif
|
||||
fprintf(f,"\n// If non-zero, enable scanlines\n");
|
||||
VAR(bVidScanlines);
|
||||
VAR(nAudSampleRate[0]);
|
||||
|
||||
fprintf(f,"\n// The paths to search for rom zips. (include trailing backslash)\n");
|
||||
STR(szAppRomPaths[0]);
|
||||
STR(szAppRomPaths[1]);
|
||||
STR(szAppRomPaths[2]);
|
||||
STR(szAppRomPaths[3]);
|
||||
STR(szAppRomPaths[4]);
|
||||
STR(szAppRomPaths[5]);
|
||||
STR(szAppRomPaths[6]);
|
||||
STR(szAppRomPaths[7]);
|
||||
STR(szAppRomPaths[8]);
|
||||
STR(szAppRomPaths[9]);
|
||||
STR(szAppRomPaths[10]);
|
||||
STR(szAppRomPaths[11]);
|
||||
STR(szAppRomPaths[12]);
|
||||
STR(szAppRomPaths[13]);
|
||||
STR(szAppRomPaths[14]);
|
||||
STR(szAppRomPaths[15]);
|
||||
STR(szAppRomPaths[16]);
|
||||
STR(szAppRomPaths[17]);
|
||||
STR(szAppRomPaths[18]);
|
||||
STR(szAppRomPaths[19]);
|
||||
|
||||
fprintf(f,"\n\n\n");
|
||||
|
||||
#undef STR
|
||||
#undef FLT
|
||||
#undef VAR
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user