o compiles now for mac but crashes
This commit is contained in:
parent
091b82a7ef
commit
7a878eab39
@ -6,13 +6,12 @@ ui = ui_qt
|
|||||||
### compiler ###
|
### compiler ###
|
||||||
################
|
################
|
||||||
|
|
||||||
platform=x
|
platform=mac
|
||||||
compiler=gcc
|
compiler=gcc
|
||||||
enable_gzip=true
|
enable_gzip=false
|
||||||
|
|
||||||
ifneq ($(findstring gcc,$(compiler)),) # GCC family
|
ifneq ($(findstring gcc,$(compiler)),) # GCC family
|
||||||
flags = -O2 -fomit-frame-pointer -Ilib
|
flags = -O2 -fomit-frame-pointer -Ilib
|
||||||
# note: libco *requires* -fomit-frame-pointer on i386 arch
|
|
||||||
libcoflags := $(flags) -static
|
libcoflags := $(flags) -static
|
||||||
c = $(compiler)
|
c = $(compiler)
|
||||||
cpp = $(subst cc,++,$(compiler))
|
cpp = $(subst cc,++,$(compiler))
|
||||||
@ -24,7 +23,6 @@ ifneq ($(findstring gcc,$(compiler)),) # GCC family
|
|||||||
mkincpath = -I$1
|
mkincpath = -I$1
|
||||||
mklib = -l$1
|
mklib = -l$1
|
||||||
mklibpath = -L$1
|
mklibpath = -L$1
|
||||||
|
|
||||||
# profile-guided optimization:
|
# profile-guided optimization:
|
||||||
#flags += -fprofile-generate
|
#flags += -fprofile-generate
|
||||||
#link += -lgcov
|
#link += -lgcov
|
||||||
@ -51,16 +49,46 @@ endif
|
|||||||
### os ###
|
### os ###
|
||||||
##########
|
##########
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(platform),mac) #Mac
|
||||||
|
ruby = video.glx video.xv video.sdl audio.alsa audio.openal audio.oss audio.pulseaudio audio.ao input.sdl input.x
|
||||||
|
mkbin = -o $1
|
||||||
|
delete = rm -f $1
|
||||||
|
link += -L/opt/local/lib \
|
||||||
|
-lSDL -framework,Cocoa \
|
||||||
|
-lX11 \
|
||||||
|
-lm \
|
||||||
|
-framework Foundation\
|
||||||
|
-framework Cocoa \
|
||||||
|
-framework AGL \
|
||||||
|
-framework OpenAL\
|
||||||
|
-framework ApplicationServices \
|
||||||
|
-framework Foundation\
|
||||||
|
-framework OpenGL\
|
||||||
|
-framework GLUT \
|
||||||
|
-lz \
|
||||||
|
-lgl \
|
||||||
|
-lao
|
||||||
|
|
||||||
|
|
||||||
|
flags +=-I/opt/local/include \
|
||||||
|
-I/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers/\
|
||||||
|
-DVIDEO_SDL \
|
||||||
|
-DINPUT_SDL \
|
||||||
|
-DVIDEO_GLX \
|
||||||
|
-DAUDIO_AO \
|
||||||
|
-DAUDIO_OPENAL
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(platform),x) # X11
|
ifeq ($(platform),x) # X11
|
||||||
ruby = video.glx video.xv video.sdl audio.alsa audio.openal audio.oss audio.pulseaudio audio.ao input.sdl input.x
|
ruby = video.glx video.xv video.sdl audio.alsa audio.openal audio.oss audio.pulseaudio audio.ao input.sdl input.x
|
||||||
delete = rm -f $1
|
delete = rm -f $1
|
||||||
|
|
||||||
else ifeq ($(platform),win) # Windows
|
else ifeq ($(platform),win) # Windows
|
||||||
mingw_link_flags = -mwindows
|
mingw_link_flags = -mwindows
|
||||||
# mingw_links_flags = -mconsole
|
# mingw_links_flags = -mconsole
|
||||||
|
|
||||||
# enable static linking to Qt for Windows build
|
# enable static linking to Qt for Windows build
|
||||||
mingw_link_flags += -enable-stdcall-fixup -Wl,-s -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
|
mingw_link_flags += -enable-stdcall-fixup -Wl,-s -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
|
||||||
|
|
||||||
ruby = video.direct3d video.wgl video.directdraw video.gdi audio.directsound input.rawinput input.directinput
|
ruby = video.direct3d video.wgl video.directdraw video.gdi audio.directsound input.rawinput input.directinput
|
||||||
delete = $(if $(findstring i586-mingw-gcc,$(compiler)),rm -f $1,del $(subst /,\,$1))
|
delete = $(if $(findstring i586-mingw-gcc,$(compiler)),rm -f $1,del $(subst /,\,$1))
|
||||||
link += $(if $(findstring mingw,$(compiler)),$(mingw_link_flags))
|
link += $(if $(findstring mingw,$(compiler)),$(mingw_link_flags))
|
||||||
@ -69,8 +97,6 @@ else ifeq ($(platform),win) # Windows
|
|||||||
link += $(call mklib,user32)
|
link += $(call mklib,user32)
|
||||||
link += $(call mklib,gdi32)
|
link += $(call mklib,gdi32)
|
||||||
link += $(call mklib,shell32)
|
link += $(call mklib,shell32)
|
||||||
else
|
|
||||||
unknown_platform: help;
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
############
|
############
|
||||||
@ -78,20 +104,20 @@ endif
|
|||||||
############
|
############
|
||||||
|
|
||||||
rubyflags = $(if $(findstring .sdl,$(ruby)),`sdl-config --cflags`)
|
rubyflags = $(if $(findstring .sdl,$(ruby)),`sdl-config --cflags`)
|
||||||
link += $(if $(findstring .sdl,$(ruby)),`sdl-config --libs`)
|
#link += $(if $(findstring .sdl,$(ruby)),`sdl-config --libs`)
|
||||||
|
|
||||||
link += $(if $(findstring video.direct3d,$(ruby)),$(call mklib,d3d9))
|
#link += $(if $(findstring video.direct3d,$(ruby)),$(call mklib,d3d9))
|
||||||
link += $(if $(findstring video.directdraw,$(ruby)),$(call mklib,ddraw))
|
#link += $(if $(findstring video.directdraw,$(ruby)),$(call mklib,ddraw))
|
||||||
link += $(if $(findstring video.glx,$(ruby)),$(call mklib,GL))
|
#link += $(if $(findstring video.glx,$(ruby)),$(call mklib,GL))
|
||||||
link += $(if $(findstring video.wgl,$(ruby)),$(call mklib,opengl32))
|
#link += $(if $(findstring video.wgl,$(ruby)),$(call mklib,opengl32))
|
||||||
link += $(if $(findstring video.xv,$(ruby)),$(call mklib,Xv))
|
#link += $(if $(findstring video.xv,$(ruby)),$(call mklib,Xv))
|
||||||
link += $(if $(findstring audio.alsa,$(ruby)),$(call mklib,asound))
|
#link += $(if $(findstring audio.alsa,$(ruby)),$(call mklib,asound))
|
||||||
link += $(if $(findstring audio.ao,$(ruby)),$(call mklib,ao))
|
#link += $(if $(findstring audio.ao,$(ruby)),$(call mklib,ao))
|
||||||
link += $(if $(findstring audio.directsound,$(ruby)),$(call mklib,dsound))
|
#link += $(if $(findstring audio.directsound,$(ruby)),$(call mklib,dsound))
|
||||||
link += $(if $(findstring audio.openal,$(ruby)),$(if $(call streq,$(platform),x),$(call mklib,openal),$(call mklib,openal32)))
|
#link += $(if $(findstring audio.openal,$(ruby)),$(if $(call streq,$(platform),x),$(call mklib,openal),$(call mklib,openal32)))
|
||||||
link += $(if $(findstring audio.pulseaudio,$(ruby)),$(call mklib,pulse-simple))
|
#link += $(if $(findstring audio.pulseaudio,$(ruby)),$(call mklib,pulse-simple))
|
||||||
link += $(if $(findstring input.directinput,$(ruby)),$(call mklib,dinput8) $(call mklib,dxguid))
|
#link += $(if $(findstring input.directinput,$(ruby)),$(call mklib,dinput8) $(call mklib,dxguid))
|
||||||
link += $(if $(findstring input.rawinput,$(ruby)),$(call mklib,xinput) $(call mklib,dinput8) $(call mklib,dxguid))
|
#link += $(if $(findstring input.rawinput,$(ruby)),$(call mklib,xinput) $(call mklib,dinput8) $(call mklib,dxguid))
|
||||||
|
|
||||||
####################
|
####################
|
||||||
### core objects ###
|
### core objects ###
|
||||||
@ -103,13 +129,13 @@ objects = libco ruby libfilter string \
|
|||||||
bsx srtc sdd1 spc7110 cx4 dsp1 dsp2 dsp3 dsp4 obc1 st010
|
bsx srtc sdd1 spc7110 cx4 dsp1 dsp2 dsp3 dsp4 obc1 st010
|
||||||
|
|
||||||
ifeq ($(enable_gzip),true)
|
ifeq ($(enable_gzip),true)
|
||||||
objects += adler32 compress crc32 deflate gzio inffast inflate inftrees ioapi trees unzip zip zutil
|
#objects += adler32 compress crc32 deflate gzio inffast inflate inftrees ioapi trees unzip zip zutil
|
||||||
flags += $(call mkdef,GZIP_SUPPORT)
|
#flags += $(call mkdef,GZIP_SUPPORT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(enable_jma),true)
|
ifeq ($(enable_jma),true)
|
||||||
objects += jma jcrc32 lzmadec 7zlzma iiostrm inbyte lzma winout
|
#objects += jma jcrc32 lzmadec 7zlzma iiostrm inbyte lzma winout
|
||||||
flags += $(call mkdef,JMA_SUPPORT)
|
#flags += $(call mkdef,JMA_SUPPORT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
######################
|
######################
|
||||||
@ -131,8 +157,9 @@ compile = \
|
|||||||
all: build;
|
all: build;
|
||||||
|
|
||||||
include $(ui)/Makefile
|
include $(ui)/Makefile
|
||||||
|
|
||||||
objects := $(patsubst %,obj/%.$(obj),$(objects))
|
objects := $(patsubst %,obj/%.$(obj),$(objects))
|
||||||
rubydef := $(foreach c,$(subst .,_,$(call strupper,$(ruby))),$(call mkdef,$c))
|
#rubydef := $(foreach c,$(subst .,_,$(call strupper,$(ruby))),$(call mkdef,$c))
|
||||||
|
|
||||||
#################
|
#################
|
||||||
### libraries ###
|
### libraries ###
|
||||||
@ -246,7 +273,7 @@ obj/winout.$(obj) : reader/jma/winout.cpp reader/jma/*
|
|||||||
###############
|
###############
|
||||||
|
|
||||||
build: ui_build $(objects)
|
build: ui_build $(objects)
|
||||||
gcc $(call mkbin,bsnes) $(objects) $(link)
|
g++ $(call mkbin,bsnes) $(objects) $(link)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -D -m 755 ../bsnes $(DESTDIR)$(prefix)/bin/bsnes
|
install -D -m 755 ../bsnes $(DESTDIR)$(prefix)/bin/bsnes
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
#include <AL/al.h>
|
|
||||||
#include <AL/alc.h>
|
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <al.h>
|
||||||
|
#include <alc.h>
|
||||||
|
#else
|
||||||
|
#include <AL/al.h>
|
||||||
|
#include <AL/alc.h>
|
||||||
|
#endif
|
||||||
namespace ruby {
|
namespace ruby {
|
||||||
|
|
||||||
#include "openal.hpp"
|
#include "openal.hpp"
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
#include "inflate.h"
|
#include "inflate.h"
|
||||||
#include "inffast.h"
|
#include "inffast.h"
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __FALSE__
|
||||||
|
|
||||||
void inflate_fast(strm, start)
|
void inflate_fast(strm, start)
|
||||||
z_streamp strm;
|
z_streamp strm;
|
||||||
|
|||||||
@ -75,11 +75,6 @@ public:
|
|||||||
) ppu.latch_counters();
|
) ppu.latch_counters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
bool iobit;
|
|
||||||
uint16_t latchx, latchy;
|
|
||||||
|
|
||||||
struct port_t {
|
struct port_t {
|
||||||
unsigned device;
|
unsigned device;
|
||||||
unsigned counter0; //read counters
|
unsigned counter0; //read counters
|
||||||
@ -110,5 +105,11 @@ private:
|
|||||||
} justifier;
|
} justifier;
|
||||||
} port[2];
|
} port[2];
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool iobit;
|
||||||
|
uint16_t latchx, latchy;
|
||||||
|
|
||||||
friend class SNES;
|
friend class SNES;
|
||||||
|
|
||||||
} input;
|
} input;
|
||||||
|
|||||||
@ -4,13 +4,28 @@
|
|||||||
|
|
||||||
objects := main $(if $(call streq,$(platform),win),resource) $(objects)
|
objects := main $(if $(call streq,$(platform),win),resource) $(objects)
|
||||||
|
|
||||||
moc = moc-qt4
|
ifeq ($(platform),mac)
|
||||||
rcc = rcc
|
moc = moc
|
||||||
|
rcc = rcc
|
||||||
|
link +=-F/Developer/SDKs/Qt/lib \
|
||||||
|
-L/Developer/SDKs/Qt/lib \
|
||||||
|
-framework QtOpenGL \
|
||||||
|
-framework QtGui \
|
||||||
|
-framework Carbon \
|
||||||
|
-framework AppKit \
|
||||||
|
-framework QtCore
|
||||||
|
qtflags= -I/Developer/SDKs/Qt/include/ \
|
||||||
|
-I/Developer/SDKs/Qt/include/Qt \
|
||||||
|
-I/Developer/SDKs/Qt/include/QtCore \
|
||||||
|
-I/Developer/SDKs/Qt/include/QtGui
|
||||||
|
|
||||||
|
endif
|
||||||
ifeq ($(platform),x) # X11
|
ifeq ($(platform),x) # X11
|
||||||
link += $(call mklib,Xtst)
|
moc = moc-qt4
|
||||||
link += `pkg-config --libs QtCore QtGui`
|
rcc = rcc
|
||||||
qtflags = `pkg-config --cflags QtCore QtGui`
|
link += $(call mklib,Xtst)
|
||||||
|
link += `pkg-config --libs QtCore QtGui`
|
||||||
|
qtflags = `pkg-config --cflags QtCore QtGui`
|
||||||
else ifeq ($(platform),win) # Windows
|
else ifeq ($(platform),win) # Windows
|
||||||
qtdir = c:/qt450
|
qtdir = c:/qt450
|
||||||
|
|
||||||
|
|||||||
@ -93,7 +93,7 @@
|
|||||||
//keycode of 255 does not map to any actual key,
|
//keycode of 255 does not map to any actual key,
|
||||||
//but it will block screensaver and power management.
|
//but it will block screensaver and power management.
|
||||||
Display *display = XOpenDisplay(0);
|
Display *display = XOpenDisplay(0);
|
||||||
XTestFakeKeyEvent(display, 255, True, 0);
|
//XTestFakeKeyEvent(display, 255, True, 0);
|
||||||
XTestFakeKeyEvent(display, 255, False, 0);
|
//XTestFakeKeyEvent(display, 255, False, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user