[Scummvm-cvs-logs] scummvm master -> 8c3488a973fb93895d542c0b55548bb96101b187
bluegr
md5 at scummvm.org
Mon Dec 26 15:54:48 CET 2011
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1fef9d1f75 DREAMWEB: Convert findAllOpen, fillOpen
3b9b4cb6ba DREAMWEB: Fix a regression in fillOpen() and remove the now unused getOpenedSize()
8c3488a973 DREAMWEB: Remove the now unused ASM style versions of getanyad, getexad, getfreead and getsetad
Commit: 1fef9d1f75948b3d6f10c221ce8289b44b288a7d
https://github.com/scummvm/scummvm/commit/1fef9d1f75948b3d6f10c221ce8289b44b288a7d
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-26T06:54:00-08:00
Commit Message:
DREAMWEB: Convert findAllOpen, fillOpen
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreambase.h
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/object.cpp
engines/dreamweb/stubs.h
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 00053ff..9fd0a2c 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -468,9 +468,11 @@ generator = cpp(context, "DreamGen", blacklist = [
'fadeupmonfirst',
'fadeupyellows',
'femalefan',
+ 'fillopen',
'fillryan',
'fillspace',
'finalframe',
+ 'findallopen',
'findallryan',
'findexobject',
'findfirstpath',
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index ab08436..3f667e8 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -212,6 +212,11 @@ public:
void makeWorn(DynObject *object);
void dropObject();
uint16 findOpenPos();
+ byte getOpenedSlotSize();
+ byte getOpenedSlotCount();
+ void openOb();
+ void findAllOpen();
+ void fillOpen();
// from pathfind.cpp
void turnPathOn(uint8 param);
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 9582ebe..282fab2 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -73,123 +73,6 @@ void DreamGenContext::transferMap() {
_add(data.word(kExframepos), cx);
}
-void DreamGenContext::fillOpen() {
- STACK_CHECK;
- delTextLine();
- getOpenedSize();
- _cmp(ah, 4);
- if (flags.c())
- goto lessthanapage;
- ah = 4;
-lessthanapage:
- al = 1;
- push(ax);
- es = data.word(kBuffers);
- di = (0+(228*13));
- findAllOpen();
- si = (0+(228*13));
- di = (80);
- bx = (58)+96;
- cx = pop();
-openloop1:
- push(cx);
- push(di);
- push(bx);
- ax = es.word(si);
- _add(si, 2);
- push(si);
- push(es);
- _cmp(ch, cl);
- if (flags.c())
- goto nextopenslot;
- obToInv();
-nextopenslot:
- es = pop();
- si = pop();
- bx = pop();
- di = pop();
- cx = pop();
- _add(di, (44));
- _inc(cl);
- _cmp(cl, 5);
- if (!flags.z())
- goto openloop1;
- underTextLine();
-}
-
-void DreamGenContext::findAllOpen() {
- STACK_CHECK;
- push(di);
- cx = 16;
- ax = 0x0ffff;
- _stosw(cx, true);
- di = pop();
- cl = data.byte(kOpenedob);
- dl = data.byte(kOpenedtype);
- ds = data.word(kExtras);
- bx = (0+2080+30000);
- ch = 0;
-findopen1:
- _cmp(ds.byte(bx+3), cl);
- if (!flags.z())
- goto findopen2;
- _cmp(ds.byte(bx+2), dl);
- if (!flags.z())
- goto findopen2;
- _cmp(data.byte(kOpenedtype), 4);
- if (flags.z())
- goto noloccheck;
- al = ds.byte(bx+5);
- _cmp(al, data.byte(kReallocation));
- if (!flags.z())
- goto findopen2;
-noloccheck:
- al = ds.byte(bx+4);
- ah = 0;
- push(di);
- _add(di, ax);
- _add(di, ax);
- al = ch;
- ah = 4;
- _stosw();
- di = pop();
-findopen2:
- _add(bx, 16);
- _inc(ch);
- _cmp(ch, (114));
- if (!flags.z())
- goto findopen1;
- cl = data.byte(kOpenedob);
- dl = data.byte(kOpenedtype);
- push(dx);
- ds = data.word(kFreedat);
- dx = pop();
- bx = 0;
- ch = 0;
-findopen1a:
- _cmp(ds.byte(bx+3), cl);
- if (!flags.z())
- goto findopen2a;
- _cmp(ds.byte(bx+2), dl);
- if (!flags.z())
- goto findopen2a;
- al = ds.byte(bx+4);
- ah = 0;
- push(di);
- _add(di, ax);
- _add(di, ax);
- al = ch;
- ah = 2;
- _stosw();
- di = pop();
-findopen2a:
- _add(bx, 16);
- _inc(ch);
- _cmp(ch, 80);
- if (!flags.z())
- goto findopen1a;
-}
-
void DreamGenContext::getFreeAd() {
STACK_CHECK;
ah = 0;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 0ecdf72..d377489 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -434,8 +434,6 @@ public:
void pickupConts();
void transferMap();
void getSetAd();
- void findAllOpen();
- void fillOpen();
void dreamweb();
void read();
void searchForString();
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index daa45e6..c8127c3 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -277,7 +277,8 @@ void DreamBase::getBackFromOb() {
}
void DreamGenContext::getOpenedSize() {
- //ax = getOpenedSlotCount();
+ //ah = getOpenedSlotSize();
+ //ah = getOpenedSlotCount();
// We need to call the ASM-style versions of get*Ad, as these also set
// bx and es
@@ -300,7 +301,7 @@ void DreamGenContext::getOpenedSize() {
}
}
-byte DreamGenContext::getOpenedSlotCount() {
+byte DreamBase::getOpenedSlotCount() {
byte obj = data.byte(kOpenedob);
switch (data.byte(kOpenedtype)) {
case 4:
@@ -312,7 +313,7 @@ byte DreamGenContext::getOpenedSlotCount() {
}
}
-byte DreamGenContext::getOpenedSlotSize() {
+byte DreamBase::getOpenedSlotSize() {
byte obj = data.byte(kOpenedob);
switch (data.byte(kOpenedtype)) {
case 4:
@@ -324,14 +325,14 @@ byte DreamGenContext::getOpenedSlotSize() {
}
}
-void DreamGenContext::openOb() {
+void DreamBase::openOb() {
uint8 commandLine[64] = "OBJECT NAME ONE ";
copyName(data.byte(kOpenedtype), data.byte(kOpenedob), commandLine);
printMessage(kInventx, kInventy+86, 62, 240, false);
- al = printDirect(commandLine, data.word(kLastxpos) + 5, kInventy+86, 220, false);
+ printDirect(commandLine, data.word(kLastxpos) + 5, kInventy+86, 220, false);
fillOpen();
_openChangeSize = getOpenedSlotCount() * kItempicsize + kInventx;
@@ -1081,4 +1082,52 @@ byte DreamGenContext::transferToEx() {
return pos;
}
+void DreamBase::fillOpen() {
+ delTextLine();
+ uint8 size = getOpenedSlotCount();
+ if (size > 4)
+ size = 4;
+ findAllOpen();
+ uint8 *openInvList = getSegment(data.word(kBuffers)).ptr(kOpeninvlist, 32);
+ for (uint8 i = 0; i < size; ++i) {
+ uint8 index = openInvList[2*i];
+ uint8 type = openInvList[2*i + 1];
+ obToInv(index, type, kInventx + (i-1)*kItempicsize, kInventy + 96);
+ }
+ underTextLine();
+}
+
+void DreamBase::findAllOpen() {
+ uint8 *openInvList = getSegment(data.word(kBuffers)).ptr(kOpeninvlist, 32);
+
+ memset(openInvList, 0xFF, 32);
+
+ const DynObject *obj;
+
+ obj = (const DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, 0);
+ for (uint8 i = 0; i < kNumexobjects; ++i, ++obj) {
+ if (obj->mapad[1] != data.byte(kOpenedob))
+ continue;
+ if (obj->mapad[0] != data.byte(kOpenedtype))
+ continue;
+ if (data.byte(kOpenedtype) != kExObjectType && obj->mapad[3] != data.byte(kReallocation))
+ continue;
+ uint8 slot = obj->mapad[2];
+ assert(slot < 16);
+ openInvList[2*slot] = i;
+ openInvList[2*slot + 1] = kExObjectType;
+ }
+
+ obj = (const DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0);
+ for (uint8 i = 0; i < 80; ++i, ++obj) {
+ if (obj->mapad[1] != data.byte(kOpenedob))
+ continue;
+ if (obj->mapad[0] != data.byte(kOpenedtype))
+ continue;
+ uint8 index = obj->mapad[2];
+ openInvList[2*index] = i;
+ openInvList[2*index + 1] = kFreeObjectType;
+ }
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 9bbf3b3..bd5cd9d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -119,10 +119,7 @@
void processTrigger();
bool execCommand();
void getOpenedSize();
- byte getOpenedSlotSize();
- byte getOpenedSlotCount();
bool checkObjectSizeCPP();
- void openOb();
void identifyOb();
void selectOb();
void findInvPos();
Commit: 3b9b4cb6ba72a93359523a9b7c3c115db3d0aed2
https://github.com/scummvm/scummvm/commit/3b9b4cb6ba72a93359523a9b7c3c115db3d0aed2
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-26T06:54:02-08:00
Commit Message:
DREAMWEB: Fix a regression in fillOpen() and remove the now unused getOpenedSize()
Changed paths:
engines/dreamweb/object.cpp
engines/dreamweb/stubs.h
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index c8127c3..a7a7814 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -276,31 +276,6 @@ void DreamBase::getBackFromOb() {
blank();
}
-void DreamGenContext::getOpenedSize() {
- //ah = getOpenedSlotSize();
- //ah = getOpenedSlotCount();
-
- // We need to call the ASM-style versions of get*Ad, as these also set
- // bx and es
-
- al = data.byte(kOpenedob);
-
- switch (data.byte(kOpenedtype)) {
- case 4:
- getExAd();
- ax = es.word(bx+7);
- break;
- case 2:
- getFreeAd();
- ax = es.word(bx+7);
- break;
- default:
- getSetAd();
- ax = es.word(bx+3);
- break;
- }
-}
-
byte DreamBase::getOpenedSlotCount() {
byte obj = data.byte(kOpenedob);
switch (data.byte(kOpenedtype)) {
@@ -1092,7 +1067,7 @@ void DreamBase::fillOpen() {
for (uint8 i = 0; i < size; ++i) {
uint8 index = openInvList[2*i];
uint8 type = openInvList[2*i + 1];
- obToInv(index, type, kInventx + (i-1)*kItempicsize, kInventy + 96);
+ obToInv(index, type, kInventx + i * kItempicsize, kInventy + 96);
}
underTextLine();
}
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index bd5cd9d..9ab025f 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -118,7 +118,6 @@
void triggerMessage(uint16 index);
void processTrigger();
bool execCommand();
- void getOpenedSize();
bool checkObjectSizeCPP();
void identifyOb();
void selectOb();
Commit: 8c3488a973fb93895d542c0b55548bb96101b187
https://github.com/scummvm/scummvm/commit/8c3488a973fb93895d542c0b55548bb96101b187
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-26T06:54:03-08:00
Commit Message:
DREAMWEB: Remove the now unused ASM style versions of getanyad, getexad, getfreead and getsetad
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/stubs.cpp
engines/dreamweb/use.cpp
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9fd0a2c..e531834 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -500,6 +500,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'gamer',
'gates',
'generalerror',
+ 'getanyad',
'getanyaddir',
'getback1',
'getbackfromob',
@@ -509,8 +510,10 @@ generator = cpp(context, "DreamGen", blacklist = [
'getdestinfo',
'getdimension',
'geteitherad',
+ 'getexad',
'getexpos',
'getflagunderp',
+ 'getfreead',
'getkeyandlogo',
'getlocation',
'getmapad',
@@ -534,6 +537,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getridoftemptext',
'getroomdata',
'getroomspaths',
+ 'getsetad',
'gettime',
'gettingshot',
'getundercentre',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 282fab2..77af051 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -73,57 +73,6 @@ void DreamGenContext::transferMap() {
_add(data.word(kExframepos), cx);
}
-void DreamGenContext::getFreeAd() {
- STACK_CHECK;
- ah = 0;
- cl = 4;
- _shl(ax, cl);
- bx = ax;
- es = data.word(kFreedat);
-}
-
-void DreamGenContext::getExAd() {
- STACK_CHECK;
- ah = 0;
- bx = 16;
- _mul(bx);
- bx = ax;
- es = data.word(kExtras);
- _add(bx, (0+2080+30000));
-}
-
-void DreamGenContext::getAnyAd() {
- STACK_CHECK;
- _cmp(data.byte(kObjecttype), 4);
- if (flags.z())
- goto isex;
- _cmp(data.byte(kObjecttype), 2);
- if (flags.z())
- goto isfree;
- al = data.byte(kCommand);
- getSetAd();
- ax = es.word(bx+4);
- return;
-isfree:
- al = data.byte(kCommand);
- getFreeAd();
- ax = es.word(bx+7);
- return;
-isex:
- al = data.byte(kCommand);
- getExAd();
- ax = es.word(bx+7);
-}
-
-void DreamGenContext::getSetAd() {
- STACK_CHECK;
- ah = 0;
- bx = 64;
- _mul(bx);
- bx = ax;
- es = data.word(kSetdat);
-}
-
void DreamGenContext::pickupConts() {
STACK_CHECK;
al = ds.byte(si+7);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d377489..d3bb80d 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -428,16 +428,12 @@ public:
#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
void dirCom();
- void getAnyAd();
- void getFreeAd();
void dirFile();
void pickupConts();
void transferMap();
- void getSetAd();
void dreamweb();
void read();
void searchForString();
- void getExAd();
void parser();
void transferConToEx();
};
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 8535b17..7c4bfe8 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2725,7 +2725,8 @@ void DreamGenContext::pickupOb(uint8 command, uint8 pos) {
data.byte(kObjecttype) = kFreeObjectType;
data.byte(kItemframe) = command;
data.byte(kCommand) = command;
- getAnyAd();
+ //uint8 dummy;
+ //getAnyAd(&dummy, &dummy); // was in the original source, seems useless here
transferToEx();
}
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 24ea58e..25ed8d5 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -127,9 +127,8 @@ void DreamGenContext::useRoutine() {
data.byte(kPointerpower) = 0;
}
- getAnyAd();
- // CHECKME: Do the callbacks use es:bx ?
- void *obj = es.ptr(bx, 15);
+ uint8 dummy;
+ void *obj = getAnyAd(&dummy, &dummy);
for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) {
const UseListEntry &entry = kUseList[i];
More information about the Scummvm-git-logs
mailing list