PSP:Implemented fingolfin's suggestion for cleaning up debugging code

svn-id: r48792
This commit is contained in:
Yotam Barnoy 2010-04-25 15:12:24 +00:00
parent aaaab9ec34
commit f036b6b9d2
13 changed files with 30 additions and 304 deletions

View file

@ -108,7 +108,6 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
_isDirectory = S_ISDIR(st.st_mode); _isDirectory = S_ISDIR(st.st_mode);
} }
DEBUG_EXIT_FUNC();
} }
bool PSPFilesystemNode::exists() const { bool PSPFilesystemNode::exists() const {
@ -123,7 +122,6 @@ bool PSPFilesystemNode::exists() const {
ret = access(_path.c_str(), F_OK); ret = access(_path.c_str(), F_OK);
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return (ret == 0); return (ret == 0);
} }
@ -139,7 +137,6 @@ bool PSPFilesystemNode::isReadable() const {
ret = access(_path.c_str(), R_OK); ret = access(_path.c_str(), R_OK);
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return (ret == 0); return (ret == 0);
} }
@ -155,7 +152,6 @@ bool PSPFilesystemNode::isWritable() const {
ret = access(_path.c_str(), W_OK); ret = access(_path.c_str(), W_OK);
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return ret == 0; return ret == 0;
} }
@ -175,7 +171,6 @@ AbstractFSNode *PSPFilesystemNode::getChild(const Common::String &n) const {
AbstractFSNode *node = new PSPFilesystemNode(newPath, true); AbstractFSNode *node = new PSPFilesystemNode(newPath, true);
DEBUG_EXIT_FUNC();
return node; return node;
} }
@ -233,7 +228,6 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -248,7 +242,7 @@ AbstractFSNode *PSPFilesystemNode::getParent() const {
const char *end = lastPathComponent(_path, '/'); const char *end = lastPathComponent(_path, '/');
AbstractFSNode *node = new PSPFilesystemNode(Common::String(start, end - start), false); AbstractFSNode *node = new PSPFilesystemNode(Common::String(start, end - start), false);
DEBUG_EXIT_FUNC();
return node; return node;
} }

View file

@ -54,8 +54,6 @@ PSPIoStream::PSPIoStream(const Common::String &path, bool writeMode)
_errorPos = 0; _errorPos = 0;
_errorHandle = 0; _errorHandle = 0;
_suspendCount = 0; _suspendCount = 0;
DEBUG_EXIT_FUNC();
} }
PSPIoStream::~PSPIoStream() { PSPIoStream::~PSPIoStream() {
@ -70,8 +68,6 @@ PSPIoStream::~PSPIoStream() {
fclose((FILE *)_handle); // We don't need a critical section(?). Worst case, the handle gets closed on its own fclose((FILE *)_handle); // We don't need a critical section(?). Worst case, the handle gets closed on its own
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
} }
/* Function to open the file pointed to by the path. /* Function to open the file pointed to by the path.
@ -90,7 +86,6 @@ void *PSPIoStream::open() {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return _handle; return _handle;
} }
@ -100,7 +95,6 @@ bool PSPIoStream::err() const {
PSP_ERROR("mem_ferror[%d], source[%d], suspend error[%d], pos[%d], _errorPos[%d], _errorHandle[%p], suspendCount[%d]\n", PSP_ERROR("mem_ferror[%d], source[%d], suspend error[%d], pos[%d], _errorPos[%d], _errorHandle[%p], suspendCount[%d]\n",
_ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount); _ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount);
DEBUG_EXIT_FUNC();
return _ferror; return _ferror;
} }
@ -136,7 +130,6 @@ int32 PSPIoStream::size() const {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return length; return length;
} }
@ -163,7 +156,6 @@ bool PSPIoStream::seek(int32 offs, int whence) {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return (ret == 0); return (ret == 0);
} }
@ -192,7 +184,6 @@ uint32 PSPIoStream::read(void *ptr, uint32 len) {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -218,7 +209,6 @@ uint32 PSPIoStream::write(const void *ptr, uint32 len) {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -239,7 +229,6 @@ bool PSPIoStream::flush() {
PowerMan.endCriticalSection(); PowerMan.endCriticalSection();
DEBUG_EXIT_FUNC();
return (ret == 0); return (ret == 0);
} }
@ -255,7 +244,6 @@ PSPIoStream *PSPIoStream::makeFromPath(const Common::String &path, bool writeMod
stream = 0; stream = 0;
} }
DEBUG_EXIT_FUNC();
return stream; return stream;
} }
@ -278,7 +266,6 @@ int PSPIoStream::suspend() {
_handle = (void *)0xFFFFFFFF; // Set handle to non-null invalid value so makeFromPath doesn't return error _handle = (void *)0xFFFFFFFF; // Set handle to non-null invalid value so makeFromPath doesn't return error
} }
DEBUG_EXIT_FUNC();
return 0; return 0;
} }
@ -306,7 +293,6 @@ int PSPIoStream::resume() {
_errorHandle = _handle; _errorHandle = _handle;
} }
} }
DEBUG_EXIT_FUNC();
return ret; return ret;
} }

View file

@ -45,8 +45,6 @@ void Cursor::init() {
_palette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit); // default _palette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit); // default
_screenPalette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit); _screenPalette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit);
_buffer.setPixelFormat(PSPPixelFormat::Type_5551); _buffer.setPixelFormat(PSPPixelFormat::Type_5551);
DEBUG_EXIT_FUNC();
} }
void Cursor::deallocate() { void Cursor::deallocate() {
@ -55,8 +53,6 @@ void Cursor::deallocate() {
_buffer.deallocate(); _buffer.deallocate();
_palette.deallocate(); _palette.deallocate();
_screenPalette.deallocate(); _screenPalette.deallocate();
DEBUG_EXIT_FUNC();
} }
void Cursor::setCursorPalette(const byte *colors, uint start, uint num) { void Cursor::setCursorPalette(const byte *colors, uint start, uint num) {
@ -73,8 +69,6 @@ void Cursor::setCursorPalette(const byte *colors, uint start, uint num) {
_palette.setPartial(colors, start, num); _palette.setPartial(colors, start, num);
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
void Cursor::setScreenPalette(const byte *colors, uint start, uint num) { void Cursor::setScreenPalette(const byte *colors, uint start, uint num) {
@ -86,8 +80,6 @@ void Cursor::setScreenPalette(const byte *colors, uint start, uint num) {
_screenPalette.setPartial(colors, start, num); _screenPalette.setPartial(colors, start, num);
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
void Cursor::setKeyColor(uint32 color) { void Cursor::setKeyColor(uint32 color) {
@ -103,8 +95,6 @@ void Cursor::setKeyColor(uint32 color) {
} }
// Don't need anything special for 16-bit // Don't need anything special for 16-bit
_keyColor = color; _keyColor = color;
DEBUG_EXIT_FUNC();
} }
void Cursor::clearKeyColor() { void Cursor::clearKeyColor() {
@ -121,8 +111,6 @@ void Cursor::clearKeyColor() {
_renderer.setKeyColor(_keyColor); _renderer.setKeyColor(_keyColor);
} }
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
void Cursor::enableCursorPalette(bool enable) { void Cursor::enableCursorPalette(bool enable) {
@ -136,7 +124,6 @@ void Cursor::enableCursorPalette(bool enable) {
_renderer.setPalette(&_screenPalette); _renderer.setPalette(&_screenPalette);
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
inline void Cursor::setSize(uint32 width, uint32 height) { inline void Cursor::setSize(uint32 width, uint32 height) {
@ -145,8 +132,6 @@ inline void Cursor::setSize(uint32 width, uint32 height) {
_buffer.setSize(width, height, Buffer::kSizeByTextureSize); // we'll use texture size for mouse _buffer.setSize(width, height, Buffer::kSizeByTextureSize); // we'll use texture size for mouse
_renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw _renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw
DEBUG_EXIT_FUNC();
} }
void Cursor::copyFromArray(const byte *array) { void Cursor::copyFromArray(const byte *array) {
@ -161,9 +146,6 @@ void Cursor::copyFromArray(const byte *array) {
// debug // debug
//PSP_DEBUG_DO(_buffer.print(0xF)); //PSP_DEBUG_DO(_buffer.print(0xF));
DEBUG_EXIT_FUNC();
} }
void Cursor::setHotspot(int32 x, int32 y) { void Cursor::setHotspot(int32 x, int32 y) {
@ -174,7 +156,6 @@ void Cursor::setHotspot(int32 x, int32 y) {
updateRendererOffset(); // Important updateRendererOffset(); // Important
PSP_DEBUG_PRINT("hotspotX[%d], hotspotY[%d]\n", x, y); PSP_DEBUG_PRINT("hotspotX[%d], hotspotY[%d]\n", x, y);
DEBUG_EXIT_FUNC();
} }
// Returns true if change in x or y // Returns true if change in x or y
@ -204,11 +185,9 @@ bool Cursor::increaseXY(int32 incX, int32 incY) {
if (oldX != _x || oldY != _y) { if (oldX != _x || oldY != _y) {
updateRendererOffset(); updateRendererOffset();
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
return true; return true;
} }
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -221,8 +200,6 @@ void Cursor::setLimits(uint32 width, uint32 height) {
PSP_DEBUG_PRINT("width[%u], height[%u]\n", width, height); PSP_DEBUG_PRINT("width[%u], height[%u]\n", width, height);
_mouseLimitWidth = width; _mouseLimitWidth = width;
_mouseLimitHeight = height; _mouseLimitHeight = height;
DEBUG_EXIT_FUNC();
} }
// Adjust X,Y movement for the screen size to keep it consistent // Adjust X,Y movement for the screen size to keep it consistent
@ -253,8 +230,6 @@ inline void Cursor::adjustXYForScreenSize(int32 &x, int32 &y) {
x = newX; x = newX;
y = newY; y = newY;
} }
DEBUG_EXIT_FUNC();
} }
// This is only called when we have a new screen // This is only called when we have a new screen
@ -280,8 +255,6 @@ void Cursor::setScreenPaletteScummvmPixelFormat(const Graphics::PixelFormat *for
_palette.setPixelFormats(paletteType, bufferType); _palette.setPixelFormats(paletteType, bufferType);
setRendererModePalettized(true); // use palettized mechanism setRendererModePalettized(true); // use palettized mechanism
} }
DEBUG_EXIT_FUNC();
} }
// This is called many many times // This is called many many times
@ -331,8 +304,6 @@ void Cursor::setSizeAndScummvmPixelFormat(uint32 width, uint32 height, const Gra
// debug // debug
// PSP_DEBUG_DO(_palette.print(10)); // PSP_DEBUG_DO(_palette.print(10));
// PSP_DEBUG_DO(_screenPalette.print(10)); // PSP_DEBUG_DO(_screenPalette.print(10));
DEBUG_EXIT_FUNC();
} }
void Cursor::setXY(int x, int y) { void Cursor::setXY(int x, int y) {
@ -342,14 +313,11 @@ void Cursor::setXY(int x, int y) {
_y = y; _y = y;
updateRendererOffset(); // Very important to let renderer know things changed updateRendererOffset(); // Very important to let renderer know things changed
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
inline void Cursor::updateRendererOffset() { inline void Cursor::updateRendererOffset() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_renderer.setOffsetOnScreen(_x - _hotspotX, _y - _hotspotY); _renderer.setOffsetOnScreen(_x - _hotspotX, _y - _hotspotY);
DEBUG_EXIT_FUNC();
} }
inline void Cursor::setRendererModePalettized(bool palettized) { inline void Cursor::setRendererModePalettized(bool palettized) {

View file

@ -39,7 +39,6 @@ bool DefaultDisplayClient::allocate(bool bufferInVram /* = false */, bool palett
if (!_buffer.allocate(bufferInVram)) { if (!_buffer.allocate(bufferInVram)) {
PSP_ERROR("Couldn't allocate buffer.\n"); PSP_ERROR("Couldn't allocate buffer.\n");
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -47,13 +46,11 @@ bool DefaultDisplayClient::allocate(bool bufferInVram /* = false */, bool palett
PSP_DEBUG_PRINT("_palette[%p]\n", &_palette); PSP_DEBUG_PRINT("_palette[%p]\n", &_palette);
if (!_palette.allocate()) { if (!_palette.allocate()) {
PSP_ERROR("Couldn't allocate pallette.\n"); PSP_ERROR("Couldn't allocate palette.\n");
DEBUG_EXIT_FUNC();
return false; return false;
} }
} }
DEBUG_EXIT_FUNC();
return true; return true;
} }
@ -68,34 +65,29 @@ void DefaultDisplayClient::clearBuffer() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_buffer.clear(); _buffer.clear();
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
inline void DefaultDisplayClient::clearPalette() { inline void DefaultDisplayClient::clearPalette() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_palette.clear(); _palette.clear();
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
void DefaultDisplayClient::init() { void DefaultDisplayClient::init() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_renderer.setBuffer(&_buffer); _renderer.setBuffer(&_buffer);
_renderer.setPalette(&_palette); _renderer.setPalette(&_palette);
DEBUG_EXIT_FUNC();
} }
void DefaultDisplayClient::copyFromRect(const byte *buf, int pitch, int destX, int destY, int recWidth, int recHeight) { void DefaultDisplayClient::copyFromRect(const byte *buf, int pitch, int destX, int destY, int recWidth, int recHeight) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_buffer.copyFromRect(buf, pitch, destX, destY, recWidth, recHeight); _buffer.copyFromRect(buf, pitch, destX, destY, recWidth, recHeight);
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
void DefaultDisplayClient::copyToArray(byte *dst, int pitch) { void DefaultDisplayClient::copyToArray(byte *dst, int pitch) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_buffer.copyToArray(dst, pitch); _buffer.copyToArray(dst, pitch);
DEBUG_EXIT_FUNC();
} }
// Class Overlay ------------------------------------------------------- // Class Overlay -------------------------------------------------------
@ -108,8 +100,6 @@ void Overlay::init() {
_renderer.setColorTest(false); _renderer.setColorTest(false);
_renderer.setUseGlobalScaler(false); _renderer.setUseGlobalScaler(false);
_renderer.setFullScreen(true); // speeds up render slightly _renderer.setFullScreen(true); // speeds up render slightly
DEBUG_EXIT_FUNC();
} }
void Overlay::setBytesPerPixel(uint32 size) { void Overlay::setBytesPerPixel(uint32 size) {
@ -127,21 +117,17 @@ void Overlay::setBytesPerPixel(uint32 size) {
_buffer.setPixelFormat(PSPPixelFormat::Type_8888); _buffer.setPixelFormat(PSPPixelFormat::Type_8888);
break; break;
} }
DEBUG_EXIT_FUNC();
} }
void Overlay::setSize(uint32 width, uint32 height) { void Overlay::setSize(uint32 width, uint32 height) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_buffer.setSize(width, height, Buffer::kSizeBySourceSize); _buffer.setSize(width, height, Buffer::kSizeBySourceSize);
_renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw _renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw
DEBUG_EXIT_FUNC();
} }
void Overlay::copyToArray(OverlayColor *buf, int pitch) { void Overlay::copyToArray(OverlayColor *buf, int pitch) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_buffer.copyToArray((byte *)buf, pitch * sizeof(OverlayColor)); // Change to bytes _buffer.copyToArray((byte *)buf, pitch * sizeof(OverlayColor)); // Change to bytes
DEBUG_EXIT_FUNC();
} }
void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
@ -151,7 +137,6 @@ void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int
// debug // debug
//_buffer.print(0xFF); //_buffer.print(0xFF);
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
bool Overlay::allocate() { bool Overlay::allocate() {
@ -159,7 +144,6 @@ bool Overlay::allocate() {
bool ret = DefaultDisplayClient::allocate(true, false); // buffer in VRAM bool ret = DefaultDisplayClient::allocate(true, false); // buffer in VRAM
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -173,8 +157,6 @@ void Screen::init() {
_renderer.setColorTest(false); _renderer.setColorTest(false);
_renderer.setUseGlobalScaler(true); _renderer.setUseGlobalScaler(true);
_renderer.setFullScreen(true); _renderer.setFullScreen(true);
DEBUG_EXIT_FUNC();
} }
void Screen::setShakePos(int pos) { void Screen::setShakePos(int pos) {
@ -188,8 +170,6 @@ void Screen::setSize(uint32 width, uint32 height) {
_buffer.setSize(width, height, Buffer::kSizeBySourceSize); _buffer.setSize(width, height, Buffer::kSizeBySourceSize);
_renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw _renderer.setDrawWholeBuffer(); // We need to let the renderer know how much to draw
DEBUG_EXIT_FUNC();
} }
void Screen::setScummvmPixelFormat(const Graphics::PixelFormat *format) { void Screen::setScummvmPixelFormat(const Graphics::PixelFormat *format) {
@ -209,8 +189,6 @@ void Screen::setScummvmPixelFormat(const Graphics::PixelFormat *format) {
PSPPixelFormat::convertFromScummvmPixelFormat(format, bufferFormat, paletteFormat, swapRedBlue); PSPPixelFormat::convertFromScummvmPixelFormat(format, bufferFormat, paletteFormat, swapRedBlue);
_buffer.setPixelFormat(bufferFormat, swapRedBlue); _buffer.setPixelFormat(bufferFormat, swapRedBlue);
_palette.setPixelFormats(paletteFormat, bufferFormat, swapRedBlue); _palette.setPixelFormats(paletteFormat, bufferFormat, swapRedBlue);
DEBUG_EXIT_FUNC();
} }
Graphics::Surface *Screen::lockAndGetForEditing() { Graphics::Surface *Screen::lockAndGetForEditing() {
@ -223,8 +201,6 @@ Graphics::Surface *Screen::lockAndGetForEditing() {
_frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel(); _frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel();
// We'll set to dirty once we unlock the screen // We'll set to dirty once we unlock the screen
DEBUG_EXIT_FUNC();
return &_frameBuffer; return &_frameBuffer;
} }
@ -232,6 +208,4 @@ bool Screen::allocate() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return DefaultDisplayClient::allocate(true, false); // buffer in VRAM return DefaultDisplayClient::allocate(true, false); // buffer in VRAM
DEBUG_EXIT_FUNC();
} }

View file

@ -53,8 +53,6 @@ void Palette::clear() {
memset(_values, 0, getSizeInBytes()); memset(_values, 0, getSizeInBytes());
PSP_DEBUG_PRINT("_values[%p]\n", _values); PSP_DEBUG_PRINT("_values[%p]\n", _values);
DEBUG_EXIT_FUNC();
} }
// Used to clear the specific keycolor // Used to clear the specific keycolor
@ -87,8 +85,6 @@ void Palette::setColorPositionAlpha(uint32 position, bool alpha) {
default: default:
PSP_ERROR("Incorrect bits per pixel value[%u]\n", _pixelFormat.bitsPerPixel); PSP_ERROR("Incorrect bits per pixel value[%u]\n", _pixelFormat.bitsPerPixel);
} }
DEBUG_EXIT_FUNC();
} }
// Set some of the palette to color values in array // Set some of the palette to color values in array
@ -125,8 +121,6 @@ void Palette::setPartial(const byte *colors, uint32 start, uint32 num, bool supp
palette++; palette++;
} }
} }
DEBUG_EXIT_FUNC();
} }
// Sets pixel format and number of entries by the buffer's pixel format */ // Sets pixel format and number of entries by the buffer's pixel format */
@ -153,8 +147,6 @@ void Palette::setPixelFormats(PSPPixelFormat::Type paletteType, PSPPixelFormat::
} }
_pixelFormat.set(paletteType, swapRedBlue); _pixelFormat.set(paletteType, swapRedBlue);
DEBUG_EXIT_FUNC();
} }
bool Palette::allocate() { bool Palette::allocate() {
@ -179,14 +171,12 @@ bool Palette::allocate() {
if (!_values) { if (!_values) {
PSP_ERROR("Couldn't allocate palette.\n"); PSP_ERROR("Couldn't allocate palette.\n");
DEBUG_EXIT_FUNC();
return false; return false;
} }
PSP_DEBUG_PRINT("_values[%p]\n", _values); PSP_DEBUG_PRINT("_values[%p]\n", _values);
clear(); clear();
DEBUG_EXIT_FUNC();
return true; return true;
} }
@ -196,8 +186,6 @@ void Palette::deallocate() {
free(CACHED(_values)); free(CACHED(_values));
_values = 0; _values = 0;
_numOfEntries = 0; _numOfEntries = 0;
DEBUG_EXIT_FUNC();
} }
// Copy some of the palette to an array of colors // Copy some of the palette to an array of colors
@ -240,8 +228,6 @@ void Palette::getPartial(byte *colors, uint start, uint num) {
palette++; palette++;
} }
} }
DEBUG_EXIT_FUNC();
} }
void Palette::setSingleColorRGBA(uint32 num, byte r, byte g, byte b, byte a) { void Palette::setSingleColorRGBA(uint32 num, byte r, byte g, byte b, byte a) {
@ -265,7 +251,6 @@ void Palette::setSingleColorRGBA(uint32 num, byte r, byte g, byte b, byte a) {
PSP_ERROR("Incorrect bitsPerPixel[%d]\n", _pixelFormat.bitsPerPixel); PSP_ERROR("Incorrect bitsPerPixel[%d]\n", _pixelFormat.bitsPerPixel);
break; break;
} }
// DEBUG_EXIT_FUNC();
} }
// Print to screen // Print to screen
@ -326,8 +311,6 @@ void Buffer::copyFromArray(const byte *buffer, int pitch) {
// We use sourceSize because outside, they won't know what the true size is // We use sourceSize because outside, they won't know what the true size is
copyFromRect(buffer, pitch, 0, 0, _sourceSize.width, _sourceSize.height); copyFromRect(buffer, pitch, 0, 0, _sourceSize.width, _sourceSize.height);
DEBUG_EXIT_FUNC();
} }
/* pitch is in bytes */ /* pitch is in bytes */
@ -345,7 +328,6 @@ void Buffer::copyFromRect(const byte *buf, uint32 pitch, int destX, int destY, u
} }
if (recWidth <= 0 || recHeight <= 0) { if (recWidth <= 0 || recHeight <= 0) {
DEBUG_EXIT_FUNC();
return; return;
} }
@ -365,8 +347,6 @@ void Buffer::copyFromRect(const byte *buf, uint32 pitch, int destX, int destY, u
dst += realWidthInBytes; dst += realWidthInBytes;
} while (--recHeight); } while (--recHeight);
} }
DEBUG_EXIT_FUNC();
} }
/* pitch is in bytes */ /* pitch is in bytes */
@ -385,8 +365,6 @@ void Buffer::copyToArray(byte *dst, int pitch) {
src += realWidthInBytes; src += realWidthInBytes;
dst += pitch; dst += pitch;
} while (--h); } while (--h);
DEBUG_EXIT_FUNC();
} }
/* We can size the buffer either by texture size (multiple of 2^n) or source size. The GU can /* We can size the buffer either by texture size (multiple of 2^n) or source size. The GU can
@ -408,8 +386,6 @@ void Buffer::setSize(uint32 width, uint32 height, HowToSize textureOrSource/*=kS
_width = _sourceSize.width; _width = _sourceSize.width;
_height = _sourceSize.height; _height = _sourceSize.height;
} }
DEBUG_EXIT_FUNC();
} }
/* Scale a dimension (width/height) up to power of 2 for the texture */ /* Scale a dimension (width/height) up to power of 2 for the texture */
@ -462,7 +438,6 @@ bool Buffer::allocate(bool inVram/*=false*/) {
if (!_pixels) { if (!_pixels) {
PSP_ERROR("couldn't allocate buffer.\n"); PSP_ERROR("couldn't allocate buffer.\n");
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -471,7 +446,6 @@ bool Buffer::allocate(bool inVram/*=false*/) {
_pixels = UNCACHED(_pixels); _pixels = UNCACHED(_pixels);
clear(); clear();
DEBUG_EXIT_FUNC();
return true; return true;
} }
@ -487,8 +461,6 @@ void Buffer::deallocate() {
free(CACHED(_pixels)); free(CACHED(_pixels));
_pixels = 0; _pixels = 0;
DEBUG_EXIT_FUNC();
} }
void Buffer::clear() { void Buffer::clear() {
@ -496,8 +468,6 @@ void Buffer::clear() {
if (_pixels) if (_pixels)
memset(_pixels, 0, getSizeInBytes()); memset(_pixels, 0, getSizeInBytes());
DEBUG_EXIT_FUNC();
} }
/* Convert 4 bit images to match weird PSP format */ /* Convert 4 bit images to match weird PSP format */
@ -517,8 +487,6 @@ void Buffer::flipNibbles() {
*dest++ = ((val >> 4) & 0x0F0F0F0F) | ((val << 4) & 0xF0F0F0F0); *dest++ = ((val >> 4) & 0x0F0F0F0F) | ((val << 4) & 0xF0F0F0F0);
} }
} }
DEBUG_EXIT_FUNC();
} }
// Print buffer contents to screen (only source size is printed out) // Print buffer contents to screen (only source size is printed out)
@ -585,8 +553,6 @@ void GuRenderer::render() {
guDrawVertices(vertices); guDrawVertices(vertices);
} }
DEBUG_EXIT_FUNC();
} }
inline void GuRenderer::setMaxTextureOffsetByIndex(uint32 x, uint32 y) { inline void GuRenderer::setMaxTextureOffsetByIndex(uint32 x, uint32 y) {
@ -595,7 +561,6 @@ inline void GuRenderer::setMaxTextureOffsetByIndex(uint32 x, uint32 y) {
_maxTextureOffset.x = x << maxTextureSizeShift; /* x times 512 */ _maxTextureOffset.x = x << maxTextureSizeShift; /* x times 512 */
_maxTextureOffset.y = y << maxTextureSizeShift; /* y times 512 */ _maxTextureOffset.y = y << maxTextureSizeShift; /* y times 512 */
DEBUG_EXIT_FUNC();
} }
inline void GuRenderer::guProgramDrawBehavior() { inline void GuRenderer::guProgramDrawBehavior() {
@ -618,8 +583,6 @@ inline void GuRenderer::guProgramDrawBehavior() {
sceGuColorFunc(GU_NOTEQUAL, _keyColor, 0x00ffffff); sceGuColorFunc(GU_NOTEQUAL, _keyColor, 0x00ffffff);
} else } else
sceGuDisable(GU_COLOR_TEST); sceGuDisable(GU_COLOR_TEST);
DEBUG_EXIT_FUNC();
} }
inline void GuRenderer::guLoadPalette() { inline void GuRenderer::guLoadPalette() {
@ -639,8 +602,6 @@ inline void GuRenderer::guLoadPalette() {
sceGuClutMode(convertToGuPixelFormat(_palette->getPixelFormat()), 0, mask, 0); sceGuClutMode(convertToGuPixelFormat(_palette->getPixelFormat()), 0, mask, 0);
sceGuClutLoad(_palette->getNumOfEntries() >> 3, _palette->getRawValues()); sceGuClutLoad(_palette->getNumOfEntries() >> 3, _palette->getRawValues());
DEBUG_EXIT_FUNC();
} }
inline void GuRenderer::guProgramTextureFormat() { inline void GuRenderer::guProgramTextureFormat() {
@ -648,7 +609,6 @@ inline void GuRenderer::guProgramTextureFormat() {
PSP_DEBUG_PRINT("pixelFormat[%d]\n", _buffer->getPixelFormat()); PSP_DEBUG_PRINT("pixelFormat[%d]\n", _buffer->getPixelFormat());
sceGuTexMode(convertToGuPixelFormat(_buffer->getPixelFormat()), 0, 0, 0); sceGuTexMode(convertToGuPixelFormat(_buffer->getPixelFormat()), 0, 0, 0);
DEBUG_EXIT_FUNC();
} }
inline uint32 GuRenderer::convertToGuPixelFormat(PSPPixelFormat::Type format) { inline uint32 GuRenderer::convertToGuPixelFormat(PSPPixelFormat::Type format) {
@ -681,17 +641,13 @@ inline uint32 GuRenderer::convertToGuPixelFormat(PSPPixelFormat::Type format) {
PSP_DEBUG_PRINT("Pixelformat[%d], guFormat[%d]\n", format, guFormat); PSP_DEBUG_PRINT("Pixelformat[%d], guFormat[%d]\n", format, guFormat);
DEBUG_EXIT_FUNC();
return guFormat; return guFormat;
} }
inline void GuRenderer::guLoadTexture() { inline void GuRenderer::guLoadTexture() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
sceGuTexImage(0, _buffer->getTextureWidth(), _buffer->getTextureHeight(), _buffer->getWidth(), _buffer->getPixels() + _buffer->_pixelFormat.pixelsToBytes(_maxTextureOffset.x)); sceGuTexImage(0, _buffer->getTextureWidth(), _buffer->getTextureHeight(), _buffer->getWidth(), _buffer->getPixels() + _buffer->_pixelFormat.pixelsToBytes(_maxTextureOffset.x));
DEBUG_EXIT_FUNC();
} }
inline Vertex *GuRenderer::guGetVertices() { inline Vertex *GuRenderer::guGetVertices() {
@ -699,7 +655,6 @@ inline Vertex *GuRenderer::guGetVertices() {
Vertex *ret = (Vertex *)sceGuGetMemory(2 * sizeof(Vertex)); Vertex *ret = (Vertex *)sceGuGetMemory(2 * sizeof(Vertex));
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -759,8 +714,6 @@ void GuRenderer::fillVertices(Vertex *vertices) {
PSP_DEBUG_PRINT("TextureStart: X[%f] Y[%f] TextureEnd: X[%.1f] Y[%.1f]\n", textureStartX, textureStartY, textureEndX, textureEndY); PSP_DEBUG_PRINT("TextureStart: X[%f] Y[%f] TextureEnd: X[%.1f] Y[%.1f]\n", textureStartX, textureStartY, textureEndX, textureEndY);
PSP_DEBUG_PRINT("ImageStart: X[%f] Y[%f] ImageEnd: X[%.1f] Y[%.1f]\n", imageStartX, imageStartY, imageEndX, imageEndY); PSP_DEBUG_PRINT("ImageStart: X[%f] Y[%f] ImageEnd: X[%.1f] Y[%.1f]\n", imageStartX, imageStartY, imageEndX, imageEndY);
DEBUG_EXIT_FUNC();
} }
/* Scale the input X offset to appear in proper position on the screen */ /* Scale the input X offset to appear in proper position on the screen */
@ -795,7 +748,6 @@ inline void GuRenderer::guDrawVertices(Vertex *vertices) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2, 0, vertices); sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2, 0, vertices);
DEBUG_EXIT_FUNC();
} }
void GuRenderer::cacheInvalidate(void *pointer, uint32 size) { void GuRenderer::cacheInvalidate(void *pointer, uint32 size) {

View file

@ -83,8 +83,6 @@ void MasterGuRenderer::guInit() {
sceDisplayWaitVblankStart(); sceDisplayWaitVblankStart();
sceGuDisplay(1); sceGuDisplay(1);
DEBUG_EXIT_FUNC();
} }
void MasterGuRenderer::guProgramDisplayBufferSizes() { void MasterGuRenderer::guProgramDisplayBufferSizes() {
@ -106,8 +104,6 @@ void MasterGuRenderer::guProgramDisplayBufferSizes() {
VramAllocator::instance().allocate(PSP_FRAME_SIZE * sizeof(uint32) * 2); VramAllocator::instance().allocate(PSP_FRAME_SIZE * sizeof(uint32) * 2);
break; break;
} }
DEBUG_EXIT_FUNC();
} }
// These are GU commands that should always stay the same // These are GU commands that should always stay the same
@ -130,8 +126,6 @@ inline void MasterGuRenderer::guPreRender() {
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); // Also good enough for all purposes sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); // Also good enough for all purposes
sceGuAlphaFunc(GU_GREATER, 0, 0xFF); // Also good enough for all purposes sceGuAlphaFunc(GU_GREATER, 0, 0xFF); // Also good enough for all purposes
DEBUG_EXIT_FUNC();
} }
inline void MasterGuRenderer::guPostRender() { inline void MasterGuRenderer::guPostRender() {
@ -147,8 +141,6 @@ inline void MasterGuRenderer::guPostRender() {
sceDisplayWaitVblankStart(); sceDisplayWaitVblankStart();
sceGuSwapBuffers(); sceGuSwapBuffers();
DEBUG_EXIT_FUNC();
} }
void MasterGuRenderer::guShutDown() { void MasterGuRenderer::guShutDown() {
@ -173,8 +165,6 @@ void DisplayManager::init() {
_cursor->init(); _cursor->init();
_masterGuRenderer.guInit(); // start up the renderer _masterGuRenderer.guInit(); // start up the renderer
DEBUG_EXIT_FUNC();
} }
void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format) { void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format) {
@ -198,8 +188,6 @@ void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphi
_displayParams.screenSource.width = width; _displayParams.screenSource.width = width;
_displayParams.screenSource.height = height; _displayParams.screenSource.height = height;
calculateScaleParams(); calculateScaleParams();
DEBUG_EXIT_FUNC();
} }
bool DisplayManager::setGraphicsMode(const char *name) { bool DisplayManager::setGraphicsMode(const char *name) {
@ -210,13 +198,11 @@ bool DisplayManager::setGraphicsMode(const char *name) {
while (_supportedModes[i].name) { while (_supportedModes[i].name) {
if (!strcmpi(_supportedModes[i].name, name)) { if (!strcmpi(_supportedModes[i].name, name)) {
setGraphicsMode(_supportedModes[i].id); setGraphicsMode(_supportedModes[i].id);
DEBUG_EXIT_FUNC();
return true; return true;
} }
i++; i++;
} }
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -248,7 +234,6 @@ bool DisplayManager::setGraphicsMode(int mode) {
calculateScaleParams(); calculateScaleParams();
DEBUG_EXIT_FUNC();
return true; return true;
} }
@ -264,7 +249,6 @@ void DisplayManager::renderAll() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
if (!isTimeToUpdate()) { if (!isTimeToUpdate()) {
DEBUG_EXIT_FUNC();
return; return;
} }
@ -273,7 +257,6 @@ void DisplayManager::renderAll() {
(!_cursor->isDirty()) && (!_cursor->isDirty()) &&
(!_keyboard->isDirty())) { (!_keyboard->isDirty())) {
PSP_DEBUG_PRINT("Nothing dirty\n"); PSP_DEBUG_PRINT("Nothing dirty\n");
DEBUG_EXIT_FUNC();
return; return;
} }
@ -306,8 +289,6 @@ void DisplayManager::renderAll() {
_keyboard->setClean(); _keyboard->setClean();
_masterGuRenderer.guPostRender(); _masterGuRenderer.guPostRender();
DEBUG_EXIT_FUNC();
} }
inline bool DisplayManager::isTimeToUpdate() { inline bool DisplayManager::isTimeToUpdate() {

View file

@ -55,7 +55,6 @@ bool InputHandler::getAllInputs(Common::Event &event) {
uint32 time = g_system->getMillis(); // may not be necessary with read uint32 time = g_system->getMillis(); // may not be necessary with read
if (time - _lastPadCheckTime < PAD_CHECK_TIME) { if (time - _lastPadCheckTime < PAD_CHECK_TIME) {
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -78,8 +77,6 @@ bool InputHandler::getAllInputs(Common::Event &event) {
PSP_DEBUG_PRINT("event.type[%d]\n", event.type); PSP_DEBUG_PRINT("event.type[%d]\n", event.type);
} }
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -100,7 +97,6 @@ bool InputHandler::getEvent(Common::Event &event, SceCtrlData &pad) {
_prevButtons = pad.Buttons; _prevButtons = pad.Buttons;
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -156,7 +152,6 @@ bool InputHandler::getDpadEvent(Common::Event &event, SceCtrlData &pad) {
haveEvent = true; haveEvent = true;
} }
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -185,7 +180,6 @@ inline Common::KeyCode InputHandler::translateDpad(int x, int y) {
key = Common::KEYCODE_KP9; key = Common::KEYCODE_KP9;
} }
DEBUG_EXIT_FUNC();
return key; return key;
} }
@ -238,7 +232,6 @@ bool InputHandler::getButtonEvent(Common::Event &event, SceCtrlData &pad) {
haveEvent = true; haveEvent = true;
} }
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -292,7 +285,6 @@ bool InputHandler::getNubEvent(Common::Event &event, SceCtrlData &pad) {
PSP_DEBUG_PRINT("Nub event. X[%d], Y[%d]\n", newX, newY); PSP_DEBUG_PRINT("Nub event. X[%d], Y[%d]\n", newX, newY);
} }
} }
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -309,7 +301,5 @@ inline int32 InputHandler::modifyNubAxisMotion(int32 input) {
else // between these points, dampen the response to 0 else // between these points, dampen the response to 0
input = 0; input = 0;
DEBUG_EXIT_FUNC();
return input; return input;
} }

View file

@ -72,7 +72,6 @@ void Copier::copy(byte *dst, const byte *src, uint32 bytes, PSPPixelFormat *form
if (bytes > prefixDst) // check that we can afford to subtract from bytes if (bytes > prefixDst) // check that we can afford to subtract from bytes
bytes -= prefixDst; bytes -= prefixDst;
else { else {
DEBUG_EXIT_FUNC();
return; return;
} }
dst32 = (uint32 *)(dst + prefixDst); dst32 = (uint32 *)(dst + prefixDst);
@ -126,7 +125,7 @@ test:
PSP_DEBUG_PRINT("\n"); PSP_DEBUG_PRINT("\n");
#endif #endif
DEBUG_EXIT_FUNC(); return; // So we have something to jump to with the label
} }
inline void Copier::copy8(byte *dst, const byte *src, uint32 bytes) { inline void Copier::copy8(byte *dst, const byte *src, uint32 bytes) {
@ -200,7 +199,6 @@ void *VramAllocator::allocate(int32 size, bool smallAllocation /* = false */) {
PSP_DEBUG_PRINT("Allocated in VRAM, size %u at %p.\n", size, lastAddress); PSP_DEBUG_PRINT("Allocated in VRAM, size %u at %p.\n", size, lastAddress);
PSP_DEBUG_PRINT("Total allocated %u, remaining %u.\n", _bytesAllocated, (2 * 1024 * 1024) - _bytesAllocated); PSP_DEBUG_PRINT("Total allocated %u, remaining %u.\n", _bytesAllocated, (2 * 1024 * 1024) - _bytesAllocated);
DEBUG_EXIT_FUNC();
return lastAddress; return lastAddress;
} }
@ -217,11 +215,9 @@ void VramAllocator::deallocate(void *address) {
_bytesAllocated -= (*i).size; _bytesAllocated -= (*i).size;
_allocList.erase(i); _allocList.erase(i);
PSP_DEBUG_PRINT("Deallocated address[%p], size[%u]\n", (*i).address, (*i).size); PSP_DEBUG_PRINT("Deallocated address[%p], size[%u]\n", (*i).address, (*i).size);
DEBUG_EXIT_FUNC();
return; return;
} }
} }
PSP_DEBUG_PRINT("Address[%p] not allocated.\n", address); PSP_DEBUG_PRINT("Address[%p] not allocated.\n", address);
DEBUG_EXIT_FUNC();
} }

View file

@ -97,8 +97,6 @@ void OSystem_PSP::initBackend() {
setupMixer(); setupMixer();
OSystem::initBackend(); OSystem::initBackend();
DEBUG_EXIT_FUNC();
} }
bool OSystem_PSP::hasFeature(Feature f) { bool OSystem_PSP::hasFeature(Feature f) {
@ -118,38 +116,22 @@ const OSystem::GraphicsMode* OSystem_PSP::getSupportedGraphicsModes() const {
int OSystem_PSP::getDefaultGraphicsMode() const { int OSystem_PSP::getDefaultGraphicsMode() const {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return _displayManager.getDefaultGraphicsMode();
int ret = _displayManager.getDefaultGraphicsMode();
DEBUG_EXIT_FUNC();
return ret;
} }
bool OSystem_PSP::setGraphicsMode(int mode) { bool OSystem_PSP::setGraphicsMode(int mode) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return _displayManager.setGraphicsMode(mode);
int ret = _displayManager.setGraphicsMode(mode);
DEBUG_EXIT_FUNC();
return ret;
} }
bool OSystem_PSP::setGraphicsMode(const char *name) { bool OSystem_PSP::setGraphicsMode(const char *name) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return _displayManager.setGraphicsMode(name);
int ret = _displayManager.setGraphicsMode(name);
DEBUG_EXIT_FUNC();
return ret;
} }
int OSystem_PSP::getGraphicsMode() const { int OSystem_PSP::getGraphicsMode() const {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return _displayManager.getGraphicsMode();
int ret = _displayManager.getGraphicsMode();
DEBUG_EXIT_FUNC();
return ret;
} }
#ifdef USE_RGB_COLOR #ifdef USE_RGB_COLOR
@ -166,144 +148,94 @@ Common::List<Graphics::PixelFormat> OSystem_PSP::getSupportedFormats() {
void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat *format) { void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_displayManager.setSizeAndPixelFormat(width, height, format); _displayManager.setSizeAndPixelFormat(width, height, format);
_cursor.setVisible(false); _cursor.setVisible(false);
_cursor.setLimits(_screen.getWidth(), _screen.getHeight()); _cursor.setLimits(_screen.getWidth(), _screen.getHeight());
DEBUG_EXIT_FUNC();
} }
int16 OSystem_PSP::getWidth() { int16 OSystem_PSP::getWidth() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return (int16)_screen.getWidth();
int16 ret = (int16)_screen.getWidth();
DEBUG_EXIT_FUNC();
return ret;
} }
int16 OSystem_PSP::getHeight() { int16 OSystem_PSP::getHeight() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return (int16)_screen.getHeight();
int16 ret = (int16)_screen.getHeight();
DEBUG_EXIT_FUNC();
return ret;
} }
void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) { void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_screen.setPartialPalette(colors, start, num); _screen.setPartialPalette(colors, start, num);
_cursor.setScreenPalette(colors, start, num); _cursor.setScreenPalette(colors, start, num);
_cursor.clearKeyColor(); _cursor.clearKeyColor();
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::setCursorPalette(const byte *colors, uint start, uint num) { void OSystem_PSP::setCursorPalette(const byte *colors, uint start, uint num) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_cursor.setCursorPalette(colors, start, num); _cursor.setCursorPalette(colors, start, num);
_cursor.enableCursorPalette(true); _cursor.enableCursorPalette(true);
_cursor.clearKeyColor(); // Do we need this? _cursor.clearKeyColor(); // Do we need this?
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::disableCursorPalette(bool disable) { void OSystem_PSP::disableCursorPalette(bool disable) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_cursor.enableCursorPalette(!disable); _cursor.enableCursorPalette(!disable);
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_screen.copyFromRect(buf, pitch, x, y, w, h); _screen.copyFromRect(buf, pitch, x, y, w, h);
DEBUG_EXIT_FUNC();
} }
Graphics::Surface *OSystem_PSP::lockScreen() { Graphics::Surface *OSystem_PSP::lockScreen() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
return _screen.lockAndGetForEditing();
Graphics::Surface *ret = _screen.lockAndGetForEditing();
DEBUG_EXIT_FUNC();
return ret;
} }
void OSystem_PSP::unlockScreen() { void OSystem_PSP::unlockScreen() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
// The screen is always completely updated anyway, so we don't have to force a full update here. // The screen is always completely updated anyway, so we don't have to force a full update here.
_screen.unlock(); _screen.unlock();
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::updateScreen() { void OSystem_PSP::updateScreen() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_displayManager.renderAll(); _displayManager.renderAll();
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::setShakePos(int shakeOffset) { void OSystem_PSP::setShakePos(int shakeOffset) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_screen.setShakePos(shakeOffset); _screen.setShakePos(shakeOffset);
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::showOverlay() { void OSystem_PSP::showOverlay() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_overlay.setVisible(true); _overlay.setVisible(true);
_cursor.setLimits(_overlay.getWidth(), _overlay.getHeight()); _cursor.setLimits(_overlay.getWidth(), _overlay.getHeight());
_cursor.useGlobalScaler(false); // mouse with overlay is 1:1 _cursor.useGlobalScaler(false); // mouse with overlay is 1:1
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::hideOverlay() { void OSystem_PSP::hideOverlay() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_overlay.setVisible(false); _overlay.setVisible(false);
_cursor.setLimits(_screen.getWidth(), _screen.getHeight()); _cursor.setLimits(_screen.getWidth(), _screen.getHeight());
_cursor.useGlobalScaler(true); // mouse needs to be scaled with screen _cursor.useGlobalScaler(true); // mouse needs to be scaled with screen
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::clearOverlay() { void OSystem_PSP::clearOverlay() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_overlay.clearBuffer(); _overlay.clearBuffer();
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::grabOverlay(OverlayColor *buf, int pitch) { void OSystem_PSP::grabOverlay(OverlayColor *buf, int pitch) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_overlay.copyToArray(buf, pitch); _overlay.copyToArray(buf, pitch);
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { void OSystem_PSP::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_overlay.copyFromRect(buf, pitch, x, y, w, h); _overlay.copyFromRect(buf, pitch, x, y, w, h);
DEBUG_EXIT_FUNC();
} }
int16 OSystem_PSP::getOverlayWidth() { int16 OSystem_PSP::getOverlayWidth() {
@ -316,35 +248,25 @@ int16 OSystem_PSP::getOverlayHeight() {
void OSystem_PSP::grabPalette(byte *colors, uint start, uint num) { void OSystem_PSP::grabPalette(byte *colors, uint start, uint num) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_screen.getPartialPalette(colors, start, num); _screen.getPartialPalette(colors, start, num);
DEBUG_EXIT_FUNC();
} }
bool OSystem_PSP::showMouse(bool v) { bool OSystem_PSP::showMouse(bool v) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
PSP_DEBUG_PRINT("%s\n", v ? "true" : "false"); PSP_DEBUG_PRINT("%s\n", v ? "true" : "false");
bool last = _cursor.isVisible(); bool last = _cursor.isVisible();
_cursor.setVisible(v); _cursor.setVisible(v);
DEBUG_EXIT_FUNC();
return last; return last;
} }
void OSystem_PSP::warpMouse(int x, int y) { void OSystem_PSP::warpMouse(int x, int y) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
_cursor.setXY(x, y); _cursor.setXY(x, y);
DEBUG_EXIT_FUNC();
} }
void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
PSP_DEBUG_PRINT("pbuf[%p], w[%u], h[%u], hotspot:X[%d], Y[%d], keycolor[%d], scale[%d], pformat[%p]\n", buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format); PSP_DEBUG_PRINT("pbuf[%p], w[%u], h[%u], hotspot:X[%d], Y[%d], keycolor[%d], scale[%d], pformat[%p]\n", buf, w, h, hotspotX, hotspotY, keycolor, cursorTargetScale, format);
if (format) { if (format) {
PSP_DEBUG_PRINT("format: bpp[%d], rLoss[%d], gLoss[%d], bLoss[%d], aLoss[%d], rShift[%d], gShift[%d], bShift[%d], aShift[%d]\n", format->bytesPerPixel, format->rLoss, format->gLoss, format->bLoss, format->aLoss, format->rShift, format->gShift, format->bShift, format->aShift); PSP_DEBUG_PRINT("format: bpp[%d], rLoss[%d], gLoss[%d], bLoss[%d], aLoss[%d], rShift[%d], gShift[%d], bShift[%d], aShift[%d]\n", format->bytesPerPixel, format->rLoss, format->gLoss, format->bLoss, format->aLoss, format->rShift, format->gShift, format->bShift, format->aShift);
@ -356,8 +278,6 @@ void OSystem_PSP::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
_cursor.setHotspot(hotspotX, hotspotY); _cursor.setHotspot(hotspotX, hotspotY);
_cursor.clearKeyColor(); _cursor.clearKeyColor();
_cursor.copyFromArray(buf); _cursor.copyFromArray(buf);
DEBUG_EXIT_FUNC();
} }
bool OSystem_PSP::pollEvent(Common::Event &event) { bool OSystem_PSP::pollEvent(Common::Event &event) {

View file

@ -83,8 +83,6 @@ PowerManager::PowerManager() {
_listCounter = 0; _listCounter = 0;
PMStatusSet(kInitDone); PMStatusSet(kInitDone);
_error = 0; _error = 0;
DEBUG_EXIT_FUNC();
} }
/******************************************* /*******************************************
@ -110,7 +108,6 @@ int PowerManager::registerSuspend(Suspendable *item) {
debugPM(); debugPM();
DEBUG_EXIT_FUNC();
return 0; return 0;
} }
@ -138,7 +135,6 @@ int PowerManager::unregisterSuspend(Suspendable *item) {
PSP_DEBUG_PRINT("Out of unregisterSuspend\n"); PSP_DEBUG_PRINT("Out of unregisterSuspend\n");
debugPM(); debugPM();
DEBUG_EXIT_FUNC();
return 0; return 0;
} }
@ -163,8 +159,6 @@ PowerManager::~PowerManager() {
SDL_DestroyMutex(_listMutex); SDL_DestroyMutex(_listMutex);
_listMutex = 0; _listMutex = 0;
DEBUG_EXIT_FUNC();
} }
/******************************************* /*******************************************
@ -247,7 +241,6 @@ int PowerManager::beginCriticalSection(bool justBlock) {
ret = Error; ret = Error;
} }
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -285,7 +278,6 @@ int PowerManager::endCriticalSection() {
ret = Error; ret = Error;
} }
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -377,7 +369,6 @@ int PowerManager::suspend() {
scePowerUnlock(0); // Allow the PSP to go to sleep now scePowerUnlock(0); // Allow the PSP to go to sleep now
DEBUG_EXIT_FUNC();
return ret; return ret;
} }
@ -452,6 +443,5 @@ int PowerManager::resume() {
scePowerUnlock(0); // Allow new suspends scePowerUnlock(0); // Allow new suspends
DEBUG_EXIT_FUNC();
return ret; return ret;
} }

View file

@ -124,8 +124,6 @@ PSPKeyboard::PSPKeyboard() {
_renderer.setAlphaBlending(true); _renderer.setAlphaBlending(true);
_renderer.setColorTest(false); _renderer.setColorTest(false);
_renderer.setUseGlobalScaler(false); _renderer.setUseGlobalScaler(false);
DEBUG_EXIT_FUNC();
} }
// Destructor // Destructor
@ -133,7 +131,6 @@ PSPKeyboard::~PSPKeyboard() {
DEBUG_ENTER_FUNC(); DEBUG_ENTER_FUNC();
if (!_init) { if (!_init) {
DEBUG_EXIT_FUNC();
return; return;
} }
@ -142,8 +139,6 @@ PSPKeyboard::~PSPKeyboard() {
_palettes[i].deallocate(); _palettes[i].deallocate();
} }
_init = false; _init = false;
DEBUG_EXIT_FUNC();
} }
void PSPKeyboard::setVisible(bool val) { void PSPKeyboard::setVisible(bool val) {
@ -164,8 +159,6 @@ void PSPKeyboard::moveTo(const int newX, const int newY) {
_movedX = newX; _movedX = newX;
_movedY = newY; _movedY = newY;
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
/* move the position the keyboard is currently drawn at */ /* move the position the keyboard is currently drawn at */
@ -175,13 +168,10 @@ void PSPKeyboard::increaseKeyboardLocationX(int amount) {
int newX = _movedX + amount; int newX = _movedX + amount;
if (newX > PSP_SCREEN_WIDTH - 5 || newX < 0 - 140) { // clamp if (newX > PSP_SCREEN_WIDTH - 5 || newX < 0 - 140) { // clamp
DEBUG_EXIT_FUNC();
return; return;
} }
_movedX = newX; _movedX = newX;
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
/* move the position the keyboard is currently drawn at */ /* move the position the keyboard is currently drawn at */
@ -191,13 +181,10 @@ void PSPKeyboard::increaseKeyboardLocationY(int amount) {
int newY = _movedY + amount; int newY = _movedY + amount;
if (newY > PSP_SCREEN_HEIGHT - 5 || newY < 0 - 140) { // clamp if (newY > PSP_SCREEN_HEIGHT - 5 || newY < 0 - 140) { // clamp
DEBUG_EXIT_FUNC();
return; return;
} }
_movedY = newY; _movedY = newY;
setDirty(); setDirty();
DEBUG_EXIT_FUNC();
} }
/* draw the keyboard at the current position */ /* draw the keyboard at the current position */
@ -229,8 +216,6 @@ void PSPKeyboard::render() {
_renderer.setOffsetInBuffer(x * OrangeBlockSize, y * OrangeBlockSize); _renderer.setOffsetInBuffer(x * OrangeBlockSize, y * OrangeBlockSize);
_renderer.setDrawSize(OrangeBlockSize, OrangeBlockSize); _renderer.setDrawSize(OrangeBlockSize, OrangeBlockSize);
_renderer.render(); _renderer.render();
DEBUG_EXIT_FUNC();
} }
inline void PSPKeyboard::convertCursorToXY(CursorDirections cur, int &x, int &y) { inline void PSPKeyboard::convertCursorToXY(CursorDirections cur, int &x, int &y) {
@ -264,7 +249,6 @@ bool PSPKeyboard::load() {
if (_init) { if (_init) {
PSP_DEBUG_PRINT("keyboard already loaded into memory\n"); PSP_DEBUG_PRINT("keyboard already loaded into memory\n");
DEBUG_EXIT_FUNC();
return true; return true;
} }
@ -371,7 +355,6 @@ bool PSPKeyboard::load() {
delete fileArchive; delete fileArchive;
delete zipArchive; delete zipArchive;
DEBUG_EXIT_FUNC();
return true; return true;
ERROR: ERROR:
@ -386,7 +369,6 @@ ERROR:
} }
_init = false; _init = false;
DEBUG_EXIT_FUNC();
return false; return false;
} }
@ -406,14 +388,12 @@ int PSPKeyboard::getPngImageSize(Common::SeekableReadStream *file, uint32 *png_w
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) { if (png_ptr == NULL) {
DEBUG_EXIT_FUNC();
return -1; return -1;
} }
png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, user_warning_fn); png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, user_warning_fn);
info_ptr = png_create_info_struct(png_ptr); info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) { if (info_ptr == NULL) {
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
DEBUG_EXIT_FUNC();
return -1; return -1;
} }
// Set the png lib to use our read function // Set the png lib to use our read function
@ -432,7 +412,6 @@ int PSPKeyboard::getPngImageSize(Common::SeekableReadStream *file, uint32 *png_w
*png_width = width; *png_width = width;
*png_height = height; *png_height = height;
DEBUG_EXIT_FUNC();
return 0; return 0;
} }
@ -451,7 +430,6 @@ int PSPKeyboard::loadPngImage(Common::SeekableReadStream *file, Buffer &buffer,
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) { if (png_ptr == NULL) {
PSP_ERROR("Couldn't create read struct to load keyboard\n"); PSP_ERROR("Couldn't create read struct to load keyboard\n");
DEBUG_EXIT_FUNC();
return -1; return -1;
} }
// Use dummy error function // Use dummy error function
@ -461,7 +439,6 @@ int PSPKeyboard::loadPngImage(Common::SeekableReadStream *file, Buffer &buffer,
if (info_ptr == NULL) { if (info_ptr == NULL) {
PSP_ERROR("Couldn't create info struct to load keyboard\n"); PSP_ERROR("Couldn't create info struct to load keyboard\n");
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
DEBUG_EXIT_FUNC();
return -1; return -1;
} }
@ -496,7 +473,6 @@ int PSPKeyboard::loadPngImage(Common::SeekableReadStream *file, Buffer &buffer,
if (!line) { if (!line) {
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
PSP_ERROR("Couldn't allocate line\n"); PSP_ERROR("Couldn't allocate line\n");
DEBUG_EXIT_FUNC();
return -1; return -1;
} }
@ -511,7 +487,6 @@ int PSPKeyboard::loadPngImage(Common::SeekableReadStream *file, Buffer &buffer,
png_read_end(png_ptr, info_ptr); png_read_end(png_ptr, info_ptr);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
DEBUG_EXIT_FUNC();
return 0; return 0;
} }
@ -567,7 +542,6 @@ bool PSPKeyboard::processInput(Common::Event &event, SceCtrlData &pad) {
_prevButtons = pad.Buttons; _prevButtons = pad.Buttons;
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -595,7 +569,6 @@ void PSPKeyboard::handleMoveState(SceCtrlData &pad) {
else /* DOWN(PSP_CTRL_RIGHT) */ else /* DOWN(PSP_CTRL_RIGHT) */
increaseKeyboardLocationX(5); increaseKeyboardLocationX(5);
} }
DEBUG_EXIT_FUNC();
} }
bool PSPKeyboard::handleDefaultState(Common::Event &event, SceCtrlData &pad) { bool PSPKeyboard::handleDefaultState(Common::Event &event, SceCtrlData &pad) {
@ -611,7 +584,6 @@ bool PSPKeyboard::handleDefaultState(Common::Event &event, SceCtrlData &pad) {
else if (!DOWN(PSP_4BUTTONS)) // Must be up to move cursor else if (!DOWN(PSP_4BUTTONS)) // Must be up to move cursor
getCursorMovement(pad); getCursorMovement(pad);
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -623,9 +595,8 @@ bool PSPKeyboard::handleCornersSelectedState(Common::Event &event, SceCtrlData &
if (CHANGED(PSP_4BUTTONS | PSP_CTRL_RTRIGGER | PSP_CTRL_LTRIGGER)) if (CHANGED(PSP_4BUTTONS | PSP_CTRL_RTRIGGER | PSP_CTRL_LTRIGGER))
haveEvent = getInputChoice(event, pad); haveEvent = getInputChoice(event, pad);
if (!DOWN(PSP_4BUTTONS | PSP_CTRL_RTRIGGER | PSP_CTRL_LTRIGGER)) // Must be up to move cursor if (!DOWN(PSP_4BUTTONS | PSP_CTRL_RTRIGGER | PSP_CTRL_LTRIGGER)) // Must be up to move cursor
getCursorMovement(pad) getCursorMovement(pad);
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -689,7 +660,6 @@ bool PSPKeyboard::getInputChoice(Common::Event &event, SceCtrlData &pad) {
haveEvent = (choice != Common::KEYCODE_INVALID) ? true : false; // We have an event/don't if it's invalid haveEvent = (choice != Common::KEYCODE_INVALID) ? true : false; // We have an event/don't if it's invalid
DEBUG_EXIT_FUNC();
return haveEvent; return haveEvent;
} }
@ -718,7 +688,6 @@ void PSPKeyboard::getCursorMovement(SceCtrlData &pad) {
_dirty = true; _dirty = true;
_oldCursor = cursor; _oldCursor = cursor;
} }
DEBUG_EXIT_FUNC();
} }
void PSPKeyboard::handleLTriggerDownState(SceCtrlData &pad) { void PSPKeyboard::handleLTriggerDownState(SceCtrlData &pad) {
@ -733,7 +702,6 @@ void PSPKeyboard::handleLTriggerDownState(SceCtrlData &pad) {
_state = kDefault; _state = kDefault;
} }
DEBUG_EXIT_FUNC();
} }
void PSPKeyboard::handleRTriggerDownState(SceCtrlData &pad) { void PSPKeyboard::handleRTriggerDownState(SceCtrlData &pad) {
@ -748,5 +716,4 @@ void PSPKeyboard::handleRTriggerDownState(SceCtrlData &pad) {
_state = kDefault; _state = kDefault;
} }
DEBUG_EXIT_FUNC();
} }

View file

@ -65,7 +65,6 @@ void PSPPixelFormat::set(Type type, bool swap /* = false */) {
} }
PSP_DEBUG_PRINT("bitsPerPixel[%u]\n", bitsPerPixel); PSP_DEBUG_PRINT("bitsPerPixel[%u]\n", bitsPerPixel);
DEBUG_EXIT_FUNC();
} }
// Convert from ScummVM general PixelFormat to our pixel format // Convert from ScummVM general PixelFormat to our pixel format
@ -185,6 +184,5 @@ uint32 PSPPixelFormat::convertTo32BitColor(uint32 color) {
output = ((b << 16) | (g << 8) | (r << 0) | (a << 24)); output = ((b << 16) | (g << 8) | (r << 0) | (a << 24));
PSP_DEBUG_PRINT_FUNC("input color[%x], output[%x]\n", color, output); PSP_DEBUG_PRINT_FUNC("input color[%x], output[%x]\n", color, output);
DEBUG_EXIT_FUNC();
return output; return output;
} }

View file

@ -100,19 +100,29 @@ extern int psp_debug_indent;
/* Debugging function calls */ /* Debugging function calls */
#ifdef __PSP_DEBUG_FUNCS__ #ifdef __PSP_DEBUG_FUNCS__
#define DEBUG_ENTER_FUNC() PSP_INFO_PRINT_INDENT("++ %s\n", __PRETTY_FUNCTION__); \
psp_debug_indent++
#define DEBUG_EXIT_FUNC() psp_debug_indent--; \ // We use this class to print out function calls on the stack in an easy way.
if (psp_debug_indent < 0) PSP_ERROR("debug indent < 0\n"); \ //
PSP_INFO_PRINT_INDENT("-- %s\n", __PRETTY_FUNCTION__) class PSPStackDebugFuncs {
Common::String _name;
#define INLINE /* don't want to inline so we get function names properly */ public:
PSPStackDebugFuncs(const char *name) : _name(name) {
PSP_INFO_PRINT_INDENT("++ %s\n", _name.c_str()); \
psp_debug_indent++;
}
~PSPStackDebugFuncs() {
psp_debug_indent--; \
if (psp_debug_indent < 0) PSP_ERROR("debug indent < 0\n"); \
PSP_INFO_PRINT_INDENT("-- %s\n", _name.c_str());
}
}
/* We don't need anything but this line at the beginning of each function to debug function calls */
#define DEBUG_ENTER_FUNC() PSPStackDebugFuncs(__PRETTY_FUNCTION__)
#else /* Don't debug function calls */ #else /* Don't debug function calls */
#define DEBUG_ENTER_FUNC() #define DEBUG_ENTER_FUNC()
#define DEBUG_EXIT_FUNC()
#define INLINE inline
#endif /* __PSP_DEBUG_FUNCS__ */ #endif /* __PSP_DEBUG_FUNCS__ */
// Undef the main defines for next time // Undef the main defines for next time