[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.49,1.50
Chris Apers
chrilith at users.sourceforge.net
Fri Dec 10 07:14:02 CET 2004
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15608
Modified Files:
screen.cpp
Log Message:
Many PalmOS ARM optimizations
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- screen.cpp 9 Dec 2004 21:32:02 -0000 1.49
+++ screen.cpp 10 Dec 2004 15:13:10 -0000 1.50
@@ -32,6 +32,12 @@
#include "sword1/menu.h"
#include "sword1/sword1.h"
+#if defined(__PALM_OS__)
+#include "init_arm.h"
+#include "arm/native.h"
+#include "arm/macros.h"
+#endif
+
namespace Sword1 {
#define SCROLL_FRACTION 16
@@ -334,6 +340,17 @@
renderParallax(_parallax[0]);
uint8 *src = _layerBlocks[0];
uint8 *dest = _screenBuf;
+
+#ifdef __PALM_OS__
+ ARM_START(DrawType)
+ ARM_INIT(SWORD1_SCREENDRAW)
+ ARM_ADDM(_scrnSizeY)
+ ARM_ADDM(_scrnSizeX)
+ ARM_ADDM(src)
+ ARM_ADDM(dest)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_CONTINUE()
+#endif
for (uint16 cnty = 0; cnty < _scrnSizeY; cnty++)
for (uint16 cntx = 0; cntx < _scrnSizeX; cntx++) {
if (*src)
@@ -341,6 +358,7 @@
dest++;
src++;
}
+
} else
memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
@@ -522,7 +540,23 @@
paraScrlY = (uint16)(scrnScrlY * scrlfy);
} else
paraScrlY = 0;
-
+
+#ifdef __PALM_OS__
+ ARM_START(ParallaxType)
+ ARM_INIT(SWORD1_RENDERPARALLAX)
+ ARM_ADDM(data)
+ ARM_ADDM(lineIndexes)
+ ARM_ADDM(_screenBuf)
+ ARM_ADDM(_scrnSizeX)
+ ARM_ADDM(scrnScrlX)
+ ARM_ADDM(scrnScrlY)
+ ARM_ADDM(paraScrlX)
+ ARM_ADDM(paraScrlY)
+ ARM_ADDM(scrnWidth)
+ ARM_ADDM(scrnHeight)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
for (uint16 cnty = 0; cnty < scrnHeight; cnty++) {
uint8 *src = data + READ_LE_UINT32(lineIndexes + cnty + paraScrlY);
uint8 *dest = _screenBuf + scrnScrlX + (cnty + scrnScrlY) * _scrnSizeX;
@@ -578,6 +612,20 @@
void Screen::drawSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch) {
uint8 *dest = _screenBuf + (sprY * _scrnSizeX) + sprX;
+
+#ifdef __PALM_OS__
+ ARM_START(DrawSpriteType)
+ ARM_INIT(SWORD1_DRAWSPRITE)
+ ARM_ADDM(sprData)
+ ARM_ADDM(sprHeight)
+ ARM_ADDM(sprWidth)
+ ARM_ADDM(sprPitch)
+ ARM_ADDM(dest)
+ ARM_ADDM(_scrnSizeX)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
+
for (uint16 cnty = 0; cnty < sprHeight; cnty++) {
for (uint16 cntx = 0; cntx < sprWidth; cntx++)
if (sprData[cntx])
@@ -589,6 +637,18 @@
// nearest neighbor filter:
void Screen::fastShrink(uint8 *src, uint32 width, uint32 height, uint32 scale, uint8 *dest) {
+#ifdef __PALM_OS__
+ ARM_START(FastShrinkType)
+ ARM_INIT(SWORD1_FASTSHRINK)
+ ARM_ADDM(src)
+ ARM_ADDM(width)
+ ARM_ADDM(height)
+ ARM_ADDM(scale)
+ ARM_ADDM(dest)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
+
uint32 resHeight = (height * scale) >> 8;
uint32 resWidth = (width * scale) >> 8;
uint32 step = 0x10000 / scale;
@@ -655,6 +715,16 @@
}
void Screen::decompressTony(uint8 *src, uint32 compSize, uint8 *dest) {
+#ifdef __PALM_OS__
+ ARM_START(CompressType)
+ ARM_INIT(SWORD1_DECOMPTONY)
+ ARM_ADDM(src)
+ ARM_ADDM(compSize)
+ ARM_ADDM(dest)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
+
uint8 *endOfData = src + compSize;
while (src < endOfData) {
uint8 numFlat = *src++;
@@ -673,6 +743,16 @@
}
void Screen::decompressRLE7(uint8 *src, uint32 compSize, uint8 *dest) {
+#ifdef __PALM_OS__
+ ARM_START(CompressType)
+ ARM_INIT(SWORD1_DECOMPRLE7)
+ ARM_ADDM(src)
+ ARM_ADDM(compSize)
+ ARM_ADDM(dest)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
+
uint8 *compBufEnd = src + compSize;
while (src < compBufEnd) {
uint8 code = *src++;
@@ -687,6 +767,16 @@
}
void Screen::decompressRLE0(uint8 *src, uint32 compSize, uint8 *dest) {
+#ifdef __PALM_OS__
+ ARM_START(CompressType)
+ ARM_INIT(SWORD1_DECOMPRLE0)
+ ARM_ADDM(src)
+ ARM_ADDM(compSize)
+ ARM_ADDM(dest)
+ ARM_CALL(ARM_ENGINE, PNO_DATA());
+ ARM_END()
+#endif
+
uint8 *srcBufEnd = src + compSize;
while (src < srcBufEnd) {
uint8 color = *src++;
More information about the Scummvm-git-logs
mailing list