From 77d50433be9ca21dde3d62ecbe7c6e0bebc341ac Mon Sep 17 00:00:00 2001 From: Ruediger Hanke Date: Tue, 22 Jul 2003 22:37:37 +0000 Subject: Some MorphOS port fixes svn-id: r9138 --- backends/morphos/morphos.cpp | 13 +++++++++---- backends/morphos/morphos_start.cpp | 3 --- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'backends/morphos') diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index 04def0ebe0..b8d6b0d963 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -213,8 +213,11 @@ OSystem_MorphOS::~OSystem_MorphOS() if (ScummMusicThread) { - Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C); - ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ + if (!AttemptSemaphore(&ScummMusicThreadRunning)) + { + Signal((Task *) ScummMusicThread, SIGBREAKF_CTRL_C); + ObtainSemaphore(&ScummMusicThreadRunning); /* Wait for thread to finish */ + } ReleaseSemaphore(&ScummMusicThreadRunning); } @@ -1096,8 +1099,9 @@ void OSystem_MorphOS::move_screen(int dx, int dy, int height) { } else if (dy < 0) { // move up // copy from top to bottom + dy = -dy; for (int y = dy; y < height; y++) - copy_rect((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1); + copy_rect((byte *)ScummBuffer + ScummBufferWidth * y, ScummBufferWidth, 0, y - dy, ScummBufferWidth, 1); } // horizontal movement @@ -1109,8 +1113,9 @@ void OSystem_MorphOS::move_screen(int dx, int dy, int height) { } else if (dx < 0) { // move left // copy from left to right + dx = -dx; for (int x = dx; x < ScummBufferWidth; x++) - copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, height); + copy_rect((byte *)ScummBuffer + x, ScummBufferWidth, x, 0, 1, height); } } diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp index 9ee85f9cc8..ce8ace3631 100644 --- a/backends/morphos/morphos_start.cpp +++ b/backends/morphos/morphos_start.cpp @@ -97,9 +97,6 @@ OSystem *OSystem_MorphOS_create(int game_id, int gfx_mode, bool full_screen) void close_resources() { - if (EtudeMidiDriver) - EtudeMidiDriver->close(); - if (TheSystem) delete TheSystem; -- cgit v1.2.3