diff options
author | Sven Hesse | 2006-12-19 07:38:33 +0000 |
---|---|---|
committer | Sven Hesse | 2006-12-19 07:38:33 +0000 |
commit | 4446f2c851f5b918daeda837905a884a70dfac0f (patch) | |
tree | 50006f242222bc4ebbf85103a20414591c369e40 | |
parent | 457ebfea3c3e630b50f8e2ccf38ec340036c0010 (diff) | |
download | scummvm-rg350-4446f2c851f5b918daeda837905a884a70dfac0f.tar.gz scummvm-rg350-4446f2c851f5b918daeda837905a884a70dfac0f.tar.bz2 scummvm-rg350-4446f2c851f5b918daeda837905a884a70dfac0f.zip |
Fixed backspace and delete in the note-pad
svn-id: r24883
-rw-r--r-- | engines/gob/inter.cpp | 25 | ||||
-rw-r--r-- | engines/gob/inter.h | 4 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 28 | ||||
-rw-r--r-- | engines/gob/inter_v2.cpp | 29 |
4 files changed, 59 insertions, 27 deletions
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 425b3e6df0..2fa2f79645 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -189,31 +189,6 @@ void Inter::funcBlock(int16 retFlag) { return; } -void Inter::storeKey(int16 key) { - WRITE_VAR(12, _vm->_util->getTimeKey() - _vm->_game->_startTimeKey); - - storeMouse(); - WRITE_VAR(1, _vm->_snd->_playingSound); - - if (key == 0x4800) - key = 0x0b; - else if (key == 0x5000) - key = 0x0a; - else if (key == 0x4d00) - key = 0x09; - else if (key == 0x4b00) - key = 0x08; - else if (key == 0x011b) - key = 0x1b; - else if ((key & 0xff) != 0) - key &= 0xff; - - WRITE_VAR(0, key); - - if (key != 0) - _vm->_util->waitKey(); -} - void Inter::checkSwitchTable(char **ppExec) { int16 i; int16 len; diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 7a49045ac5..18f501c262 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -58,13 +58,13 @@ public: char evalExpr(int16 *pRes); char evalBoolResult(void); void funcBlock(int16 retFlag); - void storeKey(int16 key); void checkSwitchTable(char **ppExec); void callSub(int16 retFlag); void initControlVars(char full); void renewTimeInVars(void); void manipulateMap(int16 xPos, int16 yPos, int16 item); virtual int16 loadSound(int16 slot) = 0; + virtual void storeKey(int16 key) = 0; virtual void storeMouse(void) = 0; virtual void animPalette(void) = 0; @@ -89,6 +89,7 @@ public: Inter_v1(GobEngine *vm); virtual ~Inter_v1() {}; virtual int16 loadSound(int16 slot); + virtual void storeKey(int16 key); virtual void storeMouse(void); virtual void animPalette(void); @@ -281,6 +282,7 @@ public: Inter_v2(GobEngine *vm); virtual ~Inter_v2() {}; virtual int16 loadSound(int16 search); + virtual void storeKey(int16 key); virtual void storeMouse(void); virtual void animPalette(void); diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 9ab3f2a97e..a58c526512 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1339,8 +1339,9 @@ bool Inter_v1::o1_keyFunc(char &cmdCount, int16 &counter, int16 &retFlag) { animPalette(); _vm->_draw->blitInvalidated(); + _vm->_video->waitRetrace(_vm->_global->_videoMode); // Gob2 busy-waits here, so add a delay - _vm->_util->longDelay(1); + _vm->_util->delay(1); if (flag != 0) { @@ -2797,6 +2798,31 @@ void Inter_v1::loadMult(void) { } } +void Inter_v1::storeKey(int16 key) { + WRITE_VAR(12, _vm->_util->getTimeKey() - _vm->_game->_startTimeKey); + + storeMouse(); + WRITE_VAR(1, _vm->_snd->_playingSound); + + if (key == 0x4800) + key = 0x0B; + else if (key == 0x5000) + key = 0x0A; + else if (key == 0x4D00) + key = 0x09; + else if (key == 0x4B00) + key = 0x08; + else if (key == 0x011B) + key = 0x1B; + else if ((key & 0xFF) != 0) + key &= 0xFF; + + WRITE_VAR(0, key); + + if (key != 0) + _vm->_util->waitKey(); +} + void Inter_v1::storeMouse(void) { WRITE_VAR(2, _vm->_global->_inter_mouseX); WRITE_VAR(3, _vm->_global->_inter_mouseY); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 5a03aa7586..b070570911 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -2312,6 +2312,35 @@ void Inter_v2::o2_switchTotSub(void) { _vm->_game->switchTotSub(index, skipPlay); } +void Inter_v2::storeKey(int16 key) { + WRITE_VAR(12, _vm->_util->getTimeKey() - _vm->_game->_startTimeKey); + + storeMouse(); + WRITE_VAR(1, _vm->_snd->_playingSound); + + if (key == 0x4800) + key = 0x0B; + else if (key == 0x5000) + key = 0x0A; + else if (key == 0x4D00) + key = 0x09; + else if (key == 0x4B00) + key = 0x08; + else if (key == 0x011B) + key = 0x1B; + else if (key == 0x0E08) + key = 0x19; + else if (key == 0x5300) + key = 0x1A; + else if ((key & 0xFF) != 0) + key &= 0xFF; + + WRITE_VAR(0, key); + + if (key != 0) + _vm->_util->waitKey(); +} + void Inter_v2::storeMouse(void) { int16 x; int16 y; |