From c65be6ce08fa3dbf4347e4656f83f824db69e2f4 Mon Sep 17 00:00:00 2001 From: Ruediger Hanke Date: Mon, 2 Dec 2002 19:03:07 +0000 Subject: Latest MorphOS changes from my harddisk ... svn-id: r5816 --- backends/morphos/morphos.cpp | 50 ++++++++++---------------------------- backends/morphos/morphos_start.cpp | 14 +++-------- 2 files changed, 16 insertions(+), 48 deletions(-) (limited to 'backends') diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index bbc5d93f22..cf5986088f 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -47,8 +47,6 @@ #include #include -#include - #include #include "morphos.h" @@ -66,17 +64,6 @@ static TagItem PlayTags[] = { { CDPA_StartTrack, 1 }, { TAG_DONE, 0 } }; -TagItem musicProcTags[] = { { NP_Entry, 0 }, - { NP_Name, (ULONG)"ScummVM Music Thread" }, - { NP_Priority, 60 }, - { TAG_DONE, 0 } - }; -TagItem soundProcTags[] = { { NP_Entry, 0 }, - { NP_Name, (ULONG)"ScummVM Sound Thread" }, - { NP_Priority, 0 }, - { TAG_DONE, 0 } - }; - #define BLOCKSIZE_X 32 #define BLOCKSIZE_Y 8 @@ -188,7 +175,7 @@ OSystem_MorphOS::~OSystem_MorphOS() if (ScummMusicThread) { Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C); - ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ + ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ ReleaseSemaphore(&ScummMusicThreadRunning); } @@ -270,10 +257,11 @@ uint32 OSystem_MorphOS::get_msecs() void OSystem_MorphOS::delay_msecs(uint msecs) { - TimerIORequest->tr_node.io_Command = TR_ADDREQUEST; +/* TimerIORequest->tr_node.io_Command = TR_ADDREQUEST; TimerIORequest->tr_time.tv_secs = 0; TimerIORequest->tr_time.tv_micro = msecs*1000; - DoIO((IORequest *) TimerIORequest); + DoIO((IORequest *) TimerIORequest);*/ + TimeDelay(UNIT_MICROHZ, 0, msecs*1000); } void OSystem_MorphOS::set_timer(int timer, int (*callback)(int)) @@ -283,15 +271,10 @@ void OSystem_MorphOS::set_timer(int timer, int (*callback)(int)) void *OSystem_MorphOS::create_thread(ThreadProc *proc, void *param) { - static EmulFunc ThreadEmulFunc; - - ThreadEmulFunc.Trap = TRAP_FUNC; - ThreadEmulFunc.Address = (ULONG)proc; - ThreadEmulFunc.StackSize = 16000; - ThreadEmulFunc.Extension = 0; - ThreadEmulFunc.Arg1 = (ULONG)param; - musicProcTags[0].ti_Data = (ULONG)&ThreadEmulFunc; - ScummMusicThread = CreateNewProc(musicProcTags); + ScummMusicThread = CreateNewProcTags(NP_Entry, (ULONG) proc, NP_CodeType, CODETYPE_PPC, + NP_Name, (ULONG) "ScummVM Music Thread", + NP_Priority, 80, NP_StackSize, 32000, + NP_PPC_Arg1, (ULONG) param, TAG_DONE); return ScummMusicThread; } @@ -1300,24 +1283,17 @@ void OSystem_MorphOS::set_mouse_cursor(const byte *buf, uint w, uint h, int hots bool OSystem_MorphOS::set_sound_proc(void *param, OSystem::SoundProc *proc, byte format) { - static EmulFunc MySoundEmulFunc; - SoundProc = proc; SoundParam = param; /* * Create Sound Thread */ - MySoundEmulFunc.Trap = TRAP_FUNC; - MySoundEmulFunc.Address = (ULONG)&morphos_sound_thread; - MySoundEmulFunc.StackSize = 8192; - MySoundEmulFunc.Extension = 0; - MySoundEmulFunc.Arg1 = (ULONG)this; - MySoundEmulFunc.Arg2 = AHIST_S16S; - - soundProcTags[0].ti_Data = (ULONG)&MySoundEmulFunc; - ScummSoundThread = CreateNewProc(soundProcTags); - + ScummSoundThread = CreateNewProcTags(NP_Entry, (ULONG) &morphos_sound_thread, + NP_CodeType, CODETYPE_PPC, + NP_Name, (ULONG) "ScummVM Sound Thread", + NP_PPC_Arg1, (ULONG) this, + NP_PPC_Arg2, AHIST_S16S, TAG_DONE); if (!ScummSoundThread) { puts("Failed to create sound thread"); diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp index 8b6177039a..118a054452 100644 --- a/backends/morphos/morphos_start.cpp +++ b/backends/morphos/morphos_start.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "stdafx.h" @@ -44,7 +43,7 @@ extern "C" WBStartup *_WBenchMsg; // For command line parsing -static STRPTR usageTemplate = "STORY/A,DATAPATH/K,WINDOW/S,SCALER/K,AMIGA/S,MIDIUNIT/K/N,MUSIC/K,MUSICVOL/K/N,SFXVOL/K/N,TEMPO/K/N,TALKSPEED/K/N,NOSUBTITLES=NST/S"; +static STRPTR usageTemplate = "STORY,DATAPATH/K,WINDOW/S,SCALER/K,AMIGA/S,MIDIUNIT/K/N,MUSIC/K,MUSICVOL/K/N,SFXVOL/K/N,TEMPO/K/N,TALKSPEED/K/N,NOSUBTITLES=NST/S"; typedef enum { USG_STORY = 0, USG_DATAPATH, USG_WINDOW, USG_SCALER, USG_AMIGA, USG_MIDIUNIT, USG_MUSIC, USG_MUSICVOL, USG_SFXVOL, USG_TEMPO, USG_TALKSPEED, USG_NOSUBTITLES } usageFields; static LONG args[13] = { (ULONG) NULL, (ULONG) NULL, FALSE, (ULONG) NULL, false, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, (ULONG) NULL, false }; static RDArgs *ScummArgs = NULL; @@ -64,7 +63,6 @@ static BPTR OrigDirLock = 0; Library *CDDABase = NULL; Library *TimerBase = NULL; -struct Library* CyberGfxBase = NULL; OSystem_MorphOS *TheSystem = NULL; @@ -118,9 +116,6 @@ void close_resources() if (CDDABase) CloseLibrary(CDDABase); - - if (CyberGfxBase) - CloseLibrary(CyberGfxBase); } static STRPTR FindMusicDriver(STRPTR argval) @@ -254,10 +249,6 @@ int main() char musicvol[6], sfxvol[6], talkspeed[12], tempo[12], scaler[14]; int argc = 0; - CyberGfxBase = OpenLibrary("cybergraphics.library",50); - if (CyberGfxBase == NULL) - exit(1); - InitSemaphore(&ScummSoundThreadRunning); InitSemaphore(&ScummMusicThreadRunning); @@ -365,7 +356,8 @@ int main() sprintf(talkspeed, "-y%d", ScummTalkSpeed); argv[argc++] = talkspeed; } - argv[argc++] = ScummStory; + if (ScummStory) + argv[argc++] = ScummStory; return morphos_main(argc, argv); } -- cgit v1.2.3