[Scummvm-cvs-logs] scummvm master -> f4207b8149f562381f6a1b6ea4a908a6be9221c5
tramboi
bertrand_augereau at yahoo.fr
Sat Aug 20 15:09:38 CEST 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:
b17561dd09 DREAMWEB: 'deletetaken' ported to C++
3affb925d5 DREAMWEB: Set objects have a four char name tag
f4207b8149 DREAMWEB: 'placesetobject' and 'removesetobject' ported to C++
Commit: b17561dd09c3a09e6c1a084a8006373e60f079b6
https://github.com/scummvm/scummvm/commit/b17561dd09c3a09e6c1a084a8006373e60f079b6
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-20T05:19:36-07:00
Commit Message:
DREAMWEB: 'deletetaken' ported to C++
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/stubs.cpp
engines/dreamweb/stubs.h
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index c671111..6b95f3d 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -137,6 +137,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'findormake',
'setallchanges',
'dochange',
+ 'deletetaken',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0b3e57f..b3ca750 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5255,31 +5255,6 @@ doplace:
delpointer();
}
-void DreamGenContext::deletetaken() {
- STACK_CHECK;
- es = data.word(kFreedat);
- ah = data.byte(kReallocation);
- ds = data.word(kExtras);
- si = (0+2080+30000);
- cx = (114);
-takenloop:
- al = ds.byte(si+11);
- _cmp(al, ah);
- if (!flags.z())
- goto notinhere;
- bl = ds.byte(si+1);
- bh = 0;
- _add(bx, bx);
- _add(bx, bx);
- _add(bx, bx);
- _add(bx, bx);
- es.byte(bx+2) = 254;
-notinhere:
- _add(si, 16);
- if (--cx)
- goto takenloop;
-}
-
void DreamGenContext::outofinv() {
STACK_CHECK;
findinvpos();
@@ -18424,7 +18399,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_swapwithinv: swapwithinv(); break;
case addr_swapwithopen: swapwithopen(); break;
case addr_intoinv: intoinv(); break;
- case addr_deletetaken: deletetaken(); break;
case addr_outofinv: outofinv(); break;
case addr_getfreead: getfreead(); break;
case addr_getexad: getexad(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 7756a58..a6dff60 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -506,7 +506,6 @@ public:
static const uint16 addr_getexad = 0xc3a8;
static const uint16 addr_getfreead = 0xc3a4;
static const uint16 addr_outofinv = 0xc3a0;
- static const uint16 addr_deletetaken = 0xc39c;
static const uint16 addr_intoinv = 0xc398;
static const uint16 addr_swapwithopen = 0xc394;
static const uint16 addr_swapwithinv = 0xc390;
@@ -1638,7 +1637,7 @@ public:
void errormessage1();
void clearchanges();
void errormessage3();
- void deletetaken();
+ //void deletetaken();
void putundermenu();
void checkifex();
void intromagic2();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 39c6e14..2968a5e 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1101,6 +1101,20 @@ void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) {
}
}
+void DreamGenContext::deletetaken() {
+ ds = data.word(kExtras);
+ si = kExdata;
+ FreeObject *freeObjects = (FreeObject *)segRef(data.word(kFreedat)).ptr(0, 0);
+ for(size_t i = 0; i < kNumexobjects; ++i) {
+ uint8 location = ds.byte(si+11);
+ if (location == data.byte(kReallocation)) {
+ uint8 index = ds.byte(si+1);
+ freeObjects[index].b2 = 254;
+ }
+ si += 16;
+ }
+}
+
bool DreamGenContext::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6d18ce4..3ffc608 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -156,5 +156,6 @@
void setallchanges();
void dochange();
void dochange(uint8 index, uint8 value, uint8 type);
+ void deletetaken();
bool isCD();
Commit: 3affb925d57fee73d31cfd790ff3f7c6b722488b
https://github.com/scummvm/scummvm/commit/3affb925d57fee73d31cfd790ff3f7c6b722488b
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-20T05:19:36-07:00
Commit Message:
DREAMWEB: Set objects have a four char name tag
Changed paths:
engines/dreamweb/structs.h
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index e472561..7e77bdf 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -67,10 +67,7 @@ struct ObjData {
uint8 b9;
uint8 b10;
uint8 b11;
- uint8 b12;
- uint8 b13;
- uint8 b14;
- uint8 b15;
+ uint8 name[4];
uint8 b16;
uint8 b17;
uint8 b18[13]; // NB: Don't know the size yet
Commit: f4207b8149f562381f6a1b6ea4a908a6be9221c5
https://github.com/scummvm/scummvm/commit/f4207b8149f562381f6a1b6ea4a908a6be9221c5
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-20T05:54:39-07:00
Commit Message:
DREAMWEB: 'placesetobject' and 'removesetobject' ported to C++
Changed paths:
devtools/tasmrecover/tasm-recover
engines/dreamweb/dreamgen.cpp
engines/dreamweb/dreamgen.h
engines/dreamweb/stubs.cpp
engines/dreamweb/stubs.h
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 6b95f3d..004a4c8 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -138,6 +138,8 @@ generator = cpp(context, "DreamGen", blacklist = [
'setallchanges',
'dochange',
'deletetaken',
+ 'placesetobject',
+ 'removesetobject',
], skip_output = [
# These functions are processed but not output
'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index b3ca750..7a48d73 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -11243,32 +11243,6 @@ void DreamGenContext::findpuztext() {
si = ax;
}
-void DreamGenContext::placesetobject() {
- STACK_CHECK;
- push(es);
- push(bx);
- cl = 0;
- ch = 0;
- findormake();
- getsetad();
- es.byte(bx+58) = 0;
- bx = pop();
- es = pop();
-}
-
-void DreamGenContext::removesetobject() {
- STACK_CHECK;
- push(es);
- push(bx);
- cl = 255;
- ch = 0;
- findormake();
- getsetad();
- es.byte(bx+58) = 255;
- bx = pop();
- es = pop();
-}
-
void DreamGenContext::issetobonmap() {
STACK_CHECK;
push(es);
@@ -18595,8 +18569,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_putbackobstuff: putbackobstuff(); break;
case addr_showpuztext: showpuztext(); break;
case addr_findpuztext: findpuztext(); break;
- case addr_placesetobject: placesetobject(); break;
- case addr_removesetobject: removesetobject(); break;
case addr_issetobonmap: issetobonmap(); break;
case addr_placefreeobject: placefreeobject(); break;
case addr_removefreeobject: removefreeobject(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index a6dff60..bca9cc6 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -308,8 +308,6 @@ public:
static const uint16 addr_removefreeobject = 0xc6f4;
static const uint16 addr_placefreeobject = 0xc6f0;
static const uint16 addr_issetobonmap = 0xc6ec;
- static const uint16 addr_removesetobject = 0xc6e8;
- static const uint16 addr_placesetobject = 0xc6e4;
static const uint16 addr_findpuztext = 0xc6e0;
static const uint16 addr_showpuztext = 0xc6dc;
static const uint16 addr_putbackobstuff = 0xc6d8;
@@ -1578,7 +1576,7 @@ public:
void copper();
void folderhints();
void openhoteldoor();
- void removesetobject();
+ //void removesetobject();
//void dumptimedtext();
//void frameoutfx();
void blank();
@@ -1996,7 +1994,7 @@ public:
//void getmapad();
void getlocation();
void geteitherad();
- void placesetobject();
+ //void placesetobject();
void drawflags();
void zoomonoff();
void updatesymboltop();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 2968a5e..67811f9 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -840,12 +840,10 @@ void DreamGenContext::fillspace() {
void DreamGenContext::dealwithspecial(uint8 firstParam, uint8 secondParam) {
uint8 type = firstParam - 220;
if (type == 0) {
- al = secondParam;
- placesetobject();
+ placesetobject(secondParam);
data.byte(kHavedoneobs) = 1;
} else if (type == 1) {
- al = secondParam;
- removesetobject();
+ removesetobject(secondParam);
data.byte(kHavedoneobs) = 1;
} else if (type == 2) {
al = secondParam;
@@ -1115,6 +1113,24 @@ void DreamGenContext::deletetaken() {
}
}
+void DreamGenContext::placesetobject() {
+ placesetobject(al);
+}
+
+void DreamGenContext::placesetobject(uint8 index) {
+ findormake(index, 0, 0);
+ getsetad(index)->b58[0] = 0;
+}
+
+void DreamGenContext::removesetobject() {
+ removesetobject(al);
+}
+
+void DreamGenContext::removesetobject(uint8 index) {
+ findormake(index, 0xff, 0);
+ getsetad(index)->b58[0] = 0xff;
+}
+
bool DreamGenContext::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 3ffc608..61a65a3 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -158,4 +158,8 @@
void dochange(uint8 index, uint8 value, uint8 type);
void deletetaken();
bool isCD();
+ void placesetobject();
+ void placesetobject(uint8 index);
+ void removesetobject();
+ void removesetobject(uint8 index);
More information about the Scummvm-git-logs
mailing list