aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoost Peters2009-08-21 22:44:49 +0000
committerJoost Peters2009-08-21 22:44:49 +0000
commit978d9dfd10c8290a6123bd96dba84a5563c0f9c2 (patch)
tree8657b12d874a0a6faf88701c791c99eeb6defc54
parent6166c85b062f5eb365b35780c38fe6bcc91020ff (diff)
downloadscummvm-rg350-978d9dfd10c8290a6123bd96dba84a5563c0f9c2.tar.gz
scummvm-rg350-978d9dfd10c8290a6123bd96dba84a5563c0f9c2.tar.bz2
scummvm-rg350-978d9dfd10c8290a6123bd96dba84a5563c0f9c2.zip
some cleanup
svn-id: r43618
-rw-r--r--backends/platform/psp/osys_psp.cpp58
-rw-r--r--backends/platform/psp/osys_psp.h8
2 files changed, 33 insertions, 33 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index a9e9aeb7d8..023ec0cc82 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -31,7 +31,6 @@
#include "common/config-manager.h"
#include "common/events.h"
-#include "common/rect.h"
#include "common/scummsys.h"
#include "osys_psp.h"
@@ -40,14 +39,11 @@
#include "backends/saves/psp/psp-saves.h"
#include "backends/timer/default/default-timer.h"
#include "graphics/surface.h"
-#include "graphics/scaler.h"
#include "sound/mixer_intern.h"
#define SAMPLES_PER_SEC 44100
-#define SCREEN_WIDTH 480
-#define SCREEN_HEIGHT 272
#define PIXEL_SIZE (4)
#define BUF_WIDTH (512)
@@ -68,8 +64,6 @@ unsigned short __attribute__((aligned(16))) kbClut[256];
//unsigned int __attribute__((aligned(16))) overlayBuffer256[640*480*2];
unsigned int __attribute__((aligned(16))) mouseBuf256[MOUSE_SIZE*MOUSE_SIZE];
-extern unsigned long RGBToColour(unsigned long r, unsigned long g, unsigned long b);
-
extern unsigned int size_keyboard_symbols_compressed;
extern unsigned char keyboard_symbols_compressed[];
extern unsigned int size_keyboard_symbols_shift_compressed;
@@ -126,28 +120,6 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
SDL_Init(sdlFlags);
- //sceKernelDcacheWritebackAll();
-
- // setup
- sceGuInit();
- sceGuStart(0, displayList);
- sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
- sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
- sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
- sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
- sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuDepthRange(0xC350, 0x2710);
- sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
- sceGuEnable(GU_SCISSOR_TEST);
- sceGuFrontFace(GU_CW);
- sceGuEnable(GU_TEXTURE_2D);
- sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
- sceGuFinish();
- sceGuSync(0,0);
-
- sceDisplayWaitVblankStart();
- sceGuDisplay(1);
-
//decompress keyboard data
uLongf kbdSize = KBD_DATA_SIZE;
keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
@@ -178,6 +150,30 @@ OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0)
_keyboardMode = 0;
_mouseX = PSP_SCREEN_WIDTH >> 1;
_mouseY = PSP_SCREEN_HEIGHT >> 1;
+
+
+ //sceKernelDcacheWritebackAll();
+
+ // setup
+ sceGuInit();
+ sceGuStart(0, displayList);
+ sceGuDrawBuffer(GU_PSM_8888, (void *)0, BUF_WIDTH);
+ sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)PSP_FRAME_SIZE, BUF_WIDTH);
+ sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * 2), BUF_WIDTH);
+ sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
+ sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuDepthRange(0xC350, 0x2710);
+ sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
+ sceGuEnable(GU_SCISSOR_TEST);
+ sceGuFrontFace(GU_CW);
+ sceGuEnable(GU_TEXTURE_2D);
+ sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+ sceGuFinish();
+ sceGuSync(0,0);
+
+ sceDisplayWaitVblankStart();
+ sceGuDisplay(1);
+
}
OSystem_PSP::~OSystem_PSP() {
@@ -270,8 +266,10 @@ void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat
_kbdClut[0] = 0xFFFF;
_kbdClut[246] = 0x4CCC;
_kbdClut[247] = 0x0000;
+
for (int i = 1; i < 31; i++)
_kbdClut[i] = 0xF888;
+
_mouseVisible = false;
sceKernelDcacheWritebackAll();
}
@@ -293,10 +291,10 @@ void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) {
}
//copy to CLUT
- memcpy(_clut, _palette, 256*sizeof(unsigned short));
+ memcpy(_clut, _palette, 256 * sizeof(unsigned short));
//force update of mouse CLUT as well, as it may have been set up before this palette was set
- memcpy(mouseClut, _palette, 256*sizeof(unsigned short));
+ memcpy(mouseClut, _palette, 256 * sizeof(unsigned short));
mouseClut[_mouseKeyColour] = 0;
sceKernelDcacheWritebackAll();
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 353561cced..047fbff97e 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -96,7 +96,6 @@ protected:
Common::TimerManager *_timer;
public:
-
OSystem_PSP();
virtual ~OSystem_PSP();
@@ -105,15 +104,19 @@ public:
virtual bool hasFeature(Feature f);
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
+
virtual const GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
virtual bool setGraphicsMode(int mode);
bool setGraphicsMode(const char *name);
virtual int getGraphicsMode() const;
+
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
virtual int16 getWidth();
virtual int16 getHeight();
+
virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void grabPalette(byte *colors, uint start, uint num);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void disableCursorPalette(bool disable);
virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
@@ -129,16 +132,15 @@ public:
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
virtual int16 getOverlayHeight();
virtual int16 getOverlayWidth();
- virtual void grabPalette(byte *colors, uint start, uint num);
virtual Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); }
virtual bool showMouse(bool visible);
-
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format);
virtual bool pollEvent(Common::Event &event);
virtual bool processInput(Common::Event &event);
+
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);