From 11adaf6d695c1c6b436ce2cd18d4c59f729c542d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 11 Dec 2011 15:16:57 +0100 Subject: DREAMWEB: Convert 'showNames' --- devtools/tasmrecover/tasm-recover | 1 + engines/dreamweb/dreambase.h | 3 ++ engines/dreamweb/dreamgen.cpp | 70 --------------------------------------- engines/dreamweb/dreamgen.h | 1 - engines/dreamweb/saveload.cpp | 24 ++++++++++++++ 5 files changed, 28 insertions(+), 71 deletions(-) diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index e1d94d6bc6..9c3d150825 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -643,6 +643,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'showmainops', 'showman', 'showmenu', + 'shownames', 'showopbox', 'showoutermenu', 'showouterpad', diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index bc272c1b19..d0bcc9150a 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -90,6 +90,9 @@ public: void printCurs(); void delCurs(); + // from saveload.cpp + void showNames(); + // from sound.cpp void volumeAdjust(); void cancelCh0(); diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c13586101d..fac388bbf7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5656,76 +5656,6 @@ nomatchslot: goto slotloop; } -void DreamGenContext::showNames() { - STACK_CHECK; - dx = data; - es = dx; - si = 1521+1; - di = (60)+21; - bx = (52)+10; - cl = 0; -shownameloop: - push(cx); - push(di); - push(es); - push(bx); - push(si); - al = 4; - _cmp(cl, data.byte(kCurrentslot)); - if (!flags.z()) - goto nomatchslot2; - _cmp(data.byte(kLoadingorsave), 2); - if (!flags.z()) - goto loadmode; - dx = si; - cx = 15; - _add(si, 15); -zerostill: - _dec(si); - _dec(cl); - _cmp(es.byte(si), 1); - if (!flags.z()) - goto foundcharacter; - goto zerostill; -foundcharacter: - data.byte(kCursorpos) = cl; - es.byte(si) = '/'; - es.byte(si+1) = 0; - push(si); - si = dx; - dl = 200; - ah = 0; - printDirect(); - si = pop(); - es.byte(si) = 0; - es.byte(si+1) = 1; - goto afterprintname; -loadmode: - al = 0; - dl = 200; - ah = 0; - data.word(kCharshift) = 91; - printDirect(); - data.word(kCharshift) = 0; - goto afterprintname; -nomatchslot2: - dl = 200; - ah = 0; - printDirect(); -afterprintname: - si = pop(); - bx = pop(); - es = pop(); - di = pop(); - cx = pop(); - _add(si, 17); - _add(bx, 10); - _inc(cl); - _cmp(cl, 7); - if (!flags.z()) - goto shownameloop; -} - void DreamGenContext::createName() { STACK_CHECK; push(ax); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 9d83762417..889a60b357 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -663,7 +663,6 @@ public: void createName(); void getPersonText(); void parser(); - void showNames(); void emergencyPurge(); void quitKey(); void processTrigger(); diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 916c2b56ce..9060a3f000 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -457,4 +457,28 @@ void DreamGenContext::loadSaveBox() { loadIntoTemp("DREAMWEB.G08"); } +// show savegame names (original interface), and set kCursorpos +void DreamBase::showNames() { + for (int slot = 0; slot < 7; ++slot) { + // The first character of the savegame name is unused + Common::String name((char *)data.ptr(kSavenames + 17*slot + 1, 16)); + + if (slot != data.byte(kCurrentslot)) { + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + continue; + } + if (data.byte(kLoadingorsave) != 2) { + data.word(kCharshift) = 91; + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + data.word(kCharshift) = 0; + continue; + } + + int pos = name.size(); + data.byte(kCursorpos) = pos; + name += '/'; // cursor character + printDirect((const uint8 *)name.c_str(), kOpsx + 21, kOpsy + 10*slot + 10, 200, false); + } +} + } // End of namespace DreamGen -- cgit v1.2.3