From 49d1872876d9f26f8a30fa81056a6adea5cb30d2 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sat, 3 Sep 2011 13:50:59 +0200 Subject: DREAMWEB: 'turnanypathon' and 'turnanypathoff' ported to C++ --- engines/dreamweb/dreamgen.cpp | 54 ------------------------------------------- engines/dreamweb/dreamgen.h | 14 +++++------ engines/dreamweb/pathfind.cpp | 21 +++++++++++++++++ engines/dreamweb/stubs.h | 4 ++++ 4 files changed, 31 insertions(+), 62 deletions(-) (limited to 'engines/dreamweb') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 9bd4f0ee63..11d2a5117d 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -14946,58 +14946,6 @@ gotfirst: al = es.byte(bx+6); } -void DreamGenContext::turnanypathon() { - STACK_CHECK; - push(ax); - push(ax); - cl = 255; - ch = ah; - _add(ch, 100); - findormake(); - ax = pop(); - al = ah; - ah = 0; - cx = 144; - _mul(cx); - es = data.word(kReels); - bx = (0); - _add(bx, ax); - ax = pop(); - ah = 0; - _add(ax, ax); - _add(ax, ax); - _add(ax, ax); - _add(bx, ax); - al = 255; - es.byte(bx+6) = al; -} - -void DreamGenContext::turnanypathoff() { - STACK_CHECK; - push(ax); - push(ax); - cl = 0; - ch = ah; - _add(ch, 100); - findormake(); - ax = pop(); - al = ah; - ah = 0; - cx = 144; - _mul(cx); - es = data.word(kReels); - bx = (0); - _add(bx, ax); - ax = pop(); - ah = 0; - _add(ax, ax); - _add(ax, ax); - _add(ax, ax); - _add(bx, ax); - al = 0; - es.byte(bx+6) = al; -} - void DreamGenContext::checkifpathison() { STACK_CHECK; push(ax); @@ -17970,8 +17918,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_isitdescribed: isitdescribed(); break; case addr_findpathofpoint: findpathofpoint(); break; case addr_findfirstpath: findfirstpath(); break; - case addr_turnanypathon: turnanypathon(); break; - case addr_turnanypathoff: turnanypathoff(); break; case addr_checkifpathison: checkifpathison(); break; case addr_afternewroom: afternewroom(); break; case addr_atmospheres: atmospheres(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 6291994bb2..6a991878cd 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -111,8 +111,6 @@ public: static const uint16 addr_atmospheres = 0xca0c; static const uint16 addr_afternewroom = 0xca08; static const uint16 addr_checkifpathison = 0xca04; - static const uint16 addr_turnanypathoff = 0xca00; - static const uint16 addr_turnanypathon = 0xc9fc; static const uint16 addr_findfirstpath = 0xc9f0; static const uint16 addr_findpathofpoint = 0xc9ec; static const uint16 addr_isitdescribed = 0xc9e8; @@ -1305,7 +1303,7 @@ public: void bresenhams(); void getbackfromops(); //void frameoutv(); - void opensarters(); + void showbyte(); void screenupdate(); //void addlength(); void wornerror(); @@ -1317,7 +1315,7 @@ public: void mainscreen(); void watchreel(); void showfolder(); - void turnanypathoff(); + //void turnanypathoff(); void openfilefromc(); void gettime(); //void clearwork(); @@ -1342,7 +1340,7 @@ public: void opentomb(); //void makename(); void buttonfour(); - void dosometalk(); + void restoreall(); //void lockmon(); //void dochange(); void getanyaddir(); @@ -1418,7 +1416,6 @@ public: //void cancelch1(); void loadold(); void loadtempcharset(); - void showbyte(); void useslab(); void dumpzoom(); //void aboutturn(); @@ -1525,7 +1522,7 @@ public: void wearwatch(); void runintroseq(); //void doblocks(); - void restoreall(); + void opensarters(); //void delpointer(); void attendant(); void nextsymbol(); @@ -1828,7 +1825,7 @@ public: void gates(); void newgame(); void showwatch(); - void turnanypathon(); + //void turnanypathon(); void restorereels(); void setwalk(); void useroutine(); @@ -1992,6 +1989,7 @@ public: void emergencypurge(); void usemenu(); void alleybarksound(); + void dosometalk(); void usecart(); void intromusic(); void quitkey(); diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp index 4b1d590bec..f7fbb854bc 100644 --- a/engines/dreamweb/pathfind.cpp +++ b/engines/dreamweb/pathfind.cpp @@ -51,6 +51,27 @@ void DreamGenContext::turnpathoff(uint8 param) { roomsPaths[8 * param + 6] = 0x00; } +void DreamGenContext::turnanypathon(uint8 param, uint8 room) { + findormake(param, 0xff, room + 100); + uint8 *paths = segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); + paths[8 * param + 6] = 0xff; +} + + +void DreamGenContext::turnanypathon() { + turnanypathon(al, ah); +} + +void DreamGenContext::turnanypathoff(uint8 param, uint8 room) { + findormake(param, 0x00, room + 100); + uint8 *paths = segRef(data.word(kReels)).ptr(kPathdata + 144 * room, 0); + paths[8 * param + 6] = 0x00; +} + +void DreamGenContext::turnanypathoff() { + turnanypathoff(al, ah); +} + void DreamGenContext::getroomspaths() { es = data.word(kReels); bx = data.byte(kRoomnum) * 144; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 57016a4f67..8244e5e218 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -107,6 +107,10 @@ void turnpathoff(uint8 param); void turnpathon(); void turnpathoff(); + void turnanypathon(uint8 param, uint8 room); + void turnanypathoff(uint8 param, uint8 room); + void turnanypathon(); + void turnanypathoff(); void getroomspaths(); uint8 *getroomspathsCPP(); void makebackob(SetObject *objData); -- cgit v1.2.3