diff options
author | Ruediger Hanke | 2003-08-05 18:18:26 +0000 |
---|---|---|
committer | Ruediger Hanke | 2003-08-05 18:18:26 +0000 |
commit | c99f6980c70ea60f5aba8f45a0384059f24deabc (patch) | |
tree | acf7f6627184660b3eeb4169e55397423f5e5dac /backends/morphos | |
parent | 7ff88ea392f430ccc78fdd0503136d8ed1aac036 (diff) | |
download | scummvm-rg350-c99f6980c70ea60f5aba8f45a0384059f24deabc.tar.gz scummvm-rg350-c99f6980c70ea60f5aba8f45a0384059f24deabc.tar.bz2 scummvm-rg350-c99f6980c70ea60f5aba8f45a0384059f24deabc.zip |
Hotfixes ...
svn-id: r9514
Diffstat (limited to 'backends/morphos')
-rw-r--r-- | backends/morphos/morphos.cpp | 31 | ||||
-rw-r--r-- | backends/morphos/morphos.h | 4 | ||||
-rw-r--r-- | backends/morphos/morphos_sound.cpp | 12 | ||||
-rw-r--r-- | backends/morphos/morphos_sound.h | 1 | ||||
-rw-r--r-- | backends/morphos/morphos_start.cpp | 31 |
5 files changed, 53 insertions, 26 deletions
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index 1dab006808..d90205c750 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -75,16 +75,15 @@ static CONST_STRPTR LoomNames[] = { "LoomCD", NULL }; #define BLOCKS_Y (ScummBufferHeight/BLOCKSIZE_Y) #define BLOCK_ID(x, y) ((y/BLOCKSIZE_Y)*BLOCKS_X+(x/BLOCKSIZE_X)) -OSystem_MorphOS *OSystem_MorphOS::create(int game_id, SCALERTYPE gfx_scaler, bool full_screen) +OSystem_MorphOS *OSystem_MorphOS::create(SCALERTYPE gfx_scaler, bool full_screen) { - OSystem_MorphOS *syst = new OSystem_MorphOS(game_id, gfx_scaler, full_screen); + OSystem_MorphOS *syst = new OSystem_MorphOS(gfx_scaler, full_screen); return syst; } -OSystem_MorphOS::OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen) +OSystem_MorphOS::OSystem_MorphOS(SCALERTYPE gfx_mode, bool full_screen) { - GameID = game_id; ScummScreen = NULL; ScummWindow = NULL; ScummBuffer = NULL; @@ -364,6 +363,9 @@ uint32 OSystem_MorphOS::property(int param, Property *value) { CONST_STRPTR *ids = NULL, *names = NULL; + if (g_scumm) + GameID = g_scumm->_gameId; + switch (GameID) { case GID_MONKEY: @@ -467,7 +469,8 @@ void OSystem_MorphOS::play_cdrom(int track, int num_loops, int start_frame, int void OSystem_MorphOS::stop_cdrom() { - CDDA_Stop(CDrive); + if (CDrive) + CDDA_Stop(CDrive); } bool OSystem_MorphOS::poll_cdrom() @@ -825,14 +828,10 @@ bool OSystem_MorphOS::poll_event(Event *event) } else if (MapRawKey(&FakedIEvent, &charbuf, 1, NULL) == 1) { - if (qual == KBD_CTRL) + if (qual == KBD_CTRL && charbuf == 'z') { - switch (charbuf) - { - case 'z': - ReplyMsg((Message *) ScummMsg); - quit(); - } + event->event_code = EVENT_QUIT; + break; } else if (qual == KBD_ALT) { @@ -846,8 +845,8 @@ bool OSystem_MorphOS::poll_event(Event *event) } else if (charbuf == 'x') { - ReplyMsg((Message *) ScummMsg); - quit(); + event->event_code = EVENT_QUIT; + break; } else if (charbuf == 0x0d) { @@ -933,8 +932,8 @@ bool OSystem_MorphOS::poll_event(Event *event) } case IDCMP_CLOSEWINDOW: - ReplyMsg((Message *)ScummMsg); - exit(0); + event->event_code = EVENT_QUIT; + break; } if (ScummMsg) diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index cb0e858528..57c137d3f0 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -37,7 +37,7 @@ class OSystem_MorphOS : public OSystem { public: - OSystem_MorphOS(int game_id, SCALERTYPE gfx_mode, bool full_screen); + OSystem_MorphOS(SCALERTYPE gfx_mode, bool full_screen); virtual ~OSystem_MorphOS(); // Set colors of the palette @@ -124,7 +124,7 @@ class OSystem_MorphOS : public OSystem // Quit virtual void quit(); - static OSystem_MorphOS *create(int game_id, SCALERTYPE gfx_scaler, bool full_screen); + static OSystem_MorphOS *create(SCALERTYPE gfx_scaler, bool full_screen); static bool OpenATimer(MsgPort **port, IORequest **req, ULONG unit, bool required = true); diff --git a/backends/morphos/morphos_sound.cpp b/backends/morphos/morphos_sound.cpp index 8ba967c0c6..0646f2bed8 100644 --- a/backends/morphos/morphos_sound.cpp +++ b/backends/morphos/morphos_sound.cpp @@ -55,9 +55,16 @@ static MsgPort *ScummMidiPort = NULL; Device *EtudeBase = NULL; +bool etude_available() +{ + bool avail = init_morphos_music(ScummMidiUnit, ETUDEF_DIRECT); + if (avail) + exit_morphos_music(); + return avail; +} + bool init_morphos_music(ULONG MidiUnit, ULONG DevFlags) { - MidiUnit = ScummMidiUnit; // Ugly fix, but ... ScummMidiPort = CreateMsgPort(); if (ScummMidiPort) { @@ -83,10 +90,7 @@ bool init_morphos_music(ULONG MidiUnit, ULONG DevFlags) } if (!ScummMidiRequest) - { - warning("Could not open Etude - music will not play"); return false; - } return true; } diff --git a/backends/morphos/morphos_sound.h b/backends/morphos/morphos_sound.h index fac6d15899..f9cd90d2e3 100644 --- a/backends/morphos/morphos_sound.h +++ b/backends/morphos/morphos_sound.h @@ -32,6 +32,7 @@ class OSystem_MorphOS; int morphos_sound_thread(OSystem_MorphOS *syst, ULONG SampleType); bool init_morphos_music(ULONG MidiUnit, ULONG DevFlags); void exit_morphos_music(); +bool etude_available(); extern SignalSemaphore ScummMusicThreadRunning; extern SignalSemaphore ScummSoundThreadRunning; diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp index cedd1d0044..176f7cc97f 100644 --- a/backends/morphos/morphos_start.cpp +++ b/backends/morphos/morphos_start.cpp @@ -35,6 +35,7 @@ #include "stdafx.h" #include "scumm/scumm.h" +#include "common/gameDetector.h" #include "common/scaler.h" #include "sound/mididrv.h" #include "morphos.h" @@ -91,32 +92,47 @@ OSystem *OSystem_MorphOS_create(int game_id, int gfx_mode, bool full_screen) break; } - TheSystem = OSystem_MorphOS::create(game_id, gfx_scaler, full_screen); + TheSystem = OSystem_MorphOS::create(gfx_scaler, full_screen); return TheSystem; } void close_resources() { if (TheSystem) + { delete TheSystem; - - if (g_engine) - delete g_engine; + TheSystem = NULL; + } if (ScummPath) + { FreeVec(ScummPath); + ScummPath = NULL; + } if (ScummStory) + { FreeVec(ScummStory); + ScummStory = NULL; + } if (ScummArgs) + { FreeArgs(ScummArgs); + ScummArgs = NULL; + } if (OrigDirLock) + { CurrentDir(OrigDirLock); + OrigDirLock = NULL; + } if (CDDABase) + { CloseLibrary(CDDABase); + CDDABase = NULL; + } } static STRPTR FindMusicDriver(STRPTR argval) @@ -389,6 +405,13 @@ int main() if (args[USG_NOSUBTITLES]) argv[argc++] = "-n"; if (args[USG_AMIGA]) argv[argc++] = "-a"; if (args[USG_MUSIC]) argv[argc++] = ScummMusicDriver; + else + { + if (etude_available()) + argv[argc++] = "-eetude"; + else + argv[argc++] = "-eadlib"; + } if (ScummGfxScaler != ST_INVALID) { sprintf(scaler, "-g%s", MorphOSScaler::GetParamName(ScummGfxScaler)); |