diff options
-rw-r--r-- | backends/morphos/build.rules | 8 | ||||
-rw-r--r-- | backends/morphos/morphos_sound.cpp | 2 | ||||
-rw-r--r-- | backends/morphos/morphos_timer.cpp | 11 | ||||
-rw-r--r-- | backends/morphos/morphos_timer.h | 14 | ||||
-rw-r--r-- | common/timer.cpp | 3 | ||||
-rw-r--r-- | common/timer.h | 2 |
6 files changed, 24 insertions, 16 deletions
diff --git a/backends/morphos/build.rules b/backends/morphos/build.rules index d5b853984a..29bf59d1b3 100644 --- a/backends/morphos/build.rules +++ b/backends/morphos/build.rules @@ -1,5 +1,11 @@ -CC = g++ +CXX = g++ CFLAGS = -Wno-multichar -fstrength-reduce -fno-rtti -O2 DEFINES = -DNO_PPCINLINE_STDARG -DNO_PPCINLINE_VARARGS LDFLAGS = -noixemul -s LIBS = -lamiga -lamigastubs -lcdda +INCLUDES += -Ibackends/morphos +MODULES += backends/morphos +OBJS += backends/morphos/morphos.o backends/morphos/morphos_scaler.o \ + backends/morphos/morphos_sound.o backends/morphos/morphos_start.o \ + backends/morphos/morphos_timer.o + diff --git a/backends/morphos/morphos_sound.cpp b/backends/morphos/morphos_sound.cpp index 0585b8708b..f2df81d789 100644 --- a/backends/morphos/morphos_sound.cpp +++ b/backends/morphos/morphos_sound.cpp @@ -66,7 +66,7 @@ bool init_morphos_music(ULONG MidiUnit) if (ScummMidiRequest) { ScummMidiRequest->amr_Version = 2; - if (OpenDevice("amidi.device", MidiUnit, (IORequest *) ScummMidiRequest, AMIDIF_MIDISERVER)) + if (OpenDevice("amidi.device", MidiUnit, (IORequest *) ScummMidiRequest, 0)) { DeleteIORequest((IORequest *) ScummMidiRequest); DeleteMsgPort(ScummMidiPort); diff --git a/backends/morphos/morphos_timer.cpp b/backends/morphos/morphos_timer.cpp index d106b9a1a9..c496f1ff29 100644 --- a/backends/morphos/morphos_timer.cpp +++ b/backends/morphos/morphos_timer.cpp @@ -50,6 +50,7 @@ Timer::Timer(Scumm * system) ThreadEmulFunc.StackSize = 16000; ThreadEmulFunc.Extension = 0; ThreadEmulFunc.Arg1 = (ULONG) this; + ThreadEmulFunc.Arg2 = (ULONG) system; TimerServiceTags[0].ti_Data = (ULONG) &ThreadEmulFunc; TimerServiceThread = CreateNewProc(TimerServiceTags); } @@ -73,17 +74,17 @@ void Timer::release() { } -bool Timer::installProcedure(int ((*procedure)(int)), int32 interval) +bool Timer::installProcedure(TimerProc procedure, int32 interval) { return SendMsg(TSM_MSGID_ADDTIMER, procedure, interval); } -void Timer::releaseProcedure(int ((*procedure)(int))) +void Timer::releaseProcedure(TimerProc procedure) { SendMsg(TSM_MSGID_REMTIMER, procedure, 0); } -bool Timer::SendMsg(ULONG msg_id, int ((*procedure)(int)), LONG interval) +bool Timer::SendMsg(ULONG msg_id, TimerProc procedure, LONG interval) { if (TimerServiceThread == NULL) return false; @@ -115,7 +116,7 @@ bool Timer::SendMsg(ULONG msg_id, int ((*procedure)(int)), LONG interval) return true; } -void Timer::TimerService(Timer *this_ptr) +void Timer::TimerService(Timer *this_ptr, Scumm *system) { MsgPort *port = &((Process *) FindTask(NULL))->pr_MsgPort; ULONG port_bit = 1 << port->mp_SigBit; @@ -215,7 +216,7 @@ void Timer::TimerService(Timer *this_ptr) timerequest *req = timer_slots[t].ts_IORequest; WaitIO((IORequest *) req); interval = timer_slots[t].ts_Interval; - (*timer_slots[t].ts_Callback)(interval); + (*timer_slots[t].ts_Callback)(system); GetSysTime(&end_callback); SubTime(&end_callback, &start_callback); interval -= end_callback.tv_sec*1000+end_callback.tv_micro/1000+40; diff --git a/backends/morphos/morphos_timer.h b/backends/morphos/morphos_timer.h index 1593b29a5c..05f710719a 100644 --- a/backends/morphos/morphos_timer.h +++ b/backends/morphos/morphos_timer.h @@ -44,13 +44,13 @@ class OSystem; #define TSM_MSGID_ADDTIMER 0 -#define TSM_MSGID_REMTIMER 1 +#define TSM_MSGID_REMTIMER 1 struct TimerServiceMessage { Message tsm_Message; ULONG tsm_MsgID; - int ((*tsm_Callback)(int)); + TimerProc tsm_Callback; LONG tsm_Interval; }; @@ -62,12 +62,12 @@ class Timer bool init(); void release(); - bool installProcedure(int ((*procedure)(int)), int32 interval); - void releaseProcedure(int ((*procedure)(int))); + bool installProcedure(TimerProc procedure, int32 interval); + void releaseProcedure(TimerProc procedure); protected: - bool SendMsg(ULONG MsgID, int ((*procedure)(int)), LONG interval); - static void TimerService(Timer *); + bool SendMsg(ULONG MsgID, TimerProc procedure, LONG interval); + static void TimerService(Timer *, Scumm *); Process *TimerServiceThread; SignalSemaphore TimerServiceSemaphore; @@ -77,7 +77,7 @@ class Timer MsgPort *ts_Port; timerequest *ts_IORequest; ULONG ts_SignalBit; - int ((*ts_Callback)(int)); + TimerProc ts_Callback; LONG ts_Interval; }; }; diff --git a/common/timer.cpp b/common/timer.cpp index 2a3fc74024..7ca8f4c1a2 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -23,6 +23,7 @@ #include "scummsys.h" #include "timer.h" +#ifndef __MORPHOS__ static Scumm * scumm; Timer::Timer(Scumm * parent) { @@ -153,5 +154,5 @@ void Timer::releaseProcedure (TimerProc procedure) { } _timerRunning = true; } - +#endif diff --git a/common/timer.h b/common/timer.h index a4f4c7080d..789714cb7a 100644 --- a/common/timer.h +++ b/common/timer.h @@ -28,7 +28,7 @@ typedef void (*TimerProc)(Scumm *); #ifdef __MORPHOS__ -#include "morphos/morphos_timer.h" +#include "morphos_timer.h" #else class OSystem; |