diff options
Diffstat (limited to 'backends')
23 files changed, 226 insertions, 226 deletions
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index 39eaf39ec0..8dc3902216 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -115,7 +115,7 @@ DSFileSystemNode::DSFileSystemNode(const Common::String& path, bool isDir) { // consolePrintf("Found: %d, Dir: %d\n", _isValid, _isDirectory); } -DSFileSystemNode::DSFileSystemNode(const DSFileSystemNode* node) { +DSFileSystemNode::DSFileSystemNode(const DSFileSystemNode *node) { //TODO: not implemented? } @@ -144,7 +144,7 @@ bool DSFileSystemNode::getChildren(AbstractFSList &dirList, ListMode mode, bool _zipFile->changeToRoot(); /* // This is the root dir, so add the RAM folder - DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/ram"); + DSFileSystemNode *dsfsn = new DSFileSystemNode("ds:/ram"); dsfsn->_isDirectory = true; dirList->push_back(wrap(dsfsn)); */ @@ -162,7 +162,7 @@ bool DSFileSystemNode::getChildren(AbstractFSList &dirList, ListMode mode, bool if ( (_zipFile->isDirectory() && ((mode == Common::FSNode::kListDirectoriesOnly) || (mode == Common::FSNode::kListAll)) ) || (!_zipFile->isDirectory() && ((mode == Common::FSNode::kListFilesOnly) || (mode == Common::FSNode::kListAll)) ) ) { - DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/" + Common::String(n), _zipFile->isDirectory()); + DSFileSystemNode *dsfsn = new DSFileSystemNode("ds:/" + Common::String(n), _zipFile->isDirectory()); dsfsn->_isDirectory = _zipFile->isDirectory(); dirList.push_back((dsfsn)); } @@ -173,7 +173,7 @@ bool DSFileSystemNode::getChildren(AbstractFSList &dirList, ListMode mode, bool return true; } -AbstractFSNode* DSFileSystemNode::getParent() const { +AbstractFSNode *DSFileSystemNode::getParent() const { // consolePrintf("parent\n"); DSFileSystemNode *p; @@ -276,7 +276,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDire } -GBAMPFileSystemNode::GBAMPFileSystemNode(const GBAMPFileSystemNode* node) { +GBAMPFileSystemNode::GBAMPFileSystemNode(const GBAMPFileSystemNode *node) { //TODO: not implemented? } @@ -319,7 +319,7 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo if ( ((entryType == TYPE_DIR) && ((mode == Common::FSNode::kListDirectoriesOnly) || (mode == Common::FSNode::kListAll))) || ((entryType == TYPE_FILE) && ((mode == Common::FSNode::kListFilesOnly) || (mode == Common::FSNode::kListAll))) ) { - GBAMPFileSystemNode* dsfsn; + GBAMPFileSystemNode *dsfsn; //consolePrintf("Fname: %s\n", fname); @@ -348,7 +348,7 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo return true; } -AbstractFSNode* GBAMPFileSystemNode::getParent() const { +AbstractFSNode *GBAMPFileSystemNode::getParent() const { // consolePrintf("parent\n"); GBAMPFileSystemNode *p; @@ -489,7 +489,7 @@ enum { static bool inited = false; static DS::fileHandle s_handle[MAX_FILE_HANDLES]; -FILE* std_fopen(const char* name, const char* mode) { +FILE *std_fopen(const char *name, const char *mode) { if (!inited) { for (int r = 0; r < MAX_FILE_HANDLES; r++) { s_handle[r].used = false; @@ -498,7 +498,7 @@ FILE* std_fopen(const char* name, const char* mode) { currentDir[0] = '\0'; } - char* realName = (char *) name; + char *realName = (char *) name; // Remove file system prefix if ((name[0] == 'd') && (name[1] == 's') && (name[2] == ':') && (name[3] == '/')) { @@ -516,13 +516,13 @@ FILE* std_fopen(const char* name, const char* mode) { FAT_chdir("/"); // Turn all back slashes into forward slashes for gba_nds_fat - char* p = realName; + char *p = realName; while (*p) { if (*p == '\\') *p = '/'; p++; } - FAT_FILE* result = FAT_fopen(realName, mode); + FAT_FILE *result = FAT_fopen(realName, mode); if (result == 0) { // consolePrintf("Error code %d\n", result); @@ -565,9 +565,9 @@ FILE* std_fopen(const char* name, const char* mode) { // consolePrintf("Not in SRAM!"); - char* data; + char *data; - ZipFile* zip = DSFileSystemNode::getZip(); + ZipFile *zip = DSFileSystemNode::getZip(); if (!zip) { // consolePrintf("No zip yet!"); return NULL; @@ -609,7 +609,7 @@ FILE* std_fopen(const char* name, const char* mode) { } } -void std_fclose(FILE* handle) { +void std_fclose(FILE *handle) { if (DS::isGBAMPAvailable()) { FAT_fclose((FAT_FILE *) handle); @@ -623,7 +623,7 @@ void std_fclose(FILE* handle) { } } -size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) { +size_t std_fread(const void *ptr, size_t size, size_t numItems, FILE *handle) { // consolePrintf("fread %d,%d %d ", size, numItems, ptr); if (DS::isGBAMPAvailable()) { @@ -668,7 +668,7 @@ size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) { return numItems; } -size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle) { +size_t std_fwrite(const void *ptr, size_t size, size_t numItems, FILE *handle) { if ((handle == stdin)) return 0; if ((handle == stderr) || (handle == stdout)) { @@ -704,7 +704,7 @@ size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle) { } } -bool std_feof(FILE* handle) { +bool std_feof(FILE *handle) { // consolePrintf("feof "); if (DS::isGBAMPAvailable()) { @@ -719,13 +719,13 @@ bool std_feof(FILE* handle) { return handle->pos >= handle->size; } -int std_fflush(FILE* handle) { +int std_fflush(FILE *handle) { //FIXME: not implemented? // consolePrintf("fflush "); return 0; } -long int std_ftell(FILE* handle) { +long int std_ftell(FILE *handle) { if (DS::isGBAMPAvailable()) { return FAT_ftell((FAT_FILE *) handle); } @@ -733,7 +733,7 @@ long int std_ftell(FILE* handle) { return handle->pos; } -int std_fseek(FILE* handle, long int offset, int whence) { +int std_fseek(FILE *handle, long int offset, int whence) { // consolePrintf("fseek %d %d ", offset, whence); if (DS::isGBAMPAvailable()) { @@ -758,14 +758,14 @@ int std_fseek(FILE* handle, long int offset, int whence) { return 0; } -int std_ferror(FILE* handle) { +int std_ferror(FILE *handle) { //FIXME: not implemented? // consolePrintf("ferror "); return readPastEndOfFile; } -void std_clearerr(FILE* handle) { +void std_clearerr(FILE *handle) { //FIXME: not implemented? readPastEndOfFile = false; // consolePrintf("clearerr "); diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h index c8bf7d6cf2..b4c8f7ac12 100644 --- a/backends/fs/ds/ds-fs.h +++ b/backends/fs/ds/ds-fs.h @@ -40,7 +40,7 @@ namespace DS { */ class DSFileSystemNode : public AbstractFSNode { protected: - static ZipFile* _zipFile; + static ZipFile *_zipFile; Common::String _displayName; Common::String _path; @@ -96,7 +96,7 @@ public: * Returns the zip file this node points to. * TODO: check this documentation. */ - static ZipFile* getZip() { return _zipFile; } + static ZipFile *getZip() { return _zipFile; } }; /** @@ -161,10 +161,10 @@ public: struct fileHandle { int pos; bool used; - char* data; + char *data; int size; - DSSaveFile* sramFile; + DSSaveFile *sramFile; }; @@ -213,16 +213,16 @@ public: #define FILE DS::fileHandle // Please do not remove any of these prototypes that appear not to be required. -FILE* std_fopen(const char* name, const char* mode); -void std_fclose(FILE* handle); -size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle); -size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle); -bool std_feof(FILE* handle); -long int std_ftell(FILE* handle); -int std_fseek(FILE* handle, long int offset, int whence); -void std_clearerr(FILE* handle); -int std_fflush(FILE* handle); -int std_ferror(FILE* handle); +FILE* std_fopen(const char *name, const char *mode); +void std_fclose(FILE *handle); +size_t std_fread(const void *ptr, size_t size, size_t numItems, FILE *handle); +size_t std_fwrite(const void *ptr, size_t size, size_t numItems, FILE *handle); +bool std_feof(FILE *handle); +long int std_ftell(FILE *handle); +int std_fseek(FILE *handle, long int offset, int whence); +void std_clearerr(FILE *handle); +int std_fflush(FILE *handle); +int std_ferror(FILE *handle); } //namespace DS diff --git a/backends/platform/ds/arm7/source/main.cpp b/backends/platform/ds/arm7/source/main.cpp index a4cde02ba6..b45b601bda 100644 --- a/backends/platform/ds/arm7/source/main.cpp +++ b/backends/platform/ds/arm7/source/main.cpp @@ -58,10 +58,10 @@ s32 TOUCH_HEIGHT = TOUCH_CAL_Y2 - TOUCH_CAL_Y1; s32 TOUCH_OFFSET_X = ( ((SCREEN_WIDTH -60) * TOUCH_CAL_X1) / TOUCH_WIDTH ) - 28; s32 TOUCH_OFFSET_Y = ( ((SCREEN_HEIGHT-60) * TOUCH_CAL_Y1) / TOUCH_HEIGHT ) - 28; -vu8* soundData; +vu8 *soundData; -vu8* soundBuffer; -vu8* arm9Buffer; +vu8 *soundBuffer; +vu8 *arm9Buffer; bool soundFilled[4]; int playingSection; @@ -81,7 +81,7 @@ int adpcmBufferNum = 0; ////////////////////////////////////////////////////////////////////// /* -void startSound(int sampleRate, const void* data, uint32 bytes, u8 channel=0, u8 vol=0x7F, u8 pan=63, u8 format=0) { +void startSound(int sampleRate, const void *data, uint32 bytes, u8 channel=0, u8 vol=0x7F, u8 pan=63, u8 format=0) { SCHANNEL_TIMER(channel) = SOUND_FREQ(sampleRate); SCHANNEL_SOURCE(channel) = (uint32)data; SCHANNEL_LENGTH(channel) = bytes; @@ -106,7 +106,7 @@ s8 getFreeSoundChannel() { return -1; } -void startSound(int sampleRate, const void* data, uint32 bytes, u8 channel=0, u8 vol=0x7F, u8 pan=63, u8 format=0) { +void startSound(int sampleRate, const void *data, uint32 bytes, u8 channel=0, u8 vol=0x7F, u8 pan=63, u8 format=0) { // REG_IME = IME_DISABLE; channel = getFreeSoundChannel(); @@ -177,7 +177,7 @@ void startSound(int sampleRate, const void* data, uint32 bytes, u8 channel=0, u8 - soundData = (vu8* ) data; + soundData = (vu8 *) data; SCHANNEL_CR(channel) = flags; SCHANNEL_CR(channel + 2) = flags; @@ -386,7 +386,7 @@ void InterruptTimer1() { //if ((!soundFilled[r]) && (!IPC->fillNeeded[playingSection])) { memcpy((void *) (soundBuffer + (r * 1024)), (void *) (arm9Buffer + (r * 1024)), 1024); - vu16* p = (vu16 *) (soundBuffer); + vu16 *p = (vu16 *) (soundBuffer); //for (int t = 0; t < 2048; t++) { // *(p + t) = (t & 1)? 0xF000: 0x0000; //} diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp index 07c6b3fee1..fa746fa51e 100644 --- a/backends/platform/ds/arm9/source/blitters.cpp +++ b/backends/platform/ds/arm9/source/blitters.cpp @@ -27,7 +27,7 @@ namespace DS { -void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst, +void asmDrawStripToScreen(int height, int width, byte const *text, byte const *src, byte *dst, int vsPitch, int vmScreenWidth, int textSurfacePitch) { @@ -111,7 +111,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s -void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height) { +void asmCopy8Col(byte *dst, int dstPitch, const byte *src, int height) { asm("ands r0, %3, #1\n" "addne %3, %3, #1\n" "bne roll2\n" @@ -155,7 +155,7 @@ void ComputeDivBy5TableIFN() #ifdef PERFECT_5_TO_4_RESCALING static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3, u16 s4, - u16* dest) + u16 *dest) { u32 bs0 = s0 & 0x1F; u32 bs1 = s1 & 0x1F; @@ -230,7 +230,7 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3 } #else static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3, u16 s4, - u16* dest) + u16 *dest) { static const u32 MASK = 0x03E07C1F; @@ -279,7 +279,7 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3 #endif static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3, u32 s4, - u16* dest) + u16 *dest) { u32 d0 = 4*s0 + s1; u32 d1 = 2*s1 + s1 + 2*s2; @@ -317,7 +317,7 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3 // Can't work in place #ifdef PERFECT_5_TO_4_RESCALING -static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u32* palette) +static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16 *dest, const u8 *src, const u32 *palette) { ComputeDivBy5TableIFN(); @@ -333,7 +333,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const } } #else -static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u16* palette) +static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16 *dest, const u8 *src, const u16 *palette) { for (size_t i=0; i<64; ++i) { @@ -350,7 +350,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const // Can work in place, because it's a contraction -static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const u16* src) +static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16 *dest, const u16 *src) { ComputeDivBy5TableIFN(); @@ -367,7 +367,7 @@ static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const } #ifdef PERFECT_5_TO_4_RESCALING -void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette) +void Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStride, int srcStride, const u16 *palette) { u32 fastRam[768]; @@ -388,7 +388,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri } } #else -void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette) +void Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStride, int srcStride, const u16 *palette) { u16 fastRam[256]; for (size_t i=0; i<128; ++i) @@ -401,7 +401,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri } #endif -void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride) +void Rescale_320x256x1555_To_256x256x1555(u16 *dest, const u16 *src, int destStride, int srcStride) { for (size_t i=0; i<200; ++i) { diff --git a/backends/platform/ds/arm9/source/blitters.h b/backends/platform/ds/arm9/source/blitters.h index 5f541d1bd6..60dc2af133 100644 --- a/backends/platform/ds/arm9/source/blitters.h +++ b/backends/platform/ds/arm9/source/blitters.h @@ -29,11 +29,11 @@ namespace DS { -void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst, +void asmDrawStripToScreen(int height, int width, byte const *text, byte const *src, byte *dst, int vsPitch, int vmScreenWidth, int textSurfacePitch); -void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height); -void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette); -void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride); +void asmCopy8Col(byte *dst, int dstPitch, const byte *src, int height); +void Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStride, int srcStride, const u16 *palette); +void Rescale_320x256x1555_To_256x256x1555(u16 *dest, const u16 *src, int destStride, int srcStride); } @@ -41,11 +41,11 @@ void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStr extern "C" { -void ITCM_CODE asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst, +void ITCM_CODE asmDrawStripToScreen(int height, int width, byte const *text, byte const *src, byte *dst, int vsPitch, int vmScreenWidth, int textSurfacePitch); -void ITCM_CODE asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height); -void ITCM_CODE Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette, u32 numLines); -void ITCM_CODE Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride); +void ITCM_CODE asmCopy8Col(byte *dst, int dstPitch, const byte *src, int height); +void ITCM_CODE Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStride, int srcStride, const u16 *palette, u32 numLines); +void ITCM_CODE Rescale_320x256x1555_To_256x256x1555(u16 *dest, const u16 *src, int destStride, int srcStride); } diff --git a/backends/platform/ds/arm9/source/cdaudio.cpp b/backends/platform/ds/arm9/source/cdaudio.cpp index 7756286117..23a276c4cb 100644 --- a/backends/platform/ds/arm9/source/cdaudio.cpp +++ b/backends/platform/ds/arm9/source/cdaudio.cpp @@ -74,13 +74,13 @@ struct decoderFormat { bool active = false; WaveHeader waveHeader; Header blockHeader; -FILE* file; +FILE *file; int fillPos; bool isPlayingFlag = false; -s16* audioBuffer; +s16 *audioBuffer; u32 sampleNum; -s16* decompressionBuffer; +s16 *decompressionBuffer; int numLoops; int blockCount; int dataChunkStart; @@ -495,7 +495,7 @@ bool trackExists(int num) { } consolePrintf("Looking for %s...", path.c_str()); - FILE* file; + FILE *file; if ((file = DS::std_fopen(path.c_str(), "r"))) { consolePrintf("Success!\n"); setActive(true); diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 4ba0b35472..2f0d5e34ee 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -119,7 +119,7 @@ static const char *registerNames[] = #ifdef WRAP_MALLOC -extern "C" void* __real_malloc(size_t size); +extern "C" void *__real_malloc(size_t size); static int s_total_malloc = 0; @@ -158,7 +158,7 @@ extern "C" void *__wrap_malloc(size_t size) { consolePrintf("0 size malloc (%d)", zeroSize++); } - void* res = __real_malloc(size); + void *res = __real_malloc(size); if (res) { if (size > 50 * 1024) { consolePrintf("Allocated %d (%x)\n", size, poo); @@ -219,7 +219,7 @@ static int subScreenScale = 256; // Sound static int bufferSize; -static s16* soundBuffer; +static s16 *soundBuffer; static int bufferFrame; static int bufferRate; static int bufferSamples; @@ -431,7 +431,7 @@ controlType getControlType() { //plays an 8 bit mono sample at 11025Hz -void playSound(const void* data, u32 length, bool loop, bool adpcm, int rate) { +void playSound(const void *data, u32 length, bool loop, bool adpcm, int rate) { if (!IPC->soundData) { soundControl.count = 0; @@ -784,7 +784,7 @@ void setMouseCursorVisible(bool enable) { mouseCursorVisible = enable; } -void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY) { +void setCursorIcon(const u8 *icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY) { int off; @@ -965,7 +965,7 @@ void displayMode16BitFlipBuffer() { consolePrintf("Flip %s...", displayModeIs8Bit ? "8bpp" : "16bpp"); #endif if (!displayModeIs8Bit) { - u16* back = get16BitBackBuffer(); + u16 *back = get16BitBackBuffer(); // highBuffer = !highBuffer; // BG3_CR = BG_BMP16_512x256 | BG_BMP_RAM(highBuffer? 1: 0); @@ -984,8 +984,8 @@ void displayMode16BitFlipBuffer() { TIMER1_CR = TIMER_ENABLE | TIMER_DIV_1024; u16 t0 = TIMER1_DATA; #endif - const u8* back = (const u8*)get8BitBackBuffer(); - u16* base = BG_GFX + 0x10000; + const u8 *back = (const u8*)get8BitBackBuffer(); + u16 *base = BG_GFX + 0x10000; Rescale_320x256xPAL8_To_256x256x1555( base, back, @@ -1033,11 +1033,11 @@ s32 get8BitBackBufferStride() { } } -u16* getScalerBuffer() { +u16 *getScalerBuffer() { return (u16 *) scalerBackBuffer; } -u16* get8BitBackBuffer() { +u16 *get8BitBackBuffer() { if (isCpuScalerEnabled()) return (u16 *) scalerBackBuffer; else @@ -1107,7 +1107,7 @@ void soundUpdate() { void memoryReport() { int r = 0; - int* p; + int *p; do { p = (int *) malloc(r * 8192); free(p); @@ -1115,7 +1115,7 @@ void memoryReport() { } while ((p) && (r < 512)); int t = -1; - void* block[1024]; + void *block[1024]; do { t++; block[t] = (int *) malloc(4096); @@ -1130,7 +1130,7 @@ void memoryReport() { void addIndyFightingKeys() { - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); Common::Event event; event.type = Common::EVENT_KEYDOWN; @@ -1230,7 +1230,7 @@ void addIndyFightingKeys() { void setKeyboardEnable(bool en) { if (en == keyboardEnable) return; keyboardEnable = en; - u16* backupBank = (u16 *) 0x6040000; + u16 *backupBank = (u16 *) 0x6040000; if (keyboardEnable) { @@ -1266,7 +1266,7 @@ void setKeyboardEnable(bool en) { if (displayModeIs8Bit) { // Copy the sub screen VRAM from the top screen - they should always be // the same. - u16* buffer = get8BitBackBuffer(); + u16 *buffer = get8BitBackBuffer(); s32 stride = get8BitBackBufferStride(); for (int y = 0; y < gameHeight; y++) { @@ -1302,7 +1302,7 @@ bool getIsDisplayMode8Bit() { return displayModeIs8Bit; } -void doScreenTapMode(OSystem_DS* system) { +void doScreenTapMode(OSystem_DS *system) { Common::Event event; static bool left = false, right = false; @@ -1368,7 +1368,7 @@ void doScreenTapMode(OSystem_DS* system) { system->addEvent(event); } -void doButtonSelectMode(OSystem_DS* system) +void doButtonSelectMode(OSystem_DS *system) { Common::Event event; @@ -1492,7 +1492,7 @@ void addEventsToQueue() { #ifdef HEAVY_LOGGING consolePrintf("addEventsToQueue\n"); #endif - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); Common::Event event; #ifdef USE_PROFILER @@ -2358,7 +2358,7 @@ void uploadSpriteGfx() { vramSetBankE(VRAM_E_MAIN_SPRITE); // Convert texture from 24bit 888 to 16bit 1555, remembering to set top bit! - const u8* srcTex = (const u8 *) ::icons_raw; + const u8 *srcTex = (const u8 *) ::icons_raw; for (int r = 32 * 256 ; r >= 0; r--) { SPRITE_GFX_SUB[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10); SPRITE_GFX[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10); @@ -2831,11 +2831,11 @@ bool getIndyFightState() { /////////////////// #define FAST_RAM_SIZE (24000) -u8* fastRamPointer; +u8 *fastRamPointer; u8 fastRamData[FAST_RAM_SIZE] ITCM_DATA; -void* fastRamAlloc(int size) { - void* result = (void *) fastRamPointer; +void *fastRamAlloc(int size) { + void *result = (void *) fastRamPointer; fastRamPointer += size; if(fastRamPointer > fastRamData + FAST_RAM_SIZE) { consolePrintf("FastRam (ITCM) allocation failed!\n"); @@ -2892,7 +2892,7 @@ void initDebugger() { // Ensure the function is processed with C linkage -extern "C" void debug_print_stub(char* string); +extern "C" void debug_print_stub(char *string); void debug_print_stub(char *string) { consolePrintf(string); @@ -3252,7 +3252,7 @@ int main(void) { */ // Create a file system node to force search for a zip file in GBA rom space - DSFileSystemNode* node = new DSFileSystemNode(); + DSFileSystemNode *node = new DSFileSystemNode(); if (!node->getZip() || (!node->getZip()->isReady())) { // If not found, init CF/SD driver initGBAMP(mode); diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h index 5669f7feaf..7cf8313391 100644 --- a/backends/platform/ds/arm9/source/dsmain.h +++ b/backends/platform/ds/arm9/source/dsmain.h @@ -76,8 +76,8 @@ void displayMode16Bit(); // Switch to 16-bit mode5 void displayMode16BitFlipBuffer(); // Get address of current back buffer -u16* get16BitBackBuffer(); -u16* get8BitBackBuffer(); +u16 * get16BitBackBuffer(); +u16 * get8BitBackBuffer(); s32 get8BitBackBufferStride(); u16* getScalerBuffer(); @@ -96,7 +96,7 @@ void doTimerCallback(); // Call callback function if required void doSoundCallback(); void startSound(int freq, int buffer); // Start sound hardware // Call function if sound buffers need more data -void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound +void playSound(const void *data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound void stopSound(int channel); int getSoundFrequency(); @@ -106,7 +106,7 @@ void VBlankHandler(); // Sam and Max Stuff void setGameID(int id); -void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY); +void setCursorIcon(const u8 *icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY); void setShowCursor(bool enable); void setMouseCursorVisible(bool visible); diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index 44bbad23b2..d8b2365c4f 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -366,7 +366,7 @@ void showOptionsDialog() { DS::displayMode16Bit(); - DSOptionsDialog* d = new DSOptionsDialog(); + DSOptionsDialog *d = new DSOptionsDialog(); d->runModal(); delete d; diff --git a/backends/platform/ds/arm9/source/dsoptions.h b/backends/platform/ds/arm9/source/dsoptions.h index 4b3ac36d45..48eb2c3303 100644 --- a/backends/platform/ds/arm9/source/dsoptions.h +++ b/backends/platform/ds/arm9/source/dsoptions.h @@ -46,30 +46,30 @@ protected: virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); void updateConfigManager(); - GUI::TabWidget* _tab; - - GUI::StaticTextWidget* _sensitivityLabel; - - GUI::SliderWidget* _touchX; - GUI::SliderWidget* _touchY; - GUI::SliderWidget* _sensitivity; - GUI::SliderWidget* _gammaCorrection; - GUI::CheckboxWidget* _leftHandedCheckbox; - GUI::CheckboxWidget* _unscaledCheckbox; - GUI::CheckboxWidget* _100PercentCheckbox; - GUI::CheckboxWidget* _150PercentCheckbox; - GUI::CheckboxWidget* _200PercentCheckbox; - GUI::CheckboxWidget* _indyFightCheckbox; - GUI::CheckboxWidget* _highQualityAudioCheckbox; - GUI::CheckboxWidget* _disablePowerOff; - GUI::CheckboxWidget* _showCursorCheckbox; - GUI::CheckboxWidget* _snapToBorderCheckbox; - - GUI::CheckboxWidget* _hardScaler; - GUI::CheckboxWidget* _cpuScaler; - - GUI::CheckboxWidget* _touchPadStyle; - GUI::CheckboxWidget* _screenTaps; + GUI::TabWidget *_tab; + + GUI::StaticTextWidget *_sensitivityLabel; + + GUI::SliderWidget *_touchX; + GUI::SliderWidget *_touchY; + GUI::SliderWidget *_sensitivity; + GUI::SliderWidget *_gammaCorrection; + GUI::CheckboxWidget *_leftHandedCheckbox; + GUI::CheckboxWidget *_unscaledCheckbox; + GUI::CheckboxWidget *_100PercentCheckbox; + GUI::CheckboxWidget *_150PercentCheckbox; + GUI::CheckboxWidget *_200PercentCheckbox; + GUI::CheckboxWidget *_indyFightCheckbox; + GUI::CheckboxWidget *_highQualityAudioCheckbox; + GUI::CheckboxWidget *_disablePowerOff; + GUI::CheckboxWidget *_showCursorCheckbox; + GUI::CheckboxWidget *_snapToBorderCheckbox; + + GUI::CheckboxWidget *_hardScaler; + GUI::CheckboxWidget *_cpuScaler; + + GUI::CheckboxWidget *_touchPadStyle; + GUI::CheckboxWidget *_screenTaps; bool _radioButtonMode; diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index 820e569555..d07e6c87fa 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -29,7 +29,7 @@ // GBAMP Save File ///////////////////////// -GBAMPSaveFile::GBAMPSaveFile(char* name, bool saveOrLoad) { +GBAMPSaveFile::GBAMPSaveFile(char *name, bool saveOrLoad) { handle = DS::std_fopen(name, saveOrLoad? "w": "r"); // consolePrintf("%s handle is %d\n", name, handle); // consolePrintf("Created %s\n", name); @@ -196,7 +196,7 @@ Common::StringArray GBAMPSaveFileManager::listSavefiles(const Common::String &pa // consolePrintf("Real cwd:%d\n", realName); - char* p = realName; + char *p = realName; while (*p) { if (*p == '\\') *p = '/'; p++; diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index bc4fdaa1a4..19a9a41938 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -29,14 +29,14 @@ #define SAVE_BUFFER_SIZE 100000 class GBAMPSaveFile : public Common::InSaveFile, public Common::OutSaveFile { - DS::fileHandle* handle; + DS::fileHandle *handle; char buffer[SAVE_BUFFER_SIZE]; int bufferPos; int saveSize; int flushed; public: - GBAMPSaveFile(char* name, bool saveOrLoad); + GBAMPSaveFile(char *name, bool saveOrLoad); virtual ~GBAMPSaveFile(); virtual uint32 read(void *buf, uint32 size); @@ -62,12 +62,12 @@ public: GBAMPSaveFileManager(); ~GBAMPSaveFileManager(); -// static GBAMPSaveFileManager* instance() { return instancePtr; } +// static GBAMPSaveFileManager *instance() { return instancePtr; } GBAMPSaveFile *openSavefile(const char *filename, bool saveOrLoad); - virtual Common::OutSaveFile* openForSaving(const Common::String &filename) { return openSavefile(filename.c_str(), true); } - virtual Common::InSaveFile* openForLoading(const Common::String &filename) { return openSavefile(filename.c_str(), false); } + virtual Common::OutSaveFile *openForSaving(const Common::String &filename) { return openSavefile(filename.c_str(), true); } + virtual Common::InSaveFile *openForLoading(const Common::String &filename) { return openSavefile(filename.c_str(), false); } virtual bool removeSavefile(const Common::String &filename) { return false; } // TODO: Implement this virtual Common::StringArray listSavefiles(const Common::String &pattern); diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 5e21a7d78f..418ab9d006 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -73,7 +73,7 @@ #define DEFAULT_CONFIG_FILE "scummvm.ini" #endif -OSystem_DS* OSystem_DS::_instance = NULL; +OSystem_DS *OSystem_DS::_instance = NULL; OSystem_DS::OSystem_DS() : eventNum(0), lastPenFrame(0), queuePos(0), _mixer(NULL), _timer(NULL), _frameBufferExists(false), @@ -133,7 +133,7 @@ bool OSystem_DS::getFeatureState(Feature f) { return false; } -const OSystem::GraphicsMode* OSystem_DS::getSupportedGraphicsModes() const { +const OSystem::GraphicsMode *OSystem_DS::getSupportedGraphicsModes() const { return s_supportedGraphicsModes; } @@ -243,13 +243,13 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) { refreshCursor(); } -bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) { +bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing - const u16* image = (const u16 *) DS::get8BitBackBuffer(); + const u16 *image = (const u16 *) DS::get8BitBackBuffer(); for (int y = 0; y < DS::getGameHeight(); y++) { DC_FlushRange(image + (y << 8), DS::getGameWidth()); for (int x = 0; x < DS::getGameWidth() >> 1; x++) { @@ -282,9 +282,9 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int // consolePrintf("CopyRectToScreen %d\n", w * h); - u16* bg; + u16 *bg; s32 stride; - u16* bgSub = (u16 *)BG_GFX_SUB; + u16 *bgSub = (u16 *)BG_GFX_SUB; // The DS video RAM doesn't support 8-bit writes because Nintendo wanted // to save a few pennies/euro cents on the hardware. @@ -309,8 +309,8 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int // the keyboard image uses the same VRAM addresses. for (int dy = y; dy < y + h; dy++) { - u8* dest = ((u8 *) (bg)) + (dy * stride) + x; - const u8* src = (const u8 *) buf + (pitch * by); + u8 *dest = ((u8 *) (bg)) + (dy * stride) + x; + const u8 *src = (const u8 *) buf + (pitch * by); u32 dx; @@ -331,7 +331,7 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } // We can now assume dest is aligned - u16* dest16 = (u16 *) dest; + u16 *dest16 = (u16 *) dest; for (dx = 0; dx < pixelsLeft; dx+=2) { u16 mix; @@ -360,9 +360,9 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int // When they keyboard is not on screen, update both vram copies for (int dy = y; dy < y + h; dy++) { - u8* dest = ((u8 *) (bg)) + (dy * stride) + x; - u8* destSub = ((u8 *) (bgSub)) + (dy * 512) + x; - const u8* src = (const u8 *) buf + (pitch * by); + u8 *dest = ((u8 *) (bg)) + (dy * stride) + x; + u8 *destSub = ((u8 *) (bgSub)) + (dy * 512) + x; + const u8 *src = (const u8 *) buf + (pitch * by); u32 dx; @@ -385,8 +385,8 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } // We can now assume dest is aligned - u16* dest16 = (u16 *) dest; - u16* destSub16 = (u16 *) destSub; + u16 *dest16 = (u16 *) dest; + u16 *destSub16 = (u16 *) destSub; for (dx = 0; dx < pixelsLeft; dx+=2) { u16 mix; @@ -422,12 +422,12 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int // Stuff is aligned to 16-bit boundaries, so it's safe to do DMA. - u16* src = (u16 *) buf; + u16 *src = (u16 *) buf; if (DS::getKeyboardEnable()) { for (int dy = y; dy < y + h; dy++) { - u16* dest = bg + (dy * (stride >> 1)) + (x >> 1); + u16 *dest = bg + (dy * (stride >> 1)) + (x >> 1); DC_FlushRange(src, w << 1); DC_FlushRange(dest, w << 1); @@ -440,8 +440,8 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } else { for (int dy = y; dy < y + h; dy++) { - u16* dest1 = bg + (dy * (stride >> 1)) + (x >> 1); - u16* dest2 = bgSub + (dy << 8) + (x >> 1); + u16 *dest1 = bg + (dy * (stride >> 1)) + (x >> 1); + u16 *dest2 = bgSub + (dy << 8) + (x >> 1); DC_FlushRange(src, w << 1); DC_FlushRange(dest1, w << 1); @@ -503,13 +503,13 @@ void OSystem_DS::clearOverlay() { // consolePrintf("clearovl\n"); } -void OSystem_DS::grabOverlay(OverlayColor* buf, int pitch) { +void OSystem_DS::grabOverlay(OverlayColor *buf, int pitch) { // consolePrintf("grabovl\n") - u16* start = DS::get16BitBackBuffer(); + u16 *start = DS::get16BitBackBuffer(); for (int y = 0; y < 200; y++) { - u16* src = start + (y * 320); - u16* dest = ((u16 *) (buf)) + (y * pitch); + u16 *src = start + (y * 320); + u16 *dest = ((u16 *) (buf)) + (y * pitch); for (int x = 0; x < 320; x++) { *dest++ = *src++; @@ -519,8 +519,8 @@ void OSystem_DS::grabOverlay(OverlayColor* buf, int pitch) { } void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { - u16* bg = (u16 *) DS::get16BitBackBuffer(); - const u16* src = (const u16 *) buf; + u16 *bg = (u16 *) DS::get16BitBackBuffer(); + const u16 *src = (const u16 *) buf; // if (x + w > 256) w = 256 - x; //if (x + h > 256) h = 256 - y; @@ -729,7 +729,7 @@ void OSystem_DS::quit() { swiSoftReset();*/ } -Common::SaveFileManager* OSystem_DS::getSavefileManager() { +Common::SaveFileManager *OSystem_DS::getSavefileManager() { bool forceSram; if (ConfMan.hasKey("forcesramsave", "ds")) { @@ -753,7 +753,7 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager() { } -Graphics::Surface* OSystem_DS::createTempFrameBuffer() { +Graphics::Surface *OSystem_DS::createTempFrameBuffer() { // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing @@ -778,13 +778,13 @@ Graphics::Surface* OSystem_DS::createTempFrameBuffer() { s32 width = DS::getGameWidth(); s32 stride = DS::get8BitBackBufferStride(); - u16* src = DS::get8BitBackBuffer(); - u16* dest = DS::getScalerBuffer(); + u16 *src = DS::get8BitBackBuffer(); + u16 *dest = DS::getScalerBuffer(); for (int y = 0; y < height; y++) { - u16* destLine = dest + (y * (width / 2)); - u16* srcLine = src + (y * (stride / 2)); + u16 *destLine = dest + (y * (width / 2)); + u16 *srcLine = src + (y * (stride / 2)); DC_FlushRange(srcLine, width); @@ -805,7 +805,7 @@ Graphics::Surface* OSystem_DS::createTempFrameBuffer() { size_t imageStrideInBytes = DS::get8BitBackBufferStride(); size_t imageStrideInWords = imageStrideInBytes / 2; - u16* image = (u16 *) DS::get8BitBackBuffer(); + u16 *image = (u16 *) DS::get8BitBackBuffer(); for (int y = 0; y < DS::getGameHeight(); y++) { DC_FlushRange(image + (y * imageStrideInWords), DS::getGameWidth()); for (int x = 0; x < DS::getGameWidth() >> 1; x++) { @@ -851,13 +851,13 @@ void OSystem_DS::setCharactersEntered(int count) { DS::setCharactersEntered(count); } -Common::SeekableReadStream* OSystem_DS::createConfigReadStream() { +Common::SeekableReadStream *OSystem_DS::createConfigReadStream() { Common::FSNode file(DEFAULT_CONFIG_FILE); // consolePrintf("R %s", DEFAULT_CONFIG_FILE); return file.createReadStream(); } -Common::WriteStream* OSystem_DS::createConfigWriteStream() { +Common::WriteStream *OSystem_DS::createConfigWriteStream() { Common::FSNode file(DEFAULT_CONFIG_FILE); // consolePrintf("W %s", DEFAULT_CONFIG_FILE); return file.createWriteStream(); diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index dc8b65a1c8..42419b762e 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -48,13 +48,13 @@ protected: DSSaveFileManager saveManager; #endif GBAMPSaveFileManager mpSaveManager; - Audio::MixerImpl* _mixer; - DefaultTimerManager* _timer; + Audio::MixerImpl *_mixer; + DefaultTimerManager *_timer; Graphics::Surface _framebuffer; bool _frameBufferExists; bool _graphicsEnable; - static OSystem_DS* _instance; + static OSystem_DS *_instance; u16 _palette[256]; u16 _cursorPalette[256]; @@ -68,7 +68,7 @@ protected: int _cursorScale; - Graphics::Surface* createTempFrameBuffer(); + Graphics::Surface *createTempFrameBuffer(); bool _disableCursorPalette; int _gammaValue; @@ -94,7 +94,7 @@ public: virtual int16 getHeight(); virtual int16 getWidth(); virtual void setPalette(const byte *colors, uint start, uint num); - virtual void grabPalette(unsigned char* colors, uint start, uint num); + virtual void grabPalette(unsigned char *colors, uint start, uint num); void restoreHardwarePalette(); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); @@ -139,7 +139,7 @@ public: void addEvent(const Common::Event& e); bool isEventQueueEmpty() const { return queuePos == 0; } - virtual bool grabRawScreen(Graphics::Surface* surf); + virtual bool grabRawScreen(Graphics::Surface *surf); virtual void setFocusRectangle(const Common::Rect& rect); @@ -150,10 +150,10 @@ public: virtual Graphics::Surface *lockScreen(); virtual void unlockScreen(); - virtual Audio::Mixer* getMixer() { return _mixer; } - Audio::MixerImpl* getMixerImpl() { return _mixer; } + virtual Audio::Mixer *getMixer() { return _mixer; } + Audio::MixerImpl *getMixerImpl() { return _mixer; } - virtual Common::TimerManager* getTimerManager() { return _timer; } + virtual Common::TimerManager *getTimerManager() { return _timer; } static int timerHandler(int t); @@ -172,8 +172,8 @@ public: void refreshCursor(); - Common::WriteStream* createConfigWriteStream(); - Common::SeekableReadStream* createConfigReadStream(); + Common::WriteStream *createConfigWriteStream(); + Common::SeekableReadStream *createConfigReadStream(); u16 applyGamma(u16 colour); void setGammaValue(int gamma) { _gammaValue = gamma; } diff --git a/backends/platform/ds/arm9/source/portdefs.cpp b/backends/platform/ds/arm9/source/portdefs.cpp index 0dcdc1d5a3..b75683df3d 100644 --- a/backends/platform/ds/arm9/source/portdefs.cpp +++ b/backends/platform/ds/arm9/source/portdefs.cpp @@ -25,7 +25,7 @@ #include "osystem_ds.h" /* -extern "C" time_t __wrap_time(time_t* t) { +extern "C" time_t __wrap_time(time_t *t) { if (t) { *t = OSystem_DS::instance()->getMillis() / 1000; } diff --git a/backends/platform/ds/arm9/source/ramsave.cpp b/backends/platform/ds/arm9/source/ramsave.cpp index a0f4633988..d8e74d7445 100644 --- a/backends/platform/ds/arm9/source/ramsave.cpp +++ b/backends/platform/ds/arm9/source/ramsave.cpp @@ -38,7 +38,7 @@ DSSaveFile::DSSaveFile() { isTempFile = false; } -DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) { +DSSaveFile::DSSaveFile(SCUMMSave *s, bool compressed, u8 *data) { save = *s; saveData = data; ptr = 0; @@ -46,7 +46,7 @@ DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) { isOpenFlag = true; if (saveCompressed) { - u8* uncompressed = new unsigned char[save.size]; + u8 *uncompressed = new unsigned char[save.size]; if (!uncompressed) consolePrintf("Out of memory allocating %d!\n", save.size); LZ_Uncompress(saveData, uncompressed, save.compressedSize); saveData = uncompressed; @@ -79,7 +79,7 @@ DSSaveFile::~DSSaveFile() { } } -bool DSSaveFile::loadFromSaveRAM(vu8* address) { +bool DSSaveFile::loadFromSaveRAM(vu8 *address) { SCUMMSave newSave; @@ -113,7 +113,7 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) { void DSSaveFile::compress() { if (!saveCompressed) { - unsigned char* compBuffer = new unsigned char[(save.size * 110) / 100]; + unsigned char *compBuffer = new unsigned char[(save.size * 110) / 100]; int compSize = LZ_Compress((u8 *) saveData, compBuffer, save.size); save.compressedSize = compSize; @@ -127,9 +127,9 @@ void DSSaveFile::compress() { } } -int DSSaveFile::saveToSaveRAM(vu8* address) { +int DSSaveFile::saveToSaveRAM(vu8 *address) { - unsigned char* compBuffer; + unsigned char *compBuffer; bool failed; @@ -356,7 +356,7 @@ void DSSaveFileManager::listFiles() { consolePrintf("SRAM free: %d bytes\n", getBytesFree()); } -DSSaveFileManager* DSSaveFileManager::instancePtr = NULL; +DSSaveFileManager *DSSaveFileManager::instancePtr = NULL; DSSaveFile *DSSaveFileManager::openSavefile(const char *filename, bool saveOrLoad) { for (int r = 0; r < 8; r++) { @@ -379,12 +379,12 @@ DSSaveFile *DSSaveFileManager::openSavefile(const char *filename, bool saveOrLoa -DSSaveFile* DSSaveFile::clone() { +DSSaveFile *DSSaveFile::clone() { // consolePrintf("Clone %s %d\n", save.name, save.size); return new DSSaveFile(&save, saveCompressed, saveData); } -void DSSaveFileManager::deleteFile(const char* name) { +void DSSaveFileManager::deleteFile(const char *name) { // consolePrintf("Deleting %s", name); for (int r = 0; r < 8; r++) { if (gbaSave[r].isValid() && (gbaSave[r].matches(name))) { @@ -506,7 +506,7 @@ void DSSaveFileManager::setExtraData(int data) { // Offset of extra data is 31. This overlaps the padding and reserved bytes of the first save entry. // which have not been used up until now. So it should be safe. - vu8* sram = CART_RAM + 31; + vu8 *sram = CART_RAM + 31; *(sram + 0) = 0xF0; // This is an identifier to check *(sram + 1) = 0x0D; // that extra data is present. @@ -518,14 +518,14 @@ void DSSaveFileManager::setExtraData(int data) { } bool DSSaveFileManager::isExtraDataPresent() { - vu8* sram = CART_RAM + 31; + vu8 *sram = CART_RAM + 31; // Check for the identifier return ((*(sram + 0) == 0xF0) && (*(sram + 1) == 0x0D)); } int DSSaveFileManager::getExtraData() { - vu8* sram = CART_RAM + 31; + vu8 *sram = CART_RAM + 31; if (isExtraDataPresent()) { int value = (*(sram + 2) << 24) | (*(sram + 3) << 16) | (*(sram + 4) << 8) | (*(sram + 5)); diff --git a/backends/platform/ds/arm9/source/ramsave.h b/backends/platform/ds/arm9/source/ramsave.h index e74df94952..7b17acb52a 100644 --- a/backends/platform/ds/arm9/source/ramsave.h +++ b/backends/platform/ds/arm9/source/ramsave.h @@ -48,15 +48,15 @@ class DSSaveFile : public Common::InSaveFile, public Common::OutSaveFile { } __attribute__ ((packed)); SCUMMSave save; - u8* saveData; - SCUMMSave* origHeader; + u8 *saveData; + SCUMMSave *origHeader; bool isOpenFlag; bool isTempFile; bool eosReached; public: DSSaveFile(); - DSSaveFile(SCUMMSave* s, bool saveCompressed, u8* data); + DSSaveFile(SCUMMSave *s, bool saveCompressed, u8 *data); ~DSSaveFile(); void reset(); @@ -74,7 +74,7 @@ public: uint32 write(const void *buf, uint32 size); void setName(char *name); - char* getName() { return save.name; } + char *getName() { return save.name; } bool isValid() { return save.isValid; } bool isTemp() { return isTempFile; } @@ -85,14 +85,14 @@ public: void compress(); int getRamUsage() { return sizeof(save) + save.compressedSize; } - char* getRamImage() { return (char *) &save; } + char *getRamImage() { return (char *) &save; } int getSize() { return save.size; } - DSSaveFile* clone(); + DSSaveFile *clone(); - bool loadFromSaveRAM(vu8* address); - int saveToSaveRAM(vu8* address); + bool loadFromSaveRAM(vu8 *address); + int saveToSaveRAM(vu8 *address); @@ -111,19 +111,19 @@ public: class DSSaveFileManager : public Common::SaveFileManager { DSSaveFile gbaSave[8]; - static DSSaveFileManager* instancePtr; + static DSSaveFileManager *instancePtr; int sramBytesFree; public: DSSaveFileManager(); ~DSSaveFileManager(); - static DSSaveFileManager* instance() { return instancePtr; } + static DSSaveFileManager *instance() { return instancePtr; } DSSaveFile *openSavefile(const char *filename, bool saveOrLoad); - virtual Common::OutSaveFile* openForSaving(const Common::String &filename) { return openSavefile(filename.c_str(), true); } - virtual Common::InSaveFile* openForLoading(const Common::String &filename) { return openSavefile(filename.c_str(), false); } + virtual Common::OutSaveFile *openForSaving(const Common::String &filename) { return openSavefile(filename.c_str(), true); } + virtual Common::InSaveFile *openForLoading(const Common::String &filename) { return openSavefile(filename.c_str(), false); } virtual bool removeSavefile(const Common::String &filename); virtual Common::StringArray listSavefiles(const Common::String &pattern); @@ -133,7 +133,7 @@ public: void addBytesFree(int size) { sramBytesFree += size; } int getBytesFree() { return sramBytesFree; } - void deleteFile(char* name); + void deleteFile(char *name); void listFiles(); void formatSram(); diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp index ef931899be..32d7f1aee0 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.cpp +++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp @@ -142,7 +142,7 @@ int keyboardY; static int s_mapBase; static int s_tileBase; -u16* baseAddress; +u16 *baseAddress; bool shiftState; bool capsLockState; @@ -181,7 +181,7 @@ void drawText(int tx, int ty, const char *string, bool highlight) { -void restoreVRAM(int tileBase, int mapBase, u16* saveSpace) { +void restoreVRAM(int tileBase, int mapBase, u16 *saveSpace) { /* for (int r = 0; r < 32 * 32; r++) { ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r] = *saveSpace++; } @@ -191,7 +191,7 @@ void restoreVRAM(int tileBase, int mapBase, u16* saveSpace) { }*/ } -void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) { +void drawKeyboard(int tileBase, int mapBase, u16 *saveSpace) { /* int keyboardDataSize = 4736 * 2; */ for (int r = 0; r < 32 * 32; r++) { @@ -211,8 +211,8 @@ void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) { // this is the font for (int tile = 0; tile < 94; tile++) { - u16* tileAddr = (u16 *) (CHAR_BASE_BLOCK_SUB(tileBase) + ((KEYBOARD_DATA_SIZE) + (tile * 32))); - const u8* src = ((const u8 *) (::_8x8font_tga_raw)) + 18 + tile * 8; + u16 *tileAddr = (u16 *) (CHAR_BASE_BLOCK_SUB(tileBase) + ((KEYBOARD_DATA_SIZE) + (tile * 32))); + const u8 *src = ((const u8 *) (::_8x8font_tga_raw)) + 18 + tile * 8; for (int y = 0 ; y < 8; y++) { for (int x = 0; x < 2; x++) { @@ -256,7 +256,7 @@ void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) { int x = keyboardX; int y = keyboardY; - u16* base = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase)); + u16 *base = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase)); baseAddress = base; for (int r = 0; r < DS_NUM_KEYS; r++) { @@ -314,7 +314,7 @@ bool getKeyboardClosed() { } void setKeyHighlight(int key, bool highlight) { - u16* base = ((u16 *) SCREEN_BASE_BLOCK_SUB(DS::s_mapBase)); + u16 *base = ((u16 *) SCREEN_BASE_BLOCK_SUB(DS::s_mapBase)); if (highlight) { base[(keyboardY + keys[key].y) * 32 + keyboardX + keys[key].x] |= 0x1000; @@ -329,7 +329,7 @@ void setKeyHighlight(int key, bool highlight) { } } -void addAutoComplete(const char* word) { +void addAutoComplete(const char *word) { if (autoCompleteCount == NUM_WORDS) return; strcpy(&autoCompleteWord[autoCompleteCount++][0], word); drawAutoComplete(); @@ -353,7 +353,7 @@ void clearAutoComplete() { void typeCompletion(int current) { Common::Event event; - /* OSystem_DS* system = OSystem_DS::instance(); */ + /* OSystem_DS *system = OSystem_DS::instance(); */ strcat(autoCompleteBuffer, &autoCompleteWord[current][charactersEntered]); strcat(autoCompleteBuffer, " "); @@ -384,7 +384,7 @@ void typeCompletion(int current) { void updateTypeEvents() { if (autoCompleteBuffer[0] != '\0') { Common::Event event; - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); event.kbd.keycode = (Common::KeyCode) autoCompleteBuffer[0]; event.kbd.ascii = autoCompleteBuffer[0]; @@ -443,7 +443,7 @@ void releaseAllKeys() { if (keys[r].pressed) { DS::setKeyHighlight(r, false); - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); Common::Event event; createKeyEvent(r, event); @@ -502,7 +502,7 @@ void addKeyboardEvents() { for (int r = 0; r < DS_NUM_KEYS; r++) { if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) && (ty >= keys[r].y) && (ty <= keys[r].y + 1)) { - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); Common::Event event; // consolePrintf("Key: %d\n", r); @@ -551,7 +551,7 @@ void addKeyboardEvents() { if (keys[r].pressed) { DS::setKeyHighlight(r, false); - OSystem_DS* system = OSystem_DS::instance(); + OSystem_DS *system = OSystem_DS::instance(); Common::Event event; if ((keys[r].character == Common::KEYCODE_INVALID)) { diff --git a/backends/platform/ds/arm9/source/touchkeyboard.h b/backends/platform/ds/arm9/source/touchkeyboard.h index 33dab253a9..0b4495ec39 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.h +++ b/backends/platform/ds/arm9/source/touchkeyboard.h @@ -35,13 +35,13 @@ enum { void createKeyEvent(int keyNum, Common::Event& event); -void drawKeyboard(int tileBase, int mapBase, u16* saveSpace); -void restoreVRAM(int tileBase, int mapBase, u16* saveSpace); +void drawKeyboard(int tileBase, int mapBase, u16 *saveSpace); +void restoreVRAM(int tileBase, int mapBase, u16 *saveSpace); void addKeyboardEvents(); bool getKeyboardClosed(); bool isInsideKeyboard(int x, int y); -void addAutoComplete(const char* word); +void addAutoComplete(const char *word); void clearAutoComplete(); void setCharactersEntered(int count); void releaseAllKeys(); diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp index 035f6a631d..bc734f3f85 100644 --- a/backends/platform/ds/arm9/source/wordcompletion.cpp +++ b/backends/platform/ds/arm9/source/wordcompletion.cpp @@ -14,7 +14,7 @@ namespace DS { char wordBuffer[WORD_BUFFER_SIZE]; int wordBufferPos = 0; -char* wordBufferPtr[MAX_WORD_COUNT]; +char *wordBufferPtr[MAX_WORD_COUNT]; int wordBufferPtrPos = 0; void addAutoCompleteLine(const char *line) { @@ -53,7 +53,7 @@ void addAutoCompleteLine(const char *line) { } } -int stringCompare(const void* a, const void* b) { +int stringCompare(const void *a, const void *b) { const char** as = (const char **) a; const char** bs = (const char **) b; @@ -71,7 +71,7 @@ void sortAutoCompleteWordList() { } // Sends the current available words to the virtual keyboard code for display -bool findWordCompletions(const char* input) { +bool findWordCompletions(const char *input) { int min = 0; int max = wordBufferPtrPos - 1; char *word; @@ -82,7 +82,7 @@ bool findWordCompletions(const char* input) { if (wordBufferPtrPos == 0) return false; - OSystem_DS* system = (OSystem_DS *) g_system; + OSystem_DS *system = (OSystem_DS *) g_system; system->clearAutoComplete(); int start = 0; diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp index fd6da4e9b9..dd9ac35990 100644 --- a/backends/platform/ds/arm9/source/zipreader.cpp +++ b/backends/platform/ds/arm9/source/zipreader.cpp @@ -28,7 +28,7 @@ ZipFile::ZipFile() { // consolePrintf("ZIP file check..."); - char* p = (char *) ZF_SEARCH_START; + char *p = (char *) ZF_SEARCH_START; bool found = false; _zipFile = NULL; @@ -112,7 +112,7 @@ bool ZipFile::currentFileInFolder() { return false; } -void ZipFile::getFileName(char* name) { +void ZipFile::getFileName(char *name) { strncpy(name, (char *) (_currentFile + 1), _currentFile->nameLength); for (int r = 0; name[r] != 0; r++) { @@ -207,7 +207,7 @@ void ZipFile::changeToRoot() { _directory[0] = 0; } -void ZipFile::changeDirectory(const char* dir) { +void ZipFile::changeDirectory(const char *dir) { // consolePrintf("Current dir now '%s'\n", dir); assert(dir && *dir); diff --git a/backends/platform/ds/arm9/source/zipreader.h b/backends/platform/ds/arm9/source/zipreader.h index d1f70942ce..5438c3b95d 100644 --- a/backends/platform/ds/arm9/source/zipreader.h +++ b/backends/platform/ds/arm9/source/zipreader.h @@ -43,12 +43,12 @@ class ZipFile { u16 extraLength; // Length of any extra data } __attribute__ ((packed)); - char* _zipFile; + char *_zipFile; char _directory[128]; bool _allFilesVisible; - FileHeader* _currentFile; + FileHeader *_currentFile; public: ZipFile(); @@ -61,13 +61,13 @@ public: bool findFile(const char *search); // These return the file's data and information - char* getFile(); + char *getFile(); int getFileSize(); - void getFileName(char* name); + void getFileName(char *name); bool isDirectory(); // These set the current directory - void changeDirectory(const char* name); + void changeDirectory(const char *name); void changeToRoot(); void setAllFilesVisible(bool state) { _allFilesVisible = state; } diff --git a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h index f41548f400..c762d1acd1 100644 --- a/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h +++ b/backends/platform/ds/commoninclude/NDS/scummvm_ipc.h @@ -58,9 +58,9 @@ typedef struct sTransferSound { typedef struct _adpcmBuffer { - u8* buffer[8]; + u8 *buffer[8]; bool filled[8]; - u8* arm7Buffer[8]; + u8 *arm7Buffer[8]; bool arm7Dirty[8]; bool semaphore; } adpcmBuffer; |