diff options
author | Max Horn | 2011-12-13 14:04:10 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-14 12:46:09 +0100 |
commit | e44a79fdd49e746947cbb88e3982dc8c89e2ae44 (patch) | |
tree | b3f79edc8f67a3e91708fecde48006844dcdef78 /engines/dreamweb/monitor.cpp | |
parent | a87a63c1bd45c925cc4d85458ccd78c82557cd18 (diff) | |
download | scummvm-rg350-e44a79fdd49e746947cbb88e3982dc8c89e2ae44.tar.gz scummvm-rg350-e44a79fdd49e746947cbb88e3982dc8c89e2ae44.tar.bz2 scummvm-rg350-e44a79fdd49e746947cbb88e3982dc8c89e2ae44.zip |
DREAMWEB: Convert makeCaps to C++, fix bug in delChar
Diffstat (limited to 'engines/dreamweb/monitor.cpp')
-rw-r--r-- | engines/dreamweb/monitor.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp index dba0d56c31..5d0987b29e 100644 --- a/engines/dreamweb/monitor.cpp +++ b/engines/dreamweb/monitor.cpp @@ -185,7 +185,7 @@ void DreamBase::printLogo() { showCurrentFile(); } -void DreamGenContext::input() { +void DreamBase::input() { char *inputLine = (char *)data.ptr(kInputline, 64); memset(inputLine, 0, 64); data.word(kCurpos) = 0; @@ -215,9 +215,7 @@ void DreamGenContext::input() { continue; if ((currentKey == 32) && (data.word(kCurpos) == 0)) continue; - al = currentKey; - makeCaps(); - currentKey = al; + currentKey = makeCaps(currentKey); inputLine[data.word(kCurpos) * 2 + 0] = currentKey; if (currentKey > 'Z') continue; @@ -231,7 +229,18 @@ void DreamGenContext::input() { } } -void DreamGenContext::delChar() { +void DreamGenContext::makeCaps() { + al = makeCaps(al); +} + +byte DreamBase::makeCaps(byte c) { + // TODO: Replace calls to this by toupper() ? + if (c >= 'a') + c -= 'a' - 'A'; // = 32 + return c; +} + +void DreamBase::delChar() { char *inputLine = (char *)data.ptr(kInputline, 0); --data.word(kCurpos); inputLine[data.word(kCurpos) * 2] = 0; @@ -241,7 +250,7 @@ void DreamGenContext::delChar() { uint16 offset = data.word(kCurpos); offset = ((offset & 0x00ff) << 8) | ((offset & 0xff00) >> 8); multiPut(mapStore() + offset, data.word(kMonadx), data.word(kMonady), 8, 8); - multiDump(data.word(kMonadx), data.word(kMonady), al, 8); + multiDump(data.word(kMonadx), data.word(kMonady), 8, 8); } void DreamBase::printCurs() { |