PalmOS : ARM optimization

svn-id: r18755
This commit is contained in:
Chris Apers 2005-09-03 17:29:35 +00:00
parent 20e088801e
commit 6b63495d5d

View File

@ -29,7 +29,7 @@
#include "scumm/usage_bits.h" #include "scumm/usage_bits.h"
#include "scumm/wiz_he.h" #include "scumm/wiz_he.h"
#if defined(__PALM_OS__) #if defined(PALMOS_68K)
#include "arm/native.h" #include "arm/native.h"
#include "arm/macros.h" #include "arm/macros.h"
#endif #endif
@ -80,7 +80,7 @@ struct TransitionEffect {
byte stripTable[16]; // ditto byte stripTable[16]; // ditto
}; };
#ifdef __PALM_OS__ #ifdef PALMOS_68K
static const TransitionEffect *transitionEffects; static const TransitionEffect *transitionEffects;
#else #else
static const TransitionEffect transitionEffects[6] = { static const TransitionEffect transitionEffects[6] = {
@ -100,7 +100,7 @@ static const TransitionEffect transitionEffects[6] = {
0, 0, 0, 24 0, 0, 0, 24
} }
}, },
// Box wipe (a box expands from the upper-left corner to the lower-right corner) // Box wipe (a box expands from the upper-left corner to the lower-right corner)
{ {
25, // Number of iterations 25, // Number of iterations
@ -117,7 +117,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0 255, 0, 0, 0
} }
}, },
// Box wipe (a box expands from the lower-right corner to the upper-left corner) // Box wipe (a box expands from the lower-right corner to the upper-left corner)
{ {
25, // Number of iterations 25, // Number of iterations
@ -134,7 +134,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0 255, 0, 0, 0
} }
}, },
// Inverse box wipe // Inverse box wipe
{ {
25, // Number of iterations 25, // Number of iterations
@ -185,7 +185,7 @@ static const TransitionEffect transitionEffects[6] = {
255, 0, 0, 0 255, 0, 0, 0
} }
} }
}; };
#endif #endif
@ -241,7 +241,7 @@ void Gdi::roomChanged(byte *roomptr, uint32 IM00_offs, byte transparentColor) {
} else if (_vm->_version == 2) { } else if (_vm->_version == 2) {
_roomStrips = generateStripTable(roomptr + IM00_offs, _vm->_roomWidth, _vm->_roomHeight, _roomStrips); _roomStrips = generateStripTable(roomptr + IM00_offs, _vm->_roomWidth, _vm->_roomHeight, _roomStrips);
} }
_transparentColor = transparentColor; _transparentColor = transparentColor;
} }
@ -287,7 +287,7 @@ void ScummEngine::initScreens(int b, int h) {
initVirtScreen(kVerbVirtScreen, h + adj, _screenWidth, _screenHeight - h - adj, false, false); initVirtScreen(kVerbVirtScreen, h + adj, _screenWidth, _screenHeight - h - adj, false, false);
_screenB = b; _screenB = b;
_screenH = h; _screenH = h;
gdi.init(); gdi.init();
} }
@ -421,7 +421,7 @@ void ScummEngine::markRectAsDirty(VirtScreenNumber virt, int left, int right, in
void ScummEngine::drawDirtyScreenParts() { void ScummEngine::drawDirtyScreenParts() {
// Update verbs // Update verbs
updateDirtyScreen(kVerbVirtScreen); updateDirtyScreen(kVerbVirtScreen);
// Update the conversation area (at the top of the screen) // Update the conversation area (at the top of the screen)
updateDirtyScreen(kTextVirtScreen); updateDirtyScreen(kTextVirtScreen);
@ -521,7 +521,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
assert(x >= 0 && width <= vs->pitch); assert(x >= 0 && width <= vs->pitch);
assert(_charset->_textSurface.pixels); assert(_charset->_textSurface.pixels);
assert(_compositeBuf); assert(_compositeBuf);
if (width > vs->w - x) if (width > vs->w - x)
width = vs->w - x; width = vs->w - x;
@ -534,13 +534,13 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// Convert the vertical coordinates to real screen coords // Convert the vertical coordinates to real screen coords
int y = vs->topline + top - _screenTop; int y = vs->topline + top - _screenTop;
int height = bottom - top; int height = bottom - top;
// Compute screen etc. buffer pointers // Compute screen etc. buffer pointers
const byte *src = vs->getPixels(x, top); const byte *src = vs->getPixels(x, top);
byte *dst = _compositeBuf + x + y * _screenWidth; byte *dst = _compositeBuf + x + y * _screenWidth;
const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch; const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
#ifdef __PALM_OS__ #ifdef PALMOS_68K
ARM_START(DrawStripType) ARM_START(DrawStripType)
ARM_INIT(SCUMM_DRAWSTRIP) ARM_INIT(SCUMM_DRAWSTRIP)
ARM_ADDM(width) ARM_ADDM(width)
@ -550,7 +550,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
ARM_ADDM(text) ARM_ADDM(text)
ARM_ADDV(_vm_screenWidth, _screenWidth) ARM_ADDV(_vm_screenWidth, _screenWidth)
ARM_ADDV(vs_pitch, vs->pitch) ARM_ADDV(vs_pitch, vs->pitch)
ARM_ADDV(_charset->_textSurface_pitch, _charset->_textSurface.pitch) ARM_ADDV(_charset_textSurface_pitch, _charset->_textSurface.pitch)
ARM_CALL(ARM_ENGINE, PNO_DATA()) ARM_CALL(ARM_ENGINE, PNO_DATA())
ARM_CONTINUE() ARM_CONTINUE()
#endif #endif
@ -573,7 +573,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
ditherHerc(_compositeBuf + x + y * _screenWidth, _herculesBuf, _screenWidth, &x, &y, &width, &height); ditherHerc(_compositeBuf + x + y * _screenWidth, _herculesBuf, _screenWidth, &x, &y, &width, &height);
// center image on the screen // center image on the screen
_system->copyRectToScreen(_herculesBuf + x + y * Common::kHercW, _system->copyRectToScreen(_herculesBuf + x + y * Common::kHercW,
Common::kHercW, x + (Common::kHercW - _screenWidth * 2) / 2, y, width, height); Common::kHercW, x + (Common::kHercW - _screenWidth * 2) / 2, y, width, height);
} else { } else {
// Finally blit the whole thing to the screen // Finally blit the whole thing to the screen
@ -604,6 +604,20 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// Odd lines have colors swapped, so there will be checkered patterns. // Odd lines have colors swapped, so there will be checkered patterns.
// But apparently there is a mistake for 10th color. // But apparently there is a mistake for 10th color.
void ScummEngine::ditherCGA(byte *dst, int dstPitch, int x, int y, int width, int height) const { void ScummEngine::ditherCGA(byte *dst, int dstPitch, int x, int y, int width, int height) const {
#ifdef PALMOS_68K
ARM_START(RenderCGAType)
ARM_INIT(SCUMM_RENDERCGA)
ARM_ADDM(dst)
ARM_ADDM(dstPitch)
ARM_ADDM(x)
ARM_ADDM(y)
ARM_ADDM(width)
ARM_ADDM(height)
ARM_ADDV(_version, _version)
ARM_CALL(ARM_ENGINE, PNO_DATA())
ARM_END()
#endif
byte *ptr; byte *ptr;
int idx1, idx2; int idx1, idx2;
static const byte cgaDither[2][2][16] = { static const byte cgaDither[2][2][16] = {
@ -638,6 +652,20 @@ void ScummEngine::ditherCGA(byte *dst, int dstPitch, int x, int y, int width, in
// cccc1 // cccc1
// dddd0 // dddd0
void ScummEngine::ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height) const { void ScummEngine::ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *width, int *height) const {
#ifdef PALMOS_68K
ARM_START(RenderHercType)
ARM_INIT(SCUMM_RENDERHERC)
ARM_ADDM(src)
ARM_ADDM(hercbuf)
ARM_ADDM(srcPitch)
ARM_ADDM(x)
ARM_ADDM(y)
ARM_ADDM(width)
ARM_ADDM(height)
ARM_CALL(ARM_ENGINE, PNO_DATA())
ARM_END()
#endif
byte *srcptr, *dstptr; byte *srcptr, *dstptr;
int xo = *x, yo = *y, widtho = *width, heighto = *height; int xo = *x, yo = *y, widtho = *width, heighto = *height;
int idx1, idx2, dsty = 0, y1; int idx1, idx2, dsty = 0, y1;
@ -864,7 +892,7 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
const int height = rect.height(); const int height = rect.height();
const int width = rect.width(); const int width = rect.width();
if (!height) if (!height)
return; return;
@ -897,7 +925,7 @@ void CharsetRenderer::restoreCharsetBg() {
return; return;
_vm->markRectAsDirty(vs->number, Common::Rect(vs->w, vs->h), USAGE_BIT_RESTORED); _vm->markRectAsDirty(vs->number, Common::Rect(vs->w, vs->h), USAGE_BIT_RESTORED);
byte *screenBuf = vs->getPixels(0, 0); byte *screenBuf = vs->getPixels(0, 0);
if (vs->hasTwoBuffers && _vm->_currentRoom != 0 && _vm->isLightOn()) { if (vs->hasTwoBuffers && _vm->_currentRoom != 0 && _vm->isLightOn()) {
@ -945,7 +973,7 @@ static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w,
assert(h > 0); assert(h > 0);
assert(src != NULL); assert(src != NULL);
assert(dst != NULL); assert(dst != NULL);
if (w == srcPitch && w == dstPitch) { if (w == srcPitch && w == dstPitch) {
memcpy(dst, src, w*h); memcpy(dst, src, w*h);
} else { } else {
@ -960,7 +988,7 @@ static void blit(byte *dst, int dstPitch, const byte *src, int srcPitch, int w,
static void fill(byte *dst, int dstPitch, byte color, int w, int h) { static void fill(byte *dst, int dstPitch, byte color, int w, int h) {
assert(h > 0); assert(h > 0);
assert(dst != NULL); assert(dst != NULL);
if (w == dstPitch) { if (w == dstPitch) {
memset(dst, color, w*h); memset(dst, color, w*h);
} else { } else {
@ -1016,7 +1044,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
// Adjust for the topline of the VirtScreen // Adjust for the topline of the VirtScreen
y -= vs->topline; y -= vs->topline;
y2 -= vs->topline; y2 -= vs->topline;
// Clip the coordinates // Clip the coordinates
if (x < 0) if (x < 0)
x = 0; x = 0;
@ -1037,7 +1065,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
return; return;
else if (y2 > vs->h) else if (y2 > vs->h)
y2 = vs->h; y2 = vs->h;
width = x2 - x; width = x2 - x;
height = y2 - y; height = y2 - y;
@ -1084,7 +1112,7 @@ void ScummEngine::drawFlashlight() {
if (_flashlight.isDrawn) { if (_flashlight.isDrawn) {
markRectAsDirty(kMainVirtScreen, _flashlight.x, _flashlight.x + _flashlight.w, markRectAsDirty(kMainVirtScreen, _flashlight.x, _flashlight.x + _flashlight.w,
_flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY); _flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY);
if (_flashlight.buffer) { if (_flashlight.buffer) {
fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h); fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h);
} }
@ -1152,7 +1180,7 @@ void ScummEngine::drawFlashlight() {
_flashlight.buffer[maxrow + maxcol - j] = 0; _flashlight.buffer[maxrow + maxcol - j] = 0;
} }
} }
_flashlight.isDrawn = true; _flashlight.isDrawn = true;
} }
@ -1211,7 +1239,7 @@ void Gdi::drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, cons
theX = 0; theX = 0;
maxX = width; maxX = width;
} }
// Decode and draw the image data. // Decode and draw the image data.
assert(height <= 128); assert(height <= 128);
for (; theX < maxX; theX++) { for (; theX < maxX; theX++) {
@ -1265,7 +1293,7 @@ void Gdi::drawBitmapV2Helper(const byte *ptr, VirtScreen *vs, int x, int y, cons
do { do {
if (!runFlag) if (!runFlag)
data = *src++; data = *src++;
if (left <= theX) { if (left <= theX) {
*mask_ptr = data; *mask_ptr = data;
mask_ptr += _numStrips; mask_ptr += _numStrips;
@ -1303,7 +1331,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
else { else {
numzbuf = _numZBuffer; numzbuf = _numZBuffer;
assert(numzbuf <= 9); assert(numzbuf <= 9);
if (_vm->_features & GF_SMALL_HEADER) { if (_vm->_features & GF_SMALL_HEADER) {
if (_vm->_features & GF_16COLOR) if (_vm->_features & GF_16COLOR)
zplane_list[1] = ptr + READ_LE_UINT16(ptr); zplane_list[1] = ptr + READ_LE_UINT16(ptr);
@ -1320,7 +1348,7 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
} else if (_vm->_version == 8) { } else if (_vm->_version == 8) {
// Find the OFFS chunk of the ZPLN chunk // Find the OFFS chunk of the ZPLN chunk
const byte *zplnOffsChunkStart = ptr + 24 + READ_BE_UINT32(ptr + 12); const byte *zplnOffsChunkStart = ptr + 24 + READ_BE_UINT32(ptr + 12);
// Each ZPLN contains a WRAP chunk, which has (as always) an OFFS subchunk pointing // Each ZPLN contains a WRAP chunk, which has (as always) an OFFS subchunk pointing
// at ZSTR chunks. These once more contain a WRAP chunk which contains nothing but // at ZSTR chunks. These once more contain a WRAP chunk which contains nothing but
// an OFFS chunk. The content of this OFFS chunk contains the offsets to the // an OFFS chunk. The content of this OFFS chunk contains the offsets to the
@ -1341,13 +1369,13 @@ int Gdi::getZPlanes(const byte *ptr, const byte *zplane_list[9], bool bmapImage)
MKID('ZP03'), MKID('ZP03'),
MKID('ZP04') MKID('ZP04')
}; };
for (i = 1; i < numzbuf; i++) { for (i = 1; i < numzbuf; i++) {
zplane_list[i] = _vm->findResource(zplane_tags[i], ptr); zplane_list[i] = _vm->findResource(zplane_tags[i], ptr);
} }
} }
} }
return numzbuf; return numzbuf;
} }
@ -1376,7 +1404,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
const bool lightsOn = _vm->isLightOn(); const bool lightsOn = _vm->isLightOn();
_objectMode = (flag & dbObjectMode) == dbObjectMode; _objectMode = (flag & dbObjectMode) == dbObjectMode;
if (_objectMode && _vm->_version == 1) { if (_objectMode && _vm->_version == 1) {
if (_vm->_platform == Common::kPlatformNES) { if (_vm->_platform == Common::kPlatformNES) {
decodeNESObject(ptr, x, y, width, height); decodeNESObject(ptr, x, y, width, height);
@ -1397,7 +1425,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
assert(smap_ptr); assert(smap_ptr);
numzbuf = getZPlanes(ptr, zplane_list, false); numzbuf = getZPlanes(ptr, zplane_list, false);
const byte *tmsk_ptr = NULL; const byte *tmsk_ptr = NULL;
if (_vm->_heversion >= 72) { if (_vm->_heversion >= 72) {
tmsk_ptr = _vm->findResource(MKID('TMSK'), ptr); tmsk_ptr = _vm->findResource(MKID('TMSK'), ptr);
@ -1405,7 +1433,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
bottom = y + height; bottom = y + height;
if (bottom > vs->h) { if (bottom > vs->h) {
error("Gdi::drawBitmap, strip drawn to %d below window bottom %d", bottom, vs->h); warning("Gdi::drawBitmap, strip drawn to %d below window bottom %d", bottom, vs->h);
} }
_vertStripNextInc = height * vs->pitch - 1; _vertStripNextInc = height * vs->pitch - 1;
@ -1613,9 +1641,9 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
_decomp_shr = code % 10; _decomp_shr = code % 10;
_decomp_mask = 0xFF >> (8 - _decomp_shr); _decomp_mask = 0xFF >> (8 - _decomp_shr);
code /= 10; code /= 10;
switch (code) { switch (code) {
case 13: case 13:
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false); drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false);
break; break;
case 14: case 14:
@ -1625,7 +1653,7 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h); fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h);
break; break;
default: default:
// Alternayive russian freddi3 uses badly formatted bitmaps // Alternative russian freddi3 uses badly formatted bitmaps
debug(0, "Gdi::drawBMAPBg: default case %d", code); debug(0, "Gdi::drawBMAPBg: default case %d", code);
} }
@ -1674,7 +1702,7 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
rect1.right -= rect2.left; rect1.right -= rect2.left;
rect1.top -= rect2.top; rect1.top -= rect2.top;
rect1.bottom -= rect2.top; rect1.bottom -= rect2.top;
copyVirtScreenBuffers(rect1); copyVirtScreenBuffers(rect1);
} }
#endif #endif
@ -1706,13 +1734,13 @@ void Gdi::copyVirtScreenBuffers(Common::Rect rect, int dirtybit) {
const int rw = rect.width(); const int rw = rect.width();
const int rh = rect.height(); const int rh = rect.height();
if (rw == 0 || rh == 0) if (rw == 0 || rh == 0)
return; return;
src = _vm->virtscr[0].getBackPixels(rect.left, rect.top); src = _vm->virtscr[0].getBackPixels(rect.left, rect.top);
dst = _vm->virtscr[0].getPixels(rect.left, rect.top); dst = _vm->virtscr[0].getPixels(rect.left, rect.top);
assert(rw <= _vm->_screenWidth && rw > 0); assert(rw <= _vm->_screenWidth && rw > 0);
assert(rh <= _vm->_screenHeight && rh > 0); assert(rh <= _vm->_screenHeight && rh > 0);
blit(dst, _vm->virtscr[0].pitch, src, _vm->virtscr[0].pitch, rw, rh); blit(dst, _vm->virtscr[0].pitch, src, _vm->virtscr[0].pitch, rw, rh);
@ -1726,7 +1754,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
VirtScreen *vs = &_vm->virtscr[0]; VirtScreen *vs = &_vm->virtscr[0];
byte *backbuff_ptr, *bgbak_ptr; byte *backbuff_ptr, *bgbak_ptr;
int numLinesToProcess; int numLinesToProcess;
if (top < 0) if (top < 0)
top = 0; top = 0;
@ -1759,7 +1787,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLinesToProcess) { bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLinesToProcess) {
assert(numLinesToProcess); assert(numLinesToProcess);
if (_vm->_features & GF_16COLOR) { if (_vm->_features & GF_16COLOR) {
drawStripEGA(dst, dstPitch, src, numLinesToProcess); drawStripEGA(dst, dstPitch, src, numLinesToProcess);
return false; return false;
@ -1767,39 +1795,39 @@ bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLine
byte code = *src++; byte code = *src++;
bool useOrDecompress = false; bool useOrDecompress = false;
if (code <= 10) { if (code <= 10) {
switch (code) { switch (code) {
case 1: case 1:
unkDecode7(dst, dstPitch, src, numLinesToProcess); unkDecode7(dst, dstPitch, src, numLinesToProcess);
break; break;
case 2: case 2:
unkDecode8(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */ unkDecode8(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break; break;
case 3: case 3:
unkDecode9(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */ unkDecode9(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break; break;
case 4: case 4:
unkDecode10(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */ unkDecode10(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break; break;
case 7: case 7:
unkDecode11(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */ unkDecode11(dst, dstPitch, src, numLinesToProcess); /* Ender - Zak256/Indy256 */
break; break;
case 8: case 8:
// Used in 3DO versions of HE games // Used in 3DO versions of HE games
useOrDecompress = true; useOrDecompress = true;
drawStrip3DO(dst, dstPitch, src, numLinesToProcess, true); drawStrip3DO(dst, dstPitch, src, numLinesToProcess, true);
break; break;
case 9: case 9:
drawStrip3DO(dst, dstPitch, src, numLinesToProcess, false); drawStrip3DO(dst, dstPitch, src, numLinesToProcess, false);
break; break;
case 10: case 10:
// Used in Amiga version of Monkey Island 1 // Used in Amiga version of Monkey Island 1
drawStripEGA(dst, dstPitch, src, numLinesToProcess); drawStripEGA(dst, dstPitch, src, numLinesToProcess);
@ -1812,51 +1840,51 @@ bool Gdi::decompressBitmap(byte *dst, int dstPitch, const byte *src, int numLine
_decomp_shr = code % 10; _decomp_shr = code % 10;
_decomp_mask = 0xFF >> (8 - _decomp_shr); _decomp_mask = 0xFF >> (8 - _decomp_shr);
code /= 10; code /= 10;
switch (code) { switch (code) {
case 1: case 1:
drawStripBasicV(dst, dstPitch, src, numLinesToProcess, false); drawStripBasicV(dst, dstPitch, src, numLinesToProcess, false);
break; break;
case 2: case 2:
drawStripBasicH(dst, dstPitch, src, numLinesToProcess, false); drawStripBasicH(dst, dstPitch, src, numLinesToProcess, false);
break; break;
case 3: case 3:
useOrDecompress = true; useOrDecompress = true;
drawStripBasicV(dst, dstPitch, src, numLinesToProcess, true); drawStripBasicV(dst, dstPitch, src, numLinesToProcess, true);
break; break;
case 4: case 4:
useOrDecompress = true; useOrDecompress = true;
drawStripBasicH(dst, dstPitch, src, numLinesToProcess, true); drawStripBasicH(dst, dstPitch, src, numLinesToProcess, true);
break; break;
case 6: case 6:
case 10: case 10:
drawStripComplex(dst, dstPitch, src, numLinesToProcess, false); drawStripComplex(dst, dstPitch, src, numLinesToProcess, false);
break; break;
case 8: case 8:
case 12: case 12:
useOrDecompress = true; useOrDecompress = true;
drawStripComplex(dst, dstPitch, src, numLinesToProcess, true); drawStripComplex(dst, dstPitch, src, numLinesToProcess, true);
break; break;
case 13: case 13:
drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, false); drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, false);
break; break;
case 14: case 14:
useOrDecompress = true; useOrDecompress = true;
drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, true); drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, true);
break; break;
default: default:
error("Gdi::decompressBitmap: default case %d", code); error("Gdi::decompressBitmap: default case %d", code);
} }
} }
return useOrDecompress; return useOrDecompress;
} }
@ -1938,7 +1966,7 @@ void Gdi::decompressMaskImgOr(byte *dst, const byte *src, int height) const {
while (height) { while (height) {
b = *src++; b = *src++;
if (b & 0x80) { if (b & 0x80) {
b &= 0x7F; b &= 0x7F;
c = *src++; c = *src++;
@ -2353,7 +2381,7 @@ StripTable *Gdi::generateStripTable(const byte *src, int width, int height, Stri
x = 0; x = 0;
y = height; y = height;
width /= 8; width /= 8;
for (;;) { for (;;) {
length = *src++; length = *src++;
const byte runFlag = length & 0x80; const byte runFlag = length & 0x80;
@ -2387,7 +2415,7 @@ void Gdi::drawStripEGA(byte *dst, int dstPitch, const byte *src, int height) con
while (x < 8) { while (x < 8) {
color = *src++; color = *src++;
if (color & 0x80) { if (color & 0x80) {
run = color & 0x3f; run = color & 0x3f;
@ -2426,7 +2454,7 @@ void Gdi::drawStripEGA(byte *dst, int dstPitch, const byte *src, int height) con
if (run == 0) { if (run == 0) {
run = *src++; run = *src++;
} }
for (z = 0; z < run; z++) { for (z = 0; z < run; z++) {
*(dst + y * dstPitch + x) = _roomPalette[color & 0xf]; *(dst + y * dstPitch + x) = _roomPalette[color & 0xf];
@ -2454,12 +2482,12 @@ void Gdi::drawStripHE(byte *dst, int dstPitch, const byte *src, int width, int h
uint32 dataBit, data; uint32 dataBit, data;
byte color; byte color;
int shift; int shift;
color = *src++; color = *src++;
data = READ_LE_UINT24(src); data = READ_LE_UINT24(src);
src += 3; src += 3;
shift = 24; shift = 24;
int x = width; int x = width;
while (1) { while (1) {
if (!transpCheck || color != _transparentColor) if (!transpCheck || color != _transparentColor)
@ -2892,10 +2920,10 @@ void ScummEngine::fadeOut(int effect) {
if (_screenEffectFlag && effect != 0) { if (_screenEffectFlag && effect != 0) {
// Fill screen 0 with black // Fill screen 0 with black
memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h); memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);
// Fade to black with the specified effect, if any. // Fade to black with the specified effect, if any.
switch (effect) { switch (effect) {
case 1: case 1:
@ -2999,13 +3027,13 @@ void ScummEngine::transitionEffect(int a) {
/** /**
* Update width*height areas of the screen, in random order, until the whole * Update width*height areas of the screen, in random order, until the whole
* screen has been updated. For instance: * screen has been updated. For instance:
* *
* dissolveEffect(1, 1) produces a pixel-by-pixel dissolve * dissolveEffect(1, 1) produces a pixel-by-pixel dissolve
* dissolveEffect(8, 8) produces a square-by-square dissolve * dissolveEffect(8, 8) produces a square-by-square dissolve
* dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve * dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve
*/ */
void ScummEngine::dissolveEffect(int width, int height) { void ScummEngine::dissolveEffect(int width, int height) {
#ifdef __PALM_OS__ #ifdef PALMOS_68K
// Remove this dissolve effect for now on PalmOS since it is a bit // Remove this dissolve effect for now on PalmOS since it is a bit
// too slow using 68k emulation // too slow using 68k emulation
if (width == 1 && height == 1) { if (width == 1 && height == 1) {
@ -3087,7 +3115,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
blits = 0; blits = 0;
blits_before_refresh = (3 * w * h) / 25; blits_before_refresh = (3 * w * h) / 25;
// Speed up the effect for CD Loom since it uses it so often. I don't // Speed up the effect for CD Loom since it uses it so often. I don't
// think the original had any delay at all, so on modern hardware it // think the original had any delay at all, so on modern hardware it
// wasn't even noticeable. // wasn't even noticeable.
@ -3226,7 +3254,7 @@ void ScummEngine::unkScreenEffect6() {
} // End of namespace Scumm } // End of namespace Scumm
#ifdef __PALM_OS__ #ifdef PALMOS_68K
#include "scumm_globals.h" #include "scumm_globals.h"
_GINIT(Gfx) _GINIT(Gfx)
@ -3238,3 +3266,4 @@ _GRELEASEPTR(GBVARS_TRANSITIONEFFECTS_INDEX, GBVARS_SCUMM)
_GEND _GEND
#endif #endif