diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 30 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 13 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 8 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 25 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
5 files changed, 41 insertions, 37 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a20d03c6b0..789a016f6b 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -11328,35 +11328,6 @@ void DreamGenContext::removefreeobject() { es = pop(); } -void DreamGenContext::findormake() { - STACK_CHECK; - bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)); - push(ax); - es = data.word(kBuffers); - ah = data.byte(kReallocation); -changeloop: - _cmp(es.byte(bx), 255); - if (flags.z()) - goto haventfound; - _cmp(ax, es.word(bx)); - if (!flags.z()) - goto nofoundchange; - _cmp(ch, es.byte(bx+3)); - if (flags.z()) - goto foundchange; -nofoundchange: - _add(bx, 4); - goto changeloop; -foundchange: - ax = pop(); - es.byte(bx+2) = cl; - return; -haventfound: - es.word(bx) = ax; - es.word(bx+2) = cx; - ax = pop(); -} - void DreamGenContext::switchryanon() { STACK_CHECK; data.byte(kRyanon) = 255; @@ -18719,7 +18690,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_issetobonmap: issetobonmap(); break; case addr_placefreeobject: placefreeobject(); break; case addr_removefreeobject: removefreeobject(); break; - case addr_findormake: findormake(); break; case addr_switchryanon: switchryanon(); break; case addr_switchryanoff: switchryanoff(); break; case addr_setallchanges: setallchanges(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 028df367a0..9496c50607 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -307,7 +307,6 @@ public: static const uint16 addr_setallchanges = 0xc704; static const uint16 addr_switchryanoff = 0xc700; static const uint16 addr_switchryanon = 0xc6fc; - static const uint16 addr_findormake = 0xc6f8; static const uint16 addr_removefreeobject = 0xc6f4; static const uint16 addr_placefreeobject = 0xc6f0; static const uint16 addr_issetobonmap = 0xc6ec; @@ -1372,6 +1371,7 @@ public: void getexpos(); void fadedos(); //void fillspace(); + void selectlocation(); //void multiget(); //void autosetwalk(); void fadeupmonfirst(); @@ -1407,7 +1407,7 @@ public: void useelevator5(); void useelevator4(); void useelevator1(); - void attendant(); + //void findormake(); void useelevator3(); void useelevator2(); void buttonone(); @@ -1427,7 +1427,7 @@ public: void slabdoore(); void slabdoord(); void adjustup(); - void readsetdata(); + void slabdoorf(); void loadintotemp(); void loadintroroom(); void saveseg(); @@ -1443,7 +1443,6 @@ public: void showdiary(); void purgealocation(); //void updatepeople(); - void slabdoorf(); void addtopeoplelist(); void hangoncurs(); void sparkydrip(); @@ -1571,7 +1570,7 @@ public: //void doblocks(); void restoreall(); void allpalette(); - void findormake(); + void attendant(); void nextsymbol(); void monks2text(); void clearpalette(); @@ -1868,7 +1867,7 @@ public: void calledensdlift(); void checkinside(); void gates(); - void selectlocation(); + void newgame(); void showwatch(); void turnanypathon(); void restorereels(); @@ -2025,7 +2024,7 @@ public: void getridoftempsp(); void scanfornames(); void setallchanges(); - void newgame(); + void readsetdata(); //void printboth(); void standardload(); void undertextline(); diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 8a9d81c9a5..8b8e1153e5 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -194,3 +194,11 @@ struct Rain { uint8 b5; }; +struct Change { + uint8 b0; + uint8 location; + uint8 b2; + uint8 b3; +}; + + diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 7d809f2ca0..76f6de4d7c 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1041,6 +1041,31 @@ void DreamGenContext::walktotext() { commandwithob(3, data.byte(kCommandtype), data.byte(kCommand)); } +void DreamGenContext::findormake() { + uint8 b0 = al; + uint8 b2 = cl; + uint8 b3 = ch; + findormake(b0, b2, b3); +} + +void DreamGenContext::findormake(uint8 b0, uint8 b2, uint8 b3) { + Change *change = (Change *)segRef(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change)); + while (true) { + if (change->b0 == 0xff) { + change->b0 = b0; + change->location = data.byte(kReallocation); + change->b2 = b2; + change->b3 = b3; + return; + } + if ((b0 == change->b0) && (data.byte(kReallocation) == change->location) && (b3 == change->b3)) { + change->b2 = b2; + return; + } + ++change; + } +} + 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 705fcd90f1..dd5b6399e7 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -149,5 +149,7 @@ void walktotext(); void personnametext(); void findxyfrompath(); + void findormake(); + void findormake(uint8 b0, uint8 b2, uint8 b3); bool isCD(); |