aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.cpp
diff options
context:
space:
mode:
authorRobin Watts2007-07-10 20:20:50 +0000
committerRobin Watts2007-07-10 20:20:50 +0000
commitb1feb9c65c715862d70b25cfa4e37df3a912cac5 (patch)
tree35044ef853787c2de285f8fc0fce8a05b4ef80fa /engines/scumm/gfx.cpp
parent6e77abc07f20736fe7d50d3f3f3211839c630b53 (diff)
downloadscummvm-rg350-b1feb9c65c715862d70b25cfa4e37df3a912cac5.tar.gz
scummvm-rg350-b1feb9c65c715862d70b25cfa4e37df3a912cac5.tar.bz2
scummvm-rg350-b1feb9c65c715862d70b25cfa4e37df3a912cac5.zip
This commit adds a new build define USE_ARM_GFX_ASM (and sets it for the WinCE
and DS builds). This causes the scumm engines graphics code to call ARM routines to do drawStripToScreen and copy8col. These routines were originally written for the DS port, and have now been made available to any other ARM device out there that wants them. I've tested this change on WinCE, but can't test it on the DS as I don't have one. We know that the routines work there though. svn-id: r28016
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r--engines/scumm/gfx.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index d21a77ea56..4e7276f2d0 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -35,9 +35,12 @@
#include "scumm/usage_bits.h"
#include "scumm/he/wiz_he.h"
#include "scumm/util.h"
-#ifdef __DS__
-#include "blitters.h"
-#endif
+
+#ifdef USE_ARM_GFX_ASM
+extern "C" void DrawStripToScreenARM(int height, int width, byte const* text, byte const* src, byte* dst,
+ int vsPitch, int vmScreenWidth, int textSurfacePitch);
+extern "C" void Copy8ColARM(byte* dst, int dstPitch, const byte* src, int height);
+#endif /* USE_ARM_GFX_ASM */
namespace Scumm {
@@ -610,8 +613,8 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// (b) RLE encode the _textSurface row-wise. This is an improved variant of (a),
// but also more complicated to implement, and incurs a bigger overhead when
// writing to the text surface.
-#ifdef __DS__
- DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, width, _textSurface.pitch);
+#ifdef ARM_USE_GFX_ASM
+ DrawStripToScreenARM(height, width, text, src, dst, vs->pitch, width, _textSurface.pitch);
#else
for (int h = 0; h < height * m; ++h) {
for (int w = 0; w < width * m; ++w) {
@@ -625,7 +628,6 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
text += _textSurface.pitch - width * m;
}
#endif
-
src = _compositeBuf;
pitch = width;
@@ -1064,11 +1066,14 @@ static void fill(byte *dst, int dstPitch, byte color, int w, int h) {
}
}
+#ifdef ARM_USE_GFX_ASM
+
+#define copy8Col(A,B,C,D) copy8ColARM(A,B,C,D)
+
+#else
+
static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) {
-#ifndef __DS__
-
-
do {
#if defined(SCUMM_NEED_ALIGNMENT)
memcpy(dst, src, 8);
@@ -1079,12 +1084,10 @@ static void copy8Col(byte *dst, int dstPitch, const byte *src, int height) {
dst += dstPitch;
src += dstPitch;
} while (--height);
-#else
- DS::asmCopy8Col(dst, dstPitch, src, height);
-#endif
-
}
+#endif /* ARM_USE_GFX_ASM */
+
static void clear8Col(byte *dst, int dstPitch, int height) {
do {
#if defined(SCUMM_NEED_ALIGNMENT)