diff options
author | Chris Apers | 2004-10-06 09:35:02 +0000 |
---|---|---|
committer | Chris Apers | 2004-10-06 09:35:02 +0000 |
commit | a5e47bf68773699eb58fbeb9c651fdaa0b24eeab (patch) | |
tree | d210667535c5cc84990606c5895b98e9e1ef25ac /backends/PalmOS | |
parent | 2f72e6fe2d958ab7d180317065ee0d6079cf6c20 (diff) | |
download | scummvm-rg350-a5e47bf68773699eb58fbeb9c651fdaa0b24eeab.tar.gz scummvm-rg350-a5e47bf68773699eb58fbeb9c651fdaa0b24eeab.tar.bz2 scummvm-rg350-a5e47bf68773699eb58fbeb9c651fdaa0b24eeab.zip |
FOTAQ ARM optimization
svn-id: r15427
Diffstat (limited to 'backends/PalmOS')
-rw-r--r-- | backends/PalmOS/Src/arm/PNOMain.cpp | 4 | ||||
-rw-r--r-- | backends/PalmOS/Src/arm/blit.cpp | 50 | ||||
-rw-r--r-- | backends/PalmOS/Src/arm/blit.h | 11 | ||||
-rw-r--r-- | backends/PalmOS/Src/arm/native.h | 21 |
4 files changed, 82 insertions, 4 deletions
diff --git a/backends/PalmOS/Src/arm/PNOMain.cpp b/backends/PalmOS/Src/arm/PNOMain.cpp index c85d694e22..1c1b2c051b 100644 --- a/backends/PalmOS/Src/arm/PNOMain.cpp +++ b/backends/PalmOS/Src/arm/PNOMain.cpp @@ -43,5 +43,9 @@ unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncTy Gdi_drawStripToScreen(userData68KP); #endif +#ifdef COMPILE_BLIT + Display_blit(userData68KP); +#endif + return ByteSwap32(retVal); } diff --git a/backends/PalmOS/Src/arm/blit.cpp b/backends/PalmOS/Src/arm/blit.cpp new file mode 100644 index 0000000000..cbbb7416c0 --- /dev/null +++ b/backends/PalmOS/Src/arm/blit.cpp @@ -0,0 +1,50 @@ +#include "native.h" +#include "endianutils.h" + +#define MAIN_TYPE BlitType +#include "macros.h" + +#define memcpy MemMove + +void Display_blit(void *userData68KP) { +// import variables + SETPTR (uint8 *, dstBuf ) + SETPTR (const uint8 *, srcBuf ) + SET16 (uint16, dstPitch ) + SET16 (uint16, srcPitch ) + SET16 (uint16, w ) + SET16 (uint16, h ) + SET8 (bool, xflip ) + SET8 (bool, masked ) +// end of import + + if (!masked) { // Unmasked always unflipped + while (h--) { + memcpy(dstBuf, srcBuf, w); + srcBuf += srcPitch; + dstBuf += dstPitch; + } + } else if (!xflip) { // Masked bitmap unflipped + while (h--) { + for(int i = 0; i < w; ++i) { + uint8 b = *(srcBuf + i); + if(b != 0) { + *(dstBuf + i) = b; + } + } + srcBuf += srcPitch; + dstBuf += dstPitch; + } + } else { // Masked bitmap flipped + while (h--) { + for(int i = 0; i < w; ++i) { + uint8 b = *(srcBuf + i); + if(b != 0) { + *(dstBuf - i) = b; + } + } + srcBuf += srcPitch; + dstBuf += dstPitch; + } + } +}
\ No newline at end of file diff --git a/backends/PalmOS/Src/arm/blit.h b/backends/PalmOS/Src/arm/blit.h new file mode 100644 index 0000000000..2e8ece77fe --- /dev/null +++ b/backends/PalmOS/Src/arm/blit.h @@ -0,0 +1,11 @@ +#ifndef __BLIT_H__ +#define __BLIT_H__ + +#include <PalmOS.h> + +#define COMPILE_BLIT +#define COMPILE_PACE + +void Display_blit(void *userData68KP); + +#endif
\ No newline at end of file diff --git a/backends/PalmOS/Src/arm/native.h b/backends/PalmOS/Src/arm/native.h index 0773fee63a..85e51a5730 100644 --- a/backends/PalmOS/Src/arm/native.h +++ b/backends/PalmOS/Src/arm/native.h @@ -9,6 +9,7 @@ #ifndef __PALM_OS__ typedef UInt8 byte; +typedef UInt8 uint8; typedef Int32 int32; typedef UInt16 uint16; typedef unsigned int uint; @@ -21,7 +22,8 @@ enum { RSC_WIDEPORTRAIT, RSC_COPYRECT, RSC_COSTUMEPROC3, - RSC_DRAWSTRIP + RSC_DRAWSTRIP, + RSC_BLIT }; enum { @@ -29,6 +31,7 @@ enum { PNO_WIDE, PNO_COSTUMEPROC3, PNO_DRAWSTRIP, + PNO_BLIT, PNO_COUNT }; @@ -109,9 +112,7 @@ typedef struct { int _outheight; byte *_shadow_table; - - byte *_vm_proc_special_palette; - byte *_palette; + byte *_palette; byte _shadow_mode; } CostumeProc3Type; @@ -128,6 +129,18 @@ typedef struct { uint16 _textSurface_pitch; } DrawStripType; +// Queen +typedef struct { + uint8 *dstBuf; + const uint8 *srcBuf; + uint16 dstPitch; + uint16 srcPitch; + uint16 w; + uint16 h; + byte xflip; + byte masked; +} BlitType; + // calls MemPtr _PceInit(DmResID resID); UInt32 _PceCall(void *armP, void *userDataP); |