aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ps2
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ps2')
-rw-r--r--backends/platform/ps2/DmaPipe.cpp6
-rw-r--r--backends/platform/ps2/Gs2dScreen.cpp18
-rw-r--r--backends/platform/ps2/fileio.cpp12
-rw-r--r--backends/platform/ps2/icon.cpp8
-rw-r--r--backends/platform/ps2/icon.h4
-rw-r--r--backends/platform/ps2/ps2mutex.cpp6
-rw-r--r--backends/platform/ps2/ps2pad.cpp2
-rw-r--r--backends/platform/ps2/systemps2.cpp18
8 files changed, 35 insertions, 39 deletions
diff --git a/backends/platform/ps2/DmaPipe.cpp b/backends/platform/ps2/DmaPipe.cpp
index c6f6ab72ac..a346a67566 100644
--- a/backends/platform/ps2/DmaPipe.cpp
+++ b/backends/platform/ps2/DmaPipe.cpp
@@ -48,7 +48,7 @@ private:
DmaPipe::DmaPipe(uint32 size) {
size &= ~0x1F;
- _buf = (uint64*)memalign(64, size);
+ _buf = (uint64 *)memalign(64, size);
_curPipe = 0;
_pipes[0] = new SinglePipe(_buf, size >> 4);
_pipes[1] = new SinglePipe(_buf + (size >> 4), size >> 4);
@@ -260,7 +260,7 @@ void SinglePipe::init(void) {
_buf[0] = 0x0000000070000000;
_buf[1] = 0;
_chainHead = _buf;
- _chainSize = (uint16*)_chainHead;
+ _chainSize = (uint16 *)_chainHead;
_bufPos = _buf + 2;
}
@@ -272,7 +272,7 @@ void SinglePipe::appendChain(uint64 dmaTag) {
_chainHead = _bufPos;
_chainHead[0] = dmaTag;
_chainHead[1] = 0;
- _chainSize = (uint16*)_chainHead;
+ _chainSize = (uint16 *)_chainHead;
_bufPos += 2;
}
diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp
index b70e8b13fa..8df6198c38 100644
--- a/backends/platform/ps2/Gs2dScreen.cpp
+++ b/backends/platform/ps2/Gs2dScreen.cpp
@@ -130,9 +130,9 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
_height = height;
_pitch = (width + 127) & ~127;
- _screenBuf = (uint8*)memalign(64, _width * _height);
- _overlayBuf = (uint16*)memalign(64, _width * _height * 2);
- _clut = (uint32*)memalign(64, 256 * 4);
+ _screenBuf = (uint8 *)memalign(64, _width * _height);
+ _overlayBuf = (uint16 *)memalign(64, _width * _height * 2);
+ _clut = (uint32 *)memalign(64, 256 * 4);
memset(_screenBuf, 0, _width * _height);
memset(_clut, 0, 256 * sizeof(uint32));
@@ -291,11 +291,11 @@ void Gs2dScreen::quit(void) {
}
void Gs2dScreen::createAnimTextures(void) {
- uint8 *buf = (uint8*)memalign(64, 16 * 64);
+ uint8 *buf = (uint8 *)memalign(64, 16 * 64);
memset(buf, 0, 16 * 64);
uint32 vramDest = _texPtrs[TEXT];
for (int i = 0; i < 16; i++) {
- uint32 *destPos = (uint32*)buf;
+ uint32 *destPos = (uint32 *)buf;
for (int ch = 15; ch >= 0; ch--) {
const uint32 *src = (const uint32*)(_binaryData + ((_binaryPattern[i] >> ch) & 1) * 4 * 14);
for (int line = 0; line < 14; line++)
@@ -331,8 +331,8 @@ void Gs2dScreen::newScreenSize(uint16 width, uint16 height) {
// malloc new buffers
free(_screenBuf);
free(_overlayBuf);
- _screenBuf = (uint8*)memalign(64, _width * _height);
- _overlayBuf = (uint16*)memalign(64, _width * _height * 2);
+ _screenBuf = (uint8 *)memalign(64, _width * _height);
+ _overlayBuf = (uint16 *)memalign(64, _width * _height * 2);
memset(_screenBuf, 0, _width * height);
memset(_overlayBuf, 0, _width * height * 2);
memset(_clut, 0, 256 * sizeof(uint32));
@@ -556,7 +556,7 @@ void Gs2dScreen::copyPrintfOverlay(const uint8 *buf) {
}
void Gs2dScreen::clearPrintfOverlay(void) {
- uint8 *tmpBuf = (uint8*)memalign(64, 320 * 200);
+ uint8 *tmpBuf = (uint8 *)memalign(64, 320 * 200);
memset(tmpBuf, 4, 320 * 200);
_dmaPipe->uploadTex(_texPtrs[PRINTF], 3 * 128, 0, 0, GS_PSMT8H, tmpBuf, 320, 200);
_dmaPipe->flush();
@@ -619,7 +619,7 @@ void Gs2dScreen::setMouseOverlay(const uint8 *buf, uint16 width, uint16 height,
_mTraCol = transpCol;
_clutChanged = true;
}
- uint8 *bufCopy = (uint8*)memalign(64, M_SIZE * M_SIZE); // make a copy to align to 64 bytes
+ uint8 *bufCopy = (uint8 *)memalign(64, M_SIZE * M_SIZE); // make a copy to align to 64 bytes
memset(bufCopy, _mTraCol, M_SIZE * M_SIZE);
for (int cnt = 0; cnt < height; cnt++)
memcpy(bufCopy + cnt * M_SIZE, buf + cnt * width, width);
diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp
index ef01f3a693..1ec16a3817 100644
--- a/backends/platform/ps2/fileio.cpp
+++ b/backends/platform/ps2/fileio.cpp
@@ -52,7 +52,7 @@ Ps2File::Ps2File() {
_eof = false;
_err = false;
- _cacheBuf = (uint8*)memalign(64, CACHE_SIZE * 2);
+ _cacheBuf = (uint8 *)memalign(64, CACHE_SIZE * 2);
_cacheOpRunning = 0;
_filePos = _physFilePos = _cachePos = 0;
@@ -362,7 +362,7 @@ uint32 Ps2File::read(void *dest, uint32 len) {
_eof = true;
}
- uint8 *destBuf = (uint8*)dest;
+ uint8 *destBuf = (uint8 *)dest;
if ((_filePos < _cachePos) || (_filePos + len > _cachePos + _bytesInCache))
cacheReadSync(); // we have to read from CD, sync cache.
@@ -413,7 +413,7 @@ uint32 Ps2File::read(void *dest, uint32 len) {
#ifdef __PS2_FILE_SEMA__
SignalSema(_sema);
#endif
- return destBuf - (uint8*)dest;
+ return destBuf - (uint8 *)dest;
}
uint32 Ps2File::write(const void *src, uint32 len) {
@@ -518,7 +518,7 @@ FILE *ps2_fopen(const char *fname, const char *mode) {
}
int ps2_fclose(FILE *stream) {
- Ps2File *file = (Ps2File*)stream;
+ Ps2File *file = (Ps2File *)stream;
delete file;
@@ -528,10 +528,10 @@ int ps2_fclose(FILE *stream) {
size_t ps2_fread(void *buf, size_t r, size_t n, FILE *stream) {
assert(r != 0);
- return ((Ps2File*)stream)->read(buf, r * n) / r;
+ return ((Ps2File *)stream)->read(buf, r * n) / r;
}
size_t ps2_fwrite(const void *buf, size_t r, size_t n, FILE *stream) {
assert(r != 0);
- return ((Ps2File*)stream)->write(buf, r * n) / r;
+ return ((Ps2File *)stream)->write(buf, r * n) / r;
}
diff --git a/backends/platform/ps2/icon.cpp b/backends/platform/ps2/icon.cpp
index 9852e6d40b..bda4843647 100644
--- a/backends/platform/ps2/icon.cpp
+++ b/backends/platform/ps2/icon.cpp
@@ -960,13 +960,13 @@ void PS2Icon::setup(mcIcon *icon) {
memcpy(icon->head, "PS2D", 4);
icon->nlOffset = strlen(_info) + 1;
strcpy(title, _info);
- strcpy_sjis((short*)&(icon->title), title);
+ strcpy_sjis((short *)&(icon->title), title);
icon->trans = 0x10;
memcpy(icon->bgCol, _bgcolor, sizeof(_bgcolor));
memcpy(icon->lightDir, _lightdir, sizeof(_lightdir));
memcpy(icon->lightCol, _lightcol, sizeof(_lightcol));
memcpy(icon->lightAmbient, _ambient, sizeof(_ambient));
- strcpy((char*)icon->view, "scummvm.icn");
- strcpy((char*)icon->copy, "scummvm.icn");
- strcpy((char*)icon->del, "scummvm.icn");
+ strcpy((char *)icon->view, "scummvm.icn");
+ strcpy((char *)icon->copy, "scummvm.icn");
+ strcpy((char *)icon->del, "scummvm.icn");
}
diff --git a/backends/platform/ps2/icon.h b/backends/platform/ps2/icon.h
index bc614bf70b..3ad19910d3 100644
--- a/backends/platform/ps2/icon.h
+++ b/backends/platform/ps2/icon.h
@@ -22,10 +22,6 @@
class PS2Icon {
public:
- PS2Icon() {};
-
- ~PS2Icon() {};
-
uint16 decompressData(uint16 **data);
void setup(mcIcon *icon);
};
diff --git a/backends/platform/ps2/ps2mutex.cpp b/backends/platform/ps2/ps2mutex.cpp
index 5b30fa7862..ae63fe5724 100644
--- a/backends/platform/ps2/ps2mutex.cpp
+++ b/backends/platform/ps2/ps2mutex.cpp
@@ -57,7 +57,7 @@ OSystem::MutexRef OSystem_PS2::createMutex(void) {
void OSystem_PS2::lockMutex(MutexRef mutex) {
WaitSema(_mutexSema);
- Ps2Mutex *sysMutex = (Ps2Mutex*)mutex;
+ Ps2Mutex *sysMutex = (Ps2Mutex *)mutex;
int tid = GetThreadId();
assert(tid != 0);
@@ -75,7 +75,7 @@ void OSystem_PS2::lockMutex(MutexRef mutex) {
void OSystem_PS2::unlockMutex(MutexRef mutex) {
WaitSema(_mutexSema);
- Ps2Mutex *sysMutex = (Ps2Mutex*)mutex;
+ Ps2Mutex *sysMutex = (Ps2Mutex *)mutex;
int tid = GetThreadId();
if (sysMutex->owner && sysMutex->count && (sysMutex->owner == tid))
@@ -90,7 +90,7 @@ void OSystem_PS2::unlockMutex(MutexRef mutex) {
void OSystem_PS2::deleteMutex(MutexRef mutex) {
WaitSema(_mutexSema);
- Ps2Mutex *sysMutex = (Ps2Mutex*)mutex;
+ Ps2Mutex *sysMutex = (Ps2Mutex *)mutex;
if (sysMutex->owner || sysMutex->count)
printf("WARNING: Deleting LOCKED mutex!\n");
DeleteSema(sysMutex->sema);
diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp
index eeb9dfbd93..b6afc217e6 100644
--- a/backends/platform/ps2/ps2pad.cpp
+++ b/backends/platform/ps2/ps2pad.cpp
@@ -30,7 +30,7 @@
Ps2Pad::Ps2Pad(OSystem_PS2 *system) {
_system = system;
- _padBuf = (uint8*)memalign(64, 256);
+ _padBuf = (uint8 *)memalign(64, 256);
_padStatus = STAT_NONE;
padInit(0); // initialize library
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index 481227dd02..d4e993da63 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -384,8 +384,8 @@ void OSystem_PS2::initTimer(void) {
ee_thread_t timerThread, soundThread, thisThread;
ReferThreadStatus(GetThreadId(), &thisThread);
- _timerStack = (uint8*)malloc(TIMER_STACK_SIZE);
- _soundStack = (uint8*)malloc(SOUND_STACK_SIZE);
+ _timerStack = (uint8 *)malloc(TIMER_STACK_SIZE);
+ _soundStack = (uint8 *)malloc(SOUND_STACK_SIZE);
// give timer thread a higher priority than main thread
timerThread.initial_priority = thisThread.current_priority - 1;
@@ -435,7 +435,7 @@ void OSystem_PS2::timerThreadCallback(void) {
}
void OSystem_PS2::soundThreadCallback(void) {
- int16 *soundBufL = (int16*)memalign(64, SMP_PER_BLOCK * sizeof(int16) * 2);
+ int16 *soundBufL = (int16 *)memalign(64, SMP_PER_BLOCK * sizeof(int16) * 2);
int16 *soundBufR = soundBufL + SMP_PER_BLOCK;
int bufferedSamples = 0;
@@ -453,9 +453,9 @@ void OSystem_PS2::soundThreadCallback(void) {
if (bufferedSamples <= 8 * SMP_PER_BLOCK) {
// we have to produce more samples, call sound mixer
// the scratchpad at 0x70000000 is used as temporary soundbuffer
- //_scummSoundProc(_scummSoundParam, (uint8*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
- // Audio::Mixer::mixCallback(_scummMixer, (byte*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
- _scummMixer->mixCallback((byte*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
+ //_scummSoundProc(_scummSoundParam, (uint8 *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
+ // Audio::Mixer::mixCallback(_scummMixer, (byte *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
+ _scummMixer->mixCallback((byte *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16));
// demux data into 2 buffers, L and R
__asm__ (
@@ -635,7 +635,7 @@ void OSystem_PS2::clearOverlay(void) {
}
void OSystem_PS2::grabOverlay(OverlayColor *buf, int pitch) {
- _screen->grabOverlay((uint16*)buf, (uint16)pitch);
+ _screen->grabOverlay((uint16 *)buf, (uint16)pitch);
}
void OSystem_PS2::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
@@ -738,12 +738,12 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) {
lnSta = lnEnd + 1;
}
- uint8 *scrBuf = (uint8*)memalign(64, 320 * 200);
+ uint8 *scrBuf = (uint8 *)memalign(64, 320 * 200);
memset(scrBuf, 4, 320 * 200);
uint8 *dstPos = scrBuf + ((200 - posY) >> 1) * 320 + (320 - maxWidth) / 2;
for (int y = 0; y < posY; y++) {
- uint8 *srcPos = (uint8*)surf.getBasePtr((300 - maxWidth) / 2, y);
+ uint8 *srcPos = (uint8 *)surf.getBasePtr((300 - maxWidth) / 2, y);
for (int x = 0; x < maxWidth; x++)
dstPos[x] = srcPos[x] + 5;
dstPos += 320;