diff options
author | Norbert Lange | 2009-07-17 21:23:54 +0000 |
---|---|---|
committer | Norbert Lange | 2009-07-17 21:23:54 +0000 |
commit | bb64bf008d03e01760a468d0df8cacb164725d41 (patch) | |
tree | d73710df5b07f3fa1ca30e719c1c1f58ebe0b107 /backends/platform/ps2/systemps2.cpp | |
parent | 81ac29ebca30c352646a5b21de512087cb96a672 (diff) | |
parent | 53756ef1d022a959b24c041e18f55eef34e60dd3 (diff) | |
download | scummvm-rg350-bb64bf008d03e01760a468d0df8cacb164725d41.tar.gz scummvm-rg350-bb64bf008d03e01760a468d0df8cacb164725d41.tar.bz2 scummvm-rg350-bb64bf008d03e01760a468d0df8cacb164725d41.zip |
merge with trunk
svn-id: r42574
Diffstat (limited to 'backends/platform/ps2/systemps2.cpp')
-rw-r--r-- | backends/platform/ps2/systemps2.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index f29caf2279..57a03f777d 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -66,6 +66,10 @@ #include "icon.h" #include "ps2temp.h" +#ifdef __PS2_DEBUG__ +#include <debug.h> +#endif + // asm("mfc0 %0, $9\n" : "=r"(tickStart)); extern void *_gp; @@ -95,6 +99,11 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath); extern AsyncFio fio; +#ifdef __PS2_DEBUG__ +extern "C" int gdb_stub_main(int argc, char *argv[]); +extern "C" void breakpoint(void); +#endif + extern "C" int scummvm_main(int argc, char *argv[]); extern "C" int main(int argc, char *argv[]) { @@ -117,6 +126,10 @@ extern "C" int main(int argc, char *argv[]) { sioprintf("Result = %d\n", res); } +#ifdef __PS2_DEBUG__ + gdb_stub_main(argc, argv); +#endif + sioprintf("Creating system\n"); g_system = g_systemPs2 = new OSystem_PS2(argv[0]); @@ -241,6 +254,8 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { _printY = 0; _msgClearTime = 0; _systemQuit = false; + _modeChanged = false; + _screenChangeCount = 0; _screen = new Gs2dScreen(320, 200, TV_DONT_CARE); @@ -327,9 +342,8 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { void OSystem_PS2::init(void) { sioprintf("Timer...\n"); _scummTimerManager = new DefaultTimerManager(); - _scummEventManager = new DefaultEventManager(); _scummMixer = new Audio::MixerImpl(this); - _scummMixer->setOutputRate(44100); + _scummMixer->setOutputRate(48000); _scummMixer->setReady(true); initTimer(); @@ -520,6 +534,9 @@ void OSystem_PS2::initSize(uint width, uint height) { _oldMouseX = width / 2; _oldMouseY = height / 2; + + _modeChanged = true; + _screenChangeCount++; printf("done\n"); } @@ -574,11 +591,11 @@ void OSystem_PS2::delayMillis(uint msecs) { Common::TimerManager *OSystem_PS2::getTimerManager() { return _scummTimerManager; } - +/* Common::EventManager *OSystem_PS2::getEventManager() { - return _scummEventManager; + return getEventManager(); } - +*/ Audio::Mixer *OSystem_PS2::getMixer() { return _scummMixer; } @@ -661,7 +678,7 @@ int16 OSystem_PS2::getOverlayHeight(void) { return _screen->getOverlayHeight(); } -Graphics::Surface *OSystem_PS2::lockScreen() { +Graphics::Surface *OSystem_PS2::lockScreen(void) { return _screen->lockScreen(); } @@ -669,6 +686,10 @@ void OSystem_PS2::unlockScreen(void) { _screen->unlockScreen(); } +void OSystem_PS2::fillScreen(uint32 col) { + _screen->fillScreen(col); +} + const OSystem::GraphicsMode OSystem_PS2::_graphicsMode = { NULL, NULL, 0 }; const OSystem::GraphicsMode *OSystem_PS2::getSupportedGraphicsModes(void) const { @@ -688,7 +709,16 @@ int OSystem_PS2::getDefaultGraphicsMode(void) const { } bool OSystem_PS2::pollEvent(Common::Event &event) { - bool res = _input->pollEvent(&event); + bool res; + + if (_modeChanged) { + _modeChanged = false; + event.type = Common::EVENT_SCREEN_CHANGED; + return true; + } + + res = _input->pollEvent(&event); + if (res && (event.type == Common::EVENT_MOUSEMOVE)) _screen->setMouseXy(event.mouse.x, event.mouse.y); return res; |