aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-01-21 04:27:32 +0000
committerMax Horn2009-01-21 04:27:32 +0000
commit39e3c76436a8fd9dcdb9c3381f03b2559b96778c (patch)
treef923bcfa90c758432be5c36fbee39090c64ebc74
parent023fcd05a3e6e1b7087f4125789b482220225964 (diff)
downloadscummvm-rg350-39e3c76436a8fd9dcdb9c3381f03b2559b96778c.tar.gz
scummvm-rg350-39e3c76436a8fd9dcdb9c3381f03b2559b96778c.tar.bz2
scummvm-rg350-39e3c76436a8fd9dcdb9c3381f03b2559b96778c.zip
More cleanup
svn-id: r35977
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp70
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp11
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h14
3 files changed, 35 insertions, 60 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index 492b7384ec..be02e0cd21 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -325,8 +325,7 @@ void uploadSpriteGfx();
TransferSound soundControl;
-bool isCpuScalerEnabled()
-{
+bool isCpuScalerEnabled() {
return cpuScalerEnable || !displayModeIs8Bit;
}
@@ -372,8 +371,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;
@@ -445,7 +443,7 @@ void saveGameBackBuffer() {
// Sometimes the only copy of the game screen is in video memory.
// So, I lock the video memory here, as if I'm going to modify it. This
// forces OSystem_DS to create a system memory copy if one doesn't exist.
- // This will be automatially resotred by OSystem_DS::updateScreen().
+ // This will be automatially restored by OSystem_DS::updateScreen().
OSystem_DS::instance()->lockScreen();
OSystem_DS::instance()->unlockScreen();
@@ -578,8 +576,7 @@ void displayMode8Bit() {
displayModeIs8Bit = true;
- if (isCpuScalerEnabled())
- {
+ if (isCpuScalerEnabled()) {
videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
@@ -598,9 +595,7 @@ void displayMode8Bit() {
BG3_YDX = 0;
BG3_YDY = (int) ((200.0f / 192.0f) * 256);
- }
- else
- {
+ } else {
videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
@@ -693,10 +688,8 @@ void checkSleepMode() {
}
}
-void setShowCursor(bool enable)
-{
- if ((currentGame) && (currentGame->control == CONT_SCUMM_SAMNMAX))
- {
+void setShowCursor(bool enable) {
+ if ((currentGame) && (currentGame->control == CONT_SCUMM_SAMNMAX)) {
if (cursorEnable) {
sprites[1].attribute[0] = ATTR0_BMP | 150;
} else {
@@ -708,42 +701,40 @@ void setShowCursor(bool enable)
cursorEnable = enable;
}
-void setMouseCursorVisible(bool enable)
-{
+void setMouseCursorVisible(bool enable) {
mouseCursorVisible = enable;
}
void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY) {
+ int off;
+
mouseHotspotX = hotspotX;
mouseHotspotY = hotspotY;
//consolePrintf("Set cursor icon %d, %d\n", w, h);
- {
- int off = 128*64;
+ off = 128*64;
- memset(SPRITE_GFX + off, 0, 32 * 32 * 2);
- memset(SPRITE_GFX_SUB + off, 0, 32 * 32 * 2);
+ memset(SPRITE_GFX + off, 0, 32 * 32 * 2);
+ memset(SPRITE_GFX_SUB + off, 0, 32 * 32 * 2);
- for (uint y=0; y<h; y++) {
- for (uint x=0; x<w; x++) {
- int color = icon[y*w+x];
+ for (uint y=0; y<h; y++) {
+ for (uint x=0; x<w; x++) {
+ int color = icon[y*w+x];
- //consolePrintf("%d:%d ", color, OSystem_DS::instance()->getDSPaletteEntry(color));
+ //consolePrintf("%d:%d ", color, OSystem_DS::instance()->getDSPaletteEntry(color));
- if (color == keycolor) {
- SPRITE_GFX[off+(y)*32+x] = 0x0000; // black background
- SPRITE_GFX_SUB[off+(y)*32+x] = 0x0000; // black background
- } else {
- SPRITE_GFX[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
- SPRITE_GFX_SUB[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
- }
+ if (color == keycolor) {
+ SPRITE_GFX[off+(y)*32+x] = 0x0000; // black background
+ SPRITE_GFX_SUB[off+(y)*32+x] = 0x0000; // black background
+ } else {
+ SPRITE_GFX[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
+ SPRITE_GFX_SUB[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
}
}
-
}
if (currentGame->control != CONT_SCUMM_SAMNMAX)
@@ -752,7 +743,7 @@ void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX,
uint16 border = RGB15(24,24,24) | 0x8000;
- int off = 176*64;
+ off = 176*64;
memset(SPRITE_GFX_SUB+off, 0, 64*64*2);
memset(SPRITE_GFX+off, 0, 64*64*2);
@@ -793,7 +784,7 @@ void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX,
}
- if ((cursorEnable)) {
+ if (cursorEnable) {
sprites[1].attribute[0] = ATTR0_BMP | 150;
sprites[1].attribute[1] = ATTR1_SIZE_64 | pos;
sprites[1].attribute[2] = ATTR2_ALPHA(1) | 176;
@@ -891,19 +882,14 @@ void displayMode16BitFlipBuffer() {
// highBuffer = !highBuffer;
// BG3_CR = BG_BMP16_512x256 | BG_BMP_RAM(highBuffer? 1: 0);
- if (isCpuScalerEnabled())
- {
+ if (isCpuScalerEnabled()) {
Rescale_320x256x1555_To_256x256x1555(BG_GFX, back, 512, 512);
- }
- else
- {
+ } else {
for (int r = 0; r < 512 * 256; r++) {
*(BG_GFX + r) = *(back + r);
}
}
- }
- else if (isCpuScalerEnabled())
- {
+ } else if (isCpuScalerEnabled()) {
//#define SCALER_PROFILE
#ifdef SCALER_PROFILE
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index a9718b4c3c..0f063e14f4 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -59,7 +59,7 @@ OSystem_DS::~OSystem_DS() {
}
int OSystem_DS::timerHandler(int t) {
- DSTimerManager *tm = (DSTimerManager *)g_system->getTimerManager();
+ DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager();
tm->handler();
return t;
}
@@ -68,9 +68,9 @@ void OSystem_DS::initBackend() {
ConfMan.setInt("autosave_period", 0);
ConfMan.setBool("FM_medium_quality", true);
- _mixer = new DSAudioMixer(this);
- _timer = new DSTimerManager();
- DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
+ _mixer = new Audio::MixerImpl(this);
+ _timer = new DefaultTimerManager();
+ DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
if (ConfMan.hasKey("22khzaudio", "ds") && ConfMan.getBool("22khzaudio", "ds")) {
DS::startSound(22050, 8192);
@@ -370,8 +370,7 @@ void OSystem_DS::updateScreen() {
// FIXME: Evil game specific hack.
// Force back buffer usage for Nippon Safes, as it doesn't double buffer it's output
if (DS::getControlType() == DS::CONT_NIPPON) {
- OSystem_DS::instance()->lockScreen();
- OSystem_DS::instance()->unlockScreen();
+ lockScreen();
}
}
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index ce494011d0..384e39bc74 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -33,16 +33,6 @@
#include "sound/mixer_intern.h"
#include "graphics/surface.h"
-class DSAudioMixer : public Audio::MixerImpl {
-
-public:
- DSAudioMixer(OSystem* system) : Audio::MixerImpl(system) { }
-};
-
-class DSTimerManager : public DefaultTimerManager {
-};
-
-
class OSystem_DS : public OSystem {
protected:
@@ -56,8 +46,8 @@ protected:
DSSaveFileManager saveManager;
#endif
GBAMPSaveFileManager mpSaveManager;
- DSAudioMixer* _mixer;
- DSTimerManager* _timer;
+ Audio::MixerImpl* _mixer;
+ DefaultTimerManager* _timer;
Graphics::Surface _framebuffer;
bool _frameBufferExists;
bool _graphicsEnable;