diff options
author | Filippos Karapetis | 2011-12-13 00:53:36 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-13 00:54:51 +0200 |
commit | c452bf9c1268155bd896b2f42c003c8eda110e84 (patch) | |
tree | 716d2fb12686cd8cbc3791a92290fe0de48baa62 | |
parent | 6d2723400662c2b7d75bf6317807770b4d370caf (diff) | |
download | scummvm-rg350-c452bf9c1268155bd896b2f42c003c8eda110e84.tar.gz scummvm-rg350-c452bf9c1268155bd896b2f42c003c8eda110e84.tar.bz2 scummvm-rg350-c452bf9c1268155bd896b2f42c003c8eda110e84.zip |
DREAMWEB: Port 'selectslot' to C++
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 52 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 35 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
5 files changed, 37 insertions, 53 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index b663a01fba..566ad8aced 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -663,6 +663,7 @@ generator = cpp(context, "DreamGen", blacklist = [ 'security', 'seecommandtail', 'selectlocation', + 'selectslot', 'selectslot2', 'set16colpalette', 'setallchanges', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index b917f58e87..7ab361b264 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4532,58 +4532,6 @@ void DreamGenContext::findText1() { si = ax; } -void DreamGenContext::selectSlot() { - STACK_CHECK; - _cmp(data.byte(kCommandtype), 244); - if (flags.z()) - goto alreadysel; - data.byte(kCommandtype) = 244; - al = 45; - commandOnly(); -alreadysel: - ax = data.word(kMousebutton); - _cmp(ax, 1); - if (!flags.z()) - return /* (noselslot) */; - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (noselslot) */; - _cmp(data.byte(kLoadingorsave), 3); - if (!flags.z()) - goto notnocurs; - _dec(data.byte(kLoadingorsave)); -notnocurs: - oldToNames(); - ax = data.word(kMousey); - _sub(ax, (52)+4); - cl = -1; -getslotnum: - _inc(cl); - _sub(ax, 11); - if (!flags.c()) - goto getslotnum; - data.byte(kCurrentslot) = cl; - delPointer(); - showOpBox(); - showSlots(); - showNames(); - _cmp(data.byte(kLoadingorsave), 1); - if (flags.z()) - goto isloadmode; - showSaveOps(); - readMouse(); - showPointer(); - workToScreen(); - delPointer(); - return; -isloadmode: - showLoadOps(); - readMouse(); - showPointer(); - workToScreen(); - delPointer(); -} - void DreamGenContext::showSlots() { STACK_CHECK; di = (60)+7; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f146649b61..3bb554e8f7 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -528,7 +528,6 @@ public: void getKeyAndLogo(); void selectOb(); void receptionist(); - void selectSlot(); void fadeUpMon(); void showDiaryPage(); void reExFromInv(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index e52ccf03f3..97dad08298 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -4476,4 +4476,39 @@ void DreamGenContext::entryAnims() { } } +void DreamGenContext::selectSlot() { + if (data.byte(kCommandtype) != 244) { + data.byte(kCommandtype) = 244; + commandOnly(45); + } + + if (data.word(kMousebutton) != 1 || data.word(kMousebutton) == data.word(kOldbutton)) + return; // noselslot + if (data.byte(kLoadingorsave) == 3) + data.byte(kLoadingorsave)--; + + oldToNames(); + uint16 y = data.word(kMousey) - (kOpsy + 4); + byte currentSlot = (byte)-1; + + do { + currentSlot++; + y -= 11; + } while (y >= 11); + + data.byte(kCurrentslot) = currentSlot; + delPointer(); + showOpBox(); + showSlots(); + showNames(); + if (data.byte(kLoadingorsave) == 1) + showLoadOps(); + else + showSaveOps(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 4376f5b42d..b32f5460ec 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -476,6 +476,7 @@ void afterIntroRoom(); void gettingShot(); void redrawMainScrn(); + void selectSlot(); void selectSlot2(); void blank(); void allPointer(); |