Hotfixes ...
svn-id: r9514
This commit is contained in:
parent
7ff88ea392
commit
c99f6980c7
6 changed files with 54 additions and 27 deletions
|
@ -60,7 +60,7 @@ int MidiDriver_ETUDE::open()
|
|||
if (_isOpen)
|
||||
return MERR_ALREADY_OPEN;
|
||||
_isOpen = true;
|
||||
if (!init_morphos_music(0, ETUDEF_DIRECT))
|
||||
if (!init_morphos_music(ScummMidiUnit, ETUDEF_DIRECT))
|
||||
return MERR_DEVICE_NOT_AVAILABLE;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue