diff options
Diffstat (limited to 'backends/platform/gp2xwiz/gp2xwiz-scaler.cpp')
-rw-r--r-- | backends/platform/gp2xwiz/gp2xwiz-scaler.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp b/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp new file mode 100644 index 0000000000..774b0b0e11 --- /dev/null +++ b/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp @@ -0,0 +1,44 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ +#include "graphics/scaler/intern.h" +#include "backends/platform/gp2xwiz/gp2xwiz-sdl.h" + +SDL_PixelFormat *screenPixelFormat; + +extern "C" { + void PocketPCHalfARM(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int mask, int round); + // Rounding constants and masks used for different pixel formats + int roundingconstants[] = { 0x00200802, 0x00201002 }; + int redbluegreenMasks[] = { 0x03E07C1F, 0x07E0F81F }; +} + +void HalfScale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + int maskUsed; + if (screenPixelFormat->Rmask == 0x7C00) + maskUsed = (gBitFormat == 555); + else + maskUsed = (gBitFormat == 565); + PocketPCHalfARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed],roundingconstants[maskUsed]); +} |