snes-support 64bit bsnes builds. this isnt tested yet since i dont have a 64bit system atm, but most of the infrastructure is there
This commit is contained in:
parent
0545cb64fa
commit
c9b662d7ea
|
@ -374,7 +374,12 @@ namespace BizHawk.MultiClient
|
||||||
void SNES_Check(string profile)
|
void SNES_Check(string profile)
|
||||||
{
|
{
|
||||||
if (SNES_prepared.ContainsKey(profile)) return;
|
if (SNES_prepared.ContainsKey(profile)) return;
|
||||||
string exename = "libsneshawk-" + profile.ToLower() + ".exe";
|
|
||||||
|
string bits = "32";
|
||||||
|
if (Win32.Is64BitOperatingSystem)
|
||||||
|
bits = "64";
|
||||||
|
|
||||||
|
string exename = "libsneshawk-" + bits + "-" + profile.ToLower() + ".exe";
|
||||||
|
|
||||||
string thisDir = PathManager.GetExeDirectoryAbsolute();
|
string thisDir = PathManager.GetExeDirectoryAbsolute();
|
||||||
string exePath = Path.Combine(thisDir, exename);
|
string exePath = Path.Combine(thisDir, exename);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -9,6 +9,38 @@ namespace BizHawk
|
||||||
{
|
{
|
||||||
public static class Win32
|
public static class Win32
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static bool Is64BitProcess { get { return (IntPtr.Size == 8); } }
|
||||||
|
public static bool Is64BitOperatingSystem { get { return Is64BitProcess || InternalCheckIsWow64(); } }
|
||||||
|
|
||||||
|
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
|
||||||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
|
private static extern bool IsWow64Process(
|
||||||
|
[In] IntPtr hProcess,
|
||||||
|
[Out] out bool wow64Process
|
||||||
|
);
|
||||||
|
|
||||||
|
static bool InternalCheckIsWow64()
|
||||||
|
{
|
||||||
|
if ((Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1) ||
|
||||||
|
Environment.OSVersion.Version.Major >= 6)
|
||||||
|
{
|
||||||
|
using (var p = System.Diagnostics.Process.GetCurrentProcess())
|
||||||
|
{
|
||||||
|
bool retVal;
|
||||||
|
if (!IsWow64Process(p.Handle, out retVal))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
public struct RECT
|
public struct RECT
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
./bizwinmakeone.sh compatibility
|
./bizwinmakeone.sh 32 compatibility
|
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#makes all bsnes binaries for distribution
|
#makes all bsnes binaries for distribution
|
||||||
#TODO - 64bit
|
#use bizwinmakedistro64.sh for 64bit (dont run it at the same time!)
|
||||||
|
|
||||||
./bizwinclean.sh
|
./bizwinclean.sh
|
||||||
./bizwinmakeone.sh performance compress
|
./bizwinmakeone.sh 32 performance compress
|
||||||
./bizwinclean.sh
|
./bizwinclean.sh
|
||||||
./bizwinmakeone.sh compatibility compress
|
./bizwinmakeone.sh 32 compatibility compress
|
||||||
|
|
||||||
#leave compatibility built as objs because thats more useful to us while devving
|
#leave compatibility built as objs because thats more useful to us while devving
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#makes all bsnes binaries for distribution
|
||||||
|
#use bizwinmakedistro64.sh for 64bit (dont run it at the same time!)
|
||||||
|
|
||||||
|
./bizwinclean.sh
|
||||||
|
./bizwinmakeone.sh 64 performance compress
|
||||||
|
./bizwinclean.sh
|
||||||
|
./bizwinmakeone.sh 64 compatibility compress
|
||||||
|
|
||||||
|
#leave compatibility built as objs because thats more useful to us while devving
|
||||||
|
|
|
@ -5,22 +5,32 @@ cd bsnes
|
||||||
mkdir obj
|
mkdir obj
|
||||||
mkdir out
|
mkdir out
|
||||||
|
|
||||||
|
if [ "$1" == "64" ]; then
|
||||||
|
export cflags64=-m64 ;
|
||||||
|
export compiler=i686-w64-mingw32-c++.exe
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == "32" ]; then
|
||||||
|
export cflags32=-llibco_msvc_win32 ;
|
||||||
|
fi
|
||||||
|
|
||||||
#debug:
|
#debug:
|
||||||
#export BIZWINCFLAGS="-I. -O0 -g -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
|
#export BIZWINCFLAGS="-I. -O0 -g -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
|
||||||
|
|
||||||
#not debug
|
#not debug
|
||||||
export BIZWINCFLAGS="-I. -O3 -masm=intel -static-libgcc -static-libstdc++"
|
export BIZWINCFLAGS="-I. -O3 -masm=intel -static-libgcc -static-libstdc++ ${cflags64}"
|
||||||
|
|
||||||
export TARGET_LIBSNES_LIBDEPS="-L ../libco_msvc_win32/release/ -llibco_msvc_win32 -static-libgcc -static-libstdc++ -Wl,--subsystem,windows"
|
export TARGET_LIBSNES_LIBDEPS="-L ../libco_msvc_win32/release/ -static-libgcc -static-libstdc++ ${cflags64} ${cflags32} -mwindows"
|
||||||
export profile=$1
|
export profile=$2
|
||||||
|
export bits=$1
|
||||||
|
|
||||||
platform=win target=libsnes make -e -j 4
|
platform=win target=libsnes make -e -j 4
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
filename=libsneshawk-${profile}.exe
|
filename=libsneshawk-${bits}-${profile}.exe
|
||||||
targetdir=../BizHawk.MultiClient/output/dll
|
targetdir=../BizHawk.MultiClient/output/dll
|
||||||
targetpath=${targetdir}/${filename}
|
targetpath=${targetdir}/${filename}
|
||||||
cp bsnes/out/${filename} ${targetdir}
|
cp bsnes/out/${filename} ${targetdir}
|
||||||
if [ "$2" == "compress" ]; then
|
if [ "$3" == "compress" ]; then
|
||||||
upx -9 ${targetpath} ;
|
upx -9 ${targetpath} ;
|
||||||
fi
|
fi
|
|
@ -37,7 +37,7 @@ else ifeq ($(platform),osx)
|
||||||
else ifeq ($(platform),win)
|
else ifeq ($(platform),win)
|
||||||
link += $(if $(findstring console,$(options)),-mconsole,-mwindows)
|
link += $(if $(findstring console,$(options)),-mconsole,-mwindows)
|
||||||
link += -mthreads -s -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32
|
link += -mthreads -s -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32
|
||||||
link += -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
|
link += -enable-auto-import -enable-runtime-pseudo-reloc
|
||||||
else
|
else
|
||||||
unknown_platform: help;
|
unknown_platform: help;
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -20,12 +20,12 @@ obj/libsnes_pwrap.o: $(ui)/libsnes_pwrap.cpp $(ui)/*
|
||||||
build: $(objects)
|
build: $(objects)
|
||||||
ifeq ($(platform),x)
|
ifeq ($(platform),x)
|
||||||
ar rcs out/libsnes.a $(objects)
|
ar rcs out/libsnes.a $(objects)
|
||||||
$(cpp) -o out/libsnes.so -shared -Wl,-soname,libsnes.so.1 $(objects)
|
$(cpp) -o out/libsnes.so -shared -soname,libsnes.so.1 $(objects)
|
||||||
else ifeq ($(platform),osx)
|
else ifeq ($(platform),osx)
|
||||||
ar rcs out/libsnes.a $(objects)
|
ar rcs out/libsnes.a $(objects)
|
||||||
$(cpp) -o out/libsnes.dylib -install_name @executable_path/../Libraries/libsnes.dylib -shared -dynamiclib $(objects)
|
$(cpp) -o out/libsnes.dylib -install_name @executable_path/../Libraries/libsnes.dylib -shared -dynamiclib $(objects)
|
||||||
else ifeq ($(platform),win)
|
else ifeq ($(platform),win)
|
||||||
$(cpp) -o out/libsneshawk-$(profile).exe -Wl $(objects) $(TARGET_LIBSNES_LIBDEPS)
|
$(cpp) -o out/libsneshawk-$(bits)-$(profile).exe $(objects) $(TARGET_LIBSNES_LIBDEPS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|
Loading…
Reference in New Issue