summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:58:48 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:58:48 +0000
commit13c3e056aac56a8733db9b20c23609437c430c17 (patch)
treeb4af294840974cca307d3cf767ddb4b75dd62be7 /src
parentad80ff6c3f58529f95ca71d4ec397df6cb7eb25d (diff)
Enable compiling PortMidi (nw)
Tested on: Linux x64, Mac OS X 10.8, Windows 8 x64 w/latest toolchain for both OSD=windows and OSD=sdl. MIDI should auto-disable on other OSes (*BSD) but there may be problems. Works fine on Linux when set to use the system's copy of the library as well, which many distros prefer.
Diffstat (limited to 'src')
-rw-r--r--src/emu/clifront.c12
-rw-r--r--src/emu/clifront.h3
-rw-r--r--src/osd/sdl/sdl.mak28
-rw-r--r--src/osd/sdl/sdlmain.c4
-rw-r--r--src/osd/windows/windows.mak7
-rw-r--r--src/osd/windows/winmain.c4
6 files changed, 51 insertions, 7 deletions
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index 188b71a4314..3427cea0fe5 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -91,6 +91,7 @@ const options_entry cli_options::s_option_entries[] =
{ CLICOMMAND_VERIFYSOFTWARE ";vsoft", "0", OPTION_COMMAND, "verify known software for the system" },
{ CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" },
{ CLICOMMAND_VERIFYSOFTLIST ";vlist", "0", OPTION_COMMAND, "verify software list by name" },
+ { CLICOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" },
{ NULL }
};
@@ -733,6 +734,16 @@ void cli_frontend::listmedia(const char *gamename)
}
}
+//-------------------------------------------------
+// listmididevices - output the list of MIDI devices
+// available in the current system to be used
+//-------------------------------------------------
+
+void cli_frontend::listmididevices(const char *gamename)
+{
+ osd_list_midi_devices();
+}
+
//-------------------------------------------------
// verifyroms - verify the ROM sets of one or
@@ -1644,6 +1655,7 @@ void cli_frontend::execute_commands(const char *exename)
{ CLICOMMAND_ROMIDENT, &cli_frontend::romident },
{ CLICOMMAND_GETSOFTLIST, &cli_frontend::getsoftlist },
{ CLICOMMAND_VERIFYSOFTLIST, &cli_frontend::verifysoftlist },
+ { CLICOMMAND_LIST_MIDI_DEVICES, &cli_frontend::listmididevices },
};
// find the command
diff --git a/src/emu/clifront.h b/src/emu/clifront.h
index 14d7be74a48..19c8f8e16ac 100644
--- a/src/emu/clifront.h
+++ b/src/emu/clifront.h
@@ -78,7 +78,7 @@
#define CLICOMMAND_VERIFYSOFTWARE "verifysoftware"
#define CLICOMMAND_GETSOFTLIST "getsoftlist"
#define CLICOMMAND_VERIFYSOFTLIST "verifysoftlist"
-
+#define CLICOMMAND_LIST_MIDI_DEVICES "listmidi"
//**************************************************************************
@@ -128,6 +128,7 @@ public:
void romident(const char *filename);
void getsoftlist(const char *gamename = "*");
void verifysoftlist(const char *gamename = "*");
+ void listmididevices(const char *gamename = "*");
private:
// internal helpers
diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak
index fba05ac24e1..02faa903b51 100644
--- a/src/osd/sdl/sdl.mak
+++ b/src/osd/sdl/sdl.mak
@@ -79,6 +79,9 @@ NO_USE_XINPUT = 1
# uncomment to try the experimental new Qt debugger
#USE_QTDEBUG = 1
+# uncomment to disable MIDI
+#NO_USE_MIDI = 1
+
###########################################################################
################## END USER-CONFIGURABLE OPTIONS ######################
###########################################################################
@@ -185,6 +188,12 @@ ifeq ($(TARGETOS),linux)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = tc
SDL_NETWORK = taptun
+
+ifndef NO_USE_MIDI
+INCPATH += `pkg-config --cflags alsa`
+LIBS += `pkg-config --libs alsa`
+endif
+
endif
ifeq ($(TARGETOS),freebsd)
@@ -198,24 +207,28 @@ CCOMFLAGS += -isystem /usr/local/include
# No clue here. There is a popmessage(NULL) in uimenu.c which
# triggers a non-null format warning on FreeBSD only.
CCOMFLAGS += -Wno-format
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),openbsd)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
LIBS += -lutil
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),netbsd)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
LIBS += -lutil
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),solaris)
BASE_TARGETOS = unix
DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf
SYNC_IMPLEMENTATION = tc
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),haiku)
@@ -223,6 +236,7 @@ BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
NO_X11 = 1
NO_USE_XINPUT = 1
+NO_USE_MIDI = 1
LIBS += -lnetwork -lbsd
endif
@@ -230,6 +244,10 @@ ifeq ($(TARGETOS),macosx)
BASE_TARGETOS = unix
DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX -DSDLMAME_DARWIN
+ifndef NO_USE_MIDI
+LIBS += -framework CoreAudio -framework CoreMIDI
+endif
+
ifndef USE_QTDEBUG
DEBUGOBJS = $(SDLOBJ)/debugosx.o
endif
@@ -324,6 +342,7 @@ SYNC_IMPLEMENTATION = os2
NO_DEBUGGER = 1
NO_X11 = 1
NO_USE_XINPUT = 1
+NO_USE_MIDI = 1
# OS/2 can't have OpenGL (aww)
NO_OPENGL = 1
endif
@@ -371,7 +390,12 @@ OSDOBJS = \
$(SDLOBJ)/drawsdl.o \
$(SDLOBJ)/window.o \
$(SDLOBJ)/output.o \
- $(SDLOBJ)/watchdog.o
+ $(SDLOBJ)/watchdog.o \
+ $(SDLOBJ)/sdlmidi.o
+
+ifdef NO_USE_MIDI
+DEFS += "-DDISABLE_MIDI=1"
+endif
# Add SDL2.0 support
@@ -765,6 +789,8 @@ testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN)
@echo Linking $@...
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@
+$(SDLOBJ)/sdlmidi.o: $(SRC)/osd/portmedia/pmmidi.c
+
#-------------------------------------------------
# clean up
#-------------------------------------------------
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index 4ab5262bb3b..a42089a4217 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -362,7 +362,7 @@ int main(int argc, char *argv[])
}
#endif
-// osd_init_midi(); // this is a blues riff in B, watch me for the changes and try to keep up...
+ osd_init_midi(); // this is a blues riff in B, watch me for the changes and try to keep up...
{
sdl_osd_interface osd;
@@ -388,7 +388,7 @@ int main(int argc, char *argv[])
#endif
#endif
-// osd_shutdown_midi();
+ osd_shutdown_midi();
exit(res);
diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak
index a1fa0dae262..f22addb5cdb 100644
--- a/src/osd/windows/windows.mak
+++ b/src/osd/windows/windows.mak
@@ -64,7 +64,6 @@
# DIRECTINPUT = 8
-
###########################################################################
################## END USER-CONFIGURABLE OPTIONS ######################
###########################################################################
@@ -292,8 +291,8 @@ OSDCOREOBJS = \
$(WINOBJ)/winclip.o \
$(WINOBJ)/winsocket.o \
$(WINOBJ)/winwork.o \
- $(WINOBJ)/winptty.o
-
+ $(WINOBJ)/winptty.o \
+ $(WINOBJ)/winmidi.o
#-------------------------------------------------
@@ -315,6 +314,7 @@ OSDOBJS = \
$(WINOBJ)/winmenu.o \
$(WINOBJ)/winmain.o
+
ifdef USE_NETWORK
OSDOBJS += \
$(WINOBJ)/netdev.o \
@@ -330,6 +330,7 @@ endif
# extra dependencies
$(WINOBJ)/drawdd.o : $(SRC)/emu/rendersw.c
$(WINOBJ)/drawgdi.o : $(SRC)/emu/rendersw.c
+$(WINOBJ)/winmidi.o: $(SRC)/osd/portmedia/pmmidi.c
# add debug-specific files
OSDOBJS += \
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index bc871803fbb..9fb164d22e0 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -473,6 +473,8 @@ int main(int argc, char *argv[])
FreeConsole();
}
+ osd_init_midi();
+
// parse config and cmdline options
DWORD result = 0;
{
@@ -482,6 +484,8 @@ int main(int argc, char *argv[])
result = frontend.execute(argc, argv);
}
+ osd_shutdown_midi();
+
// free symbols
symbols = NULL;
return result;