aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2011-06-10 11:30:11 +0400
committerAlyssa Milburn2011-06-15 17:33:56 +0200
commite535e6e2953ed91e3b66ee74d88af1a715a97f3d (patch)
treee20a9054affe12057b5d9de35d79e9090a9c5333
parentb04f5908980c3b042d8eeba8333f03a1b697b400 (diff)
downloadscummvm-rg350-e535e6e2953ed91e3b66ee74d88af1a715a97f3d.tar.gz
scummvm-rg350-e535e6e2953ed91e3b66ee74d88af1a715a97f3d.tar.bz2
scummvm-rg350-e535e6e2953ed91e3b66ee74d88af1a715a97f3d.zip
DREAMWEB: added keyboard handling
-rw-r--r--engines/dreamweb/dreamweb.cpp23
-rw-r--r--engines/dreamweb/dreamweb.h3
2 files changed, 23 insertions, 3 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index f8a8b55a81..c36e27a760 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -138,6 +138,7 @@ void DreamWebEngine::processEvents() {
}
break;
default:
+ keyPressed(event.kbd.ascii);
break;
}
break;
@@ -183,6 +184,19 @@ void DreamWebEngine::closeFile() {
_file.close();
}
+void DreamWebEngine::keyPressed(uint16 ascii) {
+ debug(1, "key pressed = %04x", ascii);
+ uint8* keybuf = _context.data.ptr(5715, 16); //fixme: some hardcoded offsets are not added as consts
+ uint16 in = (_context.data.word(dreamgen::kBufferin) + 1) % 0x0f;
+ uint16 out = _context.data.word(dreamgen::kBufferout);
+ if (in == out) {
+ warning("keyboard buffer is full");
+ return;
+ }
+ _context.data.word(dreamgen::kBufferin) = in;
+ keybuf[in] = ascii;
+}
+
void DreamWebEngine::mouseCall() {
processEvents();
Common::Point pos = _mouse;
@@ -215,8 +229,10 @@ void DreamWebEngine::fadeDos() {
if (dst[c]) {
--dst[c];
}
+ dst[c] = c / 3;
}
- palette->setPalette(dst, 0, 64);
+ //Common::hexdump(dst, 64 * 3);
+ //palette->setPalette(dst, 0, 64);
waitForVSync();
}
}
@@ -225,7 +241,8 @@ void DreamWebEngine::setPalette() {
PaletteManager *palette = _system->getPaletteManager();
unsigned n = (uint16)_context.cx;
uint8 *colors = _context.ds.ptr(_context.si, n * 3);
- palette->setPalette(colors, _context.al, n);
+ //Common::hexdump(colors, n * 3);
+ //palette->setPalette(colors, _context.al, n);
_context.si += n * 3;
_context.cx = 0;
}
@@ -318,7 +335,7 @@ void quickquit2(Context &context) {
}
void keyboardread(Context &context) {
- ::error("keyboardread");
+ ::error("keyboardread"); //this keyboard int handler, must never be called
}
void resetkeyboard(Context &context) {
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 1e9ace932b..5d2b71b23a 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -89,6 +89,9 @@ public:
void fadeDos();
private:
+
+ void keyPressed(uint16 ascii);
+
const DreamWebGameDescription *_gameDescription;
Common::RandomSource _rnd;
Common::Point _mouse;