Compare commits

...
19 Commits
Author SHA1 Message Date
Themaister 089b4fbba0 Updates for 0.6.1. 2011-06-27 02:28:35 +02:00
Themaister 80727cef5a Nitpick. 2011-06-26 18:47:54 +02:00
Themaister 346a9f2b4e Remove debug messages. 2011-06-26 17:06:05 +02:00
Themaister 363d8ca5b4 More proper string reading function. 2011-06-26 17:05:29 +02:00
Themaister 06a574225d Merge branch 'master' of github.com:Themaister/SSNES 2011-06-26 16:04:13 +02:00
Themaister fa777b8356 Should fix netplay for bSNES as well.
Do not rely on when polling takes place in the emu core.
We earlier assumed that this occured always at the start of the main
loop. We now do not care about when the poll callback is called, and we
manually poll the network ourselves in pre_frame.
2011-06-26 16:02:18 +02:00
Themaister 7cf01318cb Should fix netplay for bSNES as well. 2011-06-26 15:32:24 +02:00
Themaister 7c538274b4 Do not check twice for OS. 2011-06-25 17:22:47 +02:00
Themaister 72fb694e97 Use pkg-config more where appropriate. 2011-06-25 17:15:58 +02:00
Themaister 59c92dddc3 Slight QB cleanup. 2011-06-25 17:11:18 +02:00
Themaister 3f60fdd106 Fix build for XVideo. 2011-06-25 18:11:04 +02:00
Themaister d221c480e6 Fix aliasing issue. 2011-06-25 16:49:34 +02:00
Themaister 59d9ff0d29 Add check_code_c/cxx. 2011-06-25 14:44:45 +02:00
Themaister d279ea79e8 Fix some standard compliance. 2011-06-25 14:17:31 +02:00
Themaister 77cf9423cc Abolish use of echo -n as it isn't perfectly standard. 2011-06-25 14:10:40 +02:00
Themaister 60b94bbe43 Add some additional checks in qb. 2011-06-25 13:57:46 +02:00
Themaister b6272f9653 Small bug. 2011-06-24 13:31:21 +02:00
Themaister 25fce1a6c6 Allow XML mapping. 2011-06-24 13:29:30 +02:00
Themaister 59229f99c5 Swap client by default. 2011-06-22 21:56:04 +02:00
18 changed files with 195 additions and 67 deletions

No files matched your search

+8 -5
View File
@@ -9,7 +9,7 @@ HEADERS = $(wildcard */*.h) $(wildcard *.h)
LIBS = -lm
DEFINES = -DHAVE_CONFIG_H
ifneq ($(findstring Darwin,$(shell uname -a)),)
ifneq ($(findstring Darwin,$(OS)),)
OSX := 1
LIBS += -framework AppKit
else
@@ -18,7 +18,7 @@ endif
BSD_LOCAL_INC =
DYLIB_LIB = -ldl
ifneq ($(findstring BSD,$(shell uname -a)),)
ifneq ($(findstring BSD,$(OS)),)
BSD_LOCAL_INC = -I/usr/local/include
DYLIB_LIB = -lc
endif
@@ -55,11 +55,13 @@ endif
ifeq ($(HAVE_ALSA), 1)
OBJ += audio/alsa.o
LIBS += -lasound
LIBS += $(ALSA_LIBS)
DEFINES += $(ALSA_CFLAGS)
endif
ifeq ($(HAVE_ROAR), 1)
OBJ += audio/roar.o
LIBS += -lroar
LIBS += $(ROAR_LIBS)
DEFINES += $(ROAR_CFLAGS)
endif
ifeq ($(HAVE_AL), 1)
OBJ += audio/openal.o
@@ -93,7 +95,8 @@ endif
ifeq ($(HAVE_XVIDEO), 1)
OBJ += gfx/xvideo.o input/x11_input.o
LIBS += -lX11 -lXext -lXv
LIBS += $(XVIDEO_LIBS)
DEFINES += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_CG), 1)
+1 -1
View File
@@ -155,7 +155,7 @@ clean:
rm -f tools/*.o
dist: all
zip -r ssnes-win32-0.6.zip $(TARGET) ssnes.cfg snes.dll libxml2.dll iconv.dll zlib1.dll SDL.dll freetype6.dll xaudio-c.dll rsound.dll pthreadGC2.dll cg.dll cgGL.dll libjpeg-8.dll libpng15-15.dll python32.dll SDL_image.dll $(JTARGET)
zip -r ssnes-win32-0.6.1.zip $(TARGET) ssnes.cfg snes.dll libxml2.dll iconv.dll zlib1.dll SDL.dll freetype6.dll xaudio-c.dll rsound.dll pthreadGC2.dll cg.dll cgGL.dll libjpeg-8.dll libpng15-15.dll python32.dll SDL_image.dll $(JTARGET)
libs:
wget https://github.com/downloads/Themaister/SSNES/SSNES-win32-libs.zip --no-check-certificate
+1 -1
View File
@@ -142,7 +142,7 @@ clean:
rm -f tools/*.o
dist: all
zip -r ssnes-win64-0.6.zip $(TARGET) ssnes.cfg snes.dll xaudio-c.dll README.win32.txt $(JTARGET)
zip -r ssnes-win64-0.6.1.zip $(TARGET) ssnes.cfg snes.dll xaudio-c.dll README.win32.txt $(JTARGET)
libs:
wget https://github.com/downloads/Themaister/SSNES/ssnes-win64-libs.zip --no-check-certificate
+1 -1
View File
@@ -18,7 +18,7 @@
#include "driver.h"
#include <stdlib.h>
#include <alsa/asoundlib.h>
#include <asoundlib.h>
#include "general.h"
#define TRY_ALSA(x) if ( x < 0 ) { \
+1 -1
View File
@@ -198,7 +198,7 @@ static const bool pause_nonactive = true;
static const unsigned autosave_interval = 0;
// When being client over netplay, use keybinds for player 1 rather than player 2.
static const bool netplay_client_swap_input = false;
static const bool netplay_client_swap_input = true;
////////////////////
+6
View File
@@ -14,6 +14,12 @@ static const bool _sdl_supp = true;
static const bool _sdl_supp = false;
#endif
#ifdef HAVE_XVIDEO
static const bool _xvideo_supp = true;
#else
static const bool _xvideo_supp = false;
#endif
#ifdef HAVE_ALSA
static const bool _alsa_supp = true;
#else
+5
View File
@@ -134,6 +134,11 @@ Network port used for netplay. This defaults to 55435. This option affects both
Attempts to apply an UPS patch to the current ROM image. No files are altered.
If this flag is not specified, SSNES will look for a .ups file with same basename as ROM specified.
.TP
\fB--xml MAP, -X MAP\fR
Specifies path to XML memory map for the given ROM.
If this flag is not specified, SSNES will look for a .xml file with same basename as ROM specified.
.TP
\fB-D, --detach\fR
Detach from the current console. This is currently only relevant for Microsoft Windows.
+81 -5
View File
@@ -51,7 +51,7 @@ ssize_t read_file(const char *path, void **buf)
long len = ftell(file);
ssize_t rc = 0;
rewind(file);
rom_buf = malloc(len);
rom_buf = malloc(len + 1);
if (!rom_buf)
{
SSNES_ERR("Couldn't allocate memory!\n");
@@ -62,6 +62,9 @@ ssize_t read_file(const char *path, void **buf)
SSNES_WARN("Didn't read whole file.\n");
*buf = rom_buf;
// Allow for easy reading of strings to be safe.
// Will only work with sane character formatting (Unix).
((char*)rom_buf)[len] = '\0';
fclose(file);
return rc;
@@ -73,6 +76,46 @@ error:
return -1;
}
// Reads file content as one string.
bool read_file_string(const char *path, char **buf)
{
*buf = NULL;
FILE *file = fopen(path, "r");
if (!file)
goto error;
fseek(file, 0, SEEK_END);
long len = ftell(file) + 2; // Takes account of being able to read in EOF and '\0' at end.
rewind(file);
*buf = calloc(len, sizeof(char));
if (!*buf)
goto error;
char *ptr = *buf;
while (ptr && !feof(file))
{
size_t bufsize = (size_t)(((ptrdiff_t)*buf + (ptrdiff_t)len) - (ptrdiff_t)ptr);
fgets(ptr, bufsize, file);
ptr = strchr(ptr, '\0');
}
ptr = strchr(ptr, EOF);
if (ptr) *ptr = '\0';
fclose(file);
return true;
error:
if (file)
fclose(file);
if (*buf)
free(*buf);
return false;
}
// Load SNES rom only. Applies a hack for headered ROMs.
static ssize_t read_rom_file(FILE* file, void** buf)
{
@@ -270,6 +313,20 @@ void save_ram_file(const char* path, int type)
dump_to_file(path, data, size);
}
static char* load_xml_map(const char *path)
{
char *xml_buf = NULL;
if (*path)
{
if (!read_file_string(path, &xml_buf))
SSNES_LOG("Did not find XML memory map in \"%s\"\n", path);
else
SSNES_LOG("Found XML memory map in \"%s\"\n", path);
}
return xml_buf;
}
static bool load_sgb_rom(void)
{
void *rom_buf = NULL;
@@ -291,14 +348,19 @@ static bool load_sgb_rom(void)
goto error;
}
char *xml_buf = load_xml_map(g_extern.xml_name);
if (!psnes_load_cartridge_super_game_boy(
NULL, rom_buf, rom_len,
xml_buf, rom_buf, rom_len,
NULL, extra_rom_buf, extra_rom_len))
{
SSNES_ERR("Cannot load SGB/GameBoy rom.\n");
goto error;
}
if (xml_buf)
free(xml_buf);
if (g_extern.rom_file)
fclose(g_extern.rom_file);
if (extra_rom)
@@ -338,10 +400,12 @@ static bool load_bsx_rom(bool slotted)
goto error;
}
char *xml_buf = load_xml_map(g_extern.xml_name);
if (slotted)
{
if (!psnes_load_cartridge_bsx_slotted(
NULL, rom_buf, rom_len,
xml_buf, rom_buf, rom_len,
NULL, extra_rom_buf, extra_rom_len))
{
SSNES_ERR("Cannot load BSX slotted rom.\n");
@@ -360,6 +424,9 @@ static bool load_bsx_rom(bool slotted)
}
}
if (xml_buf)
free(xml_buf);
if (g_extern.rom_file)
fclose(g_extern.rom_file);
if (extra_rom)
@@ -407,8 +474,10 @@ static bool load_sufami_rom(void)
}
}
char *xml_buf = load_xml_map(g_extern.xml_name);
if (!psnes_load_cartridge_sufami_turbo(
NULL, rom_buf, rom_len,
xml_buf, rom_buf, rom_len,
NULL, extra_rom_buf[0], extra_rom_len[0],
NULL, extra_rom_buf[1], extra_rom_len[1]))
{
@@ -416,6 +485,8 @@ static bool load_sufami_rom(void)
goto error;
}
if (xml_buf)
free(xml_buf);
if (g_extern.rom_file)
fclose(g_extern.rom_file);
@@ -457,13 +528,18 @@ static bool load_normal_rom(void)
SSNES_LOG("ROM size: %d bytes\n", (int)rom_len);
if (!psnes_load_cartridge_normal(NULL, rom_buf, rom_len))
char *xml_buf = load_xml_map(g_extern.xml_name);
if (!psnes_load_cartridge_normal(xml_buf, rom_buf, rom_len))
{
SSNES_ERR("ROM file is not valid!\n");
free(rom_buf);
return false;
}
if (xml_buf)
free(xml_buf);
free(rom_buf);
return true;
}
+1
View File
@@ -177,6 +177,7 @@ struct global
char savefile_name_bsrm[512];
char savestate_name[256];
char ups_name[512];
char xml_name[512];
unsigned state_slot;
+4 -5
View File
@@ -96,10 +96,7 @@ struct netplay
void input_poll_net(void)
{
if (!netplay_should_skip(g_extern.netplay) && netplay_can_poll(g_extern.netplay))
{
netplay_callbacks(g_extern.netplay)->poll_cb();
netplay_poll(g_extern.netplay);
}
}
void video_frame_net(const uint16_t *data, unsigned width, unsigned height)
@@ -243,7 +240,7 @@ static bool init_socket(netplay_t *handle, const char *server, uint16_t port)
{
#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0)
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
{
WSACleanup();
return false;
@@ -470,7 +467,7 @@ static bool get_self_input_state(netplay_t *handle)
if (handle->frame_count > 0) // First frame we always give zero input since relying on input from first frame screws up when we use -F 0.
{
snes_input_state_t cb = handle->cbs.state_cb;
for (int i = 0; i <= 11; i++)
for (unsigned i = 0; i <= 11; i++)
{
int16_t tmp = cb(g_settings.input.netplay_client_swap_input ? 0 : !handle->port, SNES_DEVICE_JOYPAD, 0, i);
state |= tmp ? 1 << i : 0;
@@ -659,6 +656,8 @@ void netplay_pre_frame(netplay_t *handle)
{
psnes_serialize(handle->buffer[handle->self_ptr].state, handle->state_size);
handle->can_poll = true;
input_poll_net();
}
// Here we check if we have new input and replay from recorded input.
-1
View File
@@ -34,7 +34,6 @@ struct snes_callbacks
{
snes_video_refresh_t frame_cb;
snes_audio_sample_t sample_cb;
snes_input_poll_t poll_cb;
snes_input_state_t state_cb;
};
File renamed without changes.
+5 -3
View File
@@ -24,7 +24,7 @@ fi
check_lib DYLIB $DYLIB dlopen
check_lib NETPLAY -lc socket
check_lib ALSA -lasound snd_pcm_open
check_pkgconf ALSA alsa
check_header OSS sys/soundcard.h
check_header OSS_BSD soundcard.h
check_lib OSS_LIB -lossaudio
@@ -42,7 +42,7 @@ else
fi
check_pkgconf RSOUND rsound 1.1
check_lib ROAR -lroar roar_vs_new
check_pkgconf ROAR libroar
check_pkgconf JACK jack 0.120.1
check_pkgconf PULSE libpulse
@@ -67,12 +67,14 @@ check_pkgconf SRC samplerate
check_lib DYNAMIC $DYLIB dlopen
check_pkgconf FREETYPE freetype2
check_lib XVIDEO -lXv XvShmCreateImage
check_pkgconf XVIDEO xv
check_lib STRL -lc strlcpy
check_pkgconf PYTHON python3
add_define_make OS $OS
# Creates config.mk and config.h.
VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK PULSE SDL DYLIB CG XML SDL_IMAGE DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE SRC CONFIGFILE FREETYPE XVIDEO NETPLAY FBO STRL PYTHON"
create_config_make config.mk $VARS
+1 -1
View File
@@ -1,7 +1,7 @@
. qb/qb.params.sh
PACKAGE_NAME=ssnes
PACKAGE_VERSION=0.6
PACKAGE_VERSION=0.6.1
# Adds a command line opt to ./configure --help
# $1: Variable (HAVE_ALSA, HAVE_OSS, etc)
+13 -12
View File
@@ -1,24 +1,25 @@
. qb/conf.comp.sh
. qb/config.comp.sh
TEMP_C=.tmp.c
TEMP_CXX=.tmp.cxx
TEMP_EXE=.tmp
echo -n "Checking operating system ... "
ECHOBUF="Checking operating system ... "
OS="Win32" # whatever ;D
unamestr="`uname -a`"
if [ ! -z "`echo $unamestr | grep -i Linux`" ]; then
if [ ! -z "`echo "$unamestr" | grep -i Linux`" ]; then
OS="Linux"
elif [ ! -z "`echo $unamestr | grep -i Darwin`" ]; then
elif [ ! -z "`echo "$unamestr" | grep -i Darwin`" ]; then
OS="Darwin"
elif [ ! -z "`echo $unamestr | grep -i BSD`" ]; then
elif [ ! -z "`echo "$unamestr" | grep -i BSD`" ]; then
OS="BSD"
elif [ ! -z "`echo $unamestr | grep -i NT`" ]; then
elif [ ! -z "`echo "$unamestr" | grep -i MINGW32`" ]; then
OS="MinGW"
elif [ ! -z "`echo "$unamestr" | grep -i NT`" ]; then
OS="Cygwin"
fi
echo $OS
echo $ECHOBUF $OS
# Checking for working C compiler
if [ "$USE_LANG_C" = yes ]; then
@@ -31,12 +32,12 @@ if [ "$USE_LANG_C" = yes ]; then
exit 1
fi
echo -n "Checking if $CC is a suitable compiler ... "
ECHOBUF="Checking if $CC is a suitable compiler ..."
answer=no
echo "#include <stdio.h>" > $TEMP_C
echo "int main(void) { puts(\"Hai world!\"); return 0; }" >> $TEMP_C
$CC -o $TEMP_EXE $TEMP_C 2>/dev/null >/dev/null && answer=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_C $TEMP_EXE
@@ -54,12 +55,12 @@ if [ "$USE_LANG_CXX" = "yes" ]; then
exit 1
fi
echo -n "Checking if $CXX is a suitable compiler ... "
ECHOBUF="Checking if $CXX is a suitable compiler ..."
answer=no
echo "#include <iostream>" > $TEMP_CXX
echo "int main() { std::cout << \"Hai guise\" << std::endl; return 0; }" >> $TEMP_CXX
$CXX -o $TEMP_EXE $TEMP_CXX 2>/dev/null >/dev/null && answer=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_CXX $TEMP_EXE
+52 -23
View File
@@ -42,10 +42,10 @@ check_lib()
[ "$tmpval" = "no" ] && return 0
if [ -z "$3" ]; then
echo -n "Checking existence of $2 ..."
ECHOBUF="Checking existence of $2 ..."
echo "int main(void) { return 0; }" > $TEMP_C
else
echo -n "Checking function $3 in $2 ... "
ECHOBUF="Checking function $3 in $2 ..."
echo "void $3(void); int main(void) { $3(); return 0; }" > $TEMP_C
fi
@@ -56,9 +56,9 @@ check_lib()
$CC -o $TEMP_EXE $TEMP_C $INCLUDE_DIRS $LIBRARY_DIRS $extralibs $CFLAGS $LDFLAGS $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_C $TEMP_EXE
rm -f $TEMP_C $TEMP_EXE
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
echo "Forced to build with library $2, but cannot locate. Exiting ..."
exit 1
@@ -72,10 +72,10 @@ check_lib_cxx()
[ "$tmpval" = "no" ] && return 0
if [ -z "$3" ]; then
echo -n "Checking existence of $2 ..."
echo "int main(void) { return 0; }" > $TEMP_C
ECHOBUF="Checking existence of $2 ..."
echo "int main() { return 0; }" > $TEMP_CXX
else
echo -n "Checking function $3 in $2 ... "
ECHOBUF="Checking function $3 in $2 ..."
echo "extern \"C\" { void $3(void); } int main() { $3(); }" > $TEMP_CXX
fi
@@ -86,25 +86,55 @@ check_lib_cxx()
$CXX -o $TEMP_EXE $TEMP_CXX $INCLUDE_DIRS $LIBRARY_DIRS $extralibs $CFLAGS $LDFLAGS $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_CXX $TEMP_EXE
rm -f $TEMP_CXX $TEMP_EXE
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
echo "Forced to build with library $2, but cannot locate. Exiting ..."
exit 1
fi
}
check_code_c()
{
tmpval="HAVE_$1"
eval tmpval=\$$tmpval
[ "$tmpval" = "no" ] && return 0
ECHOBUF="Checking C code snippet \"$3\" ..."
eval HAVE_$1=no
answer=no
$CC -o $TEMP_EXE $TEMP_C $INCLUDE_DIRS $LIBRARY_DIRS $2 $CFLAGS $LDFLAGS 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $ECHOBUF $answer
rm -f $TEMP_C $TEMP_EXE
}
check_code_cxx()
{
tmpval="HAVE_$1"
eval tmpval=\$$tmpval
[ "$tmpval" = "no" ] && return 0
ECHOBUF="Checking C++ code snippet \"$3\" ..."
eval HAVE_$1=no
answer=no
$CXX -o $TEMP_EXE $TEMP_CXX $INCLUDE_DIRS $LIBRARY_DIRS $2 $CXXFLAGS $LDFLAGS 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $ECHOBUF $answer
rm -f $TEMP_CXX $TEMP_EXE
}
locate_pkg_conf()
{
echo -n "Checking for pkg-config ... "
ECHOBUF="Checking for pkg-config ... "
PKG_CONF_PATH="`which pkg-config | grep ^/ | head -n1`"
if [ -z $PKG_CONF_PATH ]; then
echo "not found"
echo "Cannot locate pkg-config. Exiting ..."
exit 1
fi
echo "$PKG_CONF_PATH"
echo $ECHOBUF $PKG_CONF_PATH
}
check_pkgconf()
@@ -115,16 +145,16 @@ check_pkgconf()
eval tmpval=\$$tmpval
[ "$tmpval" = "no" ] && return 0
echo -n "Checking presence of package $2"
ECHOBUF="Checking presence of package $2"
eval HAVE_$1=no
eval $1_CFLAGS=""
eval $1_LIBS=""
answer=no
minver=0.0
[ ! -z $3 ] && minver=$3 && echo -n " with minimum version $minver"
echo -n " ... "
[ ! -z $3 ] && minver=$3 && ECHOBUF="$ECHOBUF with minimum version $minver"
ECHOBUF="$ECHOBUF ... "
pkg-config --atleast-version=$minver "$2" && eval HAVE_$1=yes && eval $1_CFLAGS='"`pkg-config $2 --cflags`"' && eval $1_LIBS='"`pkg-config $2 --libs`"' && answer=yes
echo $answer
echo $ECHOBUF $answer
PKG_CONF_USED="$PKG_CONF_USED $1"
@@ -140,7 +170,7 @@ check_header()
eval tmpval=\$$tmpval
[ "$tmpval" = "no" ] && return 0
echo -n "Checking presence of header file $2 ... "
ECHOBUF="Checking presence of header file $2 ..."
echo "#include<$2>" > $TEMP_C
echo "int main(void) { return 0; }" >> $TEMP_C
eval HAVE_$1=no
@@ -148,7 +178,7 @@ check_header()
$CC -o $TEMP_EXE $TEMP_C $INCLUDE_DIRS 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_C $TEMP_EXE
if [ "$tmpval" = "yes" ] && [ "$answer" = "no" ]; then
@@ -159,7 +189,7 @@ check_header()
check_switch_c()
{
echo -n "Checking for availability of switch $2 in $CC ... "
ECHOBUF="Checking for availability of switch $2 in $CC ..."
if [ -z "$CC" ]; then
echo "No C compiler, cannot check ..."
exit 1
@@ -169,14 +199,14 @@ check_switch_c()
answer=no
$CC -o $TEMP_EXE $TEMP_C $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_C $TEMP_EXE
}
check_switch_cxx()
{
echo -n "Checking for availability of switch $2 in $CXX ... "
ECHOBUF="Checking for availability of switch $2 in $CXX ... "
if [ -z "$CXX" ]; then
echo "No C++ compiler, cannot check ..."
exit 1
@@ -186,7 +216,7 @@ check_switch_cxx()
answer=no
$CXX -o $TEMP_EXE $TEMP_CXX $2 2>/dev/null >/dev/null && answer=yes && eval HAVE_$1=yes
echo $answer
echo $ECHOBUF $answer
rm -rf $TEMP_CXX $TEMP_EXE
}
@@ -216,7 +246,7 @@ create_config_header()
echo "Creating config header: $outfile"
name="`echo __$outfile | sed 's|[\./]|_|g' | tr '[a-z]' '[A-Z]'`"
name="`echo QB_${outfile}__ | sed 's|[\./]|_|g' | tr '[a-z]' '[A-Z]'`"
echo "#ifndef $name" > "$outfile"
echo "#define $name" >> "$outfile"
echo "" >> "$outfile"
@@ -260,7 +290,6 @@ output_define_make()
create_config_make()
{
outfile="$1"
shift
+1 -2
View File
@@ -64,8 +64,7 @@ print_sub_opt()
lowertext="`echo $arg1 | tr '[A-Z]' '[a-z]'`"
if [ "$arg3" = "auto" ]; then
echo -n "--enable-$lowertext: "
echo $arg2
echo "--enable-$lowertext: $arg2"
echo "--disable-$lowertext"
elif [ "$arg3" = "yes" ]; then
echo "--disable-$lowertext: $arg2"
+14 -6
View File
@@ -340,7 +340,7 @@ static void fill_pathname_noext(char *out_path, const char *in_path, const char
#endif
#ifdef _WIN32
#define PACKAGE_VERSION "0.6"
#define PACKAGE_VERSION "0.6.1"
#endif
#include "config.features.h"
@@ -351,6 +351,7 @@ static void print_features(void)
puts("");
puts("Features:");
_PSUPP(sdl, "SDL", "SDL drivers");
_PSUPP(xvideo, "XVideo", "XVideo output");
_PSUPP(alsa, "ALSA", "audio driver");
_PSUPP(oss, "OSS", "audio driver");
_PSUPP(jack, "Jack", "audio driver");
@@ -407,10 +408,11 @@ static void print_help(void)
#endif
#ifdef HAVE_FFMPEG
puts("\t-r/--record: Path to record video file. Settings for video/audio codecs are found in config file.");
puts("\t-r/--record: Path to record video file.\n\t\tSettings for video/audio codecs are found in config file.");
#endif
puts("\t-v/--verbose: Verbose logging.");
puts("\t-U/--ups: Specifies path for UPS patch that will be applied to ROM.");
puts("\t-X/--xml: Specifies path to XML memory map.");
puts("\t-D/--detach: Detach SSNES from the running console. Not relevant for all platforms.\n");
print_features();
@@ -464,6 +466,7 @@ static void parse_input(int argc, char *argv[])
{ "frames", 1, NULL, 'F' },
{ "port", 1, &val, 'p' },
{ "ups", 1, NULL, 'U' },
{ "xml", 1, NULL, 'X' },
{ "detach", 0, NULL, 'D' },
{ NULL, 0, NULL, 0 }
};
@@ -482,7 +485,7 @@ static void parse_input(int argc, char *argv[])
#define CONFIG_FILE_ARG
#endif
char optstring[] = "hs:vS:m:p4jJg:b:B:Y:Z:P:HC:F:U:DN:" FFMPEG_RECORD_ARG CONFIG_FILE_ARG;
char optstring[] = "hs:vS:m:p4jJg:b:B:Y:Z:P:HC:F:U:DN:X:" FFMPEG_RECORD_ARG CONFIG_FILE_ARG;
for(;;)
{
val = 0;
@@ -612,6 +615,10 @@ static void parse_input(int argc, char *argv[])
strlcpy(g_extern.ups_name, optarg, sizeof(g_extern.ups_name));
break;
case 'X':
strlcpy(g_extern.xml_name, optarg, sizeof(g_extern.xml_name));
break;
case 'D':
#ifdef _WIN32
FreeConsole();
@@ -898,7 +905,6 @@ static void init_netplay(void)
struct snes_callbacks cbs = {
.frame_cb = video_frame,
.sample_cb = audio_sample,
.poll_cb = input_poll,
.state_cb = input_state
};
@@ -1029,6 +1035,9 @@ static void fill_pathnames(void)
if (!(*g_extern.ups_name) && *g_extern.basename)
fill_pathname_noext(g_extern.ups_name, g_extern.basename, ".ups", sizeof(g_extern.ups_name));
if (!(*g_extern.xml_name) && *g_extern.basename)
fill_pathname_noext(g_extern.xml_name, g_extern.basename, ".xml", sizeof(g_extern.xml_name));
}
// Save or load state here.
@@ -1500,14 +1509,13 @@ int main(int argc, char *argv[])
#ifdef HAVE_NETPLAY
psnes_set_video_refresh(g_extern.netplay ? video_frame_net : video_frame);
psnes_set_audio_sample(g_extern.netplay ? audio_sample_net : audio_sample);
psnes_set_input_poll(g_extern.netplay ? input_poll_net : input_poll);
psnes_set_input_state(g_extern.netplay ? input_state_net : input_state);
#else
psnes_set_video_refresh(video_frame);
psnes_set_audio_sample(audio_sample);
psnes_set_input_poll(input_poll);
psnes_set_input_state(input_state);
#endif
psnes_set_input_poll(input_poll);
init_controllers();