aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir2011-06-05 14:49:56 +0400
committerAlyssa Milburn2011-06-15 17:29:30 +0200
commit181428e65e0039179b08986c4026ab6ba54cd01c (patch)
treec72a4eace02ad5bb5721d6a74b5a96316fcbc668
parent51f44779ca432809a21ac867b87d20e85fcc807f (diff)
downloadscummvm-rg350-181428e65e0039179b08986c4026ab6ba54cd01c.tar.gz
scummvm-rg350-181428e65e0039179b08986c4026ab6ba54cd01c.tar.bz2
scummvm-rg350-181428e65e0039179b08986c4026ab6ba54cd01c.zip
DREAMWEB: started integration of stubs
-rw-r--r--engines/dreamweb/dreamgen.cpp17295
-rw-r--r--engines/dreamweb/dreamgen.h51
-rw-r--r--engines/dreamweb/dreamweb.cpp4
3 files changed, 8625 insertions, 8725 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 06aed609af..5b075a14fe 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2,487 +2,487 @@
namespace dreamgen {
-static inline void seecommandtail(Context &context);
-static inline void checkbasemem(Context &context);
-static inline void allocatebuffers(Context &context);
-static inline void clearbuffers(Context &context);
-static inline void clearpalette(Context &context);
-static inline void readsetdata(Context &context);
-static inline void loadpalfromiff(Context &context);
-static inline void titles(Context &context);
-static inline void credits(Context &context);
-static inline void cls(Context &context);
-static inline void decide(Context &context);
-static inline void clearchanges(Context &context);
-static inline void loadroom(Context &context);
-static inline void clearsprites(Context &context);
-static inline void initman(Context &context);
-static inline void entrytexts(Context &context);
-static inline void entryanims(Context &context);
-static inline void initialinv(Context &context);
-static inline void startup1(Context &context);
-static inline void clearbeforeload(Context &context);
-static inline void startup(Context &context);
-static inline void worktoscreenm(Context &context);
-static inline void screenupdate(Context &context);
-static inline void showgun(Context &context);
-static inline void fadescreendown(Context &context);
-static inline void hangon(Context &context);
-static inline void fadescreendowns(Context &context);
-static inline void endgame(Context &context);
-static inline void loadtemptext(Context &context);
-static inline void monkspeaking(Context &context);
-static inline void gettingshot(Context &context);
-static inline void getridoftemptext(Context &context);
-static inline void loadintroroom(Context &context);
-static inline void fadescreenups(Context &context);
-static inline void runendseq(Context &context);
-static inline void atmospheres(Context &context);
-static inline void spriteupdate(Context &context);
-static inline void deleverything(Context &context);
-static inline void printsprites(Context &context);
-static inline void reelsonscreen(Context &context);
-static inline void afterintroroom(Context &context);
-static inline void usetimedtext(Context &context);
-static inline void dumpmap(Context &context);
-static inline void dumptimedtext(Context &context);
-static inline void multidump(Context &context);
-static inline void getundertimed(Context &context);
-static inline void printdirect(Context &context);
-static inline void putundertimed(Context &context);
-static inline void multiput(Context &context);
-static inline void getnumber(Context &context);
-static inline void modifychar(Context &context);
-static inline void printchar(Context &context);
-static inline void showframe(Context &context);
-static inline void kernchars(Context &context);
-static inline void frameoutfx(Context &context);
-static inline void frameoutnm(Context &context);
-static inline void frameoutbh(Context &context);
-static inline void frameoutv(Context &context);
-static inline void getnextword(Context &context);
-static inline void multiget(Context &context);
-static inline void clearwork(Context &context);
-static inline void findroominloc(Context &context);
-static inline void drawfloor(Context &context);
-static inline void worktoscreen(Context &context);
-static inline void width160(Context &context);
-static inline void eraseoldobs(Context &context);
-static inline void drawflags(Context &context);
-static inline void calcmapad(Context &context);
-static inline void doblocks(Context &context);
-static inline void showallobs(Context &context);
-static inline void showallfree(Context &context);
-static inline void showallex(Context &context);
-static inline void paneltomap(Context &context);
-static inline void initrain(Context &context);
-static inline void splitintolines(Context &context);
-static inline void getblockofpixel(Context &context);
-static inline void checkone(Context &context);
-static inline void getmapad(Context &context);
-static inline void calcfrframe(Context &context);
-static inline void finalframe(Context &context);
-static inline void getxad(Context &context);
-static inline void getyad(Context &context);
-static inline void makebackob(Context &context);
-static inline void makesprite(Context &context);
-static inline void getdimension(Context &context);
-static inline void addalong(Context &context);
-static inline void addlength(Context &context);
-static inline void reconstruct(Context &context);
-static inline void updatepeople(Context &context);
-static inline void watchreel(Context &context);
-static inline void showrain(Context &context);
-static inline void randomnum1(Context &context);
-static inline void playchannel1(Context &context);
-static inline void plotreel(Context &context);
-static inline void checkforshake(Context &context);
-static inline void autosetwalk(Context &context);
-static inline void getroomspaths(Context &context);
-static inline void checkdest(Context &context);
-static inline void bresenhams(Context &context);
-static inline void workoutframes(Context &context);
-static inline void getreelstart(Context &context);
-static inline void dealwithspecial(Context &context);
-static inline void showreelframe(Context &context);
-static inline void soundonreels(Context &context);
-static inline void playchannel0(Context &context);
-static inline void findsource(Context &context);
-static inline void placesetobject(Context &context);
-static inline void removesetobject(Context &context);
-static inline void placefreeobject(Context &context);
-static inline void removefreeobject(Context &context);
-static inline void switchryanoff(Context &context);
-static inline void switchryanon(Context &context);
-static inline void movemap(Context &context);
-static inline void getfreead(Context &context);
-static inline void findormake(Context &context);
-static inline void getsetad(Context &context);
-static inline void undertextline(Context &context);
-static inline void printasprite(Context &context);
-static inline void maptopanel(Context &context);
-static inline void cancelch0(Context &context);
-static inline void clearstartpal(Context &context);
-static inline void paltoendpal(Context &context);
-static inline void loadroomssample(Context &context);
-static inline void loadintotemp(Context &context);
-static inline void showmonk(Context &context);
-static inline void getridoftemp(Context &context);
-static inline void standardload(Context &context);
-static inline void readheader(Context &context);
-static inline void twodigitnum(Context &context);
-static inline void cancelch1(Context &context);
-static inline void paltostartpal(Context &context);
-static inline void clearendpal(Context &context);
-static inline void greyscalesum(Context &context);
-static inline void endpaltostart(Context &context);
-static inline void createpanel2(Context &context);
-static inline void fadescreenup(Context &context);
-static inline void rollendcredits2(Context &context);
-static inline void rollem(Context &context);
-static inline void hangone(Context &context);
-static inline void createpanel(Context &context);
-static inline void newplace(Context &context);
-static inline void mainscreen(Context &context);
-static inline void animpointer(Context &context);
-static inline void showpointer(Context &context);
-static inline void readmouse1(Context &context);
-static inline void dumppointer(Context &context);
-static inline void dumptextline(Context &context);
-static inline void delpointer(Context &context);
-static inline void autolook(Context &context);
-static inline void watchcount(Context &context);
-static inline void zoom(Context &context);
-static inline void readmouse2(Context &context);
-static inline void dumpzoom(Context &context);
-static inline void afternewroom(Context &context);
-static inline void readmouse3(Context &context);
-static inline void readmouse4(Context &context);
-static inline void dumpwatch(Context &context);
-static inline void findpathofpoint(Context &context);
-static inline void findxyfrompath(Context &context);
-static inline void showicon(Context &context);
-static inline void getunderzoom(Context &context);
-static inline void walkintoroom(Context &context);
-static inline void reminders(Context &context);
-static inline void isryanholding(Context &context);
-static inline void findexobject(Context &context);
-static inline void compare(Context &context);
-static inline void setuptimeduse(Context &context);
-static inline void getanyaddir(Context &context);
-static inline void getexad(Context &context);
-static inline void showpanel(Context &context);
-static inline void showman(Context &context);
-static inline void roomname(Context &context);
-static inline void panelicons1(Context &context);
-static inline void zoomicon(Context &context);
-static inline void middlepanel(Context &context);
-static inline void showwatch(Context &context);
-static inline void showtime(Context &context);
-static inline void printmessage(Context &context);
-static inline void usecharset1(Context &context);
-static inline void putunderzoom(Context &context);
-static inline void crosshair(Context &context);
-static inline void dolook(Context &context);
-static inline void findnextcolon(Context &context);
-static inline void printslow(Context &context);
-static inline void hangonp(Context &context);
-static inline void redrawmainscrn(Context &context);
-static inline void readmouse(Context &context);
-static inline void printboth(Context &context);
-static inline void waitframes(Context &context);
-static inline void dumpblink(Context &context);
-static inline void showblink(Context &context);
-static inline void getflagunderp(Context &context);
-static inline void checkcoords(Context &context);
-static inline void walkandexamine(Context &context);
-static inline void finishedwalking(Context &context);
-static inline void examineob(Context &context);
-static inline void setwalk(Context &context);
-static inline void examineobtext(Context &context);
-static inline void blocknametext(Context &context);
-static inline void personnametext(Context &context);
-static inline void walktotext(Context &context);
-static inline void commandwithob(Context &context);
-static inline void deltextline(Context &context);
-static inline void copyname(Context &context);
-static inline void findobname(Context &context);
-static inline void facerightway(Context &context);
-static inline void showexit(Context &context);
-static inline void obicons(Context &context);
-static inline void obpicture(Context &context);
-static inline void describeob(Context &context);
-static inline void makemainscreen(Context &context);
-static inline void getobtextstart(Context &context);
-static inline void obsthatdothings(Context &context);
-static inline void additionaltext(Context &context);
-static inline void findpuztext(Context &context);
-static inline void getlocation(Context &context);
-static inline void setlocation(Context &context);
-static inline void lookatcard(Context &context);
-static inline void getridofreels(Context &context);
-static inline void loadkeypad(Context &context);
-static inline void hangonw(Context &context);
-static inline void restorereels(Context &context);
-static inline void putbackobstuff(Context &context);
-static inline void getroomdata(Context &context);
-static inline void allocateload(Context &context);
-static inline void searchforsame(Context &context);
-static inline void getanyad(Context &context);
-static inline void selectlocation(Context &context);
-static inline void readcitypic(Context &context);
-static inline void showcity(Context &context);
-static inline void readdesticon(Context &context);
-static inline void loadtraveltext(Context &context);
-static inline void showarrows(Context &context);
-static inline void locationpic(Context &context);
-static inline void getridoftemp2(Context &context);
-static inline void getridoftemp3(Context &context);
-static inline void getdestinfo(Context &context);
-static inline void loadintotemp2(Context &context);
-static inline void loadintotemp3(Context &context);
-static inline void clearreels(Context &context);
-static inline void clearrest(Context &context);
-static inline void pickupob(Context &context);
-static inline void transfertoex(Context &context);
-static inline void emergencypurge(Context &context);
-static inline void getexpos(Context &context);
-static inline void transfermap(Context &context);
-static inline void transferinv(Context &context);
-static inline void transfertext(Context &context);
-static inline void pickupconts(Context &context);
-static inline void transfercontoex(Context &context);
-static inline void purgeanitem(Context &context);
-static inline void deleteexobject(Context &context);
-static inline void deleteexframe(Context &context);
-static inline void deleteextext(Context &context);
-static inline void resetlocation(Context &context);
-static inline void checkifpathison(Context &context);
-static inline void turnpathon(Context &context);
-static inline void turnanypathon(Context &context);
-static inline void purgealocation(Context &context);
-static inline void startloading(Context &context);
-static inline void fillspace(Context &context);
-static inline void sortoutmap(Context &context);
-static inline void deletetaken(Context &context);
-static inline void setallchanges(Context &context);
-static inline void autoappear(Context &context);
-static inline void dochange(Context &context);
-static inline void loadsavebox(Context &context);
-static inline void showdecisions(Context &context);
-static inline void showopbox(Context &context);
-static inline void realcredits(Context &context);
-static inline void allpalette(Context &context);
-static inline void dumpcurrent(Context &context);
-static inline void biblequote(Context &context);
-static inline void intro(Context &context);
-static inline void runintroseq(Context &context);
-static inline void trysoundalloc(Context &context);
-static inline void allocatework(Context &context);
-static inline void checkforemm(Context &context);
-static inline void parseblaster(Context &context);
-static inline void printcurs(Context &context);
-static inline void delcurs(Context &context);
-static inline void commandonly(Context &context);
-static inline void talk(Context &context);
-static inline void obname(Context &context);
-static inline void pixelcheckset(Context &context);
-static inline void isitdescribed(Context &context);
-static inline void getreelframeax(Context &context);
-static inline void blank(Context &context);
-static inline void findfirstpath(Context &context);
-static inline void checkifex(Context &context);
-static inline void checkiffree(Context &context);
-static inline void checkifperson(Context &context);
-static inline void checkifset(Context &context);
-static inline void identifyob(Context &context);
-static inline void convnum(Context &context);
-static inline void onedigit(Context &context);
-static inline void volumeadjust(Context &context);
-static inline void loopchannel0(Context &context);
-static inline void createname(Context &context);
-static inline void doload(Context &context);
-static inline void showloadops(Context &context);
-static inline void showslots(Context &context);
-static inline void shownames(Context &context);
-static inline void namestoold(Context &context);
-static inline void storeit(Context &context);
-static inline void makeheader(Context &context);
-static inline void oldtonames(Context &context);
-static inline void showsaveops(Context &context);
-static inline void readkey(Context &context);
-static inline void getnamepos(Context &context);
-static inline void selectslot(Context &context);
-static inline void restoreall(Context &context);
-static inline void checkinput(Context &context);
-static inline void showdiscops(Context &context);
-static inline void getback1(Context &context);
-static inline void getridofall(Context &context);
-static inline void showmainops(Context &context);
-static inline void dosaveload(Context &context);
-static inline void findtext1(Context &context);
-static inline void usetempcharset(Context &context);
-static inline void showdiary(Context &context);
-static inline void showdiarypage(Context &context);
-static inline void loadtempcharset(Context &context);
-static inline void showdiarykeys(Context &context);
-static inline void dumpdiarykeys(Context &context);
-static inline void getridoftempcharset(Context &context);
-static inline void nextsymbol(Context &context);
-static inline void showsymbol(Context &context);
-static inline void updatesymboltop(Context &context);
-static inline void updatesymbolbot(Context &context);
-static inline void dumpsymbol(Context &context);
-static inline void turnanypathoff(Context &context);
-static inline void folderexit(Context &context);
-static inline void showleftpage(Context &context);
-static inline void showrightpage(Context &context);
-static inline void showfolder(Context &context);
-static inline void folderhints(Context &context);
-static inline void loadfolder(Context &context);
-static inline void loadmenu(Context &context);
-static inline void getundermenu(Context &context);
-static inline void putundermenu(Context &context);
-static inline void showmenu(Context &context);
-static inline void dumpmenu(Context &context);
-static inline void singlekey(Context &context);
-static inline void buttonpress(Context &context);
-static inline void showouterpad(Context &context);
-static inline void showkeypad(Context &context);
-static inline void dumpkeypad(Context &context);
-static inline void addtopresslist(Context &context);
-static inline void isitright(Context &context);
-static inline void checkinside(Context &context);
-static inline void showfirstuse(Context &context);
-static inline void withwhat(Context &context);
-static inline void showpuztext(Context &context);
-static inline void issetobonmap(Context &context);
-static inline void showseconduse(Context &context);
-static inline void removeobfrominv(Context &context);
-static inline void turnpathoff(Context &context);
-static inline void findinvpos(Context &context);
-static inline void useroutine(Context &context);
-static inline void printmessage2(Context &context);
-static inline void fillryan(Context &context);
-static inline void findsetobject(Context &context);
-static inline void usetext(Context &context);
-static inline void moneypoke(Context &context);
-static inline void nextcolon(Context &context);
-static inline void entercode(Context &context);
-static inline void makeworn(Context &context);
-static inline void nothelderror(Context &context);
-static inline void triggermessage(Context &context);
-static inline void monprint(Context &context);
-static inline void showcurrentfile(Context &context);
-static inline void printlogo(Context &context);
-static inline void printundermon(Context &context);
-static inline void randomaccess(Context &context);
-static inline void locklighton(Context &context);
-static inline void locklightoff(Context &context);
-static inline void makecaps(Context &context);
-static inline void monmessage(Context &context);
-static inline void scrollmonitor(Context &context);
-static inline void searchforstring(Context &context);
-static inline void getkeyandlogo(Context &context);
-static inline void monitorlogo(Context &context);
-static inline void parser(Context &context);
-static inline void neterror(Context &context);
-static inline void processtrigger(Context &context);
-static inline void input(Context &context);
-static inline void dirfile(Context &context);
-static inline void searchforfiles(Context &context);
-static inline void dircom(Context &context);
-static inline void signon(Context &context);
-static inline void read(Context &context);
-static inline void showkeys(Context &context);
-static inline void delchar(Context &context);
-static inline void accesslighton(Context &context);
-static inline void accesslightoff(Context &context);
-static inline void powerlighton(Context &context);
-static inline void powerlightoff(Context &context);
-static inline void lookininterface(Context &context);
-static inline void loadpersonal(Context &context);
-static inline void loadnews(Context &context);
-static inline void loadcart(Context &context);
-static inline void printoutermon(Context &context);
-static inline void initialmoncols(Context &context);
-static inline void turnonpower(Context &context);
-static inline void fadeupyellows(Context &context);
-static inline void fadeupmonfirst(Context &context);
-static inline void hangoncurs(Context &context);
-static inline void execcommand(Context &context);
-static inline void getundercentre(Context &context);
-static inline void putundercentre(Context &context);
-static inline void convicons(Context &context);
-static inline void starttalk(Context &context);
-static inline void hangonpq(Context &context);
-static inline void redes(Context &context);
-static inline void dosometalk(Context &context);
-static inline void getpersontext(Context &context);
-static inline void getpersframe(Context &context);
-static inline void findopenpos(Context &context);
-static inline void reexfromopen(Context &context);
-static inline void geteitherad(Context &context);
-static inline void fillopen(Context &context);
-static inline void useopened(Context &context);
-static inline void getopenedsize(Context &context);
-static inline void errormessage3(Context &context);
-static inline void errormessage2(Context &context);
-static inline void examicon(Context &context);
-static inline void outofopen(Context &context);
-static inline void swapwithopen(Context &context);
-static inline void isitworn(Context &context);
-static inline void wornerror(Context &context);
-static inline void errormessage1(Context &context);
-static inline void checkobjectsize(Context &context);
-static inline void openinv(Context &context);
-static inline void openob(Context &context);
-static inline void droperror(Context &context);
-static inline void cantdrop(Context &context);
-static inline void reexfrominv(Context &context);
-static inline void intoinv(Context &context);
-static inline void outofinv(Context &context);
-static inline void swapwithinv(Context &context);
-static inline void findallopen(Context &context);
-static inline void obtoinv(Context &context);
-static inline void findallryan(Context &context);
-static inline void showryanpage(Context &context);
-static inline void lockmon(Context &context);
-static inline void fadecalculation(Context &context);
-static inline void dodoor(Context &context);
-static inline void liftnoise(Context &context);
-static inline void widedoor(Context &context);
-static inline void random(Context &context);
-static inline void lockeddoorway(Context &context);
-static inline void liftsprite(Context &context);
-static inline void doorway(Context &context);
-static inline void constant(Context &context);
-static inline void steady(Context &context);
-static inline void adjustleft(Context &context);
-static inline void adjustright(Context &context);
-static inline void adjustdown(Context &context);
-static inline void adjustup(Context &context);
-static inline void aboutturn(Context &context);
-static inline void checkforexit(Context &context);
-static inline void walking(Context &context);
-static inline void showgamereel(Context &context);
-static inline void checkspeed(Context &context);
-static inline void addtopeoplelist(Context &context);
-static inline void setuptimedtemp(Context &context);
-static inline void madmantext(Context &context);
-static inline void madmode(Context &context);
-static inline void priesttext(Context &context);
-static inline void fadescreenuphalf(Context &context);
-static inline void textforend(Context &context);
-static inline void fadescreendownhalf(Context &context);
-static inline void rollendcredits(Context &context);
-static inline void textformonk(Context &context);
-static inline void monks2text(Context &context);
-static inline void intro2text(Context &context);
-static inline void intro3text(Context &context);
-static inline void intro1text(Context &context);
-
-static inline void alleybarksound(Context & context) {
+static void seecommandtail(Context &context);
+static void checkbasemem(Context &context);
+static void allocatebuffers(Context &context);
+static void clearbuffers(Context &context);
+static void clearpalette(Context &context);
+static void readsetdata(Context &context);
+static void loadpalfromiff(Context &context);
+static void titles(Context &context);
+static void credits(Context &context);
+static void cls(Context &context);
+static void decide(Context &context);
+static void clearchanges(Context &context);
+static void loadroom(Context &context);
+static void clearsprites(Context &context);
+static void initman(Context &context);
+static void entrytexts(Context &context);
+static void entryanims(Context &context);
+static void initialinv(Context &context);
+static void startup1(Context &context);
+static void clearbeforeload(Context &context);
+static void startup(Context &context);
+static void worktoscreenm(Context &context);
+static void screenupdate(Context &context);
+static void showgun(Context &context);
+static void fadescreendown(Context &context);
+static void hangon(Context &context);
+static void fadescreendowns(Context &context);
+static void endgame(Context &context);
+static void standardload(Context &context);
+static void getroomspaths(Context &context);
+static void readheader(Context &context);
+static void allocateload(Context &context);
+static void fillspace(Context &context);
+static void sortoutmap(Context &context);
+static void findroominloc(Context &context);
+static void deletetaken(Context &context);
+static void setallchanges(Context &context);
+static void autoappear(Context &context);
+static void getroomdata(Context &context);
+static void autosetwalk(Context &context);
+static void findxyfrompath(Context &context);
+static void twodigitnum(Context &context);
+static void startloading(Context &context);
+static void loadroomssample(Context &context);
+static void switchryanon(Context &context);
+static void drawflags(Context &context);
+static void getdimension(Context &context);
+static void getflagunderp(Context &context);
+static void multidump(Context &context);
+static void multiput(Context &context);
+static void multiget(Context &context);
+static void dumpblink(Context &context);
+static void showblink(Context &context);
+static void showframe(Context &context);
+static void printcurs(Context &context);
+static void delcurs(Context &context);
+static void delpointer(Context &context);
+static void readmouse(Context &context);
+static void animpointer(Context &context);
+static void showpointer(Context &context);
+static void dumppointer(Context &context);
+static void commandonly(Context &context);
+static void worktoscreen(Context &context);
+static void showtime(Context &context);
+static void showwatch(Context &context);
+static void printmessage(Context &context);
+static void printdirect(Context &context);
+static void usecharset1(Context &context);
+static void showpanel(Context &context);
+static void showman(Context &context);
+static void roomname(Context &context);
+static void panelicons1(Context &context);
+static void zoomicon(Context &context);
+static void middlepanel(Context &context);
+static void findobname(Context &context);
+static void workoutframes(Context &context);
+static void checkdest(Context &context);
+static void bresenhams(Context &context);
+static void facerightway(Context &context);
+static void checkone(Context &context);
+static void commandwithob(Context &context);
+static void findnextcolon(Context &context);
+static void deltextline(Context &context);
+static void copyname(Context &context);
+static void finishedwalking(Context &context);
+static void examineob(Context &context);
+static void talk(Context &context);
+static void setwalk(Context &context);
+static void examineobtext(Context &context);
+static void blocknametext(Context &context);
+static void personnametext(Context &context);
+static void walktotext(Context &context);
+static void clearwork(Context &context);
+static void drawfloor(Context &context);
+static void reelsonscreen(Context &context);
+static void spriteupdate(Context &context);
+static void printsprites(Context &context);
+static void playchannel0(Context &context);
+static void cancelch0(Context &context);
+static void createpanel(Context &context);
+static void findpathofpoint(Context &context);
+static void showicon(Context &context);
+static void undertextline(Context &context);
+static void mainscreen(Context &context);
+static void getunderzoom(Context &context);
+static void zoom(Context &context);
+static void walkintoroom(Context &context);
+static void reminders(Context &context);
+static void atmospheres(Context &context);
+static void findormake(Context &context);
+static void obname(Context &context);
+static void pixelcheckset(Context &context);
+static void isitdescribed(Context &context);
+static void getreelstart(Context &context);
+static void getreelframeax(Context &context);
+static void blank(Context &context);
+static void findfirstpath(Context &context);
+static void checkifex(Context &context);
+static void checkiffree(Context &context);
+static void checkifperson(Context &context);
+static void checkifset(Context &context);
+static void identifyob(Context &context);
+static void checkcoords(Context &context);
+static void walkandexamine(Context &context);
+static void convnum(Context &context);
+static void onedigit(Context &context);
+static void plotreel(Context &context);
+static void checkforshake(Context &context);
+static void newplace(Context &context);
+static void readmouse1(Context &context);
+static void dumptextline(Context &context);
+static void autolook(Context &context);
+static void watchcount(Context &context);
+static void readmouse2(Context &context);
+static void dumpzoom(Context &context);
+static void deleverything(Context &context);
+static void afternewroom(Context &context);
+static void readmouse3(Context &context);
+static void dumpmap(Context &context);
+static void dumptimedtext(Context &context);
+static void readmouse4(Context &context);
+static void dumpwatch(Context &context);
+static void fadescreenup(Context &context);
+static void parseblaster(Context &context);
+static void clearreels(Context &context);
+static void clearrest(Context &context);
+static void trysoundalloc(Context &context);
+static void allocatework(Context &context);
+static void checkforemm(Context &context);
+static void getanyad(Context &context);
+static void transfertoex(Context &context);
+static void pickupob(Context &context);
+static void switchryanoff(Context &context);
+static void resetlocation(Context &context);
+static void removefreeobject(Context &context);
+static void checkifpathison(Context &context);
+static void turnpathon(Context &context);
+static void removesetobject(Context &context);
+static void placesetobject(Context &context);
+static void turnanypathon(Context &context);
+static void setuptimeduse(Context &context);
+static void volumeadjust(Context &context);
+static void loopchannel0(Context &context);
+static void cancelch1(Context &context);
+static void createname(Context &context);
+static void doload(Context &context);
+static void showdecisions(Context &context);
+static void showopbox(Context &context);
+static void showloadops(Context &context);
+static void showslots(Context &context);
+static void shownames(Context &context);
+static void namestoold(Context &context);
+static void getridoftemp(Context &context);
+static void initrain(Context &context);
+static void createpanel2(Context &context);
+static void loadsavebox(Context &context);
+static void storeit(Context &context);
+static void makeheader(Context &context);
+static void oldtonames(Context &context);
+static void showsaveops(Context &context);
+static void readkey(Context &context);
+static void getnamepos(Context &context);
+static void selectslot(Context &context);
+static void restoreall(Context &context);
+static void redrawmainscrn(Context &context);
+static void checkinput(Context &context);
+static void showdiscops(Context &context);
+static void loadintotemp(Context &context);
+static void getback1(Context &context);
+static void getridofall(Context &context);
+static void showmainops(Context &context);
+static void dosaveload(Context &context);
+static void findtext1(Context &context);
+static void usetempcharset(Context &context);
+static void playchannel1(Context &context);
+static void getlocation(Context &context);
+static void setlocation(Context &context);
+static void hangonp(Context &context);
+static void showdiary(Context &context);
+static void showdiarypage(Context &context);
+static void getridofreels(Context &context);
+static void loadtemptext(Context &context);
+static void loadtempcharset(Context &context);
+static void showdiarykeys(Context &context);
+static void dumpdiarykeys(Context &context);
+static void getridoftemptext(Context &context);
+static void getridoftempcharset(Context &context);
+static void restorereels(Context &context);
+static void nextsymbol(Context &context);
+static void showsymbol(Context &context);
+static void updatesymboltop(Context &context);
+static void updatesymbolbot(Context &context);
+static void dumpsymbol(Context &context);
+static void turnanypathoff(Context &context);
+static void folderexit(Context &context);
+static void showleftpage(Context &context);
+static void showrightpage(Context &context);
+static void loadintotemp2(Context &context);
+static void loadintotemp3(Context &context);
+static void showfolder(Context &context);
+static void folderhints(Context &context);
+static void loadfolder(Context &context);
+static void getridoftemp2(Context &context);
+static void getridoftemp3(Context &context);
+static void loadmenu(Context &context);
+static void getundermenu(Context &context);
+static void putundermenu(Context &context);
+static void showmenu(Context &context);
+static void dumpmenu(Context &context);
+static void singlekey(Context &context);
+static void buttonpress(Context &context);
+static void loadkeypad(Context &context);
+static void showouterpad(Context &context);
+static void showkeypad(Context &context);
+static void dumpkeypad(Context &context);
+static void addtopresslist(Context &context);
+static void isitright(Context &context);
+static void checkinside(Context &context);
+static void compare(Context &context);
+static void showfirstuse(Context &context);
+static void putbackobstuff(Context &context);
+static void withwhat(Context &context);
+static void showpuztext(Context &context);
+static void placefreeobject(Context &context);
+static void issetobonmap(Context &context);
+static void showseconduse(Context &context);
+static void removeobfrominv(Context &context);
+static void turnpathoff(Context &context);
+static void getundertimed(Context &context);
+static void putundertimed(Context &context);
+static void getsetad(Context &context);
+static void getfreead(Context &context);
+static void dochange(Context &context);
+static void findpuztext(Context &context);
+static void showexit(Context &context);
+static void obicons(Context &context);
+static void obpicture(Context &context);
+static void describeob(Context &context);
+static void getanyaddir(Context &context);
+static void findinvpos(Context &context);
+static void useroutine(Context &context);
+static void printmessage2(Context &context);
+static void fillryan(Context &context);
+static void findsetobject(Context &context);
+static void getobtextstart(Context &context);
+static void usetext(Context &context);
+static void selectlocation(Context &context);
+static void hangonw(Context &context);
+static void moneypoke(Context &context);
+static void nextcolon(Context &context);
+static void getexad(Context &context);
+static void entercode(Context &context);
+static void findexobject(Context &context);
+static void makeworn(Context &context);
+static void isryanholding(Context &context);
+static void nothelderror(Context &context);
+static void triggermessage(Context &context);
+static void monprint(Context &context);
+static void modifychar(Context &context);
+static void printchar(Context &context);
+static void showcurrentfile(Context &context);
+static void printlogo(Context &context);
+static void printundermon(Context &context);
+static void randomaccess(Context &context);
+static void locklighton(Context &context);
+static void locklightoff(Context &context);
+static void makecaps(Context &context);
+static void monmessage(Context &context);
+static void scrollmonitor(Context &context);
+static void searchforstring(Context &context);
+static void getkeyandlogo(Context &context);
+static void monitorlogo(Context &context);
+static void parser(Context &context);
+static void neterror(Context &context);
+static void processtrigger(Context &context);
+static void input(Context &context);
+static void dirfile(Context &context);
+static void searchforfiles(Context &context);
+static void dircom(Context &context);
+static void signon(Context &context);
+static void read(Context &context);
+static void showkeys(Context &context);
+static void delchar(Context &context);
+static void randomnum1(Context &context);
+static void accesslighton(Context &context);
+static void accesslightoff(Context &context);
+static void powerlighton(Context &context);
+static void powerlightoff(Context &context);
+static void lookininterface(Context &context);
+static void loadpersonal(Context &context);
+static void loadnews(Context &context);
+static void loadcart(Context &context);
+static void printoutermon(Context &context);
+static void initialmoncols(Context &context);
+static void turnonpower(Context &context);
+static void fadeupyellows(Context &context);
+static void fadeupmonfirst(Context &context);
+static void hangoncurs(Context &context);
+static void execcommand(Context &context);
+static void purgealocation(Context &context);
+static void getdestinfo(Context &context);
+static void showarrows(Context &context);
+static void locationpic(Context &context);
+static void getundercentre(Context &context);
+static void putundercentre(Context &context);
+static void readcitypic(Context &context);
+static void showcity(Context &context);
+static void readdesticon(Context &context);
+static void loadtraveltext(Context &context);
+static void convicons(Context &context);
+static void starttalk(Context &context);
+static void hangonpq(Context &context);
+static void redes(Context &context);
+static void dosometalk(Context &context);
+static void getpersontext(Context &context);
+static void getpersframe(Context &context);
+static void findsource(Context &context);
+static void printslow(Context &context);
+static void dolook(Context &context);
+static void getxad(Context &context);
+static void getyad(Context &context);
+static void getmapad(Context &context);
+static void calcfrframe(Context &context);
+static void finalframe(Context &context);
+static void makesprite(Context &context);
+static void makebackob(Context &context);
+static void addalong(Context &context);
+static void addlength(Context &context);
+static void eraseoldobs(Context &context);
+static void calcmapad(Context &context);
+static void doblocks(Context &context);
+static void showallobs(Context &context);
+static void showallfree(Context &context);
+static void showallex(Context &context);
+static void paneltomap(Context &context);
+static void deleteexframe(Context &context);
+static void deleteextext(Context &context);
+static void deleteexobject(Context &context);
+static void purgeanitem(Context &context);
+static void getexpos(Context &context);
+static void transfermap(Context &context);
+static void transferinv(Context &context);
+static void transfertext(Context &context);
+static void transfercontoex(Context &context);
+static void emergencypurge(Context &context);
+static void pickupconts(Context &context);
+static void findopenpos(Context &context);
+static void reexfromopen(Context &context);
+static void geteitherad(Context &context);
+static void fillopen(Context &context);
+static void useopened(Context &context);
+static void getopenedsize(Context &context);
+static void errormessage3(Context &context);
+static void errormessage2(Context &context);
+static void examicon(Context &context);
+static void outofopen(Context &context);
+static void swapwithopen(Context &context);
+static void isitworn(Context &context);
+static void wornerror(Context &context);
+static void errormessage1(Context &context);
+static void checkobjectsize(Context &context);
+static void openinv(Context &context);
+static void openob(Context &context);
+static void droperror(Context &context);
+static void cantdrop(Context &context);
+static void reexfrominv(Context &context);
+static void intoinv(Context &context);
+static void outofinv(Context &context);
+static void swapwithinv(Context &context);
+static void makemainscreen(Context &context);
+static void searchforsame(Context &context);
+static void lookatcard(Context &context);
+static void obsthatdothings(Context &context);
+static void additionaltext(Context &context);
+static void findallopen(Context &context);
+static void obtoinv(Context &context);
+static void findallryan(Context &context);
+static void showryanpage(Context &context);
+static void kernchars(Context &context);
+static void getnextword(Context &context);
+static void getnumber(Context &context);
+static void lockmon(Context &context);
+static void printboth(Context &context);
+static void waitframes(Context &context);
+static void hangone(Context &context);
+static void allpalette(Context &context);
+static void fadescreenups(Context &context);
+static void afterintroroom(Context &context);
+static void usetimedtext(Context &context);
+static void loadintroroom(Context &context);
+static void runintroseq(Context &context);
+static void realcredits(Context &context);
+static void runendseq(Context &context);
+static void showmonk(Context &context);
+static void monkspeaking(Context &context);
+static void gettingshot(Context &context);
+static void biblequote(Context &context);
+static void intro(Context &context);
+static void paltostartpal(Context &context);
+static void paltoendpal(Context &context);
+static void dumpcurrent(Context &context);
+static void rollem(Context &context);
+static void greyscalesum(Context &context);
+static void endpaltostart(Context &context);
+static void clearendpal(Context &context);
+static void rollendcredits2(Context &context);
+static void clearstartpal(Context &context);
+static void fadecalculation(Context &context);
+static void frameoutfx(Context &context);
+static void frameoutnm(Context &context);
+static void frameoutbh(Context &context);
+static void frameoutv(Context &context);
+static void putunderzoom(Context &context);
+static void crosshair(Context &context);
+static void width160(Context &context);
+static void maptopanel(Context &context);
+static void movemap(Context &context);
+static void dealwithspecial(Context &context);
+static void showreelframe(Context &context);
+static void soundonreels(Context &context);
+static void reconstruct(Context &context);
+static void updatepeople(Context &context);
+static void watchreel(Context &context);
+static void showrain(Context &context);
+static void dodoor(Context &context);
+static void liftnoise(Context &context);
+static void widedoor(Context &context);
+static void random(Context &context);
+static void lockeddoorway(Context &context);
+static void liftsprite(Context &context);
+static void doorway(Context &context);
+static void constant(Context &context);
+static void steady(Context &context);
+static void getblockofpixel(Context &context);
+static void splitintolines(Context &context);
+static void adjustleft(Context &context);
+static void adjustright(Context &context);
+static void adjustdown(Context &context);
+static void adjustup(Context &context);
+static void aboutturn(Context &context);
+static void checkforexit(Context &context);
+static void walking(Context &context);
+static void printasprite(Context &context);
+static void showgamereel(Context &context);
+static void checkspeed(Context &context);
+static void addtopeoplelist(Context &context);
+static void setuptimedtemp(Context &context);
+static void madmantext(Context &context);
+static void madmode(Context &context);
+static void priesttext(Context &context);
+static void fadescreenuphalf(Context &context);
+static void textforend(Context &context);
+static void fadescreendownhalf(Context &context);
+static void rollendcredits(Context &context);
+static void textformonk(Context &context);
+static void monks2text(Context &context);
+static void intro2text(Context &context);
+static void intro3text(Context &context);
+static void intro1text(Context &context);
+
+static void alleybarksound(Context & context) {
context.ax = context.data.word(context.bx+3);
context._sub(context.ax, 1);
context._cmp(context.ax, 0);
@@ -499,11 +499,11 @@ nobark:
return;
}
-static inline void intromusic(Context & context) {
+static void intromusic(Context & context) {
return;
}
-static inline void foghornsound(Context & context) {
+static void foghornsound(Context & context) {
randomnumber(context);
context._cmp(context.al, 198);
if (!context.flags.z()) goto nofog;
@@ -513,7 +513,7 @@ nofog:
return;
}
-static inline void receptionist(Context & context) {
+static void receptionist(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto gotrecep;
context._cmp(context.data.byte(52), 1);
@@ -555,7 +555,7 @@ nottalkedrecep:
return;
}
-static inline void smokebloke(Context & context) {
+static void smokebloke(Context & context) {
context._cmp(context.data.byte(41), 0);
if (!context.flags.z()) goto notspokento;
context.al = context.data.byte(context.bx+7);
@@ -590,7 +590,7 @@ gotsmokeb:
return;
}
-static inline void attendant(Context & context) {
+static void attendant(Context & context) {
showgamereel(context);
addtopeoplelist(context);
context.al = context.data.byte(context.bx+7);
@@ -601,7 +601,7 @@ nottalked:
return;
}
-static inline void manasleep(Context & context) {
+static void manasleep(Context & context) {
context.al = context.data.byte(context.bx+7);
context._and(context.al, 127);
context.data.byte(context.bx+7) = context.al;
@@ -610,7 +610,7 @@ static inline void manasleep(Context & context) {
return;
}
-static inline void eden(Context & context) {
+static void eden(Context & context) {
context._cmp(context.data.byte(42), 0);
if (!context.flags.z()) goto notinbed;
showgamereel(context);
@@ -619,7 +619,7 @@ notinbed:
return;
}
-static inline void edeninbath(Context & context) {
+static void edeninbath(Context & context) {
context._cmp(context.data.byte(42), 0);
if (context.flags.z()) goto notinbed;
context._cmp(context.data.byte(43), 0);
@@ -634,19 +634,19 @@ notinbed:
return;
}
-static inline void malefan(Context & context) {
+static void malefan(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void femalefan(Context & context) {
+static void femalefan(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void louis(Context & context) {
+static void louis(Context & context) {
context._cmp(context.data.byte(41), 0);
if (!context.flags.z()) goto notlouis1;
showgamereel(context);
@@ -655,7 +655,7 @@ notlouis1:
return;
}
-static inline void louischair(Context & context) {
+static void louischair(Context & context) {
context._cmp(context.data.byte(41), 0);
if (context.flags.z()) goto notlouis2;
checkspeed(context);
@@ -683,7 +683,7 @@ notlouis2:
return;
}
-static inline void manasleep2(Context & context) {
+static void manasleep2(Context & context) {
context.al = context.data.byte(context.bx+7);
context._and(context.al, 127);
context.data.byte(context.bx+7) = context.al;
@@ -692,19 +692,19 @@ static inline void manasleep2(Context & context) {
return;
}
-static inline void mansatstill(Context & context) {
+static void mansatstill(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void tattooman(Context & context) {
+static void tattooman(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void drinker(Context & context) {
+static void drinker(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto gotdrinker;
context._add(context.data.word(context.bx+3), 1);
@@ -725,7 +725,7 @@ gotdrinker:
return;
}
-static inline void bartender(Context & context) {
+static void bartender(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto gotsmoket;
context._cmp(context.data.word(context.bx+3), 86);
@@ -752,19 +752,19 @@ notgotgun:
return;
}
-static inline void othersmoker(Context & context) {
+static void othersmoker(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void barwoman(Context & context) {
+static void barwoman(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void interviewer(Context & context) {
+static void interviewer(Context & context) {
context._cmp(context.data.word(23), 68);
if (!context.flags.z()) goto notgeneralstart;
context._add(context.data.word(context.bx+3), 1);
@@ -781,7 +781,7 @@ talking:
return;
}
-static inline void soldier1(Context & context) {
+static void soldier1(Context & context) {
context._cmp(context.data.word(context.bx+3), 0);
if (context.flags.z()) goto soldierwait;
context.data.word(21) = 10;
@@ -814,7 +814,7 @@ gotsoldframe:
return;
}
-static inline void rockstar(Context & context) {
+static void rockstar(Context & context) {
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 303);
if (context.flags.z()) goto rockcombatend;
@@ -865,7 +865,7 @@ rockcombatend:
return;
}
-static inline void helicopter(Context & context) {
+static void helicopter(Context & context) {
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 203);
if (context.flags.z()) goto heliwon;
@@ -922,7 +922,7 @@ heliwon:
return;
}
-static inline void mugger(Context & context) {
+static void mugger(Context & context) {
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 138);
if (context.flags.z()) goto endmugger1;
@@ -995,13 +995,13 @@ endmugger2:
return;
}
-static inline void aide(Context & context) {
+static void aide(Context & context) {
showgamereel(context);
addtopeoplelist(context);
return;
}
-static inline void businessman(Context & context) {
+static void businessman(Context & context) {
context.data.byte(234) = 0;
context.data.word(21) = 2;
context.ax = context.data.word(context.bx+3);
@@ -1090,7 +1090,7 @@ buscombatwonend:
return;
}
-static inline void poolguard(Context & context) {
+static void poolguard(Context & context) {
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 214);
if (context.flags.z()) goto combatover2;
@@ -1174,7 +1174,7 @@ doneover2:
return;
}
-static inline void security(Context & context) {
+static void security(Context & context) {
context._cmp(context.data.word(context.bx+3), 32);
if (context.flags.z()) goto securwait;
context._cmp(context.data.word(context.bx+3), 69);
@@ -1202,7 +1202,7 @@ gotsecurframe:
return;
}
-static inline void heavy(Context & context) {
+static void heavy(Context & context) {
context.al = context.data.byte(context.bx+7);
context._and(context.al, 127);
context.data.byte(context.bx+7) = context.al;
@@ -1237,7 +1237,7 @@ gotheavyframe:
return;
}
-static inline void bossman(Context & context) {
+static void bossman(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto notboss;
context.ax = context.data.word(context.bx+3);
@@ -1280,7 +1280,7 @@ nottalkedboss:
return;
}
-static inline void gamer(Context & context) {
+static void gamer(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto gamerfin;
gameragain:
@@ -1299,7 +1299,7 @@ gamerfin:
return;
}
-static inline void sparkydrip(Context & context) {
+static void sparkydrip(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto cantdrip;
context.al = 14;
@@ -1309,7 +1309,7 @@ cantdrip:
return;
}
-static inline void carparkdrip(Context & context) {
+static void carparkdrip(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto cantdrip2;
context.al = 14;
@@ -1318,7 +1318,7 @@ cantdrip2:
return;
}
-static inline void keeper(Context & context) {
+static void keeper(Context & context) {
context._cmp(context.data.byte(54), 0);
if (!context.flags.z()) goto notwaiting;
context._cmp(context.data.word(23), 190);
@@ -1339,7 +1339,7 @@ waiting:
return;
}
-static inline void candles1(Context & context) {
+static void candles1(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto candle1;
context.ax = context.data.word(context.bx+3);
@@ -1354,7 +1354,7 @@ candle1:
return;
}
-static inline void smallcandle(Context & context) {
+static void smallcandle(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto smallcandlef;
context.ax = context.data.word(context.bx+3);
@@ -1369,7 +1369,7 @@ smallcandlef:
return;
}
-static inline void intromagic1(Context & context) {
+static void intromagic1(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto introm1fin;
context.ax = context.data.word(context.bx+3);
@@ -1396,7 +1396,7 @@ introm1fin:
return;
}
-static inline void candles(Context & context) {
+static void candles(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto candlesfin;
context.ax = context.data.word(context.bx+3);
@@ -1411,7 +1411,7 @@ candlesfin:
return;
}
-static inline void candles2(Context & context) {
+static void candles2(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto candles2fin;
context.ax = context.data.word(context.bx+3);
@@ -1426,7 +1426,7 @@ candles2fin:
return;
}
-static inline void gates(Context & context) {
+static void gates(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto gatesfin;
context.ax = context.data.word(context.bx+3);
@@ -1462,7 +1462,7 @@ gatesfin:
return;
}
-static inline void intromagic2(Context & context) {
+static void intromagic2(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto introm2fin;
context.ax = context.data.word(context.bx+3);
@@ -1477,7 +1477,7 @@ introm2fin:
return;
}
-static inline void intromagic3(Context & context) {
+static void intromagic3(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto introm3fin;
context.ax = context.data.word(context.bx+3);
@@ -1494,7 +1494,7 @@ introm3fin:
return;
}
-static inline void intromonks1(Context & context) {
+static void intromonks1(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto intromonk1fin;
context.ax = context.data.word(context.bx+3);
@@ -1538,7 +1538,7 @@ intromonk1fin:
return;
}
-static inline void intromonks2(Context & context) {
+static void intromonks2(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto intromonk2fin;
context.ax = context.data.word(context.bx+3);
@@ -1590,11 +1590,11 @@ intromonk2fin:
return;
}
-static inline void handclap(Context & context) {
+static void handclap(Context & context) {
return;
}
-static inline void monks2text(Context & context) {
+static void monks2text(Context & context) {
context._cmp(context.data.byte(139), 1);
if (!context.flags.z()) goto notmonk2text1;
context.al = 8;
@@ -1694,7 +1694,7 @@ gotmonks2text:
return;
}
-static inline void intro1text(Context & context) {
+static void intro1text(Context & context) {
context._cmp(context.data.byte(139), 2);
if (!context.flags.z()) goto notintro1text1;
context.al = 40;
@@ -1728,7 +1728,7 @@ oktalk2:
return;
}
-static inline void intro2text(Context & context) {
+static void intro2text(Context & context) {
context._cmp(context.ax, 5);
if (!context.flags.z()) goto notintro2text1;
context.al = 43;
@@ -1753,7 +1753,7 @@ gotintro2text:
return;
}
-static inline void intro3text(Context & context) {
+static void intro3text(Context & context) {
context._cmp(context.ax, 107);
if (!context.flags.z()) goto notintro3text1;
context.al = 45;
@@ -1778,7 +1778,7 @@ gotintro3text:
return;
}
-static inline void monkandryan(Context & context) {
+static void monkandryan(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto notmonkryan;
context.ax = context.data.word(context.bx+3);
@@ -1803,7 +1803,7 @@ notmonkryan:
return;
}
-static inline void endgameseq(Context & context) {
+static void endgameseq(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto notendseq;
context.ax = context.data.word(context.bx+3);
@@ -1860,7 +1860,7 @@ notendcreds:
return;
}
-static inline void rollendcredits(Context & context) {
+static void rollendcredits(Context & context) {
context.al = 16;
context.ah = 255;
playchannel0(context);
@@ -1948,7 +1948,7 @@ gotnext:
return;
}
-static inline void priest(Context & context) {
+static void priest(Context & context) {
context._cmp(context.data.word(context.bx+3), 8);
if (context.flags.z()) goto priestspoken;
context.data.byte(234) = 0;
@@ -1967,7 +1967,7 @@ priestspoken:
return;
}
-static inline void madmanstelly(Context & context) {
+static void madmanstelly(Context & context) {
context.ax = context.data.word(context.bx+3);
context._add(context.ax, 1);
context._cmp(context.ax, 307);
@@ -1979,7 +1979,7 @@ notendtelly:
return;
}
-static inline void madman(Context & context) {
+static void madman(Context & context) {
context.data.word(21) = 2;
checkspeed(context);
if (!context.flags.z()) goto nomadspeed;
@@ -2049,7 +2049,7 @@ ryansded:
return;
}
-static inline void madmantext(Context & context) {
+static void madmantext(Context & context) {
context._cmp(context.data.byte(64), 61);
if (!context.flags.c()) goto nomadtext;
context.al = context.data.byte(64);
@@ -2069,7 +2069,7 @@ nomadtext:
return;
}
-static inline void madmode(Context & context) {
+static void madmode(Context & context) {
context.data.word(21) = 2;
context.data.byte(234) = 0;
context._cmp(context.data.byte(64), 63);
@@ -2081,7 +2081,7 @@ iswatchmad:
return;
}
-static inline void priesttext(Context & context) {
+static void priesttext(Context & context) {
context._cmp(context.data.word(context.bx+3), 2);
if (context.flags.c()) goto nopriesttext;
context._cmp(context.data.word(context.bx+3), 7);
@@ -2101,7 +2101,7 @@ nopriesttext:
return;
}
-static inline void textforend(Context & context) {
+static void textforend(Context & context) {
context._cmp(context.data.byte(139), 20);
if (!context.flags.z()) goto notendtext1;
context.al = 0;
@@ -2134,7 +2134,7 @@ gotendtext:
return;
}
-static inline void textformonk(Context & context) {
+static void textformonk(Context & context) {
context._cmp(context.data.byte(139), 1);
if (!context.flags.z()) goto notmonktext1;
context.al = 19;
@@ -2252,7 +2252,7 @@ oktalk:
return;
}
-static inline void drunk(Context & context) {
+static void drunk(Context & context) {
context._cmp(context.data.byte(42), 0);
if (!context.flags.z()) goto trampgone;
context.al = context.data.byte(context.bx+7);
@@ -2264,7 +2264,7 @@ trampgone:
return;
}
-static inline void advisor(Context & context) {
+static void advisor(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto noadvisor;
goto noadvisor;
@@ -2292,7 +2292,7 @@ noadvisor:
return;
}
-static inline void copper(Context & context) {
+static void copper(Context & context) {
checkspeed(context);
if (!context.flags.z()) goto nocopper;
context.ax = context.data.word(context.bx+3);
@@ -2322,7 +2322,7 @@ nocopper:
return;
}
-static inline void sparky(Context & context) {
+static void sparky(Context & context) {
context._cmp(context.data.word(16), 0);
if (context.flags.z()) goto animsparky;
context.data.byte(context.bx+7) = 3;
@@ -2355,7 +2355,7 @@ nottalkedsparky:
return;
}
-static inline void train(Context & context) {
+static void train(Context & context) {
return;
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 21);
@@ -2378,7 +2378,7 @@ notrainatall:
return;
}
-static inline void addtopeoplelist(Context & context) {
+static void addtopeoplelist(Context & context) {
context.push(context.es);
context.push(context.bx);
context.push(context.bx);
@@ -2396,7 +2396,7 @@ static inline void addtopeoplelist(Context & context) {
return;
}
-static inline void showgamereel(Context & context) {
+static void showgamereel(Context & context) {
context.ax = context.data.word(context.bx+3);
context._cmp(context.ax, 512);
if (!context.flags.c()) goto noshow;
@@ -2412,7 +2412,7 @@ noshow:
return;
}
-static inline void checkspeed(Context & context) {
+static void checkspeed(Context & context) {
context._cmp(context.data.byte(65), -1);
if (!context.flags.z()) goto forcenext;
context._add(context.data.byte(context.bx+6), 1);
@@ -2429,7 +2429,35 @@ forcenext:
return;
}
-static inline void delsprite(Context & context) {
+static void clearsprites(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+ context.al = 255;
+ context.cx = 32*16;
+ while(--context.cx) context._stosb();
+ return;
+}
+
+static void makesprite(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+_tmp17:
+ context._cmp(context.data.byte(context.bx+15), 255);
+ if (context.flags.z()) goto _tmp17a;
+ context._add(context.bx, 32);
+ goto _tmp17;
+_tmp17a:
+ context.data.word(context.bx) = context.cx;
+ context.data.word(context.bx+10) = context.si;
+ context.data.word(context.bx+6) = context.dx;
+ context.data.word(context.bx+8) = context.di;
+ context.data.word(context.bx+2) = 0x0ffff;
+ context.data.byte(context.bx+15) = 0;
+ context.data.byte(context.bx+18) = 0;
+ return;
+}
+
+static void delsprite(Context & context) {
context.di = context.bx;
context.cx = 32;
context.al = 255;
@@ -2437,7 +2465,175 @@ static inline void delsprite(Context & context) {
return;
}
-static inline void mainman(Context & context) {
+static void spriteupdate(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+ context.al = context.data.byte(63);
+ context.data.byte(context.bx+31) = context.al;
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+ context.cx = 16;
+_tmp18:
+ context.push(context.cx);
+ context.push(context.bx);
+ context.ax = context.data.word(context.bx);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto _tmp18a;
+ context.push(context.es);
+ context.push(context.ds);
+ context.cx = context.data.word(context.bx+2);
+ context.data.word(context.bx+24) = context.cx;
+ __dispatch_call(context, context.ax);
+ context.ds = context.pop();
+ context.es = context.pop();
+_tmp18a:
+ context.bx = context.pop();
+ context.cx = context.pop();
+ context._cmp(context.data.byte(186), 1);
+ if (context.flags.z()) goto _tmp18b;
+ context._add(context.bx, 32);
+ if (--context.cx) goto _tmp18;
+_tmp18b:
+ return;
+}
+
+static void printsprites(Context & context) {
+ context.es = context.data.word(412);
+ context.cx = 0;
+priorityloop:
+ context.push(context.cx);
+ context.data.byte(182) = context.cl;
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+ context.cx = 16;
+prtspriteloop:
+ context.push(context.cx);
+ context.push(context.bx);
+ context.ax = context.data.word(context.bx);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto skipsprite;
+ context.al = context.data.byte(182);
+ context._cmp(context.al, context.data.byte(context.bx+23));
+ if (!context.flags.z()) goto skipsprite;
+ context._cmp(context.data.byte(context.bx+31), 1);
+ if (context.flags.z()) goto skipsprite;
+ printasprite(context);
+skipsprite:
+ context.bx = context.pop();
+ context.cx = context.pop();
+ context._add(context.bx, 32);
+ if (--context.cx) goto prtspriteloop;
+ context.cx = context.pop();
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 7);
+ if (!context.flags.z()) goto priorityloop;
+ return;
+}
+
+static void printasprite(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ context.si = context.bx;
+ context.ds = context.data.word(context.si+6);
+ context.al = context.data.byte(context.si+11);
+ context.ah = 0;
+ context._cmp(context.al, 220);
+ if (context.flags.c()) goto notnegative1;
+ context.ah = 255;
+notnegative1:
+ context.bx = context.ax;
+ context._add(context.bx, context.data.word(119));
+ context.al = context.data.byte(context.si+10);
+ context.ah = 0;
+ context._cmp(context.al, 220);
+ if (context.flags.c()) goto notnegative2;
+ context.ah = 255;
+notnegative2:
+ context.di = context.ax;
+ context._add(context.di, context.data.word(117));
+ context.al = context.data.byte(context.si+15);
+ context.ah = 0;
+ context._cmp(context.data.byte(context.si+30), 0);
+ if (context.flags.z()) goto steadyframe;
+ context.ah = 8;
+steadyframe:
+ context._cmp(context.data.byte(182), 6);
+ if (!context.flags.z()) goto notquickp;
+notquickp:
+ showframe(context);
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void checkone(Context & context) {
+ context.push(context.cx);
+ context.al = context.ch;
+ context.ah = 0;
+ context.cl = 4;
+ context._shr(context.ax, context.cl);
+ context.dl = context.al;
+ context.cx = context.pop();
+ context.al = context.cl;
+ context.ah = 0;
+ context.cl = 4;
+ context._shr(context.ax, context.cl);
+ context.ah = context.dl;
+ context.push(context.ax);
+ context.ch = 0;
+ context.cl = context.al;
+ context.push(context.cx);
+ context.al = context.ah;
+ context.ah = 0;
+ context.cx = 11;
+ context._mul(context.cx);
+ context.cx = context.pop();
+ context._add(context.ax, context.cx);
+ context.cx = 3;
+ context._mul(context.cx);
+ context.si = context.ax;
+ context.ds = context.data.word(412);
+ context._add(context.si, 0+(228*13)+32+60+(32*32));
+ context._lodsw();
+ context.cx = context.ax;
+ context._lodsb();
+ context.dx = context.pop();
+ return;
+}
+
+static void findsource(Context & context) {
+ context.ax = context.data.word(160);
+ context._cmp(context.ax, 160);
+ if (!context.flags.c()) goto over1000;
+ context.ds = context.data.word(430);
+ context.data.word(244) = 0;
+ return;
+over1000:
+ context._cmp(context.ax, 320);
+ if (!context.flags.c()) goto over1001;
+ context.ds = context.data.word(432);
+ context.data.word(244) = 160;
+ return;
+over1001:
+ context.ds = context.data.word(434);
+ context.data.word(244) = 320;
+ return;
+}
+
+static void initman(Context & context) {
+ context.al = context.data.byte(151);
+ context.ah = context.data.byte(152);
+ context.si = context.ax;
+ context.cx = 49464;
+ context.dx = context.data.word(414);
+ context.di = 0;
+ makesprite(context);
+ context.data.byte(context.bx+23) = 4;
+ context.data.byte(context.bx+22) = 0;
+ context.data.byte(context.bx+29) = 0;
+ return;
+}
+
+static void mainman(Context & context) {
context._cmp(context.data.byte(187), 1);
if (!context.flags.z()) goto notinnewroom;
context.data.byte(187) = 0;
@@ -2520,7 +2716,7 @@ notwalk:
return;
}
-static inline void aboutturn(Context & context) {
+static void aboutturn(Context & context) {
context._cmp(context.data.byte(136), 1);
if (context.flags.z()) goto incdir;
context._cmp(context.data.byte(136), -1);
@@ -2554,7 +2750,7 @@ decdir:
return;
}
-static inline void walking(Context & context) {
+static void walking(Context & context) {
context._cmp(context.data.byte(493), 0);
if (context.flags.z()) goto normalwalk;
context.al = context.data.byte(492);
@@ -2603,7 +2799,25 @@ finishedwalk:
return;
}
-static inline void checkforexit(Context & context) {
+static void facerightway(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ getroomspaths(context);
+ context.al = context.data.byte(475);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.bx+7);
+ context.data.byte(135) = context.al;
+ context.data.byte(134) = context.al;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void checkforexit(Context & context) {
context.cl = context.data.byte(151);
context._add(context.cl, 12);
context.ch = context.data.byte(152);
@@ -2695,7 +2909,7 @@ notanup:
return;
}
-static inline void adjustdown(Context & context) {
+static void adjustdown(Context & context) {
context.push(context.es);
context.push(context.bx);
context._add(context.data.byte(149), 10);
@@ -2709,7 +2923,7 @@ static inline void adjustdown(Context & context) {
return;
}
-static inline void adjustup(Context & context) {
+static void adjustup(Context & context) {
context.push(context.es);
context.push(context.bx);
context._sub(context.data.byte(149), 10);
@@ -2723,7 +2937,7 @@ static inline void adjustup(Context & context) {
return;
}
-static inline void adjustleft(Context & context) {
+static void adjustleft(Context & context) {
context.push(context.es);
context.push(context.bx);
context.data.byte(153) = 0;
@@ -2738,7 +2952,7 @@ static inline void adjustleft(Context & context) {
return;
}
-static inline void adjustright(Context & context) {
+static void adjustright(Context & context) {
context.push(context.es);
context.push(context.bx);
context._add(context.data.byte(148), 11);
@@ -2753,7 +2967,263 @@ static inline void adjustright(Context & context) {
return;
}
-static inline void backobject(Context & context) {
+static void reminders(Context & context) {
+ context._cmp(context.data.byte(184), 24);
+ if (!context.flags.z()) goto notinedenslift;
+ context._cmp(context.data.byte(148), 44);
+ if (!context.flags.z()) goto notinedenslift;
+ context._cmp(context.data.byte(2), 0);
+ if (!context.flags.z()) goto notfirst;
+ context.al = 'D';
+ context.ah = 'K';
+ context.cl = 'E';
+ context.ch = 'Y';
+ isryanholding(context);
+ if (context.flags.z()) goto forgotone;
+ context.al = 'C';
+ context.ah = 'S';
+ context.cl = 'H';
+ context.ch = 'R';
+ findexobject(context);
+ context._cmp(context.al, 114);
+ if (context.flags.z()) goto forgotone;
+ context.ax = context.data.word(context.bx+2);
+ context._cmp(context.al, 4);
+ if (!context.flags.z()) goto forgotone;
+ context._cmp(context.ah, 255);
+ if (context.flags.z()) goto havegotcard;
+ context.cl = 'P';
+ context.ch = 'U';
+ context.dl = 'R';
+ context.dh = 'S';
+ context._xchg(context.al, context.ah);
+ compare(context);
+ if (!context.flags.z()) goto forgotone;
+havegotcard:
+ context._add(context.data.byte(2), 1);
+notfirst:
+ return;
+forgotone:
+ context.al = 50;
+ context.bl = 54;
+ context.bh = 70;
+ context.cx = 48;
+ context.dx = 8;
+ setuptimeduse(context);
+ return;
+notinedenslift:
+ return;
+}
+
+static void initrain(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 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)+(250*4)+(256*30);
+ context.bx = 1113;
+checkmorerain:
+ context.al = context.data.byte(context.bx);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto finishinitrain;
+ context._cmp(context.al, context.data.byte(184));
+ if (!context.flags.z()) goto checkrain;
+ context.al = context.data.byte(context.bx+1);
+ context._cmp(context.al, context.data.byte(148));
+ if (!context.flags.z()) goto checkrain;
+ context.al = context.data.byte(context.bx+2);
+ context._cmp(context.al, context.data.byte(149));
+ if (!context.flags.z()) goto checkrain;
+ context.al = context.data.byte(context.bx+3);
+ context.data.byte(132) = context.al;
+ goto dorain;
+checkrain:
+ context._add(context.bx, 4);
+ goto checkmorerain;
+dorain:
+ context.cx = 4;
+initraintop:
+ randomnumber(context);
+ context._and(context.al, 31);
+ context._add(context.al, 3);
+ context._cmp(context.al, context.data.byte(132));
+ if (!context.flags.c()) goto initraintop;
+ context._add(context.cl, context.al);
+ context._cmp(context.cl, context.data.byte(128));
+ if (!context.flags.c()) goto initrainside;
+ context.push(context.cx);
+ splitintolines(context);
+ context.cx = context.pop();
+ goto initraintop;
+initrainside:
+ context.cl = context.data.byte(128);
+ context._sub(context.cl, 1);
+initrainside2:
+ randomnumber(context);
+ context._and(context.al, 31);
+ context._add(context.al, 3);
+ context._cmp(context.al, context.data.byte(132));
+ if (!context.flags.c()) goto initrainside2;
+ context._add(context.ch, context.al);
+ context._cmp(context.ch, context.data.byte(129));
+ if (!context.flags.c()) goto finishinitrain;
+ context.push(context.cx);
+ splitintolines(context);
+ context.cx = context.pop();
+ goto initrainside2;
+finishinitrain:
+ context.al = 255;
+ context._stosb();
+ return;
+}
+
+static void splitintolines(Context & context) {
+lookforlinestart:
+ getblockofpixel(context);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto foundlinestart;
+ context._sub(context.cl, 1);
+ context._add(context.ch, 1);
+ context._cmp(context.cl, 0);
+ if (context.flags.z()) goto endofthisline;
+ context._cmp(context.ch, context.data.byte(129));
+ if (!context.flags.c()) goto endofthisline;
+ goto lookforlinestart;
+foundlinestart:
+ context.data.word(context.di) = context.cx;
+ context.bh = 1;
+lookforlineend:
+ getblockofpixel(context);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto foundlineend;
+ context._sub(context.cl, 1);
+ context._add(context.ch, 1);
+ context._cmp(context.cl, 0);
+ if (context.flags.z()) goto foundlineend;
+ context._cmp(context.ch, context.data.byte(129));
+ if (!context.flags.c()) goto foundlineend;
+ context._add(context.bh, 1);
+ goto lookforlineend;
+foundlineend:
+ context.push(context.cx);
+ context.data.byte(context.di+2) = context.bh;
+ randomnumber(context);
+ context.data.byte(context.di+3) = context.al;
+ randomnumber(context);
+ context.data.byte(context.di+4) = context.al;
+ randomnumber(context);
+ context._and(context.al, 3);
+ context._add(context.al, 4);
+ context.data.byte(context.di+5) = context.al;
+ context._add(context.di, 6);
+ context.cx = context.pop();
+ context._cmp(context.cl, 0);
+ if (context.flags.z()) goto endofthisline;
+ context._cmp(context.ch, context.data.byte(129));
+ if (!context.flags.c()) goto endofthisline;
+ goto lookforlinestart;
+endofthisline:
+ return;
+}
+
+static void getblockofpixel(Context & context) {
+ context.push(context.cx);
+ context.push(context.es);
+ context.push(context.di);
+ context.ax = context.data.word(125);
+ context._add(context.cl, context.al);
+ context.ax = context.data.word(127);
+ context._add(context.ch, context.al);
+ checkone(context);
+ context._and(context.cl, 1);
+ if (!context.flags.z()) goto failrain;
+ context.di = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ return;
+failrain:
+ context.di = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ context.al = 0;
+ return;
+}
+
+static void showrain(Context & context) {
+ context.ds = context.data.word(414);
+ context.si = 6*58;
+ context.ax = context.data.word(context.si+2);
+ context.si = context.ax;
+ context._add(context.si, 2080);
+ context.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)+(250*4)+(256*30);
+ context.es = context.data.word(412);
+ context._cmp(context.data.byte(context.bx), 255);
+ if (context.flags.z()) goto nothunder;
+morerain:
+ context.es = context.data.word(412);
+ context._cmp(context.data.byte(context.bx), 255);
+ if (context.flags.z()) goto finishrain;
+ context.al = context.data.byte(context.bx+1);
+ context.ah = 0;
+ context._add(context.ax, context.data.word(119));
+ context._add(context.ax, context.data.word(127));
+ context.cx = 320;
+ context._mul(context.cx);
+ context.cl = context.data.byte(context.bx);
+ context.ch = 0;
+ context._add(context.ax, context.cx);
+ context._add(context.ax, context.data.word(117));
+ context._add(context.ax, context.data.word(125));
+ context.di = context.ax;
+ context.cl = context.data.byte(context.bx+2);
+ context.ch = 0;
+ context.ax = context.data.word(context.bx+3);
+ context.dl = context.data.byte(context.bx+5);
+ context.dh = 0;
+ context._sub(context.ax, context.dx);
+ context._and(context.ax, 511);
+ context.data.word(context.bx+3) = context.ax;
+ context._add(context.bx, 6);
+ context.push(context.si);
+ context._add(context.si, context.ax);
+ context.es = context.data.word(400);
+ context.ah = 0;
+ context.dx = 320-2;
+rainloop:
+ context._lodsb();
+ context._cmp(context.al, context.ah);
+ if (context.flags.z()) goto noplot;
+ context._stosb();
+ context._add(context.di, context.dx);
+ if (--context.cx) goto rainloop;
+ context.si = context.pop();
+ goto morerain;
+noplot:
+ context._add(context.di, 320-1);
+ if (--context.cx) goto rainloop;
+ context.si = context.pop();
+ goto morerain;
+finishrain:
+ context._cmp(context.data.word(521), 0);
+ if (!context.flags.z()) goto nothunder;
+ context._cmp(context.data.byte(184), 2);
+ if (!context.flags.z()) goto notlouisthund;
+ context._cmp(context.data.byte(45), 1);
+ if (!context.flags.z()) goto nothunder;
+notlouisthund:
+ context._cmp(context.data.byte(184), 55);
+ if (context.flags.z()) goto nothunder;
+ randomnum1(context);
+ context._cmp(context.al, 1);
+ if (!context.flags.c()) goto nothunder;
+ context.al = 7;
+ context._cmp(context.data.byte(507), 6);
+ if (context.flags.z()) goto isthunder1;
+ context.al = 4;
+isthunder1:
+ playchannel1(context);
+nothunder:
+ return;
+}
+
+static void backobject(Context & context) {
context.ds = context.data.word(428);
context.di = context.data.word(context.bx+20);
context.al = context.data.byte(context.bx+18);
@@ -2801,7 +3271,7 @@ finishback:
return;
}
-static inline void liftsprite(Context & context) {
+static void liftsprite(Context & context) {
context.al = context.data.byte(35);
context._cmp(context.al, 0);
if (context.flags.z()) goto liftclosed;
@@ -2881,7 +3351,7 @@ nocountopen:
goto pokelift;
}
-static inline void liftnoise(Context & context) {
+static void liftnoise(Context & context) {
context._cmp(context.data.byte(184), 5);
if (context.flags.z()) goto hissnoise;
context._cmp(context.data.byte(184), 21);
@@ -2894,7 +3364,7 @@ hissnoise:
return;
}
-static inline void random(Context & context) {
+static void random(Context & context) {
randomnum1(context);
context.push(context.di);
context._and(context.ax, 7);
@@ -2906,14 +3376,14 @@ static inline void random(Context & context) {
return;
}
-static inline void steady(Context & context) {
+static void steady(Context & context) {
context.al = context.data.byte(context.di+18);
context.data.byte(context.di+17) = context.al;
context.data.byte(context.bx+15) = context.al;
return;
}
-static inline void constant(Context & context) {
+static void constant(Context & context) {
context._add(context.data.byte(context.bx+19), 1);
context.cl = context.data.byte(context.bx+19);
context.ch = 0;
@@ -2931,7 +3401,7 @@ gotconst:
return;
}
-static inline void doorway(Context & context) {
+static void doorway(Context & context) {
context.data.byte(193) = -24;
context.data.byte(194) = 10;
context.data.byte(195) = -30;
@@ -2940,7 +3410,7 @@ static inline void doorway(Context & context) {
return;
}
-static inline void widedoor(Context & context) {
+static void widedoor(Context & context) {
context.data.byte(193) = -24;
context.data.byte(194) = 24;
context.data.byte(195) = -30;
@@ -2949,7 +3419,7 @@ static inline void widedoor(Context & context) {
return;
}
-static inline void dodoor(Context & context) {
+static void dodoor(Context & context) {
context.al = context.data.byte(151);
context.ah = context.data.byte(152);
context.cl = context.data.byte(context.bx+10);
@@ -3039,7 +3509,7 @@ notnearly:
return;
}
-static inline void lockeddoorway(Context & context) {
+static void lockeddoorway(Context & context) {
context.al = context.data.byte(151);
context.ah = context.data.byte(152);
context.cl = context.data.byte(context.bx+10);
@@ -3176,7 +3646,41 @@ notnearly:
return;
}
-static inline void getreelframeax(Context & context) {
+static void updatepeople(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5);
+ context.data.word(18) = context.di;
+ context.cx = 12*5;
+ context.al = 255;
+ while(--context.cx) context._stosb();
+ context._add(context.data.word(138), 1);
+ context.es = context.cs;
+ context.bx = 537;
+ context.di = 1003;
+updateloop:
+ context.al = context.data.byte(context.bx);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto endupdate;
+ context._cmp(context.al, context.data.byte(184));
+ if (!context.flags.z()) goto notinthisroom;
+ context.cx = context.data.word(context.bx+1);
+ context._cmp(context.cl, context.data.byte(148));
+ if (!context.flags.z()) goto notinthisroom;
+ context._cmp(context.ch, context.data.byte(149));
+ if (!context.flags.z()) goto notinthisroom;
+ context.push(context.di);
+ context.ax = context.data.word(context.di);
+ __dispatch_call(context, context.ax);
+ context.di = context.pop();
+notinthisroom:
+ context._add(context.bx, 8);
+ context._add(context.di, 2);
+ goto updateloop;
+endupdate:
+ return;
+}
+
+static void getreelframeax(Context & context) {
context.push(context.ds);
context.data.word(160) = context.ax;
findsource(context);
@@ -3192,7 +3696,234 @@ static inline void getreelframeax(Context & context) {
return;
}
-static inline void dumpeverything(Context & context) {
+static void reelsonscreen(Context & context) {
+ reconstruct(context);
+ updatepeople(context);
+ watchreel(context);
+ showrain(context);
+ usetimedtext(context);
+ return;
+}
+
+static void plotreel(Context & context) {
+ getreelstart(context);
+retryreel:
+ context.push(context.es);
+ context.push(context.si);
+ context.ax = context.data.word(context.si+2);
+ context._cmp(context.al, 220);
+ if (context.flags.c()) goto normalreel;
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto normalreel;
+ dealwithspecial(context);
+ context._add(context.data.word(239), 1);
+ context.si = context.pop();
+ context.es = context.pop();
+ context._add(context.si, 40);
+ goto retryreel;
+normalreel:
+ context.cx = 8;
+plotloop:
+ context.push(context.cx);
+ context.push(context.es);
+ context.push(context.si);
+ context.ax = context.data.word(context.si);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto notplot;
+ showreelframe(context);
+notplot:
+ context.si = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ context._add(context.si, 5);
+ if (--context.cx) goto plotloop;
+ soundonreels(context);
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void soundonreels(Context & context) {
+ context.bl = context.data.byte(184);
+ context._add(context.bl, context.bl);
+ context._xor(context.bh, context.bh);
+ context._add(context.bx, 1254);
+ context.si = context.data.word(context.bx);
+reelsoundloop:
+ context.al = context.data.byte(context.si);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto endreelsound;
+ context.ax = context.data.word(context.si+1);
+ context._cmp(context.ax, context.data.word(239));
+ if (!context.flags.z()) goto skipreelsound;
+ context._cmp(context.ax, context.data.word(351));
+ if (context.flags.z()) goto skipreelsound;
+ context.data.word(351) = context.ax;
+ context.al = context.data.byte(context.si);
+ context._cmp(context.al, 64);
+ if (context.flags.c()) { playchannel1(context); return; };
+ context._cmp(context.al, 128);
+ if (context.flags.c()) goto channel0once;
+ context._and(context.al, 63);
+ context.ah = 255;
+ { playchannel0(context); return; };
+channel0once:
+ context._and(context.al, 63);
+ context.ah = 0;
+ { playchannel0(context); return; };
+skipreelsound:
+ context._add(context.si, 3);
+ goto reelsoundloop;
+endreelsound:
+ context.ax = context.data.word(351);
+ context._cmp(context.ax, context.data.word(239));
+ if (context.flags.z()) goto nochange2;
+ context.data.word(351) = -1;
+nochange2:
+ return;
+}
+
+static void reconstruct(Context & context) {
+ context._cmp(context.data.byte(130), 0);
+ if (context.flags.z()) goto noneedtorecon;
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ spriteupdate(context);
+ printsprites(context);
+ context._cmp(context.data.byte(184), 20);
+ if (!context.flags.z()) goto notfudge;
+ undertextline(context);
+notfudge:
+ context.data.byte(130) = 0;
+noneedtorecon:
+ return;
+}
+
+static void dealwithspecial(Context & context) {
+ context._sub(context.al, 220);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto notplset;
+ context.al = context.ah;
+ placesetobject(context);
+ context.data.byte(130) = 1;
+ return;
+notplset:
+ context._cmp(context.al, 1);
+ if (!context.flags.z()) goto notremset;
+ context.al = context.ah;
+ removesetobject(context);
+ context.data.byte(130) = 1;
+ return;
+notremset:
+ context._cmp(context.al, 2);
+ if (!context.flags.z()) goto notplfree;
+ context.al = context.ah;
+ placefreeobject(context);
+ context.data.byte(130) = 1;
+ return;
+notplfree:
+ context._cmp(context.al, 3);
+ if (!context.flags.z()) goto notremfree;
+ context.al = context.ah;
+ removefreeobject(context);
+ context.data.byte(130) = 1;
+ return;
+notremfree:
+ context._cmp(context.al, 4);
+ if (!context.flags.z()) goto notryanoff;
+ switchryanoff(context);
+ return;
+notryanoff:
+ context._cmp(context.al, 5);
+ if (!context.flags.z()) goto notryanon;
+ context.data.byte(135) = context.ah;
+ context.data.byte(133) = context.ah;
+ switchryanon(context);
+ return;
+notryanon:
+ context._cmp(context.al, 6);
+ if (!context.flags.z()) goto notchangeloc;
+ context.data.byte(188) = context.ah;
+ return;
+notchangeloc:
+ movemap(context);
+ return;
+}
+
+static void movemap(Context & context) {
+ context._cmp(context.ah, 32);
+ if (!context.flags.z()) goto notmapup2;
+ context._sub(context.data.byte(149), 20);
+ context.data.byte(186) = 1;
+ return;
+notmapup2:
+ context._cmp(context.ah, 16);
+ if (!context.flags.z()) goto notmapupspec;
+ context._sub(context.data.byte(149), 10);
+ context.data.byte(186) = 1;
+ return;
+notmapupspec:
+ context._cmp(context.ah, 8);
+ if (!context.flags.z()) goto notmapdownspec;
+ context._add(context.data.byte(149), 10);
+ context.data.byte(186) = 1;
+ return;
+notmapdownspec:
+ context._cmp(context.ah, 2);
+ if (!context.flags.z()) goto notmaprightspec;
+ context._add(context.data.byte(148), 11);
+ context.data.byte(186) = 1;
+ return;
+notmaprightspec:
+ context._sub(context.data.byte(148), 11);
+ context.data.byte(186) = 1;
+ return;
+}
+
+static void getreelstart(Context & context) {
+ context.ax = context.data.word(239);
+ context.cx = 40;
+ context._mul(context.cx);
+ context.es = context.data.word(450);
+ context.si = context.ax;
+ context._add(context.si, 0+(36*144));
+ return;
+}
+
+static void showreelframe(Context & context) {
+ context.al = context.data.byte(context.si+2);
+ context.ah = 0;
+ context.di = context.ax;
+ context._add(context.di, context.data.word(117));
+ context.al = context.data.byte(context.si+3);
+ context.bx = context.ax;
+ context._add(context.bx, context.data.word(119));
+ context.ax = context.data.word(context.si);
+ context.data.word(160) = context.ax;
+ findsource(context);
+ context.ax = context.data.word(160);
+ context._sub(context.ax, context.data.word(244));
+ context.ah = 8;
+ showframe(context);
+ return;
+}
+
+static void deleverything(Context & context) {
+ context.al = context.data.byte(129);
+ context.ah = 0;
+ context._add(context.ax, context.data.word(123));
+ context._cmp(context.ax, 182);
+ if (!context.flags.c()) goto bigroom;
+ maptopanel(context);
+ return;
+bigroom:
+ context._sub(context.data.byte(129), 8);
+ maptopanel(context);
+ context._add(context.data.byte(129), 8);
+ return;
+}
+
+static void dumpeverything(Context & context) {
context.es = context.data.word(412);
context.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);
dumpevery1:
@@ -3247,7 +3978,14 @@ finishevery2:
return;
}
-static inline void readabyte(Context & context) {
+static void allocatework(Context & context) {
+ context.bx = 0x1000;
+ allocatemem(context);
+ context.data.word(400) = context.ax;
+ return;
+}
+
+static void readabyte(Context & context) {
context._cmp(context.si, 30000);
if (!context.flags.z()) goto notendblock;
context.push(context.bx);
@@ -3267,7 +4005,52 @@ notendblock:
return;
}
-static inline void printundermon(Context & context) {
+static void loadpalfromiff(Context & context) {
+ context.dx = 2494;
+ openfile(context);
+ context.cx = 2000;
+ context.ds = context.data.word(402);
+ context.dx = 0;
+ readfromfile(context);
+ closefile(context);
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
+ context.ds = context.data.word(402);
+ context.si = 0x30;
+ context.cx = 768;
+palloop:
+ context._lodsb();
+ context._shr(context.al, 1);
+ context._shr(context.al, 1);
+ context._cmp(context.data.byte(73), 1);
+ if (!context.flags.z()) goto nought;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto nought;
+ context.ah = context.al;
+ context._shr(context.ah, 1);
+ context._add(context.al, context.ah);
+ context._shr(context.ah, 1);
+ context._add(context.al, context.ah);
+ context._cmp(context.al, 64);
+ if (context.flags.c()) goto nought;
+ context.al = 63;
+nought:
+ context._stosb();
+ if (--context.cx) goto palloop;
+ return;
+}
+
+static void cls(Context & context) {
+ context.ax = 0x0a000;
+ context.es = context.ax;
+ context.di = 0;
+ context.cx = 0x7fff;
+ context.ax = 0;
+ while(--context.cx) context._stosw();
+ return;
+}
+
+static void printundermon(Context & context) {
context.si = (320*43)+76;
context.di = context.si;
context.es = context.data.word(400);
@@ -3301,7 +4084,65 @@ finmonscroll:
return;
}
-static inline void pixelcheckset(Context & context) {
+static void worktoscreen(Context & context) {
+ vsync(context);
+ context.si = 0;
+ context.di = 0;
+ context.cx = 25;
+ context.ds = context.data.word(400);
+ context.dx = 0x0a000;
+ context.es = context.dx;
+dumpallloop:
+ width160(context);
+ width160(context);
+ width160(context);
+ width160(context);
+ width160(context);
+ width160(context);
+ width160(context);
+ width160(context);
+ if (--context.cx) goto dumpallloop;
+ return;
+}
+
+static void paneltomap(Context & context) {
+ context.di = context.data.word(125);
+ context._add(context.di, context.data.word(117));
+ context.bx = context.data.word(127);
+ context._add(context.bx, context.data.word(119));
+ context.ds = context.data.word(402);
+ context.si = 0;
+ context.cl = context.data.byte(128);
+ context.ch = context.data.byte(129);
+ multiget(context);
+ return;
+}
+
+static void maptopanel(Context & context) {
+ context.di = context.data.word(125);
+ context._add(context.di, context.data.word(117));
+ context.bx = context.data.word(127);
+ context._add(context.bx, context.data.word(119));
+ context.ds = context.data.word(402);
+ context.si = 0;
+ context.cl = context.data.byte(128);
+ context.ch = context.data.byte(129);
+ multiput(context);
+ return;
+}
+
+static void dumpmap(Context & context) {
+ context.di = context.data.word(125);
+ context._add(context.di, context.data.word(117));
+ context.bx = context.data.word(127);
+ context._add(context.bx, context.data.word(119));
+ context.cl = context.data.byte(128);
+ context.ch = context.data.byte(129);
+ multidump(context);
+ return;
+}
+
+static void pixelcheckset(Context & context) {
context.push(context.ax);
context._sub(context.al, context.data.byte(context.bx));
context._sub(context.ah, context.data.byte(context.bx+1));
@@ -3341,7 +4182,141 @@ static inline void pixelcheckset(Context & context) {
return;
}
-static inline void delthisone(Context & context) {
+static void createpanel(Context & context) {
+ context.di = 0;
+ context.bx = 8;
+ context.ds = context.data.word(410);
+ context.al = 0;
+ context.ah = 2;
+ showframe(context);
+ context.di = 160;
+ context.bx = 8;
+ context.ds = context.data.word(410);
+ context.al = 0;
+ context.ah = 2;
+ showframe(context);
+ context.di = 0;
+ context.bx = 104;
+ context.ds = context.data.word(410);
+ context.al = 0;
+ context.ah = 2;
+ showframe(context);
+ context.di = 160;
+ context.bx = 104;
+ context.ds = context.data.word(410);
+ context.al = 0;
+ context.ah = 2;
+ showframe(context);
+ return;
+}
+
+static void createpanel2(Context & context) {
+ createpanel(context);
+ context.di = 0;
+ context.bx = 0;
+ context.ds = context.data.word(410);
+ context.al = 5;
+ context.ah = 2;
+ showframe(context);
+ context.di = 160;
+ context.bx = 0;
+ context.ds = context.data.word(410);
+ context.al = 5;
+ context.ah = 2;
+ showframe(context);
+ return;
+}
+
+static void clearwork(Context & context) {
+ context.ax = 0x0;
+ context.es = context.data.word(400);
+ context.di = 0;
+ context.cx = (200*320)/64;
+clearloop:
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ if (--context.cx) goto clearloop;
+ return;
+}
+
+static void zoom(Context & context) {
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto inwatching;
+ context._cmp(context.data.byte(8), 1);
+ if (context.flags.z()) goto zoomswitch;
+inwatching:
+ return;
+zoomswitch:
+ context._cmp(context.data.byte(100), 199);
+ if (context.flags.c()) goto zoomit;
+cantzoom:
+ putunderzoom(context);
+ return;
+zoomit:
+ context.ax = context.data.word(222);
+ context._sub(context.ax, 9);
+ context.cx = 320;
+ context._mul(context.cx);
+ context._add(context.ax, context.data.word(220));
+ context._sub(context.ax, 11);
+ context.si = context.ax;
+ context.ax = 132+4;
+ context.cx = 320;
+ context._mul(context.cx);
+ context._add(context.ax, 8+5);
+ context.di = context.ax;
+ context.es = context.data.word(400);
+ context.ds = context.data.word(400);
+ context.cx = 20;
+zoomloop:
+ context.push(context.cx);
+ context.cx = 23;
+zoomloop2:
+ context._lodsb();
+ context.ah = context.al;
+ context._stosw();
+ context.data.word(context.di+320-2) = context.ax;
+ if (--context.cx) goto zoomloop2;
+ context._add(context.si, 320-23);
+ context._add(context.di, 320-46+320);
+ context.cx = context.pop();
+ if (--context.cx) goto zoomloop;
+ crosshair(context);
+ context.data.byte(75) = 1;
+ return;
+}
+
+static void delthisone(Context & context) {
context.push(context.ax);
context.push(context.ax);
context.al = context.ah;
@@ -3384,7 +4359,840 @@ deloneloop:
return;
}
-static inline void dofade(Context & context) {
+static void multiget(Context & context) {
+ context.ax = context.bx;
+ context.bx = 320;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.es = context.data.word(400);
+ context.es = context.ds;
+ context.ds = context.es;
+ context._xchg(context.di, context.si);
+ context.al = context.cl;
+ context.ah = 0;
+ context.dx = 320;
+ context._sub(context.dx, context.ax);
+ context.al = context.cl;
+ context._and(context.al, 1);
+ if (!context.flags.z()) goto oddwidth2;
+ context.bl = context.cl;
+ context.bh = 0;
+ context.ax = 1819;
+ context._shr(context.bx, 1);
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop3:
+ __dispatch_call(context, context.ax);
+ context._add(context.si, context.dx);
+ if (--context.cx) goto multiloop3;
+ return;
+oddwidth2:
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop4:
+ __dispatch_call(context, context.ax);
+ context._movsb();
+ context._add(context.si, context.dx);
+ if (--context.cx) goto multiloop4;
+ return;
+}
+
+static void multiput(Context & context) {
+ context.ax = context.bx;
+ context.bx = 320;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.es = context.data.word(400);
+ context.al = context.cl;
+ context.ah = 0;
+ context.dx = 320;
+ context._sub(context.dx, context.ax);
+ context.al = context.cl;
+ context._and(context.al, 1);
+ if (!context.flags.z()) goto oddwidth3;
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop5:
+ __dispatch_call(context, context.ax);
+ context._add(context.di, context.dx);
+ if (--context.cx) goto multiloop5;
+ return;
+oddwidth3:
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop6:
+ __dispatch_call(context, context.ax);
+ context._movsb();
+ context._add(context.di, context.dx);
+ if (--context.cx) goto multiloop6;
+ return;
+}
+
+static void multidump(Context & context) {
+ context.dx = 0x0a000;
+ context.es = context.dx;
+ context.ds = context.data.word(400);
+ context.ax = context.bx;
+ context.bx = 320;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.dx = 320;
+ context.si = context.di;
+ context.al = context.cl;
+ context._and(context.al, 1);
+ if (!context.flags.z()) goto oddwidth;
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.bl = context.cl;
+ context.bh = 0;
+ context._neg(context.bx);
+ context._add(context.bx, context.dx);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop1:
+ __dispatch_call(context, context.ax);
+ context._add(context.di, context.bx);
+ context._add(context.si, context.bx);
+ if (--context.cx) goto multiloop1;
+ return;
+oddwidth:
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.bl = context.cl;
+ context.bh = 0;
+ context._neg(context.bx);
+ context._add(context.bx, 320);
+ context.cl = context.ch;
+ context.ch = 0;
+multiloop2:
+ __dispatch_call(context, context.ax);
+ context._movsb();
+ context._add(context.di, context.bx);
+ context._add(context.si, context.bx);
+ if (--context.cx) goto multiloop2;
+ return;
+}
+
+static void width160(Context & context) {
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ width128:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ width110:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ width88:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ width80:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ width63:
+ context._movsw();
+ width62:
+ context._movsw();
+ width61:
+ context._movsw();
+ width60:
+ context._movsw();
+ width59:
+ context._movsw();
+ width58:
+ context._movsw();
+ width57:
+ context._movsw();
+ width56:
+ context._movsw();
+ width55:
+ context._movsw();
+ width54:
+ context._movsw();
+ width53:
+ context._movsw();
+ width52:
+ context._movsw();
+ width51:
+ context._movsw();
+ width50:
+ context._movsw();
+ width49:
+ context._movsw();
+ width48:
+ context._movsw();
+ width47:
+ context._movsw();
+ width46:
+ context._movsw();
+ width45:
+ context._movsw();
+ width44:
+ context._movsw();
+ width43:
+ context._movsw();
+ width42:
+ context._movsw();
+ width41:
+ context._movsw();
+ width40:
+ context._movsw();
+ width39:
+ context._movsw();
+ width38:
+ context._movsw();
+ width37:
+ context._movsw();
+ width36:
+ context._movsw();
+ width35:
+ context._movsw();
+ width34:
+ context._movsw();
+ width33:
+ context._movsw();
+ width32:
+ context._movsw();
+ width31:
+ context._movsw();
+ width30:
+ context._movsw();
+ width29:
+ context._movsw();
+ width28:
+ context._movsw();
+ width27:
+ context._movsw();
+ width26:
+ context._movsw();
+ width25:
+ context._movsw();
+ width24:
+ context._movsw();
+ width23:
+ context._movsw();
+ width22:
+ context._movsw();
+ width21:
+ context._movsw();
+ width20:
+ context._movsw();
+ width19:
+ context._movsw();
+ width18:
+ context._movsw();
+ width17:
+ context._movsw();
+ width16:
+ context._movsw();
+ width15:
+ context._movsw();
+ width14:
+ context._movsw();
+ width13:
+ context._movsw();
+ width12:
+ context._movsw();
+ width11:
+ context._movsw();
+ width10:
+ context._movsw();
+ width9:
+ context._movsw();
+ width8:
+ context._movsw();
+ width7:
+ context._movsw();
+ width6:
+ context._movsw();
+ width5:
+ context._movsw();
+ width4:
+ context._movsw();
+ width3:
+ context._movsw();
+ width2:
+ context._movsw();
+ width1:
+ context._movsw();
+ width0:
+ return;
+}
+
+static void doblocks(Context & context) {
+ context.es = context.data.word(400);
+ context.ax = context.data.word(119);
+ context.cx = 320;
+ context._mul(context.cx);
+ context.di = context.data.word(117);
+ context._add(context.di, context.ax);
+ context.al = context.data.byte(149);
+ context.ah = 0;
+ context.bx = 66;
+ context._mul(context.bx);
+ context.bl = context.data.byte(148);
+ context.bh = 0;
+ context._add(context.ax, context.bx);
+ context.si = 0;
+ context._add(context.si, context.ax);
+ context.cx = 10;
+loop120:
+ context.push(context.di);
+ context.push(context.cx);
+ context.cx = 11;
+loop124:
+ context.push(context.cx);
+ context.push(context.di);
+ context.ds = context.data.word(418);
+ context._lodsb();
+ context.ds = context.data.word(416);
+ context.push(context.si);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto zeroblock;
+ context.ah = context.al;
+ context.al = 0;
+ context.si = 0+192;
+ context._add(context.si, context.ax);
+ context.bh = 14;
+ context.bh = 4;
+firstbitofblock:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._add(context.di, 320-16);
+ context._sub(context.bh, 1);
+ if (!context.flags.z()) goto firstbitofblock;
+ context.bh = 12;
+loop125:
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context._movsw();
+ context.ax = 0x0dfdf;
+ context._stosw();
+ context._stosw();
+ context._add(context.di, 320-20);
+ context._sub(context.bh, 1);
+ if (!context.flags.z()) goto loop125;
+ context._add(context.di, 4);
+ context.ax = 0x0dfdf;
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._add(context.di, 320-16);
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._add(context.di, 320-16);
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._add(context.di, 320-16);
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+ context._stosw();
+zeroblock:
+ context.si = context.pop();
+ context.di = context.pop();
+ context.cx = context.pop();
+ context._add(context.di, 16);
+ if (--context.cx) goto loop124;
+ context._add(context.si, 66-11);
+ context.cx = context.pop();
+ context.di = context.pop();
+ context._add(context.di, 320*16);
+ if (--context.cx) goto loop120;
+ return;
+}
+
+static void showframe(Context & context) {
+ context.push(context.dx);
+ context.push(context.ax);
+ context.cx = context.ax;
+ context._and(context.cx, 511);
+ context._add(context.cx, context.cx);
+ context.si = context.cx;
+ context._add(context.cx, context.cx);
+ context._add(context.si, context.cx);
+ context._cmp(context.data.word(context.si), 0);
+ if (!context.flags.z()) goto notblankshow;
+ context.cx = 0;
+ return;
+notblankshow:
+ context._test(context.ah, 128);
+ if (!context.flags.z()) goto skipoffsets;
+ context.al = context.data.byte(context.si+4);
+ context.ah = 0;
+ context._add(context.di, context.ax);
+ context.al = context.data.byte(context.si+5);
+ context.ah = 0;
+ context._add(context.bx, context.ax);
+skipoffsets:
+ context.cx = context.data.word(context.si+0);
+ context.ax = context.data.word(context.si+2);
+ context._add(context.ax, 2080);
+ context.si = context.ax;
+ context.ax = context.pop();
+ context.dx = context.pop();
+ context._cmp(context.ah, 0);
+ if (context.flags.z()) goto noeffects;
+ context._test(context.ah, 128);
+ if (context.flags.z()) goto notcentred;
+ context.push(context.ax);
+ context.al = context.cl;
+ context.ah = 0;
+ context._shr(context.ax, 1);
+ context._sub(context.di, context.ax);
+ context.al = context.ch;
+ context.ah = 0;
+ context._shr(context.ax, 1);
+ context._sub(context.bx, context.ax);
+ context.ax = context.pop();
+notcentred:
+ context._test(context.ah, 64);
+ if (context.flags.z()) goto notdiffdest;
+ context.push(context.cx);
+ frameoutfx(context);
+ context.cx = context.pop();
+ return;
+notdiffdest:
+ context._test(context.ah, 8);
+ if (context.flags.z()) goto notprintlist;
+ context.push(context.ax);
+ context.ax = context.di;
+ context._sub(context.ax, context.data.word(117));
+ context.push(context.bx);
+ context._sub(context.bx, context.data.word(119));
+ context.ah = context.bl;
+ context.bx = context.pop();
+ context.ax = context.pop();
+notprintlist:
+ context._test(context.ah, 4);
+ if (context.flags.z()) goto notflippedx;
+ context.dx = 320;
+ context.es = context.data.word(400);
+ context.push(context.cx);
+ frameoutfx(context);
+ context.cx = context.pop();
+ return;
+notflippedx:
+ context._test(context.ah, 2);
+ if (context.flags.z()) goto notnomask;
+ context.dx = 320;
+ context.es = context.data.word(400);
+ context.push(context.cx);
+ frameoutnm(context);
+ context.cx = context.pop();
+ return;
+notnomask:
+ context._test(context.ah, 32);
+ if (context.flags.z()) goto noeffects;
+ context.dx = 320;
+ context.es = context.data.word(400);
+ context.push(context.cx);
+ frameoutbh(context);
+ context.cx = context.pop();
+ return;
+noeffects:
+ context.dx = 320;
+ context.es = context.data.word(400);
+ context.push(context.cx);
+ frameoutv(context);
+ context.cx = context.pop();
+ return;
+}
+
+static void frameoutv(Context & context) {
+ context.push(context.dx);
+ context.ax = context.bx;
+ context.bx = context.dx;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.dx = context.pop();
+ context.push(context.cx);
+ context.ch = 0;
+ context._sub(context.dx, context.cx);
+ context.cx = context.pop();
+frameloop1:
+ context.push(context.cx);
+ context.ch = 0;
+frameloop2:
+ context._lodsb();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto backtosolid;
+backtoother:
+ context._add(context.di, 1);
+ if (--context.cx) goto frameloop2;
+ context.cx = context.pop();
+ context._add(context.di, context.dx);
+ context._sub(context.ch, 1);
+ if (!context.flags.z()) goto frameloop1;
+ return;
+frameloop3:
+ context._lodsb();
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto backtoother;
+backtosolid:
+ context._stosb();
+ if (--context.cx) goto frameloop3;
+ context.cx = context.pop();
+ context._add(context.di, context.dx);
+ context._sub(context.ch, 1);
+ if (!context.flags.z()) goto frameloop1;
+ return;
+}
+
+static void frameoutnm(Context & context) {
+ context.push(context.dx);
+ context.ax = context.bx;
+ context.bx = context.dx;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.dx = context.pop();
+ context.push(context.cx);
+ context.ch = 0;
+ context._sub(context.dx, context.cx);
+ context.cx = context.pop();
+ context.al = context.cl;
+ context._and(context.al, 1);
+ if (!context.flags.z()) goto oddwidthframe;
+ context.bl = context.cl;
+ context.bh = 0;
+ context.ax = 1819;
+ context._shr(context.bx, 1);
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+nmloop1:
+ __dispatch_call(context, context.ax);
+ context._add(context.di, context.dx);
+ if (--context.cx) goto nmloop1;
+ return;
+oddwidthframe:
+ context.bl = context.cl;
+ context.bh = 0;
+ context._shr(context.bx, 1);
+ context.ax = 1819;
+ context._sub(context.ax, context.bx);
+ context.cl = context.ch;
+ context.ch = 0;
+nmloop2:
+ __dispatch_call(context, context.ax);
+ context._movsb();
+ context._add(context.di, context.dx);
+ if (--context.cx) goto nmloop2;
+ return;
+}
+
+static void frameoutbh(Context & context) {
+ context.push(context.dx);
+ context.ax = context.bx;
+ context.bx = context.dx;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.dx = context.pop();
+ context.push(context.cx);
+ context.ch = 0;
+ context._sub(context.dx, context.cx);
+ context.cx = context.pop();
+bhloop2:
+ context.push(context.cx);
+ context.ch = 0;
+ context.ah = 255;
+bhloop1:
+ context._cmp(context.data.byte(context.di), context.ah);
+ if (!context.flags.z()) goto nofill;
+ context._movsb();
+ if (--context.cx) goto bhloop1;
+ goto nextline;
+nofill:
+ context._add(context.di, 1);
+ context._add(context.si, 1);
+ if (--context.cx) goto bhloop1;
+nextline:
+ context._add(context.di, context.dx);
+ context.cx = context.pop();
+ context._sub(context.ch, 1);
+ if (!context.flags.z()) goto bhloop2;
+ return;
+}
+
+static void frameoutfx(Context & context) {
+ context.push(context.dx);
+ context.ax = context.bx;
+ context.bx = context.dx;
+ context._mul(context.bx);
+ context._add(context.di, context.ax);
+ context.dx = context.pop();
+ context.push(context.cx);
+ context.ch = 0;
+ context._add(context.dx, context.cx);
+ context.cx = context.pop();
+frameloopfx1:
+ context.push(context.cx);
+ context.ch = 0;
+frameloopfx2:
+ context._lodsb();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto backtosolidfx;
+backtootherfx:
+ context._sub(context.di, 1);
+ if (--context.cx) goto frameloopfx2;
+ context.cx = context.pop();
+ context._add(context.di, context.dx);
+ context._sub(context.ch, 1);
+ if (!context.flags.z()) goto frameloopfx1;
+ return;
+frameloopfx3:
+ context._lodsb();
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto backtootherfx;
+backtosolidfx:
+ context.data.byte(context.di) = context.al;
+ context._sub(context.di, 1);
+ if (--context.cx) goto frameloopfx3;
+ context.cx = context.pop();
+ context._add(context.di, context.dx);
+ context._sub(context.ch, 1);
+ if (!context.flags.z()) goto frameloopfx1;
+ return;
+}
+
+static void transferinv(Context & context) {
+ context.di = context.data.word(12);
+ context.push(context.di);
+ context.al = context.data.byte(10);
+ context.ah = 0;
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.bx);
+ context._add(context.ax, 1);
+ context.cx = 6;
+ context._mul(context.cx);
+ context.es = context.data.word(398);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context._add(context.di, 0+2080);
+ context.push(context.bx);
+ context.al = context.data.byte(90);
+ context.ah = 0;
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.bx);
+ context._add(context.ax, 1);
+ context.cx = 6;
+ context._mul(context.cx);
+ context.ds = context.data.word(446);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context.si = 0+2080;
+ context.al = context.data.byte(context.bx);
+ context.ah = 0;
+ context.cl = context.data.byte(context.bx+1);
+ context.ch = 0;
+ context._add(context.si, context.data.word(context.bx+2));
+ context.dx = context.data.word(context.bx+4);
+ context.bx = context.pop();
+ context.data.byte(context.bx+0) = context.al;
+ context.data.byte(context.bx+1) = context.cl;
+ context.data.word(context.bx+4) = context.dx;
+ context._mul(context.cx);
+ context.cx = context.ax;
+ context.push(context.cx);
+ while(--context.cx) context._movsb();
+ context.cx = context.pop();
+ context.ax = context.pop();
+ context.data.word(context.bx+2) = context.ax;
+ context._add(context.data.word(12), context.cx);
+ return;
+}
+
+static void transfermap(Context & context) {
+ context.di = context.data.word(12);
+ context.push(context.di);
+ context.al = context.data.byte(10);
+ context.ah = 0;
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.bx);
+ context.cx = 6;
+ context._mul(context.cx);
+ context.es = context.data.word(398);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context._add(context.di, 0+2080);
+ context.push(context.bx);
+ context.al = context.data.byte(90);
+ context.ah = 0;
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.bx);
+ context.cx = 6;
+ context._mul(context.cx);
+ context.ds = context.data.word(446);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context.si = 0+2080;
+ context.al = context.data.byte(context.bx);
+ context.ah = 0;
+ context.cl = context.data.byte(context.bx+1);
+ context.ch = 0;
+ context._add(context.si, context.data.word(context.bx+2));
+ context.dx = context.data.word(context.bx+4);
+ context.bx = context.pop();
+ context.data.byte(context.bx+0) = context.al;
+ context.data.byte(context.bx+1) = context.cl;
+ context.data.word(context.bx+4) = context.dx;
+ context._mul(context.cx);
+ context.cx = context.ax;
+ context.push(context.cx);
+ while(--context.cx) context._movsb();
+ context.cx = context.pop();
+ context.ax = context.pop();
+ context.data.word(context.bx+2) = context.ax;
+ context._add(context.data.word(12), context.cx);
+ return;
+}
+
+static void dofade(Context & context) {
context._cmp(context.data.byte(344), 0);
if (context.flags.z()) goto finishfade;
context.cl = context.data.byte(345);
@@ -3407,7 +5215,33 @@ finishfade:
return;
}
-static inline void fadetowhite(Context & context) {
+static void clearendpal(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
+ context.cx = 768;
+ context.al = 0;
+ while(--context.cx) context._stosb();
+ return;
+}
+
+static void clearpalette(Context & context) {
+ context.data.byte(344) = 0;
+ clearstartpal(context);
+ dumpcurrent(context);
+ return;
+}
+
+static void fadescreenup(Context & context) {
+ clearstartpal(context);
+ paltoendpal(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 128;
+ return;
+}
+
+static void fadetowhite(Context & context) {
context.es = context.data.word(412);
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
context.cx = 768;
@@ -3426,7 +5260,7 @@ static inline void fadetowhite(Context & context) {
return;
}
-static inline void fadefromwhite(Context & context) {
+static void fadefromwhite(Context & context) {
context.es = context.data.word(412);
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
context.cx = 768;
@@ -3445,7 +5279,17 @@ static inline void fadefromwhite(Context & context) {
return;
}
-static inline void fadescreendownhalf(Context & context) {
+static void fadescreenups(Context & context) {
+ clearstartpal(context);
+ paltoendpal(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 64;
+ return;
+}
+
+static void fadescreendownhalf(Context & context) {
paltostartpal(context);
paltoendpal(context);
context.cx = 768;
@@ -3474,7 +5318,7 @@ halfend:
return;
}
-static inline void fadescreenuphalf(Context & context) {
+static void fadescreenuphalf(Context & context) {
endpaltostart(context);
paltoendpal(context);
context.data.byte(344) = 1;
@@ -3484,7 +5328,187 @@ static inline void fadescreenuphalf(Context & context) {
return;
}
-static inline void fadecalculation(Context & context) {
+static void fadescreendown(Context & context) {
+ paltostartpal(context);
+ clearendpal(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 128;
+ return;
+}
+
+static void fadescreendowns(Context & context) {
+ paltostartpal(context);
+ clearendpal(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 64;
+ return;
+}
+
+static void clearstartpal(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
+ context.cx = 256;
+wholeloop1:
+ context.ax = 0;
+ context._stosw();
+ context.al = 0;
+ context._stosb();
+ if (--context.cx) goto wholeloop1;
+ return;
+}
+
+static void showgun(Context & context) {
+ context.data.byte(348) = 0;
+ context.data.byte(347) = 0;
+ context.data.byte(349) = 0;
+ paltostartpal(context);
+ paltoendpal(context);
+ greyscalesum(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 128;
+ context.cx = 130;
+ hangon(context);
+ endpaltostart(context);
+ clearendpal(context);
+ context.data.byte(344) = 1;
+ context.data.byte(346) = 63;
+ context.data.byte(343) = 0;
+ context.data.byte(345) = 128;
+ context.cx = 200;
+ hangon(context);
+ context.data.byte(531) = 34;
+ loadroomssample(context);
+ context.data.byte(386) = 0;
+ context.dx = 2364;
+ loadintotemp(context);
+ createpanel2(context);
+ context.ds = context.data.word(458);
+ context.al = 0;
+ context.ah = 0;
+ context.di = 100;
+ context.bx = 4;
+ showframe(context);
+ context.ds = context.data.word(458);
+ context.al = 1;
+ context.ah = 0;
+ context.di = 158;
+ context.bx = 106;
+ showframe(context);
+ worktoscreen(context);
+ getridoftemp(context);
+ fadescreenup(context);
+ context.cx = 160;
+ hangon(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.dx = 2273;
+ loadtemptext(context);
+ rollendcredits2(context);
+ getridoftemptext(context);
+ return;
+}
+
+static void rollendcredits2(Context & context) {
+ rollem(context);
+ return;
+}
+
+static void rollem(Context & context) {
+ context.cl = 160;
+ context.ch = 160;
+ context.di = 25;
+ context.bx = 20;
+ context.ds = context.data.word(402);
+ context.si = 0;
+ multiget(context);
+ context.es = context.data.word(466);
+ context.si = 49*2;
+ context.ax = context.data.word(context.si);
+ context.si = context.ax;
+ context._add(context.si, 66*2);
+ context.cx = 80;
+endcredits21:
+ context.push(context.cx);
+ context.bx = 10;
+ context.cx = context.data.word(77);
+endcredits22:
+ context.push(context.cx);
+ context.push(context.si);
+ context.push(context.di);
+ context.push(context.es);
+ context.push(context.bx);
+ vsync(context);
+ context.cl = 160;
+ context.ch = 160;
+ context.di = 25;
+ context.bx = 20;
+ context.ds = context.data.word(402);
+ context.si = 0;
+ multiput(context);
+ vsync(context);
+ context.bx = context.pop();
+ context.es = context.pop();
+ context.di = context.pop();
+ context.si = context.pop();
+ context.push(context.si);
+ context.push(context.di);
+ context.push(context.es);
+ context.push(context.bx);
+ context.cx = 18;
+onelot2:
+ context.push(context.cx);
+ context.di = 25;
+ context.dx = 161;
+ context.ax = 0;
+ printdirect(context);
+ context._add(context.bx, context.data.word(77));
+ context.cx = context.pop();
+ if (--context.cx) goto onelot2;
+ vsync(context);
+ context.cl = 160;
+ context.ch = 160;
+ context.di = 25;
+ context.bx = 20;
+ multidump(context);
+ context.bx = context.pop();
+ context.es = context.pop();
+ context.di = context.pop();
+ context.si = context.pop();
+ context.cx = context.pop();
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto endearly2;
+ context._sub(context.bx, 1);
+ if (--context.cx) goto endcredits22;
+ context.cx = context.pop();
+looknext2:
+ context.al = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto gotnext2;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto gotnext2;
+ goto looknext2;
+gotnext2:
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto endearly;
+ if (--context.cx) goto endcredits21;
+ context.cx = 120;
+ hangone(context);
+ return;
+endearly2:
+ context.cx = context.pop();
+endearly:
+ return;
+}
+
+static void fadecalculation(Context & context) {
context._cmp(context.data.byte(346), 0);
if (context.flags.z()) goto nomorefading;
context.bl = context.data.byte(346);
@@ -3517,7 +5541,82 @@ nomorefading:
return;
}
-static inline void startpaltoend(Context & context) {
+static void greyscalesum(Context & context) {
+ context.es = context.data.word(412);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
+ context.cx = 256;
+greysumloop1:
+ context.push(context.cx);
+ context.bx = 0;
+ context.al = context.data.byte(context.si);
+ context.ah = 0;
+ context.cx = 20;
+ context._mul(context.cx);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.si+1);
+ context.ah = 0;
+ context.cx = 59;
+ context._mul(context.cx);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.si+2);
+ context.ah = 0;
+ context.cx = 11;
+ context._mul(context.cx);
+ context._add(context.bx, context.ax);
+ context.al = -1;
+greysumloop2:
+ context._add(context.al, 1);
+ context._sub(context.bx, 100);
+ if (!context.flags.c()) goto greysumloop2;
+ context.bl = context.al;
+ context.al = context.bl;
+ context.ah = context.data.byte(348);
+ context._cmp(context.al, 0);
+ context._add(context.al, context.ah);
+noaddr:
+ context._stosb();
+ context.ah = context.data.byte(347);
+ context.al = context.bl;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto noaddg;
+ context._add(context.al, context.ah);
+noaddg:
+ context._stosb();
+ context.ah = context.data.byte(349);
+ context.al = context.bl;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto noaddb;
+ context._add(context.al, context.ah);
+noaddb:
+ context._stosb();
+ context._add(context.si, 3);
+ context.cx = context.pop();
+ if (--context.cx) goto greysumloop1;
+ return;
+}
+
+static void paltostartpal(Context & context) {
+ context.es = context.data.word(412);
+ context.ds = context.data.word(412);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
+ context.cx = 768/2;
+ while(--context.cx) context._movsw();
+ return;
+}
+
+static void endpaltostart(Context & context) {
+ context.es = context.data.word(412);
+ context.ds = context.data.word(412);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
+ context.cx = 768/2;
+ while(--context.cx) context._movsw();
+ return;
+}
+
+static void startpaltoend(Context & context) {
context.es = context.data.word(412);
context.ds = context.data.word(412);
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
@@ -3527,7 +5626,42 @@ static inline void startpaltoend(Context & context) {
return;
}
-static inline void fadedownmon(Context & context) {
+static void paltoendpal(Context & context) {
+ context.es = context.data.word(412);
+ context.ds = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
+ context.cx = 768/2;
+ while(--context.cx) context._movsw();
+ return;
+}
+
+static void allpalette(Context & context) {
+ context.es = context.data.word(412);
+ context.ds = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
+ context.cx = 768/2;
+ while(--context.cx) context._movsw();
+ dumpcurrent(context);
+ return;
+}
+
+static void dumpcurrent(Context & context) {
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3);
+ context.ds = context.data.word(412);
+ vsync(context);
+ context.al = 0;
+ context.cx = 128;
+ showgroup(context);
+ vsync(context);
+ context.al = 128;
+ context.cx = 128;
+ showgroup(context);
+ return;
+}
+
+static void fadedownmon(Context & context) {
paltostartpal(context);
paltoendpal(context);
context.es = context.data.word(412);
@@ -3547,7 +5681,7 @@ static inline void fadedownmon(Context & context) {
return;
}
-static inline void fadeupmon(Context & context) {
+static void fadeupmon(Context & context) {
paltostartpal(context);
paltoendpal(context);
context.es = context.data.word(412);
@@ -3567,7 +5701,7 @@ static inline void fadeupmon(Context & context) {
return;
}
-static inline void fadeupmonfirst(Context & context) {
+static void fadeupmonfirst(Context & context) {
paltostartpal(context);
paltoendpal(context);
context.es = context.data.word(412);
@@ -3591,7 +5725,7 @@ static inline void fadeupmonfirst(Context & context) {
return;
}
-static inline void fadeupyellows(Context & context) {
+static void fadeupyellows(Context & context) {
paltoendpal(context);
context.es = context.data.word(412);
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+(231*3);
@@ -3610,7 +5744,7 @@ static inline void fadeupyellows(Context & context) {
return;
}
-static inline void initialmoncols(Context & context) {
+static void initialmoncols(Context & context) {
paltostartpal(context);
context.es = context.data.word(412);
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+(230*3);
@@ -3628,7 +5762,559 @@ static inline void initialmoncols(Context & context) {
return;
}
-static inline void monprint(Context & context) {
+static void titles(Context & context) {
+ clearpalette(context);
+ biblequote(context);
+ intro(context);
+ return;
+}
+
+static void endgame(Context & context) {
+ context.dx = 2273;
+ loadtemptext(context);
+ monkspeaking(context);
+ gettingshot(context);
+ getridoftemptext(context);
+ context.data.byte(387) = 7;
+ context.data.byte(388) = 1;
+ context.cx = 200;
+ hangon(context);
+ return;
+}
+
+static void monkspeaking(Context & context) {
+ context.data.byte(531) = 35;
+ loadroomssample(context);
+ context.dx = 2377;
+ loadintotemp(context);
+ clearwork(context);
+ showmonk(context);
+ worktoscreen(context);
+ context.data.byte(386) = 7;
+ context.data.byte(388) = -1;
+ context.data.byte(387) = 0;
+ context.al = 12;
+ context.ah = 255;
+ playchannel0(context);
+ fadescreenups(context);
+ context.cx = 300;
+ hangon(context);
+ context.al = 40;
+nextmonkspeak:
+ context.push(context.ax);
+ context.ah = 0;
+ context.si = context.ax;
+ context._add(context.si, context.si);
+ context.es = context.data.word(466);
+ context.ax = context.data.word(context.si);
+ context._add(context.ax, 66*2);
+ context.si = context.ax;
+nextbit:
+ context.di = 36;
+ context.bx = 140;
+ context.dl = 239;
+ printdirect(context);
+ context.push(context.ax);
+ context.push(context.si);
+ context.push(context.es);
+ worktoscreen(context);
+ clearwork(context);
+ showmonk(context);
+ context.cx = 240;
+ hangon(context);
+ context.es = context.pop();
+ context.si = context.pop();
+ context.ax = context.pop();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto nextbit;
+ context.ax = context.pop();
+ context._add(context.al, 1);
+ context._cmp(context.al, 44);
+ if (!context.flags.z()) goto nextmonkspeak;
+ context.data.byte(388) = 1;
+ context.data.byte(387) = 7;
+ fadescreendowns(context);
+ context.cx = 300;
+ hangon(context);
+ getridoftemp(context);
+ return;
+}
+
+static void showmonk(Context & context) {
+ context.al = 0;
+ context.ah = 128;
+ context.di = 160;
+ context.bx = 72;
+ context.ds = context.data.word(458);
+ showframe(context);
+ return;
+}
+
+static void gettingshot(Context & context) {
+ context.data.byte(188) = 55;
+ clearpalette(context);
+ loadintroroom(context);
+ fadescreenups(context);
+ context.data.byte(387) = 0;
+ context.data.byte(388) = -1;
+ runendseq(context);
+ clearbeforeload(context);
+ return;
+}
+
+static void credits(Context & context) {
+ clearpalette(context);
+ realcredits(context);
+ return;
+}
+
+static void biblequote(Context & context) {
+ mode640x480(context);
+ context.dx = 2390;
+ showpcx(context);
+ fadescreenups(context);
+ context.cx = 80;
+ hangone(context);
+ context.cx = 560;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 200;
+ hangone(context);
+ cancelch0(context);
+ return;
+}
+
+static void hangone(Context & context) {
+hangonloope:
+ context.push(context.cx);
+ vsync(context);
+ context.cx = context.pop();
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto hangonearly;
+ if (--context.cx) goto hangonloope;
+ return;
+hangonearly:
+ context.ax = context.pop();
+ context.ax = context.pop();
+ return;
+}
+
+static void intro(Context & context) {
+ context.dx = 2260;
+ loadtemptext(context);
+ loadpalfromiff(context);
+ setmode(context);
+ context.data.byte(188) = 50;
+ clearpalette(context);
+ loadintroroom(context);
+ context.data.byte(386) = 7;
+ context.data.byte(388) = -1;
+ context.data.byte(387) = 0;
+ context.al = 12;
+ context.ah = 255;
+ playchannel0(context);
+ fadescreenups(context);
+ runintroseq(context);
+ clearbeforeload(context);
+ context.data.byte(188) = 52;
+ loadintroroom(context);
+ runintroseq(context);
+ clearbeforeload(context);
+ context.data.byte(188) = 53;
+ loadintroroom(context);
+ runintroseq(context);
+ clearbeforeload(context);
+ allpalette(context);
+ context.data.byte(188) = 54;
+ loadintroroom(context);
+ runintroseq(context);
+ getridoftemptext(context);
+ clearbeforeload(context);
+ return;
+}
+
+static void runintroseq(Context & context) {
+ context.data.byte(103) = 0;
+moreintroseq:
+ vsync(context);
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto earlyendrun;
+ spriteupdate(context);
+ vsync(context);
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto earlyendrun;
+ deleverything(context);
+ printsprites(context);
+ reelsonscreen(context);
+ afterintroroom(context);
+ usetimedtext(context);
+ vsync(context);
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto earlyendrun;
+ dumpmap(context);
+ dumptimedtext(context);
+ vsync(context);
+ context._cmp(context.data.byte(392), 1);
+ if (context.flags.z()) goto earlyendrun;
+ context._cmp(context.data.byte(103), 1);
+ if (!context.flags.z()) goto moreintroseq;
+ return;
+earlyendrun:
+ context.ax = context.pop();
+ context.ax = context.pop();
+ getridoftemptext(context);
+ clearbeforeload(context);
+ return;
+}
+
+static void runendseq(Context & context) {
+ atmospheres(context);
+ context.data.byte(103) = 0;
+moreendseq:
+ vsync(context);
+ spriteupdate(context);
+ vsync(context);
+ deleverything(context);
+ printsprites(context);
+ reelsonscreen(context);
+ afterintroroom(context);
+ usetimedtext(context);
+ vsync(context);
+ dumpmap(context);
+ dumptimedtext(context);
+ vsync(context);
+ context._cmp(context.data.byte(103), 1);
+ if (!context.flags.z()) goto moreendseq;
+ return;
+}
+
+static void loadintroroom(Context & context) {
+ context.data.byte(139) = 0;
+ context.data.byte(9) = 255;
+ loadroom(context);
+ context.data.word(121) = 72;
+ context.data.word(123) = 16;
+ clearsprites(context);
+ context.data.byte(61) = 0;
+ context.data.byte(142) = '0';
+ context.data.byte(105) = 0;
+ clearwork(context);
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ reelsonscreen(context);
+ spriteupdate(context);
+ printsprites(context);
+ worktoscreen(context);
+ return;
+}
+
+static void realcredits(Context & context) {
+ context.data.byte(531) = 33;
+ loadroomssample(context);
+ context.data.byte(386) = 0;
+ mode640x480(context);
+ context.cx = 35;
+ hangon(context);
+ context.dx = 2403;
+ showpcx(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 2;
+ hangone(context);
+ allpalette(context);
+ context.cx = 80;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ context.dx = 2416;
+ showpcx(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 2;
+ hangone(context);
+ allpalette(context);
+ context.cx = 80;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ context.dx = 2429;
+ showpcx(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 2;
+ hangone(context);
+ allpalette(context);
+ context.cx = 80;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ context.dx = 2442;
+ showpcx(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 2;
+ hangone(context);
+ allpalette(context);
+ context.cx = 80;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ context.dx = 2455;
+ showpcx(context);
+ context.al = 12;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 2;
+ hangone(context);
+ allpalette(context);
+ context.cx = 80;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ context.dx = 2468;
+ showpcx(context);
+ fadescreenups(context);
+ context.cx = 60;
+ hangone(context);
+ context.al = 13;
+ context.ah = 0;
+ playchannel0(context);
+ context.cx = 350;
+ hangone(context);
+ fadescreendowns(context);
+ context.cx = 256;
+ hangone(context);
+ return;
+}
+
+static void printchar(Context & context) {
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto ignoreit;
+ context.push(context.si);
+ context.push(context.bx);
+ context.push(context.di);
+ context._sub(context.bx, 3);
+ context.push(context.ax);
+ context._sub(context.al, 32);
+ context.ah = 0;
+ context._add(context.ax, context.data.word(71));
+ showframe(context);
+ context.ax = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.si = context.pop();
+ context._cmp(context.data.byte(72), 0);
+ if (!context.flags.z()) goto nokern;
+ kernchars(context);
+nokern:
+ context.push(context.cx);
+ context.ch = 0;
+ context._add(context.di, context.cx);
+ context.cx = context.pop();
+ignoreit:
+ return;
+}
+
+static void kernchars(Context & context) {
+ context._cmp(context.al, 'a');
+ if (context.flags.z()) goto iskern;
+ context._cmp(context.al, 'u');
+ if (context.flags.z()) goto iskern;
+ return;
+iskern:
+ context._cmp(context.ah, 'n');
+ if (context.flags.z()) goto kernit;
+ context._cmp(context.ah, 't');
+ if (context.flags.z()) goto kernit;
+ context._cmp(context.ah, 'r');
+ if (context.flags.z()) goto kernit;
+ context._cmp(context.ah, 'i');
+ if (context.flags.z()) goto kernit;
+ context._cmp(context.ah, 'l');
+ if (context.flags.z()) goto kernit;
+ return;
+kernit:
+ context._sub(context.cl, 1);
+ return;
+}
+
+static void printslow(Context & context) {
+ context.data.byte(231) = 1;
+ context.data.byte(234) = 3;
+ context.ds = context.data.word(404);
+printloopslow6:
+ context.push(context.bx);
+ context.push(context.di);
+ context.push(context.dx);
+ getnumber(context);
+ context.ch = 0;
+printloopslow5:
+ context.push(context.cx);
+ context.push(context.si);
+ context.push(context.es);
+ context.ax = context.data.word(context.si);
+ context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.es);
+ context.push(context.si);
+ context.push(context.ds);
+ modifychar(context);
+ printboth(context);
+ context.ds = context.pop();
+ context.si = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.ax = context.data.word(context.si+1);
+ context._add(context.si, 1);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto finishslow;
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto finishslow;
+ context._cmp(context.cl, 1);
+ if (context.flags.z()) goto afterslow;
+ context.push(context.di);
+ context.push(context.ds);
+ context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.es);
+ context.push(context.si);
+ modifychar(context);
+ context.data.word(71) = 91;
+ printboth(context);
+ context.data.word(71) = 0;
+ context.si = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.ds = context.pop();
+ context.di = context.pop();
+ waitframes(context);
+ context._cmp(context.ax, 0);
+ if (context.flags.z()) goto keepgoing;
+ context._cmp(context.ax, context.data.word(212));
+ if (!context.flags.z()) goto finishslow2;
+keepgoing:
+ waitframes(context);
+noslow:
+ context._cmp(context.ax, 0);
+ if (context.flags.z()) goto afterslow;
+ context._cmp(context.ax, context.data.word(212));
+ if (!context.flags.z()) goto finishslow2;
+afterslow:
+ context.es = context.pop();
+ context.si = context.pop();
+ context.cx = context.pop();
+ context._add(context.si, 1);
+ if (--context.cx) goto printloopslow5;
+ context.dx = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context._add(context.bx, 10);
+ goto printloopslow6;
+finishslow:
+ context.cx = context.pop();
+ context.si = context.pop();
+ context.es = context.pop();
+ context.dx = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.al = 0;
+ return;
+finishslow2:
+ context.cx = context.pop();
+ context.si = context.pop();
+ context.es = context.pop();
+ context.dx = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.al = 1;
+ return;
+}
+
+static void waitframes(Context & context) {
+ context.push(context.di);
+ context.push(context.bx);
+ context.push(context.es);
+ context.push(context.si);
+ context.push(context.ds);
+ readmouse(context);
+ showpointer(context);
+ vsync(context);
+ dumppointer(context);
+ delpointer(context);
+ context.ax = context.data.word(202);
+ context.ds = context.pop();
+ context.si = context.pop();
+ context.es = context.pop();
+ context.bx = context.pop();
+ context.di = context.pop();
+ return;
+}
+
+static void printboth(Context & context) {
+ context.push(context.ax);
+ context.push(context.cx);
+ context.push(context.bx);
+ context.push(context.di);
+ printchar(context);
+ context.ax = context.pop();
+ context.push(context.di);
+ context.di = context.ax;
+ multidump(context);
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.cx = context.pop();
+ context.ax = context.pop();
+ return;
+}
+
+static void printdirect(Context & context) {
+ context.data.word(84) = context.di;
+ context.ds = context.data.word(268);
+printloop6:
+ context.push(context.bx);
+ context.push(context.di);
+ context.push(context.dx);
+ getnumber(context);
+ context.ch = 0;
+printloop5:
+ context.ax = context.data.word(context.si);
+ context._add(context.si, 1);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto finishdirct;
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto finishdirct;
+ context.push(context.cx);
+ context.push(context.es);
+ modifychar(context);
+ printchar(context);
+ context.data.word(84) = context.di;
+ context.es = context.pop();
+ context.cx = context.pop();
+ if (--context.cx) goto printloop5;
+ context.dx = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context._add(context.bx, context.data.word(77));
+ goto printloop6;
+finishdirct:
+ context.dx = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ return;
+}
+
+static void monprint(Context & context) {
context.data.byte(72) = 1;
context.si = context.bx;
context.dl = 166;
@@ -3707,7 +6393,205 @@ nottrigger2:
return;
}
-static inline void fillryan(Context & context) {
+static void getnumber(Context & context) {
+ context.cx = 0;
+ context.push(context.si);
+ context.push(context.bx);
+ context.push(context.di);
+ context.push(context.ds);
+ context.push(context.es);
+ context.di = context.si;
+wordloop:
+ context.push(context.cx);
+ context.push(context.dx);
+ getnextword(context);
+ context.dx = context.pop();
+ context.cx = context.pop();
+ context._cmp(context.al, 1);
+ if (context.flags.z()) goto endoftext;
+ context.al = context.cl;
+ context.ah = 0;
+ context.push(context.bx);
+ context.bh = 0;
+ context._add(context.ax, context.bx);
+ context.bx = context.pop();
+ context._sub(context.ax, 10);
+ context.dh = 0;
+ context._cmp(context.ax, context.dx);
+ if (!context.flags.c()) goto gotoverend;
+ context._add(context.cl, context.bl);
+ context._add(context.ch, context.bh);
+ goto wordloop;
+gotoverend:
+ context.al = context.dl;
+ context._and(context.al, 1);
+ if (context.flags.z()) goto notcentre;
+ context.push(context.cx);
+ context.al = context.dl;
+ context._and(context.al, 0xfe);
+ context.ah = 0;
+ context.ch = 0;
+ context._sub(context.ax, context.cx);
+ context._add(context.ax, 20);
+ context._shr(context.ax, 1);
+ context.cx = context.pop();
+ context.es = context.pop();
+ context.ds = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.si = context.pop();
+ context._add(context.di, context.ax);
+ context.cl = context.ch;
+ return;
+notcentre:
+ context.es = context.pop();
+ context.ds = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.si = context.pop();
+ context.cl = context.ch;
+ return;
+endoftext:
+ context.al = context.cl;
+ context.ah = 0;
+ context.push(context.bx);
+ context.bh = 0;
+ context._add(context.ax, context.bx);
+ context.bx = context.pop();
+ context._sub(context.ax, 10);
+ context.dh = 0;
+ context._cmp(context.ax, context.dx);
+ if (!context.flags.c()) goto gotoverend2;
+ context._add(context.cl, context.bl);
+ context._add(context.ch, context.bh);
+gotoverend2:
+ context.al = context.dl;
+ context._and(context.al, 1);
+ if (context.flags.z()) goto notcent2;
+ context.push(context.cx);
+ context.al = context.dl;
+ context._and(context.al, 0xfe);
+ context._add(context.al, 2);
+ context.ah = 0;
+ context.ch = 0;
+ context._add(context.ax, 20);
+ context._sub(context.ax, context.cx);
+ context._shr(context.ax, 1);
+ context.cx = context.pop();
+ context.es = context.pop();
+ context.ds = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.si = context.pop();
+ context._add(context.di, context.ax);
+ context.cl = context.ch;
+ return;
+notcent2:
+ context.es = context.pop();
+ context.ds = context.pop();
+ context.di = context.pop();
+ context.bx = context.pop();
+ context.si = context.pop();
+ context.cl = context.ch;
+ return;
+}
+
+static void getnextword(Context & context) {
+ context.bx = 0;
+getloop:
+ context.ax = context.data.word(context.di);
+ context._add(context.di, 1);
+ context._add(context.bh, 1);
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto endall;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto endall;
+ context._cmp(context.al, 32);
+ if (context.flags.z()) goto endword;
+ modifychar(context);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto getloop;
+ context.push(context.ax);
+ context._sub(context.al, 32);
+ context.ah = 0;
+ context._add(context.ax, context.data.word(71));
+ context._add(context.ax, context.ax);
+ context.si = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.si, context.ax);
+ context.cl = context.data.byte(context.si+0);
+ context.ax = context.pop();
+ kernchars(context);
+ context._add(context.bl, context.cl);
+ goto getloop;
+endword:
+ context._add(context.bl, 6);
+ context.al = 0;
+ return;
+endall:
+ context._add(context.bl, 6);
+ context.al = 1;
+ return;
+}
+
+static void modifychar(Context & context) {
+ context._cmp(context.al, 128);
+ if (context.flags.c()) goto nomod;
+ context._cmp(context.al, 160);
+ if (!context.flags.z()) goto not160;
+ context.al = 'Z'+1;
+ return;
+not160:
+ context._cmp(context.al, 130);
+ if (!context.flags.z()) goto not130;
+ context.al = 'Z'+2;
+ return;
+not130:
+ context._cmp(context.al, 161);
+ if (!context.flags.z()) goto not161;
+ context.al = 'Z'+3;
+ return;
+not161:
+ context._cmp(context.al, 162);
+ if (!context.flags.z()) goto not162;
+ context.al = 'Z'+4;
+ return;
+not162:
+ context._cmp(context.al, 163);
+ if (!context.flags.z()) goto not163;
+ context.al = 'Z'+5;
+ return;
+not163:
+ context._cmp(context.al, 164);
+ if (!context.flags.z()) goto not164;
+ context.al = 'Z'+6;
+ return;
+not164:
+ context._cmp(context.al, 165);
+ if (!context.flags.z()) goto not165;
+ context.al = ','-1;
+ return;
+not165:
+ context._cmp(context.al, 168);
+ if (!context.flags.z()) goto not168;
+ context.al = 'A'-1;
+ return;
+not168:
+ context._cmp(context.al, 173);
+ if (!context.flags.z()) goto not173;
+ context.al = 'A'-4;
+ return;
+not173:
+ context._cmp(context.al, 129);
+ if (!context.flags.z()) goto not129;
+ context.al = 'A'-5;
+not129:
+ return;
+nomod:
+ return;
+}
+
+static void fillryan(Context & context) {
context.es = context.data.word(412);
context.di = 0+(228*13)+32;
findallryan(context);
@@ -3750,7 +6634,7 @@ ryanloop1:
return;
}
-static inline void fillopen(Context & context) {
+static void fillopen(Context & context) {
deltextline(context);
getopenedsize(context);
context._cmp(context.ah, 4);
@@ -3791,7 +6675,7 @@ nextopenslot:
return;
}
-static inline void findallryan(Context & context) {
+static void findallryan(Context & context) {
context.push(context.di);
context.cx = 30;
context.ax = 0x0ffff;
@@ -3823,7 +6707,7 @@ notinryaninv:
return;
}
-static inline void findallopen(Context & context) {
+static void findallopen(Context & context) {
context.push(context.di);
context.cx = 16;
context.ax = 0x0ffff;
@@ -3888,7 +6772,7 @@ findopen2a:
return;
}
-static inline void obtoinv(Context & context) {
+static void obtoinv(Context & context) {
context.push(context.bx);
context.push(context.es);
context.push(context.si);
@@ -3945,7 +6829,7 @@ finishfill:
return;
}
-static inline void isitworn(Context & context) {
+static void isitworn(Context & context) {
context.al = context.data.byte(context.bx+12);
context._cmp(context.al, 'W'-'A');
if (!context.flags.z()) goto notworn;
@@ -3955,13 +6839,96 @@ notworn:
return;
}
-static inline void makeworn(Context & context) {
+static void makeworn(Context & context) {
context.data.byte(context.bx+12) = 'W'-'A';
context.data.byte(context.bx+13) = 'E'-'A';
return;
}
-static inline void getbackfromob(Context & context) {
+static void examineob(Context & context) {
+ context.data.byte(234) = 0;
+ context.data.word(328) = 0;
+examineagain:
+ context.data.byte(237) = 0;
+ context.data.byte(108) = 0;
+ context.data.byte(110) = 255;
+ context.data.byte(111) = 255;
+ context.data.byte(104) = 0;
+ context.al = context.data.byte(100);
+ context.data.byte(102) = context.al;
+ context.data.byte(89) = 0;
+ context.data.byte(231) = 0;
+ createpanel(context);
+ showpanel(context);
+ showman(context);
+ showexit(context);
+ obicons(context);
+ obpicture(context);
+ describeob(context);
+ undertextline(context);
+ context.data.byte(100) = 255;
+ readmouse(context);
+ showpointer(context);
+ worktoscreen(context);
+ delpointer(context);
+waitexam:
+ readmouse(context);
+ showpointer(context);
+ vsync(context);
+ dumppointer(context);
+ dumptextline(context);
+ delpointer(context);
+ context.data.byte(103) = 0;
+ context.bx = 2494;
+ context._cmp(context.data.byte(104), 0);
+ if (context.flags.z()) goto notuseinv;
+ context.bx = 2556;
+ context._cmp(context.data.byte(104), 1);
+ if (context.flags.z()) goto notuseinv;
+ context.bx = 2618;
+notuseinv:
+ checkcoords(context);
+ context._cmp(context.data.byte(108), 0);
+ if (context.flags.z()) goto norex;
+ goto examineagain;
+norex:
+ context._cmp(context.data.byte(103), 0);
+ if (context.flags.z()) goto waitexam;
+ context.data.byte(106) = 0;
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto iswatching;
+ context._cmp(context.data.byte(188), 255);
+ if (!context.flags.z()) goto justgetback;
+iswatching:
+ makemainscreen(context);
+ context.data.byte(104) = 0;
+ context.data.byte(110) = 255;
+ return;
+justgetback:
+ context.data.byte(104) = 0;
+ context.data.byte(110) = 255;
+ return;
+}
+
+static void makemainscreen(Context & context) {
+ createpanel(context);
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ spriteupdate(context);
+ printsprites(context);
+ reelsonscreen(context);
+ showicon(context);
+ getunderzoom(context);
+ undertextline(context);
+ context.data.byte(100) = 255;
+ animpointer(context);
+ worktoscreenm(context);
+ context.data.byte(100) = 200;
+ context.data.byte(131) = 0;
+ return;
+}
+
+static void getbackfromob(Context & context) {
context._cmp(context.data.byte(106), 1);
if (!context.flags.z()) goto notheldob;
blank(context);
@@ -3971,7 +6938,7 @@ notheldob:
return;
}
-static inline void incryanpage(Context & context) {
+static void incryanpage(Context & context) {
context._cmp(context.data.byte(100), 222);
if (context.flags.z()) goto alreadyincryan;
context.data.byte(100) = 222;
@@ -4002,7 +6969,7 @@ findnewpage:
return;
}
-static inline void openinv(Context & context) {
+static void openinv(Context & context) {
context.data.byte(104) = 1;
context.al = 61;
context.di = 80;
@@ -4014,7 +6981,7 @@ static inline void openinv(Context & context) {
return;
}
-static inline void showryanpage(Context & context) {
+static void showryanpage(Context & context) {
context.ds = context.data.word(408);
context.di = 80+167;
context.bx = 58-12;
@@ -4038,7 +7005,7 @@ static inline void showryanpage(Context & context) {
return;
}
-static inline void openob(Context & context) {
+static void openob(Context & context) {
context.al = context.data.byte(110);
context.ah = context.data.byte(111);
context.di = 5674;
@@ -4069,7 +7036,28 @@ static inline void openob(Context & context) {
return;
}
-static inline void examicon(Context & context) {
+static void obicons(Context & context) {
+ context.al = context.data.byte(99);
+ getanyad(context);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto cantopenit;
+ context.ds = context.data.word(410);
+ context.di = 210;
+ context.bx = 1;
+ context.al = 4;
+ context.ah = 0;
+ showframe(context);
+cantopenit:
+ context.ds = context.data.word(410);
+ context.di = 260;
+ context.bx = 1;
+ context.al = 1;
+ context.ah = 0;
+ showframe(context);
+ return;
+}
+
+static void examicon(Context & context) {
context.ds = context.data.word(410);
context.di = 254;
context.bx = 5;
@@ -4079,7 +7067,224 @@ static inline void examicon(Context & context) {
return;
}
-static inline void inventory(Context & context) {
+static void obpicture(Context & context) {
+ context.al = context.data.byte(99);
+ context.ah = context.data.byte(102);
+ context._cmp(context.ah, 1);
+ if (context.flags.z()) goto setframe;
+ context._cmp(context.ah, 4);
+ if (context.flags.z()) goto exframe;
+ context.ds = context.data.word(446);
+ context.di = 160;
+ context.bx = 68;
+ context.cl = context.al;
+ context._add(context.al, context.al);
+ context._add(context.al, context.cl);
+ context._add(context.al, 1);
+ context.ah = 128;
+ showframe(context);
+ return;
+setframe:
+ return;
+exframe:
+ context.ds = context.data.word(398);
+ context.di = 160;
+ context.bx = 68;
+ context.cl = context.al;
+ context._add(context.al, context.al);
+ context._add(context.al, context.cl);
+ context._add(context.al, 1);
+ context.ah = 128;
+ showframe(context);
+ return;
+}
+
+static void describeob(Context & context) {
+ getobtextstart(context);
+ context.di = 33;
+ context.bx = 92;
+ context._cmp(context.data.byte(102), 1);
+ if (!context.flags.z()) goto notsetd;
+ context.bx = 82;
+notsetd:
+ context.dl = 241;
+ context.ah = 16;
+ context.data.word(71) = 91+91;
+ printdirect(context);
+ context.data.word(71) = 0;
+ context.di = 36;
+ context.bx = 104;
+ context._cmp(context.data.byte(102), 1);
+ if (!context.flags.z()) goto notsetd2;
+ context.bx = 94;
+notsetd2:
+ context.dl = 241;
+ context.ah = 0;
+ printdirect(context);
+ context.push(context.bx);
+ obsthatdothings(context);
+ context.bx = context.pop();
+ additionaltext(context);
+ return;
+}
+
+static void additionaltext(Context & context) {
+ context._add(context.bx, 10);
+ context.push(context.bx);
+ context.al = context.data.byte(99);
+ context.ah = context.data.byte(102);
+ context.cl = 'C';
+ context.ch = 'U';
+ context.dl = 'P';
+ context.dh = 'E';
+ compare(context);
+ if (context.flags.z()) goto emptycup;
+ context.al = context.data.byte(99);
+ context.ah = context.data.byte(102);
+ context.cl = 'C';
+ context.ch = 'U';
+ context.dl = 'P';
+ context.dh = 'F';
+ compare(context);
+ if (context.flags.z()) goto fullcup;
+ context.bx = context.pop();
+ return;
+emptycup:
+ context.al = 40;
+ findpuztext(context);
+ context.bx = context.pop();
+ context.di = 36;
+ context.dl = 241;
+ context.ah = 0;
+ printdirect(context);
+ return;
+fullcup:
+ context.al = 39;
+ findpuztext(context);
+ context.bx = context.pop();
+ context.di = 36;
+ context.dl = 241;
+ context.ah = 0;
+ printdirect(context);
+ return;
+}
+
+static void obsthatdothings(Context & context) {
+ context.al = context.data.byte(99);
+ context.ah = context.data.byte(102);
+ context.cl = 'M';
+ context.ch = 'E';
+ context.dl = 'M';
+ context.dh = 'B';
+ compare(context);
+ if (!context.flags.z()) goto notlouiscard;
+ context.al = 4;
+ getlocation(context);
+ context._cmp(context.al, 1);
+ if (context.flags.z()) goto seencard;
+ context.al = 4;
+ setlocation(context);
+ lookatcard(context);
+seencard:
+ return;
+notlouiscard:
+ return;
+}
+
+static void getobtextstart(Context & context) {
+ context.es = context.data.word(438);
+ context.si = 0;
+ context.cx = 0+(82*2);
+ context._cmp(context.data.byte(102), 2);
+ if (context.flags.z()) goto describe;
+ context.es = context.data.word(440);
+ context.si = 0;
+ context.cx = 0+(130*2);
+ context._cmp(context.data.byte(102), 1);
+ if (context.flags.z()) goto describe;
+ context.es = context.data.word(398);
+ context.si = 0+2080+30000+(16*114);
+ context.cx = 0+2080+30000+(16*114)+((114+2)*2);
+describe:
+ context.al = context.data.byte(99);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.si, context.ax);
+ context.ax = context.data.word(context.si);
+ context._add(context.ax, context.cx);
+ context.si = context.ax;
+ context.bx = context.ax;
+tryagain:
+ context.push(context.si);
+ findnextcolon(context);
+ context.al = context.data.byte(context.si);
+ context.cx = context.si;
+ context.si = context.pop();
+ context._cmp(context.data.byte(102), 1);
+ if (!context.flags.z()) goto cantmakeoneup;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto findsometext;
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto findsometext;
+cantmakeoneup:
+ return;
+findsometext:
+ searchforsame(context);
+ goto tryagain;
+ return;
+}
+
+static void searchforsame(Context & context) {
+ context.si = context.cx;
+searchagain:
+ context._add(context.si, 1);
+ context.al = context.data.byte(context.bx);
+search:
+ context._cmp(context.data.byte(context.si), context.al);
+ if (context.flags.z()) goto gotstartletter;
+ context._add(context.cx, 1);
+ context._add(context.si, 1);
+ context._cmp(context.si, 8000);
+ if (context.flags.c()) goto search;
+ context.si = context.bx;
+ context.ax = context.pop();
+ return;
+gotstartletter:
+ context.push(context.bx);
+ context.push(context.si);
+keepchecking:
+ context._add(context.si, 1);
+ context._add(context.bx, 1);
+ context.al = context.data.byte(context.bx);
+ context.ah = context.data.byte(context.si);
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto foundmatch;
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto foundmatch;
+ context._cmp(context.al, context.ah);
+ if (context.flags.z()) goto keepchecking;
+ context.si = context.pop();
+ context.bx = context.pop();
+ goto searchagain;
+foundmatch:
+ context.si = context.pop();
+ context.bx = context.pop();
+ return;
+}
+
+static void findnextcolon(Context & context) {
+isntcolon:
+ context.al = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto endofcolon;
+ context._cmp(context.al, ':');
+ if (!context.flags.z()) goto isntcolon;
+endofcolon:
+ return;
+}
+
+static void inventory(Context & context) {
context._cmp(context.data.byte(56), 1);
if (context.flags.z()) goto iswatchinv;
context._cmp(context.data.word(21), 0);
@@ -4121,7 +7326,7 @@ doopeninv:
delpointer(context);
context.data.byte(110) = 255;
goto waitexam;
-/*continuing to unbounded code: examineagain from examineob:3-62*/
+/*continuing to unbounded code: examineagain from examineob:3-66*/
examineagain:
context.data.byte(237) = 0;
context.data.byte(108) = 0;
@@ -4182,10 +7387,14 @@ justgetback:
context.data.byte(104) = 0;
context.data.byte(110) = 255;
return;
+examlist:
+invlist1:
+openchangesize:
+withlist1:
return;
}
-static inline void setpickup(Context & context) {
+static void setpickup(Context & context) {
context._cmp(context.data.byte(102), 1);
if (context.flags.z()) goto cantpick;
context._cmp(context.data.byte(102), 3);
@@ -4244,7 +7453,7 @@ pickupexob:
return;
}
-static inline void examinventory(Context & context) {
+static void examinventory(Context & context) {
context._cmp(context.data.byte(100), 249);
if (context.flags.z()) goto alreadyexinv;
context.data.byte(100) = 249;
@@ -4268,7 +7477,7 @@ doexinv:
return;
}
-static inline void reexfrominv(Context & context) {
+static void reexfrominv(Context & context) {
findinvpos(context);
context.ax = context.data.word(context.bx);
context.data.byte(100) = context.ah;
@@ -4278,7 +7487,7 @@ static inline void reexfrominv(Context & context) {
return;
}
-static inline void reexfromopen(Context & context) {
+static void reexfromopen(Context & context) {
return;
findopenpos(context);
context.ax = context.data.word(context.bx);
@@ -4289,7 +7498,7 @@ static inline void reexfromopen(Context & context) {
return;
}
-static inline void swapwithinv(Context & context) {
+static void swapwithinv(Context & context) {
context.al = context.data.byte(89);
context.ah = context.data.byte(102);
context._cmp(context.ax, context.data.word(94));
@@ -4346,7 +7555,7 @@ doswap1:
return;
}
-static inline void swapwithopen(Context & context) {
+static void swapwithopen(Context & context) {
context.al = context.data.byte(89);
context.ah = context.data.byte(102);
context._cmp(context.ax, context.data.word(94));
@@ -4440,7 +7649,7 @@ actuallyswap:
return;
}
-static inline void intoinv(Context & context) {
+static void intoinv(Context & context) {
context._cmp(context.data.byte(106), 0);
if (!context.flags.z()) goto notout;
outofinv(context);
@@ -4491,7 +7700,30 @@ doplace:
return;
}
-static inline void outofinv(Context & context) {
+static void deletetaken(Context & context) {
+ context.es = context.data.word(426);
+ context.ah = context.data.byte(184);
+ context.ds = context.data.word(398);
+ context.si = 0+2080+30000;
+ context.cx = 114;
+takenloop:
+ context.al = context.data.byte(context.si+11);
+ context._cmp(context.al, context.ah);
+ if (!context.flags.z()) goto notinhere;
+ context.bl = context.data.byte(context.si+1);
+ context.bh = 0;
+ context._add(context.bx, context.bx);
+ context._add(context.bx, context.bx);
+ context._add(context.bx, context.bx);
+ context._add(context.bx, context.bx);
+ context.data.byte(context.bx+2) = 254;
+notinhere:
+ context._add(context.si, 16);
+ if (--context.cx) goto takenloop;
+ return;
+}
+
+static void outofinv(Context & context) {
findinvpos(context);
context.ax = context.data.word(context.bx);
context._cmp(context.al, 255);
@@ -4542,7 +7774,26 @@ dograb:
return;
}
-static inline void geteitherad(Context & context) {
+static void getfreead(Context & context) {
+ context.ah = 0;
+ context.cl = 4;
+ context._shl(context.ax, context.cl);
+ context.bx = context.ax;
+ context.es = context.data.word(426);
+ return;
+}
+
+static void getexad(Context & context) {
+ context.ah = 0;
+ context.bx = 16;
+ context._mul(context.bx);
+ context.bx = context.ax;
+ context.es = context.data.word(398);
+ context._add(context.bx, 0+2080+30000);
+ return;
+}
+
+static void geteitherad(Context & context) {
context._cmp(context.data.byte(102), 4);
if (context.flags.z()) goto isinexlist;
context.al = context.data.byte(89);
@@ -4554,7 +7805,43 @@ isinexlist:
return;
}
-static inline void getopenedsize(Context & context) {
+static void getanyad(Context & context) {
+ context._cmp(context.data.byte(102), 4);
+ if (context.flags.z()) goto isex;
+ context._cmp(context.data.byte(102), 2);
+ if (context.flags.z()) goto isfree;
+ context.al = context.data.byte(99);
+ getsetad(context);
+ context.ax = context.data.word(context.bx+4);
+ return;
+isfree:
+ context.al = context.data.byte(99);
+ getfreead(context);
+ context.ax = context.data.word(context.bx+7);
+ return;
+isex:
+ context.al = context.data.byte(99);
+ getexad(context);
+ context.ax = context.data.word(context.bx+7);
+ return;
+}
+
+static void getanyaddir(Context & context) {
+ context._cmp(context.ah, 4);
+ if (context.flags.z()) goto isex3;
+ context._cmp(context.ah, 2);
+ if (context.flags.z()) goto isfree3;
+ getsetad(context);
+ return;
+isfree3:
+ getfreead(context);
+ return;
+isex3:
+ getexad(context);
+ return;
+}
+
+static void getopenedsize(Context & context) {
context._cmp(context.data.byte(111), 4);
if (context.flags.z()) goto isex2;
context._cmp(context.data.byte(111), 2);
@@ -4575,7 +7862,16 @@ isex2:
return;
}
-static inline void findinvpos(Context & context) {
+static void getsetad(Context & context) {
+ context.ah = 0;
+ context.bx = 64;
+ context._mul(context.bx);
+ context.bx = context.ax;
+ context.es = context.data.word(428);
+ return;
+}
+
+static void findinvpos(Context & context) {
context.cx = context.data.word(198);
context._sub(context.cx, 80);
context.bx = -1;
@@ -4603,7 +7899,7 @@ findinv2:
return;
}
-static inline void findopenpos(Context & context) {
+static void findopenpos(Context & context) {
context.cx = context.data.word(198);
context._sub(context.cx, 80);
context.bx = -1;
@@ -4619,7 +7915,7 @@ findopenp1:
return;
}
-static inline void dropobject(Context & context) {
+static void dropobject(Context & context) {
context._cmp(context.data.byte(100), 223);
if (context.flags.z()) goto alreadydrop;
context.data.byte(100) = 223;
@@ -4710,7 +8006,7 @@ notinlift:
return;
}
-static inline void droperror(Context & context) {
+static void droperror(Context & context) {
context.data.byte(100) = 255;
delpointer(context);
context.di = 76;
@@ -4729,7 +8025,7 @@ static inline void droperror(Context & context) {
return;
}
-static inline void cantdrop(Context & context) {
+static void cantdrop(Context & context) {
context.data.byte(100) = 255;
delpointer(context);
context.di = 76;
@@ -4748,7 +8044,7 @@ static inline void cantdrop(Context & context) {
return;
}
-static inline void wornerror(Context & context) {
+static void wornerror(Context & context) {
context.data.byte(100) = 255;
delpointer(context);
context.di = 76;
@@ -4767,7 +8063,7 @@ static inline void wornerror(Context & context) {
return;
}
-static inline void removeobfrominv(Context & context) {
+static void removeobfrominv(Context & context) {
context._cmp(context.data.byte(99), 100);
if (context.flags.z()) goto obnotexist;
getanyad(context);
@@ -4779,7 +8075,7 @@ obnotexist:
return;
}
-static inline void selectopenob(Context & context) {
+static void selectopenob(Context & context) {
context.al = context.data.byte(99);
getanyad(context);
context._cmp(context.al, 255);
@@ -4822,7 +8118,7 @@ doopenob:
return;
}
-static inline void useopened(Context & context) {
+static void useopened(Context & context) {
context._cmp(context.data.byte(110), 255);
if (context.flags.z()) goto cannotuseopen;
context._cmp(context.data.byte(106), 0);
@@ -4906,7 +8202,7 @@ sizeok1:
return;
}
-static inline void errormessage1(Context & context) {
+static void errormessage1(Context & context) {
delpointer(context);
context.di = 76;
context.bx = 21;
@@ -4930,7 +8226,7 @@ static inline void errormessage1(Context & context) {
return;
}
-static inline void errormessage2(Context & context) {
+static void errormessage2(Context & context) {
context.data.byte(100) = 255;
delpointer(context);
context.di = 76;
@@ -4955,7 +8251,7 @@ static inline void errormessage2(Context & context) {
return;
}
-static inline void errormessage3(Context & context) {
+static void errormessage3(Context & context) {
delpointer(context);
context.di = 76;
context.bx = 21;
@@ -4976,7 +8272,7 @@ static inline void errormessage3(Context & context) {
return;
}
-static inline void checkobjectsize(Context & context) {
+static void checkobjectsize(Context & context) {
getopenedsize(context);
context.push(context.ax);
context.al = context.data.byte(89);
@@ -5017,7 +8313,7 @@ sizeok:
return;
}
-static inline void outofopen(Context & context) {
+static void outofopen(Context & context) {
context._cmp(context.data.byte(110), 255);
if (context.flags.z()) goto cantuseopen;
findopenpos(context);
@@ -5080,7 +8376,371 @@ actuallyout:
return;
}
-static inline void blockget(Context & context) {
+static void transfertoex(Context & context) {
+ emergencypurge(context);
+ getexpos(context);
+ context.al = context.data.byte(10);
+ context.push(context.ax);
+ context.push(context.di);
+ context.al = context.data.byte(89);
+ context.ah = 0;
+ context.bx = 16;
+ context._mul(context.bx);
+ context.ds = context.data.word(426);
+ context.si = context.ax;
+ context.cx = 8;
+ while(--context.cx) context._movsw();
+ context.di = context.pop();
+ context.al = context.data.byte(184);
+ context.data.byte(context.di) = context.al;
+ context.data.byte(context.di+11) = context.al;
+ context.al = context.data.byte(89);
+ context.data.byte(context.di+1) = context.al;
+ context.data.byte(context.di+2) = 4;
+ context.data.byte(context.di+3) = 255;
+ context.al = context.data.byte(107);
+ context.data.byte(context.di+4) = context.al;
+ context.al = context.data.byte(89);
+ context.data.byte(90) = context.al;
+ transfermap(context);
+ transferinv(context);
+ transfertext(context);
+ context.al = context.data.byte(89);
+ context.ah = 0;
+ context.bx = 16;
+ context._mul(context.bx);
+ context.ds = context.data.word(426);
+ context.si = context.ax;
+ context.data.byte(context.si+2) = 254;
+ pickupconts(context);
+ context.ax = context.pop();
+ return;
+}
+
+static void pickupconts(Context & context) {
+ context.al = context.data.byte(context.si+7);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto notopenable;
+ context.al = context.data.byte(89);
+ context.ah = context.data.byte(102);
+ context.dl = context.data.byte(10);
+ context.es = context.data.word(426);
+ context.bx = 0;
+ context.cx = 0;
+pickupcontloop:
+ context.push(context.cx);
+ context.push(context.es);
+ context.push(context.bx);
+ context.push(context.dx);
+ context.push(context.ax);
+ context._cmp(context.data.byte(context.bx+2), context.ah);
+ if (!context.flags.z()) goto notinsidethis;
+ context._cmp(context.data.byte(context.bx+3), context.al);
+ if (!context.flags.z()) goto notinsidethis;
+ context.data.byte(90) = context.cl;
+ transfercontoex(context);
+notinsidethis:
+ context.ax = context.pop();
+ context.dx = context.pop();
+ context.bx = context.pop();
+ context.es = context.pop();
+ context.cx = context.pop();
+ context._add(context.bx, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 80);
+ if (!context.flags.z()) goto pickupcontloop;
+notopenable:
+ return;
+}
+
+static void transfercontoex(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ context.push(context.dx);
+ context.push(context.es);
+ context.push(context.bx);
+ getexpos(context);
+ context.si = context.pop();
+ context.ds = context.pop();
+ context.push(context.di);
+ context.cx = 8;
+ while(--context.cx) context._movsw();
+ context.di = context.pop();
+ context.dx = context.pop();
+ context.al = context.data.byte(184);
+ context.data.byte(context.di) = context.al;
+ context.data.byte(context.di+11) = context.al;
+ context.al = context.data.byte(90);
+ context.data.byte(context.di+1) = context.al;
+ context.data.byte(context.di+3) = context.dl;
+ context.data.byte(context.di+2) = 4;
+ transfermap(context);
+ transferinv(context);
+ transfertext(context);
+ context.si = context.pop();
+ context.ds = context.pop();
+ context.data.byte(context.si+2) = 255;
+ return;
+}
+
+static void transfertext(Context & context) {
+ context.es = context.data.word(398);
+ context.al = context.data.byte(10);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.bx = 0+2080+30000+(16*114);
+ context._add(context.bx, context.ax);
+ context.di = context.data.word(14);
+ context.data.word(context.bx) = context.di;
+ context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2));
+ context.al = context.data.byte(90);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.ds = context.data.word(438);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context.si = 0+(82*2);
+ context.ax = context.data.word(context.bx);
+ context._add(context.si, context.ax);
+moretext:
+ context._lodsb();
+ context._stosb();
+ context._add(context.data.word(14), 1);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto moretext;
+ return;
+}
+
+static void getexpos(Context & context) {
+ context.es = context.data.word(398);
+ context.al = 0;
+ context.di = 0+2080+30000;
+tryanotherex:
+ context._cmp(context.data.byte(context.di+2), 255);
+ if (context.flags.z()) goto foundnewex;
+ context._add(context.di, 16);
+ context._add(context.al, 1);
+ context._cmp(context.al, 114);
+ if (!context.flags.z()) goto tryanotherex;
+foundnewex:
+ context.data.byte(10) = context.al;
+ return;
+}
+
+static void purgealocation(Context & context) {
+ context.push(context.ax);
+ context.es = context.data.word(398);
+ context.di = 0+2080+30000;
+ context.bx = context.pop();
+ context.cx = 0;
+purgeloc:
+ context._cmp(context.bl, context.data.byte(context.di+0));
+ if (!context.flags.z()) goto dontpurge;
+ context._cmp(context.data.byte(context.di+2), 0);
+ if (!context.flags.z()) goto dontpurge;
+ context.push(context.di);
+ context.push(context.es);
+ context.push(context.bx);
+ context.push(context.cx);
+ deleteexobject(context);
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.es = context.pop();
+ context.di = context.pop();
+dontpurge:
+ context._add(context.di, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 114);
+ if (!context.flags.z()) goto purgeloc;
+ return;
+}
+
+static void emergencypurge(Context & context) {
+checkpurgeagain:
+ context.ax = context.data.word(12);
+ context._add(context.ax, 4000);
+ context._cmp(context.ax, 30000);
+ if (context.flags.c()) goto notnearframeend;
+ purgeanitem(context);
+ goto checkpurgeagain;
+notnearframeend:
+ context.ax = context.data.word(14);
+ context._add(context.ax, 400);
+ context._cmp(context.ax, 18000);
+ if (context.flags.c()) goto notneartextend;
+ purgeanitem(context);
+ goto checkpurgeagain;
+notneartextend:
+ return;
+}
+
+static void purgeanitem(Context & context) {
+ context.es = context.data.word(398);
+ context.di = 0+2080+30000;
+ context.bl = context.data.byte(184);
+ context.cx = 0;
+lookforpurge:
+ context.al = context.data.byte(context.di+2);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto cantpurge;
+ context._cmp(context.data.byte(context.di+12), 2);
+ if (context.flags.z()) goto iscup;
+ context._cmp(context.data.byte(context.di+12), 255);
+ if (!context.flags.z()) goto cantpurge;
+iscup:
+ context._cmp(context.data.byte(context.di+11), context.bl);
+ if (context.flags.z()) goto cantpurge;
+ deleteexobject(context);
+ return;
+cantpurge:
+ context._add(context.di, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 114);
+ if (!context.flags.z()) goto lookforpurge;
+ context.di = 0+2080+30000;
+ context.bl = context.data.byte(184);
+ context.cx = 0;
+lookforpurge2:
+ context.al = context.data.byte(context.di+2);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto cantpurge2;
+ context._cmp(context.data.byte(context.di+12), 255);
+ if (!context.flags.z()) goto cantpurge2;
+ deleteexobject(context);
+ return;
+cantpurge2:
+ context._add(context.di, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 114);
+ if (!context.flags.z()) goto lookforpurge2;
+ return;
+}
+
+static void deleteexobject(Context & context) {
+ context.push(context.cx);
+ context.push(context.cx);
+ context.push(context.cx);
+ context.push(context.cx);
+ context.al = 255;
+ context.cx = 16;
+ while(--context.cx) context._stosb();
+ context.ax = context.pop();
+ context.cl = context.al;
+ context._add(context.al, context.al);
+ context._add(context.al, context.cl);
+ deleteexframe(context);
+ context.ax = context.pop();
+ context.cl = context.al;
+ context._add(context.al, context.al);
+ context._add(context.al, context.cl);
+ context._add(context.al, 1);
+ deleteexframe(context);
+ context.ax = context.pop();
+ deleteextext(context);
+ context.bx = context.pop();
+ context.bh = context.bl;
+ context.bl = 4;
+ context.di = 0+2080+30000;
+ context.cx = 0;
+deleteconts:
+ context._cmp(context.data.word(context.di+2), context.bx);
+ if (!context.flags.z()) goto notinsideex;
+ context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.di);
+ deleteexobject(context);
+ context.di = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+notinsideex:
+ context._add(context.di, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 114);
+ if (!context.flags.z()) goto deleteconts;
+ return;
+}
+
+static void deleteexframe(Context & context) {
+ context.di = 0;
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.di, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.di, context.ax);
+ context.al = context.data.byte(context.di);
+ context.ah = 0;
+ context.cl = context.data.byte(context.di+1);
+ context.ch = 0;
+ context._mul(context.cx);
+ context.si = context.data.word(context.di+2);
+ context.push(context.si);
+ context._add(context.si, 0+2080);
+ context.cx = 30000;
+ context._sub(context.cx, context.data.word(context.di+2));
+ context.di = context.si;
+ context._add(context.si, context.ax);
+ context.push(context.ax);
+ context.ds = context.es;
+ while(--context.cx) context._movsb();
+ context.bx = context.pop();
+ context._sub(context.data.word(12), context.bx);
+ context.si = context.pop();
+ context.cx = 114*3;
+ context.di = 0;
+shuffleadsdown:
+ context.ax = context.data.word(context.di+2);
+ context._cmp(context.ax, context.si);
+ if (context.flags.c()) goto beforethisone;
+ context._sub(context.ax, context.bx);
+beforethisone:
+ context.data.word(context.di+2) = context.ax;
+ context._add(context.di, 6);
+ if (--context.cx) goto shuffleadsdown;
+ return;
+}
+
+static void deleteextext(Context & context) {
+ context.di = 0+2080+30000+(16*114);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.di, context.ax);
+ context.ax = context.data.word(context.di);
+ context.si = context.ax;
+ context.di = context.ax;
+ context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2));
+ context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2));
+ context.ax = 0;
+findlenextext:
+ context.cl = context.data.byte(context.si);
+ context._add(context.ax, 1);
+ context._add(context.si, 1);
+ context._cmp(context.cl, 0);
+ if (!context.flags.z()) goto findlenextext;
+ context.cx = 18000;
+ context.bx = context.si;
+ context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2));
+ context.push(context.bx);
+ context.push(context.ax);
+ context._sub(context.cx, context.bx);
+ while(--context.cx) context._movsb();
+ context.bx = context.pop();
+ context._sub(context.data.word(14), context.bx);
+ context.si = context.pop();
+ context.cx = 114;
+ context.di = 0+2080+30000+(16*114);
+shuffletextads:
+ context.ax = context.data.word(context.di);
+ context._cmp(context.ax, context.si);
+ if (context.flags.c()) goto beforethistext;
+ context._sub(context.ax, context.bx);
+beforethistext:
+ context.data.word(context.di) = context.ax;
+ context._add(context.di, 2);
+ if (--context.cx) goto shuffletextads;
+ return;
+}
+
+static void blockget(Context & context) {
context.ah = context.al;
context.al = 0;
context.ds = context.data.word(416);
@@ -5089,7 +8749,549 @@ static inline void blockget(Context & context) {
return;
}
-static inline void adjustlen(Context & context) {
+static void drawfloor(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ eraseoldobs(context);
+ drawflags(context);
+ calcmapad(context);
+ doblocks(context);
+ showallobs(context);
+ showallfree(context);
+ showallex(context);
+ paneltomap(context);
+ initrain(context);
+ context.data.byte(62) = 0;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void calcmapad(Context & context) {
+ getdimension(context);
+ context.push(context.cx);
+ context.push(context.dx);
+ context.al = 11;
+ context._sub(context.al, context.dl);
+ context._sub(context.al, context.cl);
+ context._sub(context.al, context.cl);
+ context.ax.cbw();
+ context.bx = 8;
+ context._mul(context.bx);
+ context._add(context.ax, context.data.word(121));
+ context.data.word(117) = context.ax;
+ context.dx = context.pop();
+ context.cx = context.pop();
+ context.al = 10;
+ context._sub(context.al, context.dh);
+ context._sub(context.al, context.ch);
+ context._sub(context.al, context.ch);
+ context.ax.cbw();
+ context.bx = 8;
+ context._mul(context.bx);
+ context._add(context.ax, context.data.word(123));
+ context.data.word(119) = context.ax;
+ return;
+}
+
+static void getdimension(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32);
+ context.ch = 0;
+dimloop1:
+ addalong(context);
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto finishdim1;
+ context._add(context.ch, 1);
+ goto dimloop1;
+finishdim1:
+ context.bx = 0+(228*13)+32+60+(32*32);
+ context.cl = 0;
+dimloop2:
+ context.push(context.bx);
+ addlength(context);
+ context.bx = context.pop();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto finishdim2;
+ context._add(context.cl, 1);
+ context._add(context.bx, 3);
+ goto dimloop2;
+finishdim2:
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9);
+ context.dh = 10;
+dimloop3:
+ context.push(context.bx);
+ addalong(context);
+ context.bx = context.pop();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto finishdim3;
+ context._sub(context.dh, 1);
+ context._sub(context.bx, 11*3);
+ goto dimloop3;
+finishdim3:
+ context.bx = 0+(228*13)+32+60+(32*32)+(3*10);
+ context.dl = 11;
+dimloop4:
+ context.push(context.bx);
+ addlength(context);
+ context.bx = context.pop();
+ context._cmp(context.al, 0);
+ if (!context.flags.z()) goto finishdim4;
+ context._sub(context.dl, 1);
+ context._sub(context.bx, 3);
+ goto dimloop4;
+finishdim4:
+ context.al = context.cl;
+ context.ah = 0;
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context.data.word(125) = context.ax;
+ context.al = context.ch;
+ context.ah = 0;
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context.data.word(127) = context.ax;
+ context._sub(context.dl, context.cl);
+ context._sub(context.dh, context.ch);
+ context.al = context.dl;
+ context.ah = 0;
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context.data.byte(128) = context.al;
+ context.al = context.dh;
+ context.ah = 0;
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context._shl(context.ax, 1);
+ context.data.byte(129) = context.al;
+ return;
+}
+
+static void addalong(Context & context) {
+ context.ah = 11;
+addloop:
+ context._cmp(context.data.byte(context.bx), 0);
+ if (!context.flags.z()) goto gotalong;
+ context._add(context.bx, 3);
+ context._sub(context.ah, 1);
+ if (!context.flags.z()) goto addloop;
+ context.al = 0;
+ return;
+gotalong:
+ context.al = 1;
+ return;
+}
+
+static void addlength(Context & context) {
+ context.ah = 10;
+addloop2:
+ context._cmp(context.data.byte(context.bx), 0);
+ if (!context.flags.z()) goto gotlength;
+ context._add(context.bx, 3*11);
+ context._sub(context.ah, 1);
+ if (!context.flags.z()) goto addloop2;
+ context.al = 0;
+ return;
+gotlength:
+ context.al = 1;
+ return;
+}
+
+static void drawflags(Context & context) {
+ context.es = context.data.word(412);
+ context.di = 0+(228*13)+32+60+(32*32);
+ context.al = context.data.byte(149);
+ context.ah = 0;
+ context.cx = 66;
+ context._mul(context.cx);
+ context.bl = context.data.byte(148);
+ context.bh = 0;
+ context._add(context.ax, context.bx);
+ context.si = 0;
+ context._add(context.si, context.ax);
+ context.cx = 10;
+_tmp28:
+ context.push(context.cx);
+ context.cx = 11;
+_tmp28a:
+ context.ds = context.data.word(418);
+ context._lodsb();
+ context.ds = context.data.word(416);
+ context.push(context.si);
+ context.push(context.ax);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.si = 0;
+ context._add(context.si, context.ax);
+ context._movsw();
+ context.ax = context.pop();
+ context._stosb();
+ context.si = context.pop();
+ if (--context.cx) goto _tmp28a;
+ context._add(context.si, 66-11);
+ context.cx = context.pop();
+ if (--context.cx) goto _tmp28;
+ return;
+}
+
+static void eraseoldobs(Context & context) {
+ context._cmp(context.data.byte(62), 0);
+ if (context.flags.z()) goto donterase;
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
+ context.cx = 16;
+oberase:
+ context.push(context.cx);
+ context.push(context.bx);
+ context.ax = context.data.word(context.bx+20);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto notthisob;
+ context.di = context.bx;
+ context.al = 255;
+ context.cx = 32;
+ while(--context.cx) context._stosb();
+notthisob:
+ context.bx = context.pop();
+ context.cx = context.pop();
+ context._add(context.bx, 32);
+ if (--context.cx) goto oberase;
+donterase:
+ return;
+}
+
+static void showallobs(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32);
+ context.data.word(18) = context.bx;
+ context.di = context.bx;
+ context.cx = 128*5;
+ context.al = 255;
+ while(--context.cx) context._stosb();
+ context.es = context.data.word(444);
+ context.data.word(166) = context.es;
+ context.ax = 0;
+ context.data.word(164) = context.ax;
+ context.ax = 0+2080;
+ context.data.word(162) = context.ax;
+ context.data.byte(181) = 0;
+ context.ds = context.data.word(428);
+ context.si = 0;
+ context.cx = 128;
+showobsloop:
+ context.push(context.cx);
+ context.push(context.si);
+ context.push(context.si);
+ context._add(context.si, 58);
+ context.es = context.data.word(428);
+ getmapad(context);
+ context.si = context.pop();
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto blankframe;
+ context.al = context.data.byte(context.si+18);
+ context.ah = 0;
+ context.data.word(160) = context.ax;
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto blankframe;
+ context.push(context.es);
+ context.push(context.si);
+ calcfrframe(context);
+ finalframe(context);
+ context.si = context.pop();
+ context.es = context.pop();
+ context.al = context.data.byte(context.si+18);
+ context.data.byte(context.si+17) = context.al;
+ context._cmp(context.data.byte(context.si+8), 0);
+ if (!context.flags.z()) goto animating;
+ context._cmp(context.data.byte(context.si+5), 5);
+ if (context.flags.z()) goto animating;
+ context._cmp(context.data.byte(context.si+5), 6);
+ if (context.flags.z()) goto animating;
+ context.ax = context.data.word(160);
+ context.ah = 0;
+ context._add(context.di, context.data.word(117));
+ context._add(context.bx, context.data.word(119));
+ showframe(context);
+ goto drawnsetob;
+animating:
+ makebackob(context);
+drawnsetob:
+ context.si = context.data.word(18);
+ context.es = context.data.word(412);
+ context.al = context.data.byte(179);
+ context.ah = context.data.byte(180);
+ context.data.word(context.si) = context.ax;
+ context.cx = context.ax;
+ context.ax = context.data.word(176);
+ context._add(context.al, context.cl);
+ context._add(context.ah, context.ch);
+ context.data.word(context.si+2) = context.ax;
+ context.al = context.data.byte(181);
+ context.data.byte(context.si+4) = context.al;
+ context._add(context.si, 5);
+ context.data.word(18) = context.si;
+blankframe:
+ context._add(context.data.byte(181), 1);
+ context.si = context.pop();
+ context.cx = context.pop();
+ context._add(context.si, 64);
+ context._sub(context.cx, 1);
+ if (context.flags.z()) goto finishedsetobs;
+ goto showobsloop;
+finishedsetobs:
+ return;
+}
+
+static void makebackob(Context & context) {
+ context._cmp(context.data.byte(62), 0);
+ if (context.flags.z()) goto nomake;
+ context.al = context.data.byte(context.si+5);
+ context.ah = context.data.byte(context.si+8);
+ context.push(context.si);
+ context.push(context.ax);
+ context.push(context.si);
+ context.ax = context.data.word(168);
+ context.bx = context.data.word(170);
+ context.ah = context.bl;
+ context.si = context.ax;
+ context.cx = 49520;
+ context.dx = context.data.word(444);
+ context.di = 0;
+ makesprite(context);
+ context.ax = context.pop();
+ context.data.word(context.bx+20) = context.ax;
+ context.ax = context.pop();
+ context._cmp(context.al, 255);
+ if (!context.flags.z()) goto usedpriority;
+ context.al = 0;
+usedpriority:
+ context.data.byte(context.bx+23) = context.al;
+ context.data.byte(context.bx+30) = context.ah;
+ context.data.byte(context.bx+16) = 0;
+ context.data.byte(context.bx+18) = 0;
+ context.data.byte(context.bx+19) = 0;
+ context.si = context.pop();
+nomake:
+ return;
+}
+
+static void showallfree(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5);
+ context.data.word(18) = context.bx;
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5);
+ context.cx = 80*5;
+ context.al = 255;
+ while(--context.cx) context._stosb();
+ context.es = context.data.word(446);
+ context.data.word(166) = context.es;
+ context.ax = 0;
+ context.data.word(164) = context.ax;
+ context.ax = 0+2080;
+ context.data.word(162) = context.ax;
+ context.al = 0;
+ context.data.byte(158) = context.al;
+ context.ds = context.data.word(426);
+ context.si = 2;
+ context.cx = 0;
+loop127:
+ context.push(context.cx);
+ context.push(context.si);
+ context.push(context.si);
+ context.es = context.data.word(426);
+ getmapad(context);
+ context.si = context.pop();
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto over138;
+ context.al = context.data.byte(158);
+ context.ah = 0;
+ context.dx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.dx);
+ context.data.word(160) = context.ax;
+ context.push(context.es);
+ context.push(context.si);
+ calcfrframe(context);
+ context.es = context.data.word(402);
+ context.ds = context.data.word(166);
+ finalframe(context);
+ context.si = context.pop();
+ context.es = context.pop();
+ context._cmp(context.cx, 0);
+ if (context.flags.z()) goto over138;
+ context.ax = context.data.word(160);
+ context.ah = 0;
+ context._add(context.di, context.data.word(117));
+ context._add(context.bx, context.data.word(119));
+ showframe(context);
+ context.si = context.data.word(18);
+ context.es = context.data.word(412);
+ context.al = context.data.byte(179);
+ context.ah = context.data.byte(180);
+ context.data.word(context.si) = context.ax;
+ context.cx = context.ax;
+ context.ax = context.data.word(176);
+ context._add(context.al, context.cl);
+ context._add(context.ah, context.ch);
+ context.data.word(context.si+2) = context.ax;
+ context.ax = context.pop();
+ context.cx = context.pop();
+ context.push(context.cx);
+ context.push(context.ax);
+ context.data.byte(context.si+4) = context.cl;
+ context._add(context.si, 5);
+ context.data.word(18) = context.si;
+over138:
+ context._add(context.data.byte(158), 1);
+ context.si = context.pop();
+ context.cx = context.pop();
+ context._add(context.si, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 80);
+ if (context.flags.z()) goto finfree;
+ goto loop127;
+finfree:
+ return;
+}
+
+static void showallex(Context & context) {
+ context.es = context.data.word(412);
+ context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5);
+ context.data.word(18) = context.bx;
+ context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5);
+ context.cx = 100*5;
+ context.al = 255;
+ while(--context.cx) context._stosb();
+ context.es = context.data.word(398);
+ context.data.word(166) = context.es;
+ context.ax = 0;
+ context.data.word(164) = context.ax;
+ context.ax = 0+2080;
+ context.data.word(162) = context.ax;
+ context.data.byte(157) = 0;
+ context.si = 0+2080+30000+2;
+ context.cx = 0;
+exloop:
+ context.push(context.cx);
+ context.push(context.si);
+ context.es = context.data.word(398);
+ context.push(context.si);
+ context.ch = 0;
+ context._cmp(context.data.byte(context.si), 255);
+ if (context.flags.z()) goto notinroom;
+ context.al = context.data.byte(context.si-2);
+ context._cmp(context.al, context.data.byte(184));
+ if (!context.flags.z()) goto notinroom;
+ getmapad(context);
+notinroom:
+ context.si = context.pop();
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto blankex;
+ context.al = context.data.byte(157);
+ context.ah = 0;
+ context.dx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.dx);
+ context.data.word(160) = context.ax;
+ context.push(context.es);
+ context.push(context.si);
+ calcfrframe(context);
+ context.es = context.data.word(402);
+ context.ds = context.data.word(166);
+ finalframe(context);
+ context.si = context.pop();
+ context.es = context.pop();
+ context._cmp(context.cx, 0);
+ if (context.flags.z()) goto blankex;
+ context.ax = context.data.word(160);
+ context.ah = 0;
+ context._add(context.di, context.data.word(117));
+ context._add(context.bx, context.data.word(119));
+ showframe(context);
+ context.si = context.data.word(18);
+ context.es = context.data.word(412);
+ context.al = context.data.byte(179);
+ context.ah = context.data.byte(180);
+ context.data.word(context.si) = context.ax;
+ context.cx = context.ax;
+ context.ax = context.data.word(176);
+ context._add(context.al, context.cl);
+ context._add(context.ah, context.ch);
+ context.data.word(context.si+2) = context.ax;
+ context.ax = context.pop();
+ context.cx = context.pop();
+ context.push(context.cx);
+ context.push(context.ax);
+ context.data.byte(context.si+4) = context.cl;
+ context._add(context.si, 5);
+ context.data.word(18) = context.si;
+blankex:
+ context._add(context.data.byte(157), 1);
+ context.si = context.pop();
+ context.cx = context.pop();
+ context._add(context.si, 16);
+ context._add(context.cx, 1);
+ context._cmp(context.cx, 100);
+ if (context.flags.z()) goto finex;
+ goto exloop;
+finex:
+ return;
+}
+
+static void calcfrframe(Context & context) {
+ context.dx = context.data.word(166);
+ context.ax = context.data.word(162);
+ context.push(context.ax);
+ context.cx = context.data.word(164);
+ context.ax = context.data.word(160);
+ context.ds = context.dx;
+ context.bx = 6;
+ context._mul(context.bx);
+ context._add(context.ax, context.cx);
+ context.bx = context.ax;
+ context.cx = context.data.word(context.bx);
+ context.ax = context.data.word(context.bx+2);
+ context.dx = context.data.word(context.bx+4);
+ context.bx = context.pop();
+ context.push(context.dx);
+ context._add(context.ax, context.bx);
+ context.data.word(178) = context.ax;
+ context.data.word(176) = context.cx;
+ context.ax = context.pop();
+ context.push(context.ax);
+ context.ah = 0;
+ context.data.word(172) = context.ax;
+ context.ax = context.pop();
+ context.al = context.ah;
+ context.ah = 0;
+ context.data.word(174) = context.ax;
+ return;
+nullframe:
+ context.ax = context.pop();
+ context.cx = 0;
+ context.data.word(176) = context.cx;
+ return;
+}
+
+static void finalframe(Context & context) {
+ context.ax = context.data.word(170);
+ context._add(context.ax, context.data.word(174));
+ context.bx = context.data.word(168);
+ context._add(context.bx, context.data.word(172));
+ context.data.byte(179) = context.bl;
+ context.data.byte(180) = context.al;
+ context.di = context.data.word(168);
+ context.bx = context.data.word(170);
+ return;
+}
+
+static void adjustlen(Context & context) {
context.ah = context.al;
context._add(context.al, context.ch);
context._cmp(context.al, 100);
@@ -5101,7 +9303,85 @@ over242:
return;
}
-static inline void look(Context & context) {
+static void getmapad(Context & context) {
+ getxad(context);
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto over146;
+ context.data.word(168) = context.ax;
+ getyad(context);
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto over146;
+ context.data.word(170) = context.ax;
+ context.ch = 1;
+over146:
+ return;
+}
+
+static void getxad(Context & context) {
+ context.cl = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context.al = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context.ah = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context._cmp(context.cl, 0);
+ if (!context.flags.z()) goto over148;
+ context._sub(context.al, context.data.byte(148));
+ if (context.flags.c()) goto over148;
+ context._cmp(context.al, 11);
+ if (!context.flags.c()) goto over148;
+ context.cl = 4;
+ context._shl(context.al, context.cl);
+ context._or(context.al, context.ah);
+ context.ah = 0;
+ context.ch = 1;
+ return;
+over148:
+ context.ch = 0;
+ return;
+}
+
+static void getyad(Context & context) {
+ context.al = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context.ah = context.data.byte(context.si);
+ context._add(context.si, 1);
+ context._sub(context.al, context.data.byte(149));
+ if (context.flags.c()) goto over147;
+ context._cmp(context.al, 10);
+ if (!context.flags.c()) goto over147;
+ context.cl = 4;
+ context._shl(context.al, context.cl);
+ context._or(context.al, context.ah);
+ context.ah = 0;
+ context.ch = 1;
+ return;
+over147:
+ context.ch = 0;
+ return;
+}
+
+static void autolook(Context & context) {
+ context.ax = context.data.word(198);
+ context._cmp(context.ax, context.data.word(214));
+ if (!context.flags.z()) goto diffmouse;
+ context.ax = context.data.word(200);
+ context._cmp(context.ax, context.data.word(216));
+ if (!context.flags.z()) goto diffmouse;
+ context._sub(context.data.word(98), 1);
+ context._cmp(context.data.word(98), 0);
+ if (!context.flags.z()) goto noautolook;
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto noautolook;
+ dolook(context);
+noautolook:
+ return;
+diffmouse:
+ context.data.word(98) = 1000;
+ return;
+}
+
+static void look(Context & context) {
context._cmp(context.data.word(21), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(234), 2);
@@ -5122,7 +9402,58 @@ nolook:
return;
}
-static inline void getback1(Context & context) {
+static void dolook(Context & context) {
+ createpanel(context);
+ showicon(context);
+ undertextline(context);
+ worktoscreenm(context);
+ context.data.byte(100) = 255;
+ dumptextline(context);
+ context.bl = context.data.byte(185);
+ context._and(context.bl, 31);
+ context.bh = 0;
+ context._add(context.bx, context.bx);
+ context.es = context.data.word(436);
+ context._add(context.bx, 0);
+ context.si = context.data.word(context.bx);
+ context._add(context.si, 0+(38*2));
+ findnextcolon(context);
+ context.di = 66;
+ context._cmp(context.data.byte(184), 50);
+ if (context.flags.c()) goto notdream3;
+ context.di = 40;
+notdream3:
+ context.bx = 80;
+ context.dl = 241;
+ printslow(context);
+ context._cmp(context.al, 1);
+ if (context.flags.z()) goto afterlook;
+ context.cx = 400;
+ hangonp(context);
+afterlook:
+ context.data.byte(234) = 0;
+ context.data.byte(100) = 0;
+ redrawmainscrn(context);
+ worktoscreenm(context);
+ return;
+}
+
+static void redrawmainscrn(Context & context) {
+ context.data.word(328) = 0;
+ createpanel(context);
+ context.data.byte(62) = 0;
+ drawfloor(context);
+ printsprites(context);
+ reelsonscreen(context);
+ showicon(context);
+ getunderzoom(context);
+ undertextline(context);
+ readmouse(context);
+ context.data.byte(100) = 255;
+ return;
+}
+
+static void getback1(Context & context) {
context._cmp(context.data.byte(106), 0);
if (context.flags.z()) goto notgotobject;
blank(context);
@@ -5147,7 +9478,7 @@ dogetback:
return;
}
-static inline void talk(Context & context) {
+static void talk(Context & context) {
context.data.byte(246) = 0;
context.data.byte(237) = 0;
context.al = context.data.byte(99);
@@ -5196,7 +9527,7 @@ nospeech:
return;
}
-static inline void convicons(Context & context) {
+static void convicons(Context & context) {
context.al = context.data.byte(247);
context._and(context.al, 127);
getpersframe(context);
@@ -5211,7 +9542,7 @@ static inline void convicons(Context & context) {
return;
}
-static inline void getpersframe(Context & context) {
+static void getpersframe(Context & context) {
context.ah = 0;
context._add(context.ax, context.ax);
context.bx = context.ax;
@@ -5221,7 +9552,7 @@ static inline void getpersframe(Context & context) {
return;
}
-static inline void starttalk(Context & context) {
+static void starttalk(Context & context) {
context.data.byte(245) = 0;
context.al = context.data.byte(247);
context._and(context.al, 127);
@@ -5244,7 +9575,7 @@ nospeech1:
return;
}
-static inline void getpersontext(Context & context) {
+static void getpersontext(Context & context) {
context.ah = 0;
context.cx = 64*2;
context._mul(context.cx);
@@ -5258,7 +9589,7 @@ static inline void getpersontext(Context & context) {
return;
}
-static inline void moretalk(Context & context) {
+static void moretalk(Context & context) {
context._cmp(context.data.byte(245), 0);
if (context.flags.z()) goto canmore;
redes(context);
@@ -5288,7 +9619,7 @@ notsecondpart:
return;
}
-static inline void dosometalk(Context & context) {
+static void dosometalk(Context & context) {
watchtalk:
context.al = context.data.byte(246);
context.al = context.data.byte(247);
@@ -5381,7 +9712,7 @@ endwatchtalk:
return;
}
-static inline void hangonpq(Context & context) {
+static void hangonpq(Context & context) {
context.data.byte(103) = 0;
context.bx = 0;
hangloopq:
@@ -5424,7 +9755,7 @@ quitconv:
return;
}
-static inline void redes(Context & context) {
+static void redes(Context & context) {
context._cmp(context.data.byte(515), 255);
if (!context.flags.z()) goto cantredes;
context._cmp(context.data.byte(245), 2);
@@ -5458,7 +9789,100 @@ doredes:
return;
}
-static inline void lookatplace(Context & context) {
+static void newplace(Context & context) {
+ context._cmp(context.data.byte(60), 1);
+ if (context.flags.z()) goto istravel;
+ context._cmp(context.data.byte(189), -1);
+ if (!context.flags.z()) goto isautoloc;
+ return;
+isautoloc:
+ context.al = context.data.byte(189);
+ context.data.byte(188) = context.al;
+ context.data.byte(189) = -1;
+ return;
+istravel:
+ context.data.byte(60) = 0;
+ selectlocation(context);
+ return;
+}
+
+static void selectlocation(Context & context) {
+ context.data.byte(237) = 0;
+ clearbeforeload(context);
+ context.data.byte(103) = 0;
+ context.data.byte(231) = 22;
+ readcitypic(context);
+ showcity(context);
+ getridoftemp(context);
+ readdesticon(context);
+ loadtraveltext(context);
+ showpanel(context);
+ showman(context);
+ showarrows(context);
+ showexit(context);
+ locationpic(context);
+ undertextline(context);
+ context.data.byte(100) = 255;
+ readmouse(context);
+ context.data.byte(231) = 0;
+ showpointer(context);
+ worktoscreen(context);
+ context.al = 9;
+ context.ah = 255;
+ playchannel0(context);
+ context.data.byte(188) = 255;
+select:
+ delpointer(context);
+ readmouse(context);
+ showpointer(context);
+ vsync(context);
+ dumppointer(context);
+ dumptextline(context);
+ context._cmp(context.data.byte(103), 1);
+ if (context.flags.z()) goto quittravel;
+ context.bx = 2714;
+ checkcoords(context);
+ context._cmp(context.data.byte(188), 255);
+ if (context.flags.z()) goto select;
+ context.al = context.data.byte(188);
+ context._cmp(context.al, context.data.byte(9));
+ if (context.flags.z()) goto quittravel;
+ getridoftemp(context);
+ getridoftemp2(context);
+ getridoftemp3(context);
+ context.es = context.data.word(456);
+ deallocatemem(context);
+ return;
+quittravel:
+ context.al = context.data.byte(184);
+ context.data.byte(188) = context.al;
+ context.data.byte(103) = 0;
+ getridoftemp(context);
+ getridoftemp2(context);
+ getridoftemp3(context);
+ context.es = context.data.word(456);
+ deallocatemem(context);
+ return;
+}
+
+static void showcity(Context & context) {
+ clearwork(context);
+ context.ds = context.data.word(458);
+ context.di = 57;
+ context.bx = 32;
+ context.al = 0;
+ context.ah = 0;
+ showframe(context);
+ context.ds = context.data.word(458);
+ context.di = 120+57;
+ context.bx = 32;
+ context.al = 1;
+ context.ah = 0;
+ showframe(context);
+ return;
+}
+
+static void lookatplace(Context & context) {
context._cmp(context.data.byte(100), 224);
if (context.flags.z()) goto alreadyinfo;
context.data.byte(100) = 224;
@@ -5518,7 +9942,7 @@ noinfo:
return;
}
-static inline void getundercentre(Context & context) {
+static void getundercentre(Context & context) {
context.di = 58;
context.bx = 72;
context.ds = context.data.word(402);
@@ -5529,7 +9953,7 @@ static inline void getundercentre(Context & context) {
return;
}
-static inline void putundercentre(Context & context) {
+static void putundercentre(Context & context) {
context.di = 58;
context.bx = 72;
context.ds = context.data.word(402);
@@ -5540,7 +9964,94 @@ static inline void putundercentre(Context & context) {
return;
}
-static inline void nextdest(Context & context) {
+static void locationpic(Context & context) {
+ getdestinfo(context);
+ context.al = context.data.byte(context.si);
+ context.push(context.es);
+ context.push(context.si);
+ context.di = 0;
+ context._cmp(context.al, 6);
+ if (!context.flags.c()) goto secondlot;
+ context.ds = context.data.word(458);
+ context._add(context.al, 4);
+ goto gotgraphic;
+secondlot:
+ context._sub(context.al, 6);
+ context.ds = context.data.word(460);
+gotgraphic:
+ context._add(context.di, 104);
+ context.bx = 138+14;
+ context.ah = 0;
+ showframe(context);
+ context.si = context.pop();
+ context.es = context.pop();
+ context.al = context.data.byte(183);
+ context._cmp(context.al, context.data.byte(184));
+ if (!context.flags.z()) goto notinthisone;
+ context.al = 3;
+ context.di = 104;
+ context.bx = 140+14;
+ context.ds = context.data.word(458);
+ context.ah = 0;
+ showframe(context);
+notinthisone:
+ context.bl = context.data.byte(183);
+ context.bh = 0;
+ context._add(context.bx, context.bx);
+ context.es = context.data.word(456);
+ context.si = context.data.word(context.bx);
+ context._add(context.si, 66*2);
+ context.di = 50;
+ context.bx = 20;
+ context.dl = 241;
+ context.al = 0;
+ context.ah = 0;
+ printdirect(context);
+ return;
+}
+
+static void getdestinfo(Context & context) {
+ context.al = context.data.byte(183);
+ context.ah = 0;
+ context.push(context.ax);
+ context.dx = context.ds;
+ context.es = context.dx;
+ context.si = 7798;
+ context._add(context.si, context.ax);
+ context.cl = context.data.byte(context.si);
+ context.ax = context.pop();
+ context.push(context.cx);
+ context.dx = context.ds;
+ context.es = context.dx;
+ context.si = 7813;
+ context._add(context.si, context.ax);
+ context.ax = context.pop();
+ return;
+}
+
+static void showarrows(Context & context) {
+ context.di = 116-12;
+ context.bx = 16;
+ context.ds = context.data.word(458);
+ context.al = 0;
+ context.ah = 0;
+ showframe(context);
+ context.di = 226+12;
+ context.bx = 16;
+ context.ds = context.data.word(458);
+ context.al = 1;
+ context.ah = 0;
+ showframe(context);
+ context.di = 280;
+ context.bx = 14;
+ context.ds = context.data.word(458);
+ context.al = 2;
+ context.ah = 0;
+ showframe(context);
+ return;
+}
+
+static void nextdest(Context & context) {
duok:
context._cmp(context.data.byte(100), 218);
if (context.flags.z()) goto alreadydu;
@@ -5578,7 +10089,7 @@ nodu:
return;
}
-static inline void lastdest(Context & context) {
+static void lastdest(Context & context) {
ddok:
context._cmp(context.data.byte(100), 219);
if (context.flags.z()) goto alreadydd;
@@ -5616,7 +10127,7 @@ nodd:
return;
}
-static inline void destselect(Context & context) {
+static void destselect(Context & context) {
context._cmp(context.data.byte(100), 222);
if (context.flags.z()) goto alreadytrav;
context.data.byte(100) = 222;
@@ -5635,7 +10146,90 @@ notrav:
return;
}
-static inline void usemon(Context & context) {
+static void getlocation(Context & context) {
+ context.ah = 0;
+ context.bx = context.ax;
+ context.dx = context.ds;
+ context.es = context.dx;
+ context._add(context.bx, 7798);
+ context.al = context.data.byte(context.bx);
+ return;
+}
+
+static void setlocation(Context & context) {
+ context.ah = 0;
+ context.bx = context.ax;
+ context.dx = context.ds;
+ context.es = context.dx;
+ context._add(context.bx, 7798);
+ context.data.byte(context.bx) = 1;
+ return;
+}
+
+static void resetlocation(Context & context) {
+ context.push(context.ax);
+ context._cmp(context.al, 5);
+ if (!context.flags.z()) goto notdelhotel;
+ purgealocation(context);
+ context.al = 21;
+ purgealocation(context);
+ context.al = 22;
+ purgealocation(context);
+ context.al = 27;
+ purgealocation(context);
+ goto clearedlocations;
+notdelhotel:
+ context._cmp(context.al, 8);
+ if (!context.flags.z()) goto notdeltvstud;
+ purgealocation(context);
+ context.al = 28;
+ purgealocation(context);
+ goto clearedlocations;
+notdeltvstud:
+ context._cmp(context.al, 6);
+ if (!context.flags.z()) goto notdelsarters;
+ purgealocation(context);
+ context.al = 20;
+ purgealocation(context);
+ context.al = 25;
+ purgealocation(context);
+ goto clearedlocations;
+notdelsarters:
+ context._cmp(context.al, 13);
+ if (!context.flags.z()) goto notdelboathouse;
+ purgealocation(context);
+ context.al = 29;
+ purgealocation(context);
+ goto clearedlocations;
+notdelboathouse:
+clearedlocations:
+ context.ax = context.pop();
+ context.ah = 0;
+ context.bx = context.ax;
+ context.dx = context.ds;
+ context.es = context.dx;
+ context._add(context.bx, 7798);
+ context.data.byte(context.bx) = 0;
+ return;
+}
+
+static void readdesticon(Context & context) {
+ context.dx = 2026;
+ loadintotemp(context);
+ context.dx = 2039;
+ loadintotemp2(context);
+ context.dx = 1974;
+ loadintotemp3(context);
+ return;
+}
+
+static void readcitypic(Context & context) {
+ context.dx = 2013;
+ loadintotemp(context);
+ return;
+}
+
+static void usemon(Context & context) {
context.data.byte(55) = 0;
context.es = context.cs;
context.di = 2895+1;
@@ -5725,7 +10319,7 @@ endmon:
return;
}
-static inline void printoutermon(Context & context) {
+static void printoutermon(Context & context) {
context.di = 40;
context.bx = 32;
context.ds = context.data.word(458);
@@ -5753,7 +10347,7 @@ static inline void printoutermon(Context & context) {
return;
}
-static inline void loadpersonal(Context & context) {
+static void loadpersonal(Context & context) {
context.al = context.data.byte(9);
context.dx = 2065;
context._cmp(context.al, 0);
@@ -5780,7 +10374,7 @@ foundpersonal:
return;
}
-static inline void loadnews(Context & context) {
+static void loadnews(Context & context) {
context.al = context.data.byte(34);
context.dx = 2091;
context._cmp(context.al, 0);
@@ -5809,7 +10403,7 @@ foundnews:
return;
}
-static inline void loadcart(Context & context) {
+static void loadcart(Context & context) {
lookininterface(context);
context.dx = 2143;
context._cmp(context.al, 0);
@@ -5841,7 +10435,7 @@ gotcart:
return;
}
-static inline void lookininterface(Context & context) {
+static void lookininterface(Context & context) {
context.al = 'I';
context.ah = 'N';
context.cl = 'T';
@@ -5859,7 +10453,7 @@ emptyinterface:
return;
}
-static inline void turnonpower(Context & context) {
+static void turnonpower(Context & context) {
context.cx = 3;
powerloop:
context.push(context.cx);
@@ -5875,7 +10469,7 @@ powerloop:
return;
}
-static inline void randomaccess(Context & context) {
+static void randomaccess(Context & context) {
accessloop:
context.push(context.cx);
vsync(context);
@@ -5895,7 +10489,7 @@ chosenaccess:
return;
}
-static inline void powerlighton(Context & context) {
+static void powerlighton(Context & context) {
context.di = 257+4;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5912,7 +10506,7 @@ static inline void powerlighton(Context & context) {
return;
}
-static inline void powerlightoff(Context & context) {
+static void powerlightoff(Context & context) {
context.di = 257+4;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5929,7 +10523,7 @@ static inline void powerlightoff(Context & context) {
return;
}
-static inline void accesslighton(Context & context) {
+static void accesslighton(Context & context) {
context.di = 74;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5946,7 +10540,7 @@ static inline void accesslighton(Context & context) {
return;
}
-static inline void accesslightoff(Context & context) {
+static void accesslightoff(Context & context) {
context.di = 74;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5963,7 +10557,7 @@ static inline void accesslightoff(Context & context) {
return;
}
-static inline void locklighton(Context & context) {
+static void locklighton(Context & context) {
context.di = 56;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5980,7 +10574,7 @@ static inline void locklighton(Context & context) {
return;
}
-static inline void locklightoff(Context & context) {
+static void locklightoff(Context & context) {
context.di = 56;
context.bx = 182;
context.ds = context.data.word(458);
@@ -5997,7 +10591,7 @@ static inline void locklightoff(Context & context) {
return;
}
-static inline void input(Context & context) {
+static void input(Context & context) {
context.es = context.cs;
context.di = 7944;
context.cx = 64;
@@ -6086,7 +10680,7 @@ endofinput:
return;
}
-static inline void makecaps(Context & context) {
+static void makecaps(Context & context) {
context._cmp(context.al, 'a');
if (context.flags.c()) goto notupperc;
context._sub(context.al, 32);
@@ -6094,7 +10688,7 @@ notupperc:
return;
}
-static inline void delchar(Context & context) {
+static void delchar(Context & context) {
context._sub(context.data.word(316), 1);
context.si = context.data.word(316);
context._add(context.si, context.si);
@@ -6122,7 +10716,7 @@ static inline void delchar(Context & context) {
return;
}
-static inline void execcommand(Context & context) {
+static void execcommand(Context & context) {
context.es = context.cs;
context.bx = 2776;
context.ds = context.cs;
@@ -6195,14 +10789,14 @@ quitcom:
return;
}
-static inline void neterror(Context & context) {
+static void neterror(Context & context) {
context.al = 5;
monmessage(context);
scrollmonitor(context);
return;
}
-static inline void dircom(Context & context) {
+static void dircom(Context & context) {
context.cx = 30;
randomaccess(context);
parser(context);
@@ -6234,7 +10828,7 @@ dirroot:
return;
}
-static inline void searchforfiles(Context & context) {
+static void searchforfiles(Context & context) {
context.bx = 66*2;
directloop1:
context.al = context.data.byte(context.bx);
@@ -6249,7 +10843,7 @@ endofdir:
return;
}
-static inline void signon(Context & context) {
+static void signon(Context & context) {
parser(context);
context._add(context.di, 1);
context.ds = context.cs;
@@ -6344,7 +10938,7 @@ passpassed:
return;
}
-static inline void showkeys(Context & context) {
+static void showkeys(Context & context) {
context.cx = 10;
randomaccess(context);
scrollmonitor(context);
@@ -6369,7 +10963,7 @@ notheld:
return;
}
-static inline void read(Context & context) {
+static void read(Context & context) {
context.cx = 40;
randomaccess(context);
parser(context);
@@ -6451,7 +11045,7 @@ endoftopic:
return;
}
-static inline void dirfile(Context & context) {
+static void dirfile(Context & context) {
context.al = 34;
context.data.byte(context.di) = context.al;
context.push(context.es);
@@ -6522,7 +11116,7 @@ endofdir2:
return;
}
-static inline void getkeyandlogo(Context & context) {
+static void getkeyandlogo(Context & context) {
context._add(context.bx, 1);
context.al = context.data.byte(context.bx);
context._sub(context.al, 48);
@@ -6566,7 +11160,7 @@ keyok:
return;
}
-static inline void searchforstring(Context & context) {
+static void searchforstring(Context & context) {
context.dl = context.data.byte(context.di);
context.cx = context.di;
restartlook:
@@ -6604,7 +11198,7 @@ notfound:
return;
}
-static inline void parser(Context & context) {
+static void parser(Context & context) {
context.es = context.cs;
context.di = 2883;
context.cx = 13;
@@ -6638,7 +11232,7 @@ finishpars:
return;
}
-static inline void scrollmonitor(Context & context) {
+static void scrollmonitor(Context & context) {
context.push(context.ax);
context.push(context.bx);
context.push(context.cx);
@@ -6666,7 +11260,7 @@ static inline void scrollmonitor(Context & context) {
return;
}
-static inline void lockmon(Context & context) {
+static void lockmon(Context & context) {
context._cmp(context.data.byte(392), 57);
if (!context.flags.z()) goto notlock;
locklighton(context);
@@ -6678,7 +11272,7 @@ notlock:
return;
}
-static inline void monitorlogo(Context & context) {
+static void monitorlogo(Context & context) {
context.al = context.data.byte(269);
context._cmp(context.al, context.data.byte(270));
if (context.flags.z()) goto notnewlogo;
@@ -6698,7 +11292,7 @@ notnewlogo:
return;
}
-static inline void printlogo(Context & context) {
+static void printlogo(Context & context) {
context.di = 56;
context.bx = 32;
context.ds = context.data.word(458);
@@ -6709,7 +11303,7 @@ static inline void printlogo(Context & context) {
return;
}
-static inline void showcurrentfile(Context & context) {
+static void showcurrentfile(Context & context) {
context.di = 178;
context.bx = 37;
context.si = 2895+1;
@@ -6729,7 +11323,7 @@ finishfile:
return;
}
-static inline void monmessage(Context & context) {
+static void monmessage(Context & context) {
context.es = context.data.word(466);
context.bx = 66*2;
context.cl = context.al;
@@ -6744,7 +11338,7 @@ monmessageloop:
return;
}
-static inline void processtrigger(Context & context) {
+static void processtrigger(Context & context) {
context._cmp(context.data.byte(55), '1');
if (!context.flags.z()) goto notfirsttrigger;
context.al = 8;
@@ -6771,7 +11365,7 @@ notthirdtrigger:
return;
}
-static inline void triggermessage(Context & context) {
+static void triggermessage(Context & context) {
context.push(context.ax);
context.di = 174;
context.bx = 153;
@@ -6804,7 +11398,7 @@ static inline void triggermessage(Context & context) {
return;
}
-static inline void printcurs(Context & context) {
+static void printcurs(Context & context) {
context.push(context.si);
context.push(context.di);
context.push(context.ds);
@@ -6851,7 +11445,7 @@ flashcurs:
return;
}
-static inline void delcurs(Context & context) {
+static void delcurs(Context & context) {
context.push(context.es);
context.push(context.bx);
context.push(context.di);
@@ -6884,7 +11478,7 @@ finishcurdel:
return;
}
-static inline void useobject(Context & context) {
+static void useobject(Context & context) {
context.data.byte(95) = 255;
context._cmp(context.data.byte(100), 229);
if (context.flags.z()) goto alreadyuse;
@@ -6906,7 +11500,7 @@ douse:
return;
}
-static inline void useroutine(Context & context) {
+static void useroutine(Context & context) {
context._cmp(context.data.byte(184), 50);
if (context.flags.c()) goto nodream7;
context._cmp(context.data.byte(232), 0);
@@ -6981,7 +11575,7 @@ cantuse2:
return;
}
-static inline void wheelsound(Context & context) {
+static void wheelsound(Context & context) {
context.al = 17;
playchannel1(context);
showfirstuse(context);
@@ -6989,7 +11583,7 @@ static inline void wheelsound(Context & context) {
return;
}
-static inline void runtap(Context & context) {
+static void runtap(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto tapwith;
withwhat(context);
@@ -7035,7 +11629,7 @@ cupfromtapfull:
return;
}
-static inline void playguitar(Context & context) {
+static void playguitar(Context & context) {
context.al = 14;
playchannel1(context);
showfirstuse(context);
@@ -7043,7 +11637,7 @@ static inline void playguitar(Context & context) {
return;
}
-static inline void hotelcontrol(Context & context) {
+static void hotelcontrol(Context & context) {
context._cmp(context.data.byte(184), 21);
if (!context.flags.z()) goto notrightcont;
context._cmp(context.data.byte(148), 33);
@@ -7057,7 +11651,7 @@ notrightcont:
return;
}
-static inline void hotelbell(Context & context) {
+static void hotelbell(Context & context) {
context.al = 12;
playchannel1(context);
showfirstuse(context);
@@ -7065,7 +11659,7 @@ static inline void hotelbell(Context & context) {
return;
}
-static inline void opentomb(Context & context) {
+static void opentomb(Context & context) {
context._add(context.data.byte(2), 1);
showfirstuse(context);
context.data.word(21) = 35*2;
@@ -7077,7 +11671,7 @@ static inline void opentomb(Context & context) {
return;
}
-static inline void usetrainer(Context & context) {
+static void usetrainer(Context & context) {
getanyad(context);
context._cmp(context.data.byte(context.bx+2), 4);
if (!context.flags.z()) goto notheldtrainer;
@@ -7091,7 +11685,7 @@ notheldtrainer:
return;
}
-static inline void nothelderror(Context & context) {
+static void nothelderror(Context & context) {
createpanel(context);
showpanel(context);
showman(context);
@@ -7110,7 +11704,7 @@ static inline void nothelderror(Context & context) {
return;
}
-static inline void usepipe(Context & context) {
+static void usepipe(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto pipewith;
withwhat(context);
@@ -7154,7 +11748,7 @@ alreadyfull:
return;
}
-static inline void usefullcart(Context & context) {
+static void usefullcart(Context & context) {
context._add(context.data.byte(2), 1);
context.al = 2;
context.ah = context.data.byte(185);
@@ -7176,7 +11770,7 @@ static inline void usefullcart(Context & context) {
return;
}
-static inline void useplinth(Context & context) {
+static void useplinth(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto plinthwith;
withwhat(context);
@@ -7207,7 +11801,7 @@ isrightkey:
return;
}
-static inline void chewy(Context & context) {
+static void chewy(Context & context) {
showfirstuse(context);
getanyad(context);
context.data.byte(context.bx+2) = 255;
@@ -7215,7 +11809,7 @@ static inline void chewy(Context & context) {
return;
}
-static inline void useladder(Context & context) {
+static void useladder(Context & context) {
showfirstuse(context);
context._sub(context.data.byte(148), 11);
findroominloc(context);
@@ -7230,7 +11824,7 @@ static inline void useladder(Context & context) {
return;
}
-static inline void useladderb(Context & context) {
+static void useladderb(Context & context) {
showfirstuse(context);
context._add(context.data.byte(148), 11);
findroominloc(context);
@@ -7245,7 +11839,7 @@ static inline void useladderb(Context & context) {
return;
}
-static inline void slabdoora(Context & context) {
+static void slabdoora(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.byte(27) = 1;
@@ -7266,7 +11860,7 @@ slabawrong:
return;
}
-static inline void slabdoorb(Context & context) {
+static void slabdoorb(Context & context) {
context._cmp(context.data.byte(66), 1);
if (!context.flags.z()) goto slabbwrong;
context.al = 'S';
@@ -7304,7 +11898,7 @@ slabbwrong:
return;
}
-static inline void slabdoord(Context & context) {
+static void slabdoord(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.byte(27) = 1;
@@ -7325,7 +11919,7 @@ slabcwrong:
return;
}
-static inline void slabdoorc(Context & context) {
+static void slabdoorc(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.byte(27) = 1;
@@ -7346,7 +11940,7 @@ slabdwrong:
return;
}
-static inline void slabdoore(Context & context) {
+static void slabdoore(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.byte(27) = 1;
@@ -7367,7 +11961,7 @@ slabewrong:
return;
}
-static inline void slabdoorf(Context & context) {
+static void slabdoorf(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.byte(27) = 1;
@@ -7388,7 +11982,7 @@ slabfwrong:
return;
}
-static inline void useslab(Context & context) {
+static void useslab(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto slabwith;
withwhat(context);
@@ -7435,7 +12029,7 @@ notlastslab:
return;
}
-static inline void usecart(Context & context) {
+static void usecart(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto cartwith;
withwhat(context);
@@ -7472,7 +12066,7 @@ nextcart:
return;
}
-static inline void useclearbox(Context & context) {
+static void useclearbox(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto clearboxwith;
withwhat(context);
@@ -7503,7 +12097,7 @@ openbox:
return;
}
-static inline void usecoveredbox(Context & context) {
+static void usecoveredbox(Context & context) {
context._add(context.data.byte(2), 1);
showfirstuse(context);
context.data.word(21) = 50;
@@ -7515,7 +12109,7 @@ static inline void usecoveredbox(Context & context) {
return;
}
-static inline void userailing(Context & context) {
+static void userailing(Context & context) {
showfirstuse(context);
context.data.word(21) = 80;
context.data.word(23) = 0;
@@ -7527,7 +12121,7 @@ static inline void userailing(Context & context) {
return;
}
-static inline void useopenbox(Context & context) {
+static void useopenbox(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto openboxwith;
withwhat(context);
@@ -7576,7 +12170,7 @@ openboxwrong:
return;
}
-static inline void wearwatch(Context & context) {
+static void wearwatch(Context & context) {
context._cmp(context.data.byte(3), 1);
if (context.flags.z()) goto wearingwatch;
showfirstuse(context);
@@ -7591,7 +12185,7 @@ wearingwatch:
return;
}
-static inline void wearshades(Context & context) {
+static void wearshades(Context & context) {
context._cmp(context.data.byte(4), 1);
if (context.flags.z()) goto wearingshades;
context.data.byte(4) = 1;
@@ -7606,7 +12200,7 @@ wearingshades:
return;
}
-static inline void sitdowninbar(Context & context) {
+static void sitdowninbar(Context & context) {
context._cmp(context.data.byte(32), -1);
if (!context.flags.z()) goto satdown;
showfirstuse(context);
@@ -7625,7 +12219,7 @@ satdown:
return;
}
-static inline void usechurchhole(Context & context) {
+static void usechurchhole(Context & context) {
showfirstuse(context);
context.data.byte(103) = 1;
context.data.word(21) = 28;
@@ -7636,7 +12230,7 @@ static inline void usechurchhole(Context & context) {
return;
}
-static inline void usehole(Context & context) {
+static void usehole(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto holewith;
withwhat(context);
@@ -7667,7 +12261,7 @@ righthand:
return;
}
-static inline void usealtar(Context & context) {
+static void usealtar(Context & context) {
context.al = 'C';
context.ah = 'N';
context.cl = 'D';
@@ -7711,7 +12305,7 @@ thingsonaltar:
return;
}
-static inline void opentvdoor(Context & context) {
+static void opentvdoor(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto tvdoorwith;
withwhat(context);
@@ -7737,7 +12331,7 @@ keyontv:
return;
}
-static inline void usedryer(Context & context) {
+static void usedryer(Context & context) {
context.al = 12;
playchannel1(context);
showfirstuse(context);
@@ -7745,7 +12339,7 @@ static inline void usedryer(Context & context) {
return;
}
-static inline void openlouis(Context & context) {
+static void openlouis(Context & context) {
context.al = 5;
context.ah = 2;
context.cl = 3;
@@ -7755,7 +12349,7 @@ static inline void openlouis(Context & context) {
return;
}
-static inline void nextcolon(Context & context) {
+static void nextcolon(Context & context) {
lookcolon:
context.al = context.data.byte(context.si);
context._add(context.si, 1);
@@ -7764,7 +12358,7 @@ lookcolon:
return;
}
-static inline void openyourneighbour(Context & context) {
+static void openyourneighbour(Context & context) {
context.al = 255;
context.ah = 255;
context.cl = 255;
@@ -7774,7 +12368,7 @@ static inline void openyourneighbour(Context & context) {
return;
}
-static inline void usewindow(Context & context) {
+static void usewindow(Context & context) {
context._cmp(context.data.byte(475), 6);
if (!context.flags.z()) goto notonbalc;
context._add(context.data.byte(2), 1);
@@ -7788,7 +12382,7 @@ notonbalc:
return;
}
-static inline void usebalcony(Context & context) {
+static void usebalcony(Context & context) {
showfirstuse(context);
context.al = 6;
turnpathon(context);
@@ -7820,7 +12414,7 @@ static inline void usebalcony(Context & context) {
return;
}
-static inline void openryan(Context & context) {
+static void openryan(Context & context) {
context.al = 5;
context.ah = 1;
context.cl = 0;
@@ -7830,7 +12424,7 @@ static inline void openryan(Context & context) {
return;
}
-static inline void openpoolboss(Context & context) {
+static void openpoolboss(Context & context) {
context.al = 5;
context.ah = 2;
context.cl = 2;
@@ -7840,7 +12434,7 @@ static inline void openpoolboss(Context & context) {
return;
}
-static inline void openeden(Context & context) {
+static void openeden(Context & context) {
context.al = 2;
context.ah = 8;
context.cl = 6;
@@ -7850,7 +12444,7 @@ static inline void openeden(Context & context) {
return;
}
-static inline void opensarters(Context & context) {
+static void opensarters(Context & context) {
context.al = 7;
context.ah = 8;
context.cl = 3;
@@ -7860,7 +12454,7 @@ static inline void opensarters(Context & context) {
return;
}
-static inline void isitright(Context & context) {
+static void isitright(Context & context) {
context.bx = context.ds;
context.es = context.bx;
context.bx = 8350;
@@ -7875,7 +12469,7 @@ notright:
return;
}
-static inline void drawitall(Context & context) {
+static void drawitall(Context & context) {
createpanel(context);
drawfloor(context);
printsprites(context);
@@ -7883,7 +12477,7 @@ static inline void drawitall(Context & context) {
return;
}
-static inline void openhoteldoor(Context & context) {
+static void openhoteldoor(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto hoteldoorwith;
withwhat(context);
@@ -7911,7 +12505,7 @@ keyonhotel1:
return;
}
-static inline void openhoteldoor2(Context & context) {
+static void openhoteldoor2(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto hoteldoorwith2;
withwhat(context);
@@ -7938,7 +12532,7 @@ keyonhotel2:
return;
}
-static inline void grafittidoor(Context & context) {
+static void grafittidoor(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto grafwith;
withwhat(context);
@@ -7963,7 +12557,7 @@ dograf:
return;
}
-static inline void trapdoor(Context & context) {
+static void trapdoor(Context & context) {
context._add(context.data.byte(2), 1);
showfirstuse(context);
switchryanoff(context);
@@ -7977,7 +12571,7 @@ static inline void trapdoor(Context & context) {
return;
}
-static inline void callhotellift(Context & context) {
+static void callhotellift(Context & context) {
context.al = 12;
playchannel1(context);
showfirstuse(context);
@@ -7991,7 +12585,7 @@ static inline void callhotellift(Context & context) {
return;
}
-static inline void calledenslift(Context & context) {
+static void calledenslift(Context & context) {
showfirstuse(context);
context.data.byte(39) = 8;
context.data.byte(103) = 1;
@@ -8000,7 +12594,7 @@ static inline void calledenslift(Context & context) {
return;
}
-static inline void calledensdlift(Context & context) {
+static void calledensdlift(Context & context) {
context._cmp(context.data.byte(35), 1);
if (context.flags.z()) goto edensdhere;
showfirstuse(context);
@@ -8015,7 +12609,7 @@ edensdhere:
return;
}
-static inline void usepoolreader(Context & context) {
+static void usepoolreader(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto poolwith;
withwhat(context);
@@ -8049,7 +12643,7 @@ canopenpool:
return;
}
-static inline void uselighter(Context & context) {
+static void uselighter(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotlighterwith;
withwhat(context);
@@ -8077,7 +12671,7 @@ cigarette:
return;
}
-static inline void showseconduse(Context & context) {
+static void showseconduse(Context & context) {
getobtextstart(context);
nextcolon(context);
nextcolon(context);
@@ -8088,7 +12682,7 @@ static inline void showseconduse(Context & context) {
return;
}
-static inline void usecardreader1(Context & context) {
+static void usecardreader1(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotreader1with;
withwhat(context);
@@ -8133,7 +12727,7 @@ notyet:
return;
}
-static inline void usecardreader2(Context & context) {
+static void usecardreader2(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotreader2with;
withwhat(context);
@@ -8189,7 +12783,7 @@ notyetboss:
return;
}
-static inline void usecardreader3(Context & context) {
+static void usecardreader3(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotreader3with;
withwhat(context);
@@ -8235,7 +12829,7 @@ notyetrecep:
return;
}
-static inline void usecashcard(Context & context) {
+static void usecashcard(Context & context) {
getridofreels(context);
loadkeypad(context);
createpanel(context);
@@ -8287,7 +12881,58 @@ static inline void usecashcard(Context & context) {
return;
}
-static inline void moneypoke(Context & context) {
+static void lookatcard(Context & context) {
+ context.data.byte(131) = 1;
+ getridofreels(context);
+ loadkeypad(context);
+ createpanel2(context);
+ context.di = 160;
+ context.bx = 80;
+ context.ds = context.data.word(458);
+ context.al = 42;
+ context.ah = 128;
+ showframe(context);
+ getobtextstart(context);
+ findnextcolon(context);
+ findnextcolon(context);
+ findnextcolon(context);
+ context.di = 36;
+ context.bx = 124;
+ context.dl = 241;
+ context.al = 0;
+ context.ah = 0;
+ printdirect(context);
+ context.push(context.es);
+ context.push(context.si);
+ worktoscreenm(context);
+ context.cx = 280;
+ hangonw(context);
+ createpanel2(context);
+ context.di = 160;
+ context.bx = 80;
+ context.ds = context.data.word(458);
+ context.al = 42;
+ context.ah = 128;
+ showframe(context);
+ context.si = context.pop();
+ context.es = context.pop();
+ context.di = 36;
+ context.bx = 130;
+ context.dl = 241;
+ context.al = 0;
+ context.ah = 0;
+ printdirect(context);
+ worktoscreenm(context);
+ context.cx = 200;
+ hangonw(context);
+ context.data.byte(131) = 0;
+ getridoftemp(context);
+ restorereels(context);
+ putbackobstuff(context);
+ return;
+}
+
+static void moneypoke(Context & context) {
context.bx = 3385;
context.cl = 48-1;
numberpoke0:
@@ -8326,7 +12971,7 @@ numberpoke3:
return;
}
-static inline void usecontrol(Context & context) {
+static void usecontrol(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotcontrolwith;
withwhat(context);
@@ -8416,14 +13061,14 @@ axeoncontrols:
return;
}
-static inline void usehatch(Context & context) {
+static void usehatch(Context & context) {
showfirstuse(context);
context.data.byte(188) = 40;
context.data.byte(103) = 1;
return;
}
-static inline void usewire(Context & context) {
+static void usewire(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotwirewith;
withwhat(context);
@@ -8469,7 +13114,7 @@ wireknife:
return;
}
-static inline void usehandle(Context & context) {
+static void usehandle(Context & context) {
context.al = 'C';
context.ah = 'U';
context.cl = 'T';
@@ -8492,14 +13137,14 @@ havecutwire:
return;
}
-static inline void useelevator1(Context & context) {
+static void useelevator1(Context & context) {
showfirstuse(context);
selectlocation(context);
context.data.byte(103) = 1;
return;
}
-static inline void showfirstuse(Context & context) {
+static void showfirstuse(Context & context) {
getobtextstart(context);
findnextcolon(context);
findnextcolon(context);
@@ -8509,7 +13154,7 @@ static inline void showfirstuse(Context & context) {
return;
}
-static inline void useelevator3(Context & context) {
+static void useelevator3(Context & context) {
showfirstuse(context);
context.data.byte(40) = 20;
context.data.byte(188) = 34;
@@ -8522,7 +13167,7 @@ static inline void useelevator3(Context & context) {
return;
}
-static inline void useelevator4(Context & context) {
+static void useelevator4(Context & context) {
showfirstuse(context);
context.data.word(23) = 0;
context.data.word(25) = 11;
@@ -8535,7 +13180,7 @@ static inline void useelevator4(Context & context) {
return;
}
-static inline void useelevator2(Context & context) {
+static void useelevator2(Context & context) {
context._cmp(context.data.byte(9), 23);
if (context.flags.z()) goto inpoolhall;
showfirstuse(context);
@@ -8555,7 +13200,7 @@ inpoolhall:
return;
}
-static inline void useelevator5(Context & context) {
+static void useelevator5(Context & context) {
context.al = 4;
placesetobject(context);
context.al = 0;
@@ -8568,7 +13213,7 @@ static inline void useelevator5(Context & context) {
return;
}
-static inline void usekey(Context & context) {
+static void usekey(Context & context) {
context._cmp(context.data.byte(9), 5);
if (context.flags.z()) goto usekey1;
context._cmp(context.data.byte(9), 30);
@@ -8613,7 +13258,7 @@ wrongroom1:
return;
}
-static inline void usestereo(Context & context) {
+static void usestereo(Context & context) {
context._cmp(context.data.byte(9), 0);
if (context.flags.z()) goto stereook;
context.cx = 400;
@@ -8670,7 +13315,7 @@ stereoon:
return;
}
-static inline void usecooker(Context & context) {
+static void usecooker(Context & context) {
context.al = context.data.byte(99);
context.ah = context.data.byte(102);
checkinside(context);
@@ -8685,7 +13330,7 @@ foodinside:
return;
}
-static inline void useaxe(Context & context) {
+static void useaxe(Context & context) {
context._cmp(context.data.byte(184), 22);
if (!context.flags.z()) goto notinpool;
context._cmp(context.data.byte(149), 10);
@@ -8715,7 +13360,7 @@ axeondoor:
return;
}
-static inline void useelvdoor(Context & context) {
+static void useelvdoor(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gotdoorwith;
withwhat(context);
@@ -8748,7 +13393,7 @@ axeondoor:
return;
}
-static inline void withwhat(Context & context) {
+static void withwhat(Context & context) {
createpanel(context);
showpanel(context);
showman(context);
@@ -8790,7 +13435,7 @@ static inline void withwhat(Context & context) {
return;
}
-static inline void selectob(Context & context) {
+static void selectob(Context & context) {
findinvpos(context);
context.ax = context.data.word(context.bx);
context._cmp(context.al, 255);
@@ -8825,7 +13470,24 @@ doselob:
return;
}
-static inline void findsetobject(Context & context) {
+static void compare(Context & context) {
+ context._sub(context.dl, 'A');
+ context._sub(context.dh, 'A');
+ context._sub(context.cl, 'A');
+ context._sub(context.ch, 'A');
+ context.push(context.cx);
+ context.push(context.dx);
+ getanyaddir(context);
+ context.dx = context.pop();
+ context.cx = context.pop();
+ context._cmp(context.data.word(context.bx+12), context.cx);
+ if (!context.flags.z()) goto comparefin;
+ context._cmp(context.data.word(context.bx+14), context.dx);
+comparefin:
+ return;
+}
+
+static void findsetobject(Context & context) {
context._sub(context.al, 'A');
context._sub(context.ah, 'A');
context._sub(context.cl, 'A');
@@ -8853,7 +13515,67 @@ nofind:
return;
}
-static inline void checkinside(Context & context) {
+static void findexobject(Context & context) {
+ context._sub(context.al, 'A');
+ context._sub(context.ah, 'A');
+ context._sub(context.cl, 'A');
+ context._sub(context.ch, 'A');
+ context.es = context.data.word(398);
+ context.bx = 0+2080+30000;
+ context.dl = 0;
+findexloop:
+ context._cmp(context.al, context.data.byte(context.bx+12));
+ if (!context.flags.z()) goto nofindex;
+ context._cmp(context.ah, context.data.byte(context.bx+13));
+ if (!context.flags.z()) goto nofindex;
+ context._cmp(context.cl, context.data.byte(context.bx+14));
+ if (!context.flags.z()) goto nofindex;
+ context._cmp(context.ch, context.data.byte(context.bx+15));
+ if (!context.flags.z()) goto nofindex;
+ context.al = context.dl;
+ return;
+nofindex:
+ context._add(context.bx, 16);
+ context._add(context.dl, 1);
+ context._cmp(context.dl, 114);
+ if (!context.flags.z()) goto findexloop;
+ context.al = context.dl;
+ return;
+}
+
+static void isryanholding(Context & context) {
+ context._sub(context.al, 'A');
+ context._sub(context.ah, 'A');
+ context._sub(context.cl, 'A');
+ context._sub(context.ch, 'A');
+ context.es = context.data.word(398);
+ context.bx = 0+2080+30000;
+ context.dl = 0;
+searchinv:
+ context._cmp(context.data.byte(context.bx+2), 4);
+ if (!context.flags.z()) goto nofindininv;
+ context._cmp(context.al, context.data.byte(context.bx+12));
+ if (!context.flags.z()) goto nofindininv;
+ context._cmp(context.ah, context.data.byte(context.bx+13));
+ if (!context.flags.z()) goto nofindininv;
+ context._cmp(context.cl, context.data.byte(context.bx+14));
+ if (!context.flags.z()) goto nofindininv;
+ context._cmp(context.ch, context.data.byte(context.bx+15));
+ if (!context.flags.z()) goto nofindininv;
+ context.al = context.dl;
+ context._cmp(context.al, 114);
+ return;
+nofindininv:
+ context._add(context.bx, 16);
+ context._add(context.dl, 1);
+ context._cmp(context.dl, 114);
+ if (!context.flags.z()) goto searchinv;
+ context.al = context.dl;
+ context._cmp(context.al, 114);
+ return;
+}
+
+static void checkinside(Context & context) {
context.es = context.data.word(398);
context.bx = 0+2080+30000;
context.cl = 0;
@@ -8871,7 +13593,7 @@ notfoundinside:
return;
}
-static inline void usetext(Context & context) {
+static void usetext(Context & context) {
context.push(context.es);
context.push(context.si);
createpanel(context);
@@ -8891,7 +13613,24 @@ static inline void usetext(Context & context) {
return;
}
-static inline void showpuztext(Context & context) {
+static void putbackobstuff(Context & context) {
+ createpanel(context);
+ showpanel(context);
+ showman(context);
+ obicons(context);
+ showexit(context);
+ obpicture(context);
+ describeob(context);
+ undertextline(context);
+ context.data.byte(100) = 255;
+ readmouse(context);
+ showpointer(context);
+ worktoscreen(context);
+ delpointer(context);
+ return;
+}
+
+static void showpuztext(Context & context) {
context.push(context.cx);
findpuztext(context);
context.push(context.es);
@@ -8914,7 +13653,44 @@ static inline void showpuztext(Context & context) {
return;
}
-static inline void issetobonmap(Context & context) {
+static void findpuztext(Context & context) {
+ context.ah = 0;
+ context.si = context.ax;
+ context._add(context.si, context.si);
+ context.es = context.data.word(454);
+ context.ax = context.data.word(context.si);
+ context._add(context.ax, 66*2);
+ context.si = context.ax;
+ return;
+}
+
+static void placesetobject(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ context.cl = 0;
+ context.ch = 0;
+ findormake(context);
+ getsetad(context);
+ context.data.byte(context.bx+58) = 0;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void removesetobject(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ context.cl = 255;
+ context.ch = 0;
+ findormake(context);
+ getsetad(context);
+ context.data.byte(context.bx+58) = 255;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void issetobonmap(Context & context) {
context.push(context.es);
context.push(context.bx);
getsetad(context);
@@ -8925,7 +13701,266 @@ static inline void issetobonmap(Context & context) {
return;
}
-static inline void setuptimedtemp(Context & context) {
+static void placefreeobject(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ context.cl = 0;
+ context.ch = 1;
+ findormake(context);
+ getfreead(context);
+ context.data.byte(context.bx+2) = 0;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void removefreeobject(Context & context) {
+ context.push(context.es);
+ context.push(context.bx);
+ getfreead(context);
+ context.data.byte(context.bx+2) = 255;
+ context.bx = context.pop();
+ context.es = context.pop();
+ return;
+}
+
+static void findormake(Context & context) {
+ context.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);
+ context.push(context.ax);
+ context.es = context.data.word(412);
+ context.ah = context.data.byte(184);
+changeloop:
+ context._cmp(context.data.byte(context.bx), 255);
+ if (context.flags.z()) goto haventfound;
+ context._cmp(context.ax, context.data.word(context.bx));
+ if (!context.flags.z()) goto nofoundchange;
+ context._cmp(context.ch, context.data.byte(context.bx+3));
+ if (context.flags.z()) goto foundchange;
+nofoundchange:
+ context._add(context.bx, 4);
+ goto changeloop;
+foundchange:
+ context.ax = context.pop();
+ context.data.byte(context.bx+2) = context.cl;
+ return;
+haventfound:
+ context.data.word(context.bx) = context.ax;
+ context.data.word(context.bx+2) = context.cx;
+ context.ax = context.pop();
+ return;
+}
+
+static void switchryanon(Context & context) {
+ context.data.byte(63) = 255;
+ return;
+}
+
+static void switchryanoff(Context & context) {
+ context.data.byte(63) = 1;
+ return;
+}
+
+static void setallchanges(Context & context) {
+ context.es = context.data.word(412);
+ context.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);
+setallloop:
+ context.ax = context.data.word(context.bx);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto endsetloop;
+ context.cx = context.data.word(context.bx+2);
+ context._add(context.bx, 4);
+ context._cmp(context.ah, context.data.byte(184));
+ if (!context.flags.z()) goto setallloop;
+ context.push(context.es);
+ context.push(context.bx);
+ dochange(context);
+ context.bx = context.pop();
+ context.es = context.pop();
+ goto setallloop;
+endsetloop:
+ return;
+}
+
+static void dochange(Context & context) {
+ context._cmp(context.ch, 0);
+ if (context.flags.z()) goto object;
+ context._cmp(context.ch, 1);
+ if (context.flags.z()) goto freeobject;
+path:
+ context.push(context.cx);
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context.push(context.ax);
+ context.al = context.ch;
+ context._sub(context.al, 100);
+ context.ah = 0;
+ context.cx = 144;
+ context._mul(context.cx);
+ context.bx = context.pop();
+ context._add(context.bx, context.ax);
+ context._add(context.bx, 0);
+ context.es = context.data.word(450);
+ context.cx = context.pop();
+ context.data.byte(context.bx+6) = context.cl;
+nopath:
+ return;
+object:
+ context.push(context.cx);
+ getsetad(context);
+ context.cx = context.pop();
+ context.data.byte(context.bx+58) = context.cl;
+ return;
+freeobject:
+ context.push(context.cx);
+ getfreead(context);
+ context.cx = context.pop();
+ context._cmp(context.data.byte(context.bx+2), 255);
+ if (!context.flags.z()) goto beenpickedup;
+ context.data.byte(context.bx+2) = context.cl;
+beenpickedup:
+ return;
+}
+
+static void autoappear(Context & context) {
+ context._cmp(context.data.byte(9), 32);
+ if (!context.flags.z()) goto notinalley;
+ context.al = 5;
+ resetlocation(context);
+ context.al = 10;
+ setlocation(context);
+ context.data.byte(183) = 10;
+ return;
+notinalley:
+ context._cmp(context.data.byte(184), 24);
+ if (!context.flags.z()) goto notinedens;
+ context._cmp(context.data.byte(42), 1);
+ if (!context.flags.z()) goto edenspart2;
+ context._add(context.data.byte(42), 1);
+ context.al = 44;
+ placesetobject(context);
+ context.al = 18;
+ placesetobject(context);
+ context.al = 93;
+ placesetobject(context);
+ context.al = 92;
+ removesetobject(context);
+ context.al = 55;
+ removesetobject(context);
+ context.al = 75;
+ removesetobject(context);
+ context.al = 84;
+ removesetobject(context);
+ context.al = 85;
+ removesetobject(context);
+ return;
+edenspart2:
+ context._cmp(context.data.byte(43), 1);
+ if (!context.flags.z()) goto notedens2;
+ context.al = 44;
+ removesetobject(context);
+ context.al = 93;
+ removesetobject(context);
+ context.al = 55;
+ placesetobject(context);
+ context._add(context.data.byte(43), 1);
+notedens2:
+ return;
+notinedens:
+ context._cmp(context.data.byte(184), 25);
+ if (!context.flags.z()) goto notonsartroof;
+ context.data.byte(34) = 3;
+ context.al = 6;
+ resetlocation(context);
+ context.al = 11;
+ setlocation(context);
+ context.data.byte(183) = 11;
+ return;
+notonsartroof:
+ context._cmp(context.data.byte(184), 2);
+ if (!context.flags.z()) goto notinlouiss;
+ context._cmp(context.data.byte(41), 0);
+ if (context.flags.z()) goto notinlouiss;
+ context.al = 23;
+ placesetobject(context);
+notinlouiss:
+ return;
+}
+
+static void getundertimed(Context & context) {
+ context.al = context.data.byte(335);
+ context._sub(context.al, 3);
+ context.ah = 0;
+ context.bx = context.ax;
+ context.al = context.data.byte(336);
+ context.ah = 0;
+ context.di = context.ax;
+ context.ch = 30;
+ context.cl = 240;
+ context.ds = context.data.word(412);
+ context.si = 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)+(250*4);
+ multiget(context);
+ return;
+}
+
+static void putundertimed(Context & context) {
+ context.al = context.data.byte(335);
+ context._sub(context.al, 3);
+ context.ah = 0;
+ context.bx = context.ax;
+ context.al = context.data.byte(336);
+ context.ah = 0;
+ context.di = context.ax;
+ context.ch = 30;
+ context.cl = 240;
+ context.ds = context.data.word(412);
+ context.si = 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)+(250*4);
+ multiput(context);
+ return;
+}
+
+static void dumptimedtext(Context & context) {
+ context._cmp(context.data.byte(337), 1);
+ if (!context.flags.z()) goto nodumptimed;
+ context.al = context.data.byte(335);
+ context._sub(context.al, 3);
+ context.ah = 0;
+ context.bx = context.ax;
+ context.al = context.data.byte(336);
+ context.ah = 0;
+ context.di = context.ax;
+ context.cl = 240;
+ context.ch = 30;
+ multidump(context);
+ context.data.byte(337) = 0;
+nodumptimed:
+ return;
+}
+
+static void setuptimeduse(Context & context) {
+ context._cmp(context.data.word(328), 0);
+ if (!context.flags.z()) goto cantsetup;
+ context.data.byte(335) = context.bh;
+ context.data.byte(336) = context.bl;
+ context.data.word(330) = context.cx;
+ context._add(context.dx, context.cx);
+ context.data.word(328) = context.dx;
+ context.bl = context.al;
+ context.bh = 0;
+ context._add(context.bx, context.bx);
+ context.es = context.data.word(454);
+ context.cx = 66*2;
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, context.cx);
+ context.bx = context.ax;
+ context.data.word(332) = context.es;
+ context.data.word(334) = context.bx;
+cantsetup:
+ return;
+}
+
+static void setuptimedtemp(Context & context) {
context._cmp(context.data.word(328), 0);
if (!context.flags.z()) goto cantsetup2;
context.data.byte(335) = context.bh;
@@ -8947,7 +13982,40 @@ cantsetup2:
return;
}
-static inline void edenscdplayer(Context & context) {
+static void usetimedtext(Context & context) {
+ context._cmp(context.data.word(328), 0);
+ if (context.flags.z()) goto notext;
+ context._sub(context.data.word(328), 1);
+ context._cmp(context.data.word(328), 0);
+ if (context.flags.z()) goto deltimedtext;
+ context.ax = context.data.word(328);
+ context._cmp(context.ax, context.data.word(330));
+ if (context.flags.z()) goto firsttimed;
+ if (!context.flags.c()) goto notext;
+ goto notfirsttimed;
+firsttimed:
+ getundertimed(context);
+notfirsttimed:
+ context.bl = context.data.byte(335);
+ context.bh = 0;
+ context.al = context.data.byte(336);
+ context.ah = 0;
+ context.di = context.ax;
+ context.es = context.data.word(332);
+ context.si = context.data.word(334);
+ context.dl = 237;
+ context.ah = 0;
+ printdirect(context);
+ context.data.byte(337) = 1;
+notext:
+ return;
+deltimedtext:
+ putundertimed(context);
+ context.data.byte(337) = 1;
+ return;
+}
+
+static void edenscdplayer(Context & context) {
showfirstuse(context);
context.data.word(21) = 18*2;
context.data.word(23) = 25;
@@ -8958,7 +14026,7 @@ static inline void edenscdplayer(Context & context) {
return;
}
-static inline void usewall(Context & context) {
+static void usewall(Context & context) {
showfirstuse(context);
context._cmp(context.data.byte(475), 3);
if (context.flags.z()) goto gobackover;
@@ -9013,7 +14081,7 @@ gobackover:
return;
}
-static inline void usechurchgate(Context & context) {
+static void usechurchgate(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto gatewith;
withwhat(context);
@@ -9051,7 +14119,7 @@ notopenchurch:
return;
}
-static inline void usegun(Context & context) {
+static void usegun(Context & context) {
context._cmp(context.data.byte(102), 4);
if (context.flags.z()) goto istakengun;
showseconduse(context);
@@ -9206,7 +14274,7 @@ nottvsoldier:
return;
}
-static inline void useshield(Context & context) {
+static void useshield(Context & context) {
context._cmp(context.data.byte(184), 20);
if (!context.flags.z()) goto notinsartroom;
context._cmp(context.data.byte(64), 0);
@@ -9223,7 +14291,7 @@ notinsartroom:
return;
}
-static inline void usebuttona(Context & context) {
+static void usebuttona(Context & context) {
context.al = 95;
issetobonmap(context);
if (context.flags.z()) goto donethisbit;
@@ -9250,7 +14318,7 @@ donethisbit:
return;
}
-static inline void useplate(Context & context) {
+static void useplate(Context & context) {
context._cmp(context.data.byte(95), 255);
if (!context.flags.z()) goto platewith;
withwhat(context);
@@ -9300,7 +14368,7 @@ triedknife:
return;
}
-static inline void usewinch(Context & context) {
+static void usewinch(Context & context) {
context.al = 40;
context.ah = 1;
checkinside(context);
@@ -9334,7 +14402,7 @@ nowinch:
return;
}
-static inline void entercode(Context & context) {
+static void entercode(Context & context) {
context.data.word(284) = context.ax;
context.data.word(286) = context.cx;
getridofreels(context);
@@ -9406,7 +14474,13 @@ numberright:
return;
}
-static inline void quitkey(Context & context) {
+static void loadkeypad(Context & context) {
+ context.dx = 1961;
+ loadintotemp(context);
+ return;
+}
+
+static void quitkey(Context & context) {
context._cmp(context.data.byte(100), 222);
if (context.flags.z()) goto alreadyqk;
context.data.byte(100) = 222;
@@ -9425,7 +14499,7 @@ doqk:
return;
}
-static inline void addtopresslist(Context & context) {
+static void addtopresslist(Context & context) {
context._cmp(context.data.word(280), 5);
if (context.flags.z()) goto nomorekeys;
context.al = context.data.byte(278);
@@ -9443,73 +14517,73 @@ nomorekeys:
return;
}
-static inline void buttonone(Context & context) {
+static void buttonone(Context & context) {
context.cl = 1;
buttonpress(context);
return;
}
-static inline void buttontwo(Context & context) {
+static void buttontwo(Context & context) {
context.cl = 2;
buttonpress(context);
return;
}
-static inline void buttonthree(Context & context) {
+static void buttonthree(Context & context) {
context.cl = 3;
buttonpress(context);
return;
}
-static inline void buttonfour(Context & context) {
+static void buttonfour(Context & context) {
context.cl = 4;
buttonpress(context);
return;
}
-static inline void buttonfive(Context & context) {
+static void buttonfive(Context & context) {
context.cl = 5;
buttonpress(context);
return;
}
-static inline void buttonsix(Context & context) {
+static void buttonsix(Context & context) {
context.cl = 6;
buttonpress(context);
return;
}
-static inline void buttonseven(Context & context) {
+static void buttonseven(Context & context) {
context.cl = 7;
buttonpress(context);
return;
}
-static inline void buttoneight(Context & context) {
+static void buttoneight(Context & context) {
context.cl = 8;
buttonpress(context);
return;
}
-static inline void buttonnine(Context & context) {
+static void buttonnine(Context & context) {
context.cl = 9;
buttonpress(context);
return;
}
-static inline void buttonnought(Context & context) {
+static void buttonnought(Context & context) {
context.cl = 10;
buttonpress(context);
return;
}
-static inline void buttonenter(Context & context) {
+static void buttonenter(Context & context) {
context.cl = 11;
buttonpress(context);
return;
}
-static inline void buttonpress(Context & context) {
+static void buttonpress(Context & context) {
context.ch = context.cl;
context._add(context.ch, 100);
context._cmp(context.data.byte(100), context.ch);
@@ -9541,7 +14615,7 @@ nonoise:
return;
}
-static inline void showouterpad(Context & context) {
+static void showouterpad(Context & context) {
context.di = 36+112-3;
context.bx = 72-4;
context.ds = context.data.word(458);
@@ -9557,7 +14631,7 @@ static inline void showouterpad(Context & context) {
return;
}
-static inline void showkeypad(Context & context) {
+static void showkeypad(Context & context) {
context.al = 22;
context.di = 36+112+9;
context.bx = 72+5;
@@ -9626,7 +14700,7 @@ notenter:
return;
}
-static inline void singlekey(Context & context) {
+static void singlekey(Context & context) {
context._cmp(context.data.byte(281), context.al);
if (!context.flags.z()) goto gotkey;
context._add(context.al, 11);
@@ -9641,7 +14715,7 @@ gotkey:
return;
}
-static inline void dumpkeypad(Context & context) {
+static void dumpkeypad(Context & context) {
context.di = 36+112-3;
context.bx = 72-4;
context.cl = 120;
@@ -9650,7 +14724,7 @@ static inline void dumpkeypad(Context & context) {
return;
}
-static inline void usemenu(Context & context) {
+static void usemenu(Context & context) {
getridofreels(context);
loadmenu(context);
createpanel(context);
@@ -9699,7 +14773,7 @@ menulist:
return;
}
-static inline void dumpmenu(Context & context) {
+static void dumpmenu(Context & context) {
context.di = 80+40;
context.bx = 60;
context.cl = 48;
@@ -9708,7 +14782,7 @@ static inline void dumpmenu(Context & context) {
return;
}
-static inline void getundermenu(Context & context) {
+static void getundermenu(Context & context) {
context.di = 80+40;
context.bx = 60;
context.cl = 48;
@@ -9719,7 +14793,7 @@ static inline void getundermenu(Context & context) {
return;
}
-static inline void putundermenu(Context & context) {
+static void putundermenu(Context & context) {
context.di = 80+40;
context.bx = 60;
context.cl = 48;
@@ -9730,7 +14804,7 @@ static inline void putundermenu(Context & context) {
return;
}
-static inline void showoutermenu(Context & context) {
+static void showoutermenu(Context & context) {
context.al = 40;
context.ah = 0;
context.di = 80+40-34;
@@ -9758,7 +14832,7 @@ static inline void showoutermenu(Context & context) {
return;
}
-static inline void showmenu(Context & context) {
+static void showmenu(Context & context) {
context._add(context.data.byte(290), 1);
context._cmp(context.data.byte(290), 37*2);
if (!context.flags.z()) goto menuframeok;
@@ -9774,7 +14848,7 @@ menuframeok:
return;
}
-static inline void loadmenu(Context & context) {
+static void loadmenu(Context & context) {
context.dx = 1845;
loadintotemp(context);
context.dx = 2000;
@@ -9782,7 +14856,7 @@ static inline void loadmenu(Context & context) {
return;
}
-static inline void viewfolder(Context & context) {
+static void viewfolder(Context & context) {
context.data.byte(131) = 1;
getridofall(context);
loadfolder(context);
@@ -9812,7 +14886,7 @@ folderloop:
return;
}
-static inline void nextfolder(Context & context) {
+static void nextfolder(Context & context) {
context._cmp(context.data.byte(288), 12);
if (!context.flags.z()) goto cannextf;
blank(context);
@@ -9843,7 +14917,7 @@ donextf:
return;
}
-static inline void folderhints(Context & context) {
+static void folderhints(Context & context) {
context._cmp(context.data.byte(288), 5);
if (!context.flags.z()) goto notaideadd;
context._cmp(context.data.byte(44), 1);
@@ -9890,7 +14964,7 @@ notaristoadd:
return;
}
-static inline void lastfolder(Context & context) {
+static void lastfolder(Context & context) {
context._cmp(context.data.byte(288), 0);
if (!context.flags.z()) goto canlastf;
blank(context);
@@ -9922,7 +14996,7 @@ dolastf:
return;
}
-static inline void loadfolder(Context & context) {
+static void loadfolder(Context & context) {
context.dx = 2312;
loadintotemp(context);
context.dx = 2325;
@@ -9936,7 +15010,7 @@ static inline void loadfolder(Context & context) {
return;
}
-static inline void showfolder(Context & context) {
+static void showfolder(Context & context) {
context.data.byte(100) = 255;
context._cmp(context.data.byte(288), 0);
if (context.flags.z()) goto closedfolder;
@@ -9997,7 +15071,7 @@ closedfolder:
return;
}
-static inline void folderexit(Context & context) {
+static void folderexit(Context & context) {
context.ds = context.data.word(460);
context.di = 296;
context.bx = 178;
@@ -10007,7 +15081,7 @@ static inline void folderexit(Context & context) {
return;
}
-static inline void showleftpage(Context & context) {
+static void showleftpage(Context & context) {
context.ds = context.data.word(460);
context.di = 0;
context.bx = 12;
@@ -10088,7 +15162,7 @@ flipfolderline:
return;
}
-static inline void showrightpage(Context & context) {
+static void showrightpage(Context & context) {
context.ds = context.data.word(460);
context.di = 143;
context.bx = 12;
@@ -10142,7 +15216,7 @@ contrightpage:
return;
}
-static inline void entersymbol(Context & context) {
+static void entersymbol(Context & context) {
context.data.byte(131) = 1;
getridofreels(context);
context.dx = 2351;
@@ -10208,7 +15282,7 @@ symbolwrong:
return;
}
-static inline void quitsymbol(Context & context) {
+static void quitsymbol(Context & context) {
context._cmp(context.data.byte(291), 24);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(294), 24);
@@ -10231,7 +15305,7 @@ doqs:
return;
}
-static inline void settopleft(Context & context) {
+static void settopleft(Context & context) {
context._cmp(context.data.byte(293), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(100), 210);
@@ -10247,7 +15321,7 @@ notopleft:
return;
}
-static inline void settopright(Context & context) {
+static void settopright(Context & context) {
context._cmp(context.data.byte(293), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(100), 211);
@@ -10263,7 +15337,7 @@ notopright:
return;
}
-static inline void setbotleft(Context & context) {
+static void setbotleft(Context & context) {
context._cmp(context.data.byte(296), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(100), 212);
@@ -10279,7 +15353,7 @@ nobotleft:
return;
}
-static inline void setbotright(Context & context) {
+static void setbotright(Context & context) {
context._cmp(context.data.byte(296), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(100), 213);
@@ -10295,7 +15369,7 @@ nobotright:
return;
}
-static inline void dumpsymbol(Context & context) {
+static void dumpsymbol(Context & context) {
context.data.byte(109) = 0;
context.di = 64;
context.bx = 56+20;
@@ -10305,7 +15379,7 @@ static inline void dumpsymbol(Context & context) {
return;
}
-static inline void showsymbol(Context & context) {
+static void showsymbol(Context & context) {
context.al = 12;
context.ah = 0;
context.di = 64;
@@ -10378,7 +15452,7 @@ static inline void showsymbol(Context & context) {
return;
}
-static inline void nextsymbol(Context & context) {
+static void nextsymbol(Context & context) {
context._add(context.al, 1);
context._cmp(context.al, 6);
if (context.flags.z()) goto topwrap;
@@ -10393,7 +15467,7 @@ botwrap:
return;
}
-static inline void updatesymboltop(Context & context) {
+static void updatesymboltop(Context & context) {
context._cmp(context.data.byte(293), 0);
if (context.flags.z()) goto topfinished;
context._cmp(context.data.byte(293), -1);
@@ -10430,7 +15504,7 @@ topfinished:
return;
}
-static inline void updatesymbolbot(Context & context) {
+static void updatesymbolbot(Context & context) {
context._cmp(context.data.byte(296), 0);
if (context.flags.z()) goto botfinished;
context._cmp(context.data.byte(296), -1);
@@ -10467,7 +15541,7 @@ botfinished:
return;
}
-static inline void dumpsymbox(Context & context) {
+static void dumpsymbox(Context & context) {
context._cmp(context.data.word(303), -1);
if (context.flags.z()) goto nodumpsym;
context.di = context.data.word(303);
@@ -10480,7 +15554,7 @@ nodumpsym:
return;
}
-static inline void usediary(Context & context) {
+static void usediary(Context & context) {
getridofreels(context);
context.dx = 2052;
loadintotemp(context);
@@ -10523,7 +15597,7 @@ diarylist:
return;
}
-static inline void showdiary(Context & context) {
+static void showdiary(Context & context) {
context.al = 1;
context.ah = 0;
context.di = 68+24;
@@ -10539,7 +15613,7 @@ static inline void showdiary(Context & context) {
return;
}
-static inline void showdiarykeys(Context & context) {
+static void showdiarykeys(Context & context) {
context._cmp(context.data.byte(282), 0);
if (context.flags.z()) goto nokeyatall;
context._sub(context.data.byte(282), 1);
@@ -10582,7 +15656,7 @@ nokeyatall:
return;
}
-static inline void dumpdiarykeys(Context & context) {
+static void dumpdiarykeys(Context & context) {
context._cmp(context.data.byte(282), 1);
if (!context.flags.z()) goto notdumpdiary;
context._cmp(context.data.byte(43), 1);
@@ -10635,7 +15709,7 @@ notdumpdiary:
return;
}
-static inline void diarykeyp(Context & context) {
+static void diarykeyp(Context & context) {
context._cmp(context.data.byte(100), 214);
if (context.flags.z()) goto alreadykeyp;
context.data.byte(100) = 214;
@@ -10661,7 +15735,7 @@ notkeyp:
return;
}
-static inline void diarykeyn(Context & context) {
+static void diarykeyn(Context & context) {
context._cmp(context.data.byte(100), 213);
if (context.flags.z()) goto alreadykeyn;
context.data.byte(100) = 213;
@@ -10687,7 +15761,7 @@ notkeyn:
return;
}
-static inline void showdiarypage(Context & context) {
+static void showdiarypage(Context & context) {
context.al = 0;
context.ah = 0;
context.di = 68+24;
@@ -10720,7 +15794,7 @@ static inline void showdiarypage(Context & context) {
return;
}
-static inline void findtext1(Context & context) {
+static void findtext1(Context & context) {
context.ah = 0;
context.si = context.ax;
context._add(context.si, context.si);
@@ -10731,7 +15805,7 @@ static inline void findtext1(Context & context) {
return;
}
-static inline void zoomonoff(Context & context) {
+static void zoomonoff(Context & context) {
context._cmp(context.data.word(21), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(234), 2);
@@ -10768,7 +15842,7 @@ dozoomonoff:
return;
}
-static inline void saveload(Context & context) {
+static void saveload(Context & context) {
context._cmp(context.data.word(21), 0);
if (!context.flags.z()) { blank(context); return; };
context._cmp(context.data.byte(234), 2);
@@ -10789,7 +15863,7 @@ noops:
return;
}
-static inline void dosaveload(Context & context) {
+static void dosaveload(Context & context) {
context.data.byte(231) = 0;
context.data.word(79) = 70;
context.data.word(81) = 182-8;
@@ -10838,7 +15912,7 @@ justret:
return;
}
-static inline void getbackfromops(Context & context) {
+static void getbackfromops(Context & context) {
context._cmp(context.data.byte(56), 2);
if (context.flags.z()) goto opsblock1;
getback1(context);
@@ -10848,7 +15922,7 @@ opsblock1:
return;
}
-static inline void showmainops(Context & context) {
+static void showmainops(Context & context) {
context.ds = context.data.word(458);
context.di = 60+10;
context.bx = 52+10;
@@ -10870,7 +15944,7 @@ static inline void showmainops(Context & context) {
return;
}
-static inline void showdiscops(Context & context) {
+static void showdiscops(Context & context) {
context.ds = context.data.word(458);
context.di = 60+128+4;
context.bx = 52+12;
@@ -10898,7 +15972,13 @@ static inline void showdiscops(Context & context) {
return;
}
-static inline void loadgame(Context & context) {
+static void loadsavebox(Context & context) {
+ context.dx = 1974;
+ loadintotemp(context);
+ return;
+}
+
+static void loadgame(Context & context) {
context._cmp(context.data.byte(100), 246);
if (context.flags.z()) goto alreadyload;
context.data.byte(100) = 246;
@@ -10957,7 +16037,7 @@ quitloaded:
return;
}
-static inline void getbacktoops(Context & context) {
+static void getbacktoops(Context & context) {
context._cmp(context.data.byte(100), 201);
if (context.flags.z()) goto alreadygetops;
context.data.byte(100) = 201;
@@ -10977,7 +16057,7 @@ dogetbackops:
return;
}
-static inline void discops(Context & context) {
+static void discops(Context & context) {
context._cmp(context.data.byte(100), 249);
if (context.flags.z()) goto alreadydiscops;
context.data.byte(100) = 249;
@@ -11013,7 +16093,7 @@ discopsloop:
return;
}
-static inline void savegame(Context & context) {
+static void savegame(Context & context) {
context._cmp(context.data.byte(56), 2);
if (!context.flags.z()) goto cansaveok;
blank(context);
@@ -11056,7 +16136,7 @@ saveops:
return;
}
-static inline void actualsave(Context & context) {
+static void actualsave(Context & context) {
context._cmp(context.data.byte(100), 222);
if (context.flags.z()) goto alreadyactsave;
context.data.byte(100) = 222;
@@ -11116,7 +16196,7 @@ noactsave:
return;
}
-static inline void actualload(Context & context) {
+static void actualload(Context & context) {
context._cmp(context.data.byte(100), 221);
if (context.flags.z()) goto alreadyactload;
context.data.byte(100) = 221;
@@ -11145,7 +16225,7 @@ notactload:
return;
}
-static inline void selectslot2(Context & context) {
+static void selectslot2(Context & context) {
context._cmp(context.data.word(202), 0);
if (context.flags.z()) goto noselslot2;
context.data.byte(340) = 2;
@@ -11154,7 +16234,7 @@ noselslot2:
return;
}
-static inline void checkinput(Context & context) {
+static void checkinput(Context & context) {
context._cmp(context.data.byte(340), 3);
if (context.flags.z()) goto nokeypress;
readkey(context);
@@ -11197,7 +16277,7 @@ afterkey:
return;
}
-static inline void getnamepos(Context & context) {
+static void getnamepos(Context & context) {
context.al = context.data.byte(341);
context.ah = 0;
context.cx = 17;
@@ -11212,7 +16292,23 @@ static inline void getnamepos(Context & context) {
return;
}
-static inline void showloadops(Context & context) {
+static void showopbox(Context & context) {
+ context.ds = context.data.word(458);
+ context.di = 60;
+ context.bx = 52;
+ context.al = 0;
+ context.ah = 0;
+ showframe(context);
+ context.ds = context.data.word(458);
+ context.di = 60;
+ context.bx = 52+55;
+ context.al = 4;
+ context.ah = 0;
+ showframe(context);
+ return;
+}
+
+static void showloadops(Context & context) {
context.ds = context.data.word(458);
context.di = 60+128+4;
context.bx = 52+12;
@@ -11233,7 +16329,7 @@ static inline void showloadops(Context & context) {
return;
}
-static inline void showsaveops(Context & context) {
+static void showsaveops(Context & context) {
context.ds = context.data.word(458);
context.di = 60+128+4;
context.bx = 52+12;
@@ -11254,7 +16350,7 @@ static inline void showsaveops(Context & context) {
return;
}
-static inline void selectslot(Context & context) {
+static void selectslot(Context & context) {
context._cmp(context.data.byte(100), 244);
if (context.flags.z()) goto alreadysel;
context.data.byte(100) = 244;
@@ -11302,7 +16398,7 @@ noselslot:
return;
}
-static inline void showslots(Context & context) {
+static void showslots(Context & context) {
context.di = 60+7;
context.bx = 52+8;
context.al = 2;
@@ -11333,7 +16429,7 @@ nomatchslot:
return;
}
-static inline void shownames(Context & context) {
+static void shownames(Context & context) {
context.dx = context.ds;
context.es = context.dx;
context.si = 8367+1;
@@ -11399,7 +16495,7 @@ afterprintname:
return;
}
-static inline void namestoold(Context & context) {
+static void namestoold(Context & context) {
context.ds = context.cs;
context.si = 8367;
context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
@@ -11409,7 +16505,7 @@ static inline void namestoold(Context & context) {
return;
}
-static inline void oldtonames(Context & context) {
+static void oldtonames(Context & context) {
context.es = context.cs;
context.di = 8367;
context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
@@ -11419,7 +16515,7 @@ static inline void oldtonames(Context & context) {
return;
}
-static inline void makeheader(Context & context) {
+static void makeheader(Context & context) {
context.dx = context.ds;
context.es = context.dx;
context.di = 5952;
@@ -11438,7 +16534,7 @@ static inline void makeheader(Context & context) {
return;
}
-static inline void storeit(Context & context) {
+static void storeit(Context & context) {
context._cmp(context.ax, 0);
if (!context.flags.z()) goto isntblank;
context._add(context.ax, 1);
@@ -11447,7 +16543,7 @@ isntblank:
return;
}
-static inline void findlen(Context & context) {
+static void findlen(Context & context) {
context._sub(context.bx, 1);
context._add(context.bx, context.ax);
nextone:
@@ -11461,7 +16557,57 @@ foundlen:
return;
}
-static inline void newgame(Context & context) {
+static void decide(Context & context) {
+ setmode(context);
+ loadpalfromiff(context);
+ clearpalette(context);
+ context.data.byte(234) = 0;
+ context.data.word(21) = 0;
+ context.data.byte(231) = 0;
+ context.data.word(79) = 70;
+ context.data.word(81) = 182-8;
+ context.data.byte(82) = 181;
+ context.data.byte(131) = 1;
+ loadsavebox(context);
+ showdecisions(context);
+ worktoscreen(context);
+ fadescreenup(context);
+ context.data.byte(103) = 0;
+waitdecide:
+ readmouse(context);
+ showpointer(context);
+ vsync(context);
+ dumppointer(context);
+ dumptextline(context);
+ delpointer(context);
+ context.bx = 4884;
+ checkcoords(context);
+ context._cmp(context.data.byte(103), 0);
+ if (context.flags.z()) goto waitdecide;
+ context._cmp(context.data.byte(103), 4);
+ if (context.flags.z()) goto hasloadedroom;
+ getridoftemp(context);
+hasloadedroom:
+ context.data.word(79) = 13;
+ context.data.word(81) = 182;
+ context.data.byte(82) = 240;
+ return;
+}
+
+static void showdecisions(Context & context) {
+ createpanel2(context);
+ showopbox(context);
+ context.ds = context.data.word(458);
+ context.di = 60+17;
+ context.bx = 52+13;
+ context.al = 6;
+ context.ah = 0;
+ showframe(context);
+ undertextline(context);
+ return;
+}
+
+static void newgame(Context & context) {
context._cmp(context.data.byte(100), 251);
if (context.flags.z()) goto alreadynewgame;
context.data.byte(100) = 251;
@@ -11476,7 +16622,7 @@ nonewgame:
return;
}
-static inline void doload(Context & context) {
+static void doload(Context & context) {
context.data.byte(340) = 1;
showopbox(context);
showloadops(context);
@@ -11521,7 +16667,7 @@ quitloaded:
return;
}
-static inline void loadold(Context & context) {
+static void loadold(Context & context) {
context._cmp(context.data.byte(100), 252);
if (context.flags.z()) goto alreadyloadold;
context.data.byte(100) = 252;
@@ -11541,7 +16687,7 @@ noloadold:
return;
}
-static inline void createname(Context & context) {
+static void createname(Context & context) {
context.push(context.ax);
context.di = 4932;
context.data.byte(context.di+0) = context.dl;
@@ -11582,7 +16728,127 @@ tensc:
return;
}
-static inline void makenextblock(Context & context) {
+static void trysoundalloc(Context & context) {
+ context._cmp(context.data.byte(358), 1);
+ if (context.flags.z()) goto gotsoundbuff;
+ context._add(context.data.byte(357), 1);
+ context.bx = (16384+2048)/16;
+ allocatemem(context);
+ context.data.word(353) = context.ax;
+ context.push(context.ax);
+ context.al = context.ah;
+ context.cl = 4;
+ context._shr(context.al, context.cl);
+ context.data.byte(356) = context.al;
+ context.ax = context.pop();
+ context.cl = 4;
+ context._shl(context.ax, context.cl);
+ context.data.word(355) = context.ax;
+ context._cmp(context.ax, 0x0b7ff);
+ if (!context.flags.c()) goto soundfail;
+ context.es = context.data.word(353);
+ context.di = 0;
+ context.cx = 16384/2;
+ context.ax = 0x7f7f;
+ while(--context.cx) context._stosw();
+ context.data.byte(358) = 1;
+ return;
+soundfail:
+ context.es = context.data.word(353);
+ deallocatemem(context);
+gotsoundbuff:
+ return;
+}
+
+static void playchannel0(Context & context) {
+ context._cmp(context.data.byte(378), 255);
+ if (context.flags.z()) goto dontbother4;
+ context.push(context.es);
+ context.push(context.ds);
+ context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.di);
+ context.push(context.si);
+ context.data.byte(507) = context.al;
+ context.es = context.data.word(420);
+ context._cmp(context.al, 12);
+ if (context.flags.c()) goto notsecondbank;
+ context.es = context.data.word(422);
+ context._sub(context.al, 12);
+notsecondbank:
+ context.data.byte(508) = context.ah;
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.bx);
+ context.ah = 0;
+ context.data.word(502) = context.ax;
+ context.ax = context.data.word(context.bx+1);
+ context.data.word(504) = context.ax;
+ context.ax = context.data.word(context.bx+3);
+ context.data.word(506) = context.ax;
+ context._cmp(context.data.byte(508), 0);
+ if (context.flags.z()) goto nosetloop;
+ context.ax = context.data.word(502);
+ context.data.word(510) = context.ax;
+ context.ax = context.data.word(504);
+ context.data.word(512) = context.ax;
+ context.ax = context.data.word(506);
+ context.data.word(514) = context.ax;
+nosetloop:
+ context.si = context.pop();
+ context.di = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.ds = context.pop();
+ context.es = context.pop();
+dontbother4:
+ return;
+}
+
+static void playchannel1(Context & context) {
+ context._cmp(context.data.byte(378), 255);
+ if (context.flags.z()) goto dontbother5;
+ context._cmp(context.data.byte(515), 7);
+ if (context.flags.z()) goto dontbother5;
+ context.push(context.es);
+ context.push(context.ds);
+ context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.di);
+ context.push(context.si);
+ context.data.byte(515) = context.al;
+ context.es = context.data.word(420);
+ context._cmp(context.al, 12);
+ if (context.flags.c()) goto notsecondbank1;
+ context.es = context.data.word(422);
+ context._sub(context.al, 12);
+notsecondbank1:
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.bx = context.ax;
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.bx);
+ context.ah = 0;
+ context.data.word(517) = context.ax;
+ context.ax = context.data.word(context.bx+1);
+ context.data.word(519) = context.ax;
+ context.ax = context.data.word(context.bx+3);
+ context.data.word(521) = context.ax;
+ context.si = context.pop();
+ context.di = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.ds = context.pop();
+ context.es = context.pop();
+dontbother5:
+ return;
+}
+
+static void makenextblock(Context & context) {
volumeadjust(context);
loopchannel0(context);
context._cmp(context.data.word(521), 0);
@@ -11619,7 +16885,7 @@ notch0only:
return;
}
-static inline void volumeadjust(Context & context) {
+static void volumeadjust(Context & context) {
context.al = context.data.byte(388);
context._cmp(context.al, 0);
if (context.flags.z()) goto volok;
@@ -11638,7 +16904,7 @@ volok:
return;
}
-static inline void loopchannel0(Context & context) {
+static void loopchannel0(Context & context) {
context._cmp(context.data.word(506), 0);
if (!context.flags.z()) goto notloop;
context._cmp(context.data.byte(508), 0);
@@ -11659,7 +16925,20 @@ notloop:
return;
}
-static inline void channel0tran(Context & context) {
+static void cancelch0(Context & context) {
+ context.data.byte(508) = 0;
+ context.data.word(506) = 0;
+ context.data.byte(507) = 255;
+ return;
+}
+
+static void cancelch1(Context & context) {
+ context.data.word(521) = 0;
+ context.data.byte(515) = 255;
+ return;
+}
+
+static void channel0tran(Context & context) {
context._cmp(context.data.byte(386), 0);
if (!context.flags.z()) goto lowvolumetran;
context.cx = 1024;
@@ -11681,7 +16960,7 @@ volloop:
return;
}
-static inline void domix(Context & context) {
+static void domix(Context & context) {
context._cmp(context.data.byte(386), 0);
if (!context.flags.z()) goto lowvolumemix;
slow:
@@ -11773,117 +17052,458 @@ doneit:
return;
}
-static inline void dreamweb(Context & context) {
- seecommandtail(context);
- checkbasemem(context);
- soundstartup(context);
- setkeyboardint(context);
- setupemm(context);
- allocatebuffers(context);
- setmouse(context);
- fadedos(context);
- gettime(context);
- clearbuffers(context);
- clearpalette(context);
- set16colpalette(context);
- readsetdata(context);
- context.data.byte(391) = 0;
- context.dx = 1922;
- loadsample(context);
- setsoundoff(context);
- scanfornames(context);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto dodecisions;
- setmode(context);
- loadpalfromiff(context);
- titles(context);
- credits(context);
- goto playgame;
-dodecisions:
- cls(context);
- setmode(context);
- decide(context);
- context._cmp(context.data.byte(103), 4);
- if (context.flags.z()) goto mainloop;
- titles(context);
- credits(context);
-playgame:
- clearchanges(context);
- setmode(context);
- loadpalfromiff(context);
- context.data.byte(9) = 255;
- context.data.byte(67) = 1;
- context.data.byte(188) = 35;
- context.data.byte(386) = 7;
- loadroom(context);
- clearsprites(context);
- initman(context);
- entrytexts(context);
- entryanims(context);
- context.data.byte(183) = 3;
- initialinv(context);
- context.data.byte(153) = 32;
- startup1(context);
- context.data.byte(387) = 0;
- context.data.byte(388) = -1;
- context.data.byte(100) = 255;
- goto mainloop;
-loadnew:
- clearbeforeload(context);
- loadroom(context);
- clearsprites(context);
- initman(context);
- entrytexts(context);
- entryanims(context);
- context.data.byte(188) = 255;
- startup(context);
- context.data.byte(100) = 255;
- worktoscreenm(context);
- goto mainloop;
-alreadyloaded:
- context.data.byte(188) = 255;
- clearsprites(context);
- initman(context);
- startup(context);
- context.data.byte(100) = 255;
-mainloop:
- screenupdate(context);
- context._cmp(context.data.byte(391), 0);
- if (!context.flags.z()) goto endofgame;
- context._cmp(context.data.byte(56), 1);
- if (context.flags.z()) goto gameover;
- context._cmp(context.data.byte(56), 2);
- if (context.flags.z()) goto gameover;
- context._cmp(context.data.word(21), 0);
- if (context.flags.z()) goto notwatching;
- context.al = context.data.byte(477);
- context._cmp(context.al, context.data.byte(475));
- if (!context.flags.z()) goto mainloop;
- context._sub(context.data.word(21), 1);
- if (!context.flags.z()) goto mainloop;
-notwatching:
- context._cmp(context.data.byte(56), 4);
- if (context.flags.z()) goto gameover;
- context._cmp(context.data.byte(188), 255);
- if (!context.flags.z()) goto loadnew;
- goto mainloop;
-gameover:
- clearbeforeload(context);
- showgun(context);
- fadescreendown(context);
- context.cx = 100;
- hangon(context);
- goto dodecisions;
-endofgame:
- clearbeforeload(context);
- fadescreendowns(context);
- context.cx = 200;
- hangon(context);
- endgame(context);
- { quickquit2(context); return; };
+static void entrytexts(Context & context) {
+ context._cmp(context.data.byte(9), 21);
+ if (!context.flags.z()) goto notloc15;
+ context.al = 28;
+ context.cx = 60;
+ context.dx = 11;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notloc15:
+ context._cmp(context.data.byte(9), 30);
+ if (!context.flags.z()) goto notloc43;
+ context.al = 27;
+ context.cx = 60;
+ context.dx = 11;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notloc43:
+ context._cmp(context.data.byte(9), 23);
+ if (!context.flags.z()) goto notloc23;
+ context.al = 29;
+ context.cx = 60;
+ context.dx = 11;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notloc23:
+ context._cmp(context.data.byte(9), 31);
+ if (!context.flags.z()) goto notloc44;
+ context.al = 30;
+ context.cx = 60;
+ context.dx = 11;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notloc44:
+ context._cmp(context.data.byte(9), 20);
+ if (!context.flags.z()) goto notsarters2;
+ context.al = 31;
+ context.cx = 60;
+ context.dx = 11;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notsarters2:
+ context._cmp(context.data.byte(9), 24);
+ if (!context.flags.z()) goto notedenlob;
+ context.al = 32;
+ context.cx = 60;
+ context.dx = 3;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+notedenlob:
+ context._cmp(context.data.byte(9), 34);
+ if (!context.flags.z()) goto noteden2;
+ context.al = 33;
+ context.cx = 60;
+ context.dx = 3;
+ context.bl = 68;
+ context.bh = 64;
+ setuptimeduse(context);
+ return;
+noteden2:
+ return;
+}
+
+static void entryanims(Context & context) {
+ context.data.word(23) = -1;
+ context.data.byte(32) = -1;
+ context._cmp(context.data.byte(9), 33);
+ if (!context.flags.z()) goto notinthebeach;
+ switchryanoff(context);
+ context.data.word(21) = 76*2;
+ context.data.word(23) = 0;
+ context.data.word(25) = 76;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ return;
+notinthebeach:
+ context._cmp(context.data.byte(9), 44);
+ if (!context.flags.z()) goto notsparkys;
+ context.al = 8;
+ resetlocation(context);
+ context.data.word(21) = 50*2;
+ context.data.word(23) = 247;
+ context.data.word(25) = 297;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+notsparkys:
+ context._cmp(context.data.byte(9), 22);
+ if (!context.flags.z()) goto notinthelift;
+ context.data.word(21) = 31*2;
+ context.data.word(23) = 0;
+ context.data.word(25) = 30;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+notinthelift:
+ context._cmp(context.data.byte(9), 26);
+ if (!context.flags.z()) goto notunderchurch;
+ context.data.byte(292) = 2;
+ context.data.byte(295) = 1;
+ return;
+notunderchurch:
+ context._cmp(context.data.byte(9), 45);
+ if (!context.flags.z()) goto notenterdream;
+ context.data.byte(54) = 0;
+ context.data.word(21) = 296;
+ context.data.word(23) = 45;
+ context.data.word(25) = 198;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+notenterdream:
+ context._cmp(context.data.byte(184), 46);
+ if (!context.flags.z()) goto notcrystal;
+ context._cmp(context.data.byte(43), 1);
+ if (!context.flags.z()) goto notcrystal;
+ context.al = 0;
+ removefreeobject(context);
+ return;
+notcrystal:
+ context._cmp(context.data.byte(9), 9);
+ if (!context.flags.z()) goto nottopchurch;
+ context.al = 2;
+ checkifpathison(context);
+ if (context.flags.z()) goto nottopchurch;
+ context._cmp(context.data.byte(44), 0);
+ if (context.flags.z()) goto nottopchurch;
+ context.al = 3;
+ checkifpathison(context);
+ if (!context.flags.z()) goto makedoorsopen;
+ context.al = 2;
+ turnpathon(context);
+makedoorsopen:
+ context.al = 4;
+ removesetobject(context);
+ context.al = 5;
+ placesetobject(context);
+ return;
+nottopchurch:
+ context._cmp(context.data.byte(9), 47);
+ if (!context.flags.z()) goto notdreamcentre;
+ context.al = 4;
+ placesetobject(context);
+ context.al = 5;
+ placesetobject(context);
+ return;
+notdreamcentre:
+ context._cmp(context.data.byte(9), 38);
+ if (!context.flags.z()) goto notcarpark;
+ context.data.word(21) = 57*2;
+ context.data.word(23) = 4;
+ context.data.word(25) = 57;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+notcarpark:
+ context._cmp(context.data.byte(9), 32);
+ if (!context.flags.z()) goto notalley;
+ context.data.word(21) = 66*2;
+ context.data.word(23) = 0;
+ context.data.word(25) = 66;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+notalley:
+ context._cmp(context.data.byte(9), 24);
+ if (!context.flags.z()) goto notedensagain;
+ context.al = 2;
+ context.ah = context.data.byte(185);
+ context._sub(context.ah, 1);
+ turnanypathon(context);
+notedensagain:
+ return;
+}
+
+static void initialinv(Context & context) {
+ context._cmp(context.data.byte(184), 24);
+ if (context.flags.z()) goto isedens;
+ return;
+isedens:
+ context.al = 11;
+ context.ah = 5;
+ pickupob(context);
+ context.al = 12;
+ context.ah = 6;
+ pickupob(context);
+ context.al = 13;
+ context.ah = 7;
+ pickupob(context);
+ context.al = 14;
+ context.ah = 8;
+ pickupob(context);
+ context.al = 18;
+ context.al = 18;
+ context.ah = 0;
+ pickupob(context);
+ context.al = 19;
+ context.ah = 1;
+ pickupob(context);
+ context.al = 20;
+ context.ah = 9;
+ pickupob(context);
+ context.al = 16;
+ context.ah = 2;
+ pickupob(context);
+ context.data.byte(32) = 1;
+ context.data.word(29) = 0;
+ context.data.word(31) = 6;
+ context.data.byte(27) = 1;
+ context.data.byte(26) = 1;
+ switchryanoff(context);
+ return;
+}
+
+static void pickupob(Context & context) {
+ context.data.byte(107) = context.ah;
+ context.data.byte(102) = 2;
+ context.data.byte(89) = context.al;
+ context.data.byte(99) = context.al;
+ getanyad(context);
+ transfertoex(context);
+ return;
+}
+
+static void checkforemm(Context & context) {
+ return;
+}
+
+static void checkbasemem(Context & context) {
+ context.bx = context.data.word(534);
+ context._cmp(context.bx, 0x9360);
+ if (!context.flags.c()) goto enoughmem;
+ context.data.byte(532) = 5;
+ { quickquit(context); return; };
+enoughmem:
+ return;
+}
+
+static void allocatebuffers(Context & context) {
+ context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16;
+ allocatemem(context);
+ context.data.word(398) = context.ax;
+ trysoundalloc(context);
+ context.bx = 0+(66*60)/16;
+ allocatemem(context);
+ context.data.word(418) = context.ax;
+ trysoundalloc(context);
+ context.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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537)+68-context.data.byte(1)/16;
+ allocatemem(context);
+ context.data.word(412) = context.ax;
+ trysoundalloc(context);
+ context.bx = 16*80/16;
+ allocatemem(context);
+ context.data.word(426) = context.ax;
+ trysoundalloc(context);
+ context.bx = 64*128/16;
+ allocatemem(context);
+ context.data.word(428) = context.ax;
+ trysoundalloc(context);
+ context.bx = 22*8*20*8/16;
+ allocatemem(context);
+ context.data.word(402) = context.ax;
+ allocatework(context);
+ context.bx = 2048/16;
+ allocatemem(context);
+ context.data.word(420) = context.ax;
+ context.bx = 2048/16;
+ allocatemem(context);
+ context.data.word(422) = context.ax;
+ return;
+}
+
+static void clearbuffers(Context & context) {
+ context.es = context.data.word(412);
+ context.cx = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537)+68-context.data.byte(1)/2;
+ context.ax = 0;
+ context.di = 0;
+ while(--context.cx) context._stosw();
+ context.es = context.data.word(398);
+ context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2;
+ context.ax = 0x0ffff;
+ context.di = 0;
+ while(--context.cx) context._stosw();
+ context.es = context.data.word(412);
+ context.di = 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)+(250*4)+(256*30)+(6*64);
+ context.ds = context.cs;
+ context.si = 537;
+ context.cx = 991-context.data.byte(537);
+ while(--context.cx) context._movsb();
+ context.es = context.data.word(412);
+ context.di = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537);
+ context.ds = context.cs;
+ context.si = 1;
+ context.cx = 68-context.data.byte(1);
+ while(--context.cx) context._movsb();
+ clearchanges(context);
+ return;
+}
+
+static void clearchanges(Context & context) {
+ context.es = context.data.word(412);
+ context.cx = 250*2;
+ context.ax = 0x0ffff;
+ context.di = 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);
+ while(--context.cx) context._stosw();
+ context.ds = context.data.word(412);
+ context.si = 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)+(250*4)+(256*30)+(6*64);
+ context.es = context.cs;
+ context.di = 537;
+ context.cx = 991-context.data.byte(537);
+ while(--context.cx) context._movsb();
+ context.ds = context.data.word(412);
+ context.si = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537);
+ context.es = context.cs;
+ context.di = 1;
+ context.cx = 68-context.data.byte(1);
+ while(--context.cx) context._movsb();
+ context.data.byte(10) = 0;
+ context.data.word(12) = 0;
+ context.data.word(14) = 0;
+ context.es = context.data.word(398);
+ context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2;
+ context.ax = 0x0ffff;
+ context.di = 0;
+ while(--context.cx) context._stosw();
+ context.es = context.cs;
+ context.di = 7798;
+ context.al = 1;
+ context._stosb();
+ context._stosb();
+ context.al = 0;
+ context._stosb();
+ context.al = 1;
+ context._stosb();
+ context.ax = 0;
+ context.cx = 6;
+ while(--context.cx) context._stosw();
+ return;
+}
+
+static void clearbeforeload(Context & context) {
+ context._cmp(context.data.byte(74), 1);
+ if (!context.flags.z()) goto noclear;
+ clearreels(context);
+ clearrest(context);
+ context.data.byte(74) = 0;
+noclear:
+ return;
+}
+
+static void clearreels(Context & context) {
+ context.es = context.data.word(430);
+ deallocatemem(context);
+ context.es = context.data.word(432);
+ deallocatemem(context);
+ context.es = context.data.word(434);
+ deallocatemem(context);
+ return;
+}
+
+static void clearrest(Context & context) {
+ context.es = context.data.word(418);
+ context.cx = 66*60/2;
+ context.ax = 0;
+ context.di = 0;
+ while(--context.cx) context._stosw();
+ context.es = context.data.word(416);
+ deallocatemem(context);
+ context.es = context.data.word(444);
+ deallocatemem(context);
+ context.es = context.data.word(450);
+ deallocatemem(context);
+ context.es = context.data.word(448);
+ deallocatemem(context);
+ context.es = context.data.word(440);
+ deallocatemem(context);
+ context.es = context.data.word(442);
+ deallocatemem(context);
+ context.es = context.data.word(436);
+ deallocatemem(context);
+ context.es = context.data.word(446);
+ deallocatemem(context);
+ context.es = context.data.word(438);
+ deallocatemem(context);
+ return;
+}
+
+static void seecommandtail(Context & context) {
+ context.data.word(372) = 0x220;
+ context.data.byte(378) = 5;
+ context.data.byte(379) = 1;
+ context.data.byte(73) = 0;
+ context.bx = 2;
+ context.ax = context.data.word(context.bx);
+ context.dx = context.es;
+ context._sub(context.ax, context.dx);
+ context.data.word(534) = context.ax;
+ context.bx = 0x02c;
+ context.ax = context.data.word(context.bx);
+ context.push(context.es);
+ context.push(context.bx);
+ context.es = context.ax;
+ context.bx = 0;
+findblaster:
+ context.ax = context.data.word(context.bx);
+ context._cmp(context.ax, 0);
+ if (context.flags.z()) goto endofenvironment;
+ context._cmp(context.al, 'B');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.ah, 'L');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.data.byte(context.bx+2), 'A');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.data.byte(context.bx+3), 'S');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.data.byte(context.bx+4), 'T');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.data.byte(context.bx+5), 'E');
+ if (!context.flags.z()) goto notblast;
+ context._cmp(context.data.byte(context.bx+6), 'R');
+ if (!context.flags.z()) goto notblast;
+ context._add(context.bx, 7);
+ parseblaster(context);
+ goto endofenvironment;
+notblast:
+ context._add(context.bx, 1);
+ goto findblaster;
+endofenvironment:
+ context.bx = context.pop();
+ context.es = context.pop();
+ context.bx = 0x81;
+ parseblaster(context);
+ return;
}
-static inline void parseblaster(Context & context) {
+static void parseblaster(Context & context) {
lookattail:
context.al = context.data.byte(context.bx);
context._cmp(context.al, 0);
@@ -11949,7 +17569,293 @@ endtail:
return;
}
-static inline void showbyte(Context & context) {
+static void startup(Context & context) {
+ context.data.byte(142) = 0;
+ context.data.byte(105) = 0;
+ createpanel(context);
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ showicon(context);
+ getunderzoom(context);
+ spriteupdate(context);
+ printsprites(context);
+ undertextline(context);
+ reelsonscreen(context);
+ atmospheres(context);
+ return;
+}
+
+static void startup1(Context & context) {
+ clearpalette(context);
+ context.data.byte(61) = 0;
+ context.data.byte(142) = '0';
+ context.data.byte(105) = 0;
+ createpanel(context);
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ showicon(context);
+ getunderzoom(context);
+ spriteupdate(context);
+ printsprites(context);
+ undertextline(context);
+ reelsonscreen(context);
+ atmospheres(context);
+ worktoscreen(context);
+ fadescreenup(context);
+ return;
+}
+
+static void screenupdate(Context & context) {
+ newplace(context);
+ mainscreen(context);
+ animpointer(context);
+ showpointer(context);
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto iswatchingmode;
+ context._cmp(context.data.byte(188), 255);
+ if (!context.flags.z()) goto finishearly;
+iswatchingmode:
+ vsync(context);
+ readmouse1(context);
+ dumppointer(context);
+ dumptextline(context);
+ delpointer(context);
+ autolook(context);
+ spriteupdate(context);
+ watchcount(context);
+ zoom(context);
+ showpointer(context);
+ context._cmp(context.data.byte(391), 0);
+ if (!context.flags.z()) goto finishearly;
+ vsync(context);
+ readmouse2(context);
+ dumppointer(context);
+ dumpzoom(context);
+ delpointer(context);
+ deleverything(context);
+ printsprites(context);
+ reelsonscreen(context);
+ afternewroom(context);
+ showpointer(context);
+ vsync(context);
+ readmouse3(context);
+ dumppointer(context);
+ dumpmap(context);
+ dumptimedtext(context);
+ delpointer(context);
+ showpointer(context);
+ vsync(context);
+ readmouse4(context);
+ dumppointer(context);
+ dumpwatch(context);
+ delpointer(context);
+finishearly:
+ return;
+}
+
+static void watchreel(Context & context) {
+ context._cmp(context.data.word(23), -1);
+ if (context.flags.z()) goto notplayingreel;
+ context.al = context.data.byte(475);
+ context._cmp(context.al, context.data.byte(477));
+ if (!context.flags.z()) goto waitstopwalk;
+ context.al = context.data.byte(135);
+ context._cmp(context.al, context.data.byte(133));
+ if (context.flags.z()) goto notwatchpath;
+waitstopwalk:
+ return;
+notwatchpath:
+ context._sub(context.data.byte(26), 1);
+ context._cmp(context.data.byte(26), -1);
+ if (!context.flags.z()) goto showwatchreel;
+ context.al = context.data.byte(27);
+ context.data.byte(26) = context.al;
+ context.ax = context.data.word(23);
+ context._cmp(context.ax, context.data.word(25));
+ if (!context.flags.z()) goto ismorereel;
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto showwatchreel;
+ context.data.word(23) = -1;
+ context.data.byte(32) = -1;
+ context._cmp(context.data.word(29), -1);
+ if (context.flags.z()) goto nomorereel;
+ context.data.byte(32) = 1;
+ goto notplayingreel;
+ismorereel:
+ context._add(context.data.word(23), 1);
+showwatchreel:
+ context.ax = context.data.word(23);
+ context.data.word(239) = context.ax;
+ plotreel(context);
+ context.ax = context.data.word(239);
+ context.data.word(23) = context.ax;
+ checkforshake(context);
+nomorereel:
+ return;
+notplayingreel:
+ context._cmp(context.data.byte(32), 1);
+ if (!context.flags.z()) goto notholdingreel;
+ context.ax = context.data.word(29);
+ context.data.word(239) = context.ax;
+ plotreel(context);
+ return;
+notholdingreel:
+ context._cmp(context.data.byte(32), 2);
+ if (!context.flags.z()) goto notreleasehold;
+ context._sub(context.data.byte(26), 1);
+ context._cmp(context.data.byte(26), -1);
+ if (!context.flags.z()) goto notlastspeed2;
+ context.al = context.data.byte(27);
+ context.data.byte(26) = context.al;
+ context._add(context.data.word(29), 1);
+notlastspeed2:
+ context.ax = context.data.word(29);
+ context._cmp(context.ax, context.data.word(31));
+ if (!context.flags.z()) goto ismorereel2;
+ context.data.word(29) = -1;
+ context.data.byte(32) = -1;
+ context.al = context.data.byte(33);
+ context.data.byte(478) = context.al;
+ context.data.byte(477) = context.al;
+ autosetwalk(context);
+ return;
+ismorereel2:
+ context.ax = context.data.word(29);
+ context.data.word(239) = context.ax;
+ plotreel(context);
+ return;
+notreleasehold:
+ return;
+}
+
+static void checkforshake(Context & context) {
+ context._cmp(context.data.byte(184), 26);
+ if (!context.flags.z()) goto notstartshake;
+ context._cmp(context.ax, 104);
+ if (!context.flags.z()) goto notstartshake;
+ context.data.byte(68) = -1;
+notstartshake:
+ return;
+}
+
+static void watchcount(Context & context) {
+ context._cmp(context.data.byte(3), 0);
+ if (context.flags.z()) goto nowatchworn;
+ context._add(context.data.byte(146), 1);
+ context._cmp(context.data.byte(146), 9);
+ if (context.flags.z()) goto flashdots;
+ context._cmp(context.data.byte(146), 18);
+ if (context.flags.z()) goto uptime;
+nowatchworn:
+ return;
+flashdots:
+ context.ax = 91*3+21;
+ context.di = 268+4;
+ context.bx = 21;
+ context.ds = context.data.word(404);
+ showframe(context);
+ goto finishwatch;
+uptime:
+ context.data.byte(146) = 0;
+ context._add(context.data.byte(5), 1);
+ context._cmp(context.data.byte(5), 60);
+ if (!context.flags.z()) goto finishtime;
+ context.data.byte(5) = 0;
+ context._add(context.data.byte(6), 1);
+ context._cmp(context.data.byte(6), 60);
+ if (!context.flags.z()) goto finishtime;
+ context.data.byte(6) = 0;
+ context._add(context.data.byte(7), 1);
+ context._cmp(context.data.byte(7), 24);
+ if (!context.flags.z()) goto finishtime;
+ context.data.byte(7) = 0;
+finishtime:
+ showtime(context);
+finishwatch:
+ context.data.byte(266) = 1;
+ return;
+}
+
+static void showtime(Context & context) {
+ context._cmp(context.data.byte(3), 0);
+ if (context.flags.z()) goto nowatch;
+ context.al = context.data.byte(5);
+ context.cl = 0;
+ twodigitnum(context);
+ context.push(context.ax);
+ context.al = context.ah;
+ context.ah = 0;
+ context._add(context.ax, 91*3+10);
+ context.ds = context.data.word(404);
+ context.di = 282+5;
+ context.bx = 21;
+ showframe(context);
+ context.ax = context.pop();
+ context.ah = 0;
+ context._add(context.ax, 91*3+10);
+ context.ds = context.data.word(404);
+ context.di = 282+9;
+ context.bx = 21;
+ showframe(context);
+ context.al = context.data.byte(6);
+ context.cl = 0;
+ twodigitnum(context);
+ context.push(context.ax);
+ context.al = context.ah;
+ context.ah = 0;
+ context._add(context.ax, 91*3);
+ context.ds = context.data.word(404);
+ context.di = 270+5;
+ context.bx = 21;
+ showframe(context);
+ context.ax = context.pop();
+ context.ah = 0;
+ context._add(context.ax, 91*3);
+ context.ds = context.data.word(404);
+ context.di = 270+11;
+ context.bx = 21;
+ showframe(context);
+ context.al = context.data.byte(7);
+ context.cl = 0;
+ twodigitnum(context);
+ context.push(context.ax);
+ context.al = context.ah;
+ context.ah = 0;
+ context._add(context.ax, 91*3);
+ context.ds = context.data.word(404);
+ context.di = 256+5;
+ context.bx = 21;
+ showframe(context);
+ context.ax = context.pop();
+ context.ah = 0;
+ context._add(context.ax, 91*3);
+ context.ds = context.data.word(404);
+ context.di = 256+11;
+ context.bx = 21;
+ showframe(context);
+ context.ax = 91*3+20;
+ context.ds = context.data.word(404);
+ context.di = 267+5;
+ context.bx = 21;
+ showframe(context);
+nowatch:
+ return;
+}
+
+static void dumpwatch(Context & context) {
+ context._cmp(context.data.byte(266), 1);
+ if (!context.flags.z()) goto nodumpwatch;
+ context.di = 256;
+ context.bx = 21;
+ context.cl = 40;
+ context.ch = 12;
+ multidump(context);
+ context.data.byte(266) = 0;
+nodumpwatch:
+ return;
+}
+
+static void showbyte(Context & context) {
context.dl = context.al;
context._shr(context.dl, 1);
context._shr(context.dl, 1);
@@ -11965,7 +17871,7 @@ static inline void showbyte(Context & context) {
return;
}
-static inline void onedigit(Context & context) {
+static void onedigit(Context & context) {
context._cmp(context.dl, 10);
if (!context.flags.c()) goto morethan10;
context._add(context.dl, '0');
@@ -11976,7 +17882,19 @@ morethan10:
return;
}
-static inline void showword(Context & context) {
+static void twodigitnum(Context & context) {
+ context.ah = context.cl;
+ context._sub(context.ah, 1);
+numloop1:
+ context._add(context.ah, 1);
+ context._sub(context.al, 10);
+ if (!context.flags.c()) goto numloop1;
+ context._add(context.al, 10);
+ context._add(context.al, context.cl);
+ return;
+}
+
+static void showword(Context & context) {
context.ch = 0;
context.bx = 10000;
context.cl = 47;
@@ -12021,7 +17939,7 @@ word4:
return;
}
-static inline void convnum(Context & context) {
+static void convnum(Context & context) {
context._cmp(context.ch, 0);
if (!context.flags.z()) goto noconvnum;
context._cmp(context.cl, '0');
@@ -12034,7 +17952,93 @@ noconvnum:
return;
}
-static inline void madmanrun(Context & context) {
+static void walkandexamine(Context & context) {
+ finishedwalking(context);
+ if (!context.flags.z()) goto noobselect;
+ context.al = context.data.byte(307);
+ context.data.byte(100) = context.al;
+ context.al = context.data.byte(308);
+ context.data.byte(99) = context.al;
+ context.data.byte(306) = 0;
+ context._cmp(context.data.byte(100), 5);
+ if (context.flags.z()) goto noobselect;
+ examineob(context);
+ return;
+wantstowalk:
+ setwalk(context);
+ context.data.byte(473) = 1;
+noobselect:
+ return;
+diff:
+ context.data.byte(99) = context.al;
+ context.data.byte(100) = context.ah;
+diff2:
+ context._cmp(context.data.byte(492), 254);
+ if (!context.flags.z()) goto middleofwalk;
+ context._cmp(context.data.word(21), 0);
+ if (!context.flags.z()) goto middleofwalk;
+ context.al = context.data.byte(133);
+ context._cmp(context.al, context.data.byte(135));
+ if (!context.flags.z()) goto middleofwalk;
+ context._cmp(context.data.byte(100), 3);
+ if (!context.flags.z()) goto notblock;
+ context.bl = context.data.byte(475);
+ context._cmp(context.bl, context.data.byte(474));
+ if (!context.flags.z()) goto dontcheck;
+ context.cl = context.data.byte(151);
+ context._add(context.cl, 12);
+ context.ch = context.data.byte(152);
+ context._add(context.ch, 12);
+ checkone(context);
+ context._cmp(context.cl, 2);
+ if (context.flags.c()) goto isblock;
+dontcheck:
+ getflagunderp(context);
+ context._cmp(context.data.byte(153), 2);
+ if (context.flags.c()) goto isblock;
+ context._cmp(context.data.byte(153), 128);
+ if (!context.flags.c()) goto isblock;
+ goto toofaraway;
+notblock:
+ context.bl = context.data.byte(475);
+ context._cmp(context.bl, context.data.byte(474));
+ if (!context.flags.z()) goto toofaraway;
+ context._cmp(context.data.byte(100), 3);
+ if (context.flags.z()) goto isblock;
+ context._cmp(context.data.byte(100), 5);
+ if (context.flags.z()) goto isaperson;
+ examineobtext(context);
+ return;
+middleofwalk:
+ blocknametext(context);
+ return;
+isblock:
+ blocknametext(context);
+ return;
+isaperson:
+ personnametext(context);
+ return;
+toofaraway:
+ walktotext(context);
+ return;
+}
+
+static void mainscreen(Context & context) {
+ context.data.byte(237) = 0;
+ context.bx = 4949;
+ context._cmp(context.data.byte(3), 1);
+ if (context.flags.z()) goto checkmain;
+ context.bx = 5011;
+checkmain:
+ checkcoords(context);
+ context._cmp(context.data.byte(306), 0);
+ if (context.flags.z()) goto finishmain;
+ walkandexamine(context);
+finishmain:
+ return;
+}
+
+static void madmanrun(Context & context) {
context._cmp(context.data.byte(9), 14);
if (!context.flags.z()) { identifyob(context); return; };
context._cmp(context.data.byte(148), 22);
@@ -12059,7 +18063,37 @@ norun:
return;
}
-static inline void identifyob(Context & context) {
+static void checkcoords(Context & context) {
+loop048:
+ context.ax = context.data.word(context.bx);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto nonefound;
+ context.push(context.bx);
+ context._cmp(context.data.word(198), context.ax);
+ if (context.flags.l()) goto over045;
+ context.ax = context.data.word(context.bx+2);
+ context._cmp(context.data.word(198), context.ax);
+ if (!context.flags.ge()) goto over045;
+ context.ax = context.data.word(context.bx+4);
+ context._cmp(context.data.word(200), context.ax);
+ if (context.flags.l()) goto over045;
+ context.ax = context.data.word(context.bx+6);
+ context._cmp(context.data.word(200), context.ax);
+ if (!context.flags.ge()) goto over045;
+ context.ax = context.data.word(context.bx+8);
+ __dispatch_call(context, context.ax);
+finished:
+ context.ax = context.pop();
+ return;
+over045:
+ context.bx = context.pop();
+ context._add(context.bx, 10);
+ goto loop048;
+nonefound:
+ return;
+}
+
+static void identifyob(Context & context) {
context._cmp(context.data.word(21), 0);
if (!context.flags.z()) { blank(context); return; };
context.ax = context.data.word(198);
@@ -12114,7 +18148,7 @@ nothingund:
return;
}
-static inline void checkifperson(Context & context) {
+static void checkifperson(Context & context) {
context.es = context.data.word(412);
context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5);
context.cx = 12;
@@ -12170,7 +18204,7 @@ notareelid:
return;
}
-static inline void checkifset(Context & context) {
+static void checkifset(Context & context) {
context.es = context.data.word(412);
context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(127*5);
context.cx = 127;
@@ -12203,7 +18237,7 @@ notasetid:
return;
}
-static inline void checkifex(Context & context) {
+static void checkifex(Context & context) {
context.es = context.data.word(412);
context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(99*5);
context.cx = 99;
@@ -12232,7 +18266,7 @@ notanexid:
return;
}
-static inline void checkiffree(Context & context) {
+static void checkiffree(Context & context) {
context.es = context.data.word(412);
context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(79*5);
context.cx = 79;
@@ -12261,7 +18295,7 @@ notafreeid:
return;
}
-static inline void isitdescribed(Context & context) {
+static void isitdescribed(Context & context) {
context.push(context.ax);
context.push(context.cx);
context.push(context.es);
@@ -12284,7 +18318,45 @@ static inline void isitdescribed(Context & context) {
return;
}
-static inline void findfirstpath(Context & context) {
+static void findpathofpoint(Context & context) {
+ context.push(context.ax);
+ context.bx = 0;
+ context.es = context.data.word(450);
+ context.al = context.data.byte(185);
+ context.ah = 0;
+ context.cx = 144;
+ context._mul(context.cx);
+ context._add(context.bx, context.ax);
+ context.cx = context.pop();
+ context.dl = 0;
+pathloop:
+ context.al = context.data.byte(context.bx+6);
+ context._cmp(context.al, 255);
+ if (!context.flags.z()) goto flunkedit;
+ context.ax = context.data.word(context.bx+2);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto flunkedit;
+ context._cmp(context.cl, context.al);
+ if (context.flags.c()) goto flunkedit;
+ context._cmp(context.ch, context.ah);
+ if (context.flags.c()) goto flunkedit;
+ context.ax = context.data.word(context.bx+4);
+ context._cmp(context.cl, context.al);
+ if (!context.flags.c()) goto flunkedit;
+ context._cmp(context.ch, context.ah);
+ if (!context.flags.c()) goto flunkedit;
+ goto gotvalidpath;
+flunkedit:
+ context._add(context.bx, 8);
+ context._add(context.dl, 1);
+ context._cmp(context.dl, 12);
+ if (!context.flags.z()) goto pathloop;
+ context.dl = 255;
+gotvalidpath:
+ return;
+}
+
+static void findfirstpath(Context & context) {
context.push(context.ax);
context.bx = 0;
context.es = context.data.word(450);
@@ -12321,7 +18393,30 @@ gotfirst:
return;
}
-static inline void turnpathoff(Context & context) {
+static void turnpathon(Context & context) {
+ context.push(context.ax);
+ context.push(context.ax);
+ context.cl = 255;
+ context.ch = context.data.byte(185);
+ context._add(context.ch, 100);
+ findormake(context);
+ context.ax = context.pop();
+ getroomspaths(context);
+ context.ax = context.pop();
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto nopathon;
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = 255;
+ context.data.byte(context.bx+6) = context.al;
+nopathon:
+ return;
+}
+
+static void turnpathoff(Context & context) {
context.push(context.ax);
context.push(context.ax);
context.cl = 0;
@@ -12344,7 +18439,33 @@ nopathoff:
return;
}
-static inline void turnanypathoff(Context & context) {
+static void turnanypathon(Context & context) {
+ context.push(context.ax);
+ context.push(context.ax);
+ context.cl = 255;
+ context.ch = context.ah;
+ context._add(context.ch, 100);
+ findormake(context);
+ context.ax = context.pop();
+ context.al = context.ah;
+ context.ah = 0;
+ context.cx = 144;
+ context._mul(context.cx);
+ context.es = context.data.word(450);
+ context.bx = 0;
+ context._add(context.bx, context.ax);
+ context.ax = context.pop();
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = 255;
+ context.data.byte(context.bx+6) = context.al;
+ return;
+}
+
+static void turnanypathoff(Context & context) {
context.push(context.ax);
context.push(context.ax);
context.cl = 0;
@@ -12370,7 +18491,141 @@ static inline void turnanypathoff(Context & context) {
return;
}
-static inline void obname(Context & context) {
+static void checkifpathison(Context & context) {
+ context.push(context.ax);
+ getroomspaths(context);
+ context.ax = context.pop();
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.ax, context.ax);
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.bx+6);
+ context._cmp(context.al, 255);
+ return;
+}
+
+static void afternewroom(Context & context) {
+ context._cmp(context.data.byte(186), 0);
+ if (context.flags.z()) goto notnew;
+ context.data.word(328) = 0;
+ createpanel(context);
+ context.data.byte(100) = 0;
+ findroominloc(context);
+ context._cmp(context.data.byte(63), 1);
+ if (context.flags.z()) goto ryansoff;
+ context.al = context.data.byte(151);
+ context._add(context.al, 12);
+ context.ah = context.data.byte(152);
+ context._add(context.ah, 12);
+ findpathofpoint(context);
+ context.data.byte(475) = context.dl;
+ findxyfrompath(context);
+ context.data.byte(187) = 1;
+ryansoff:
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ context.data.word(98) = 160;
+ context.data.byte(186) = 0;
+ showicon(context);
+ spriteupdate(context);
+ printsprites(context);
+ undertextline(context);
+ reelsonscreen(context);
+ mainscreen(context);
+ getunderzoom(context);
+ zoom(context);
+ worktoscreenm(context);
+ walkintoroom(context);
+ reminders(context);
+ atmospheres(context);
+notnew:
+ return;
+}
+
+static void atmospheres(Context & context) {
+ context.cl = context.data.byte(148);
+ context.ch = context.data.byte(149);
+ context.bx = 5073;
+nextatmos:
+ context.al = context.data.byte(context.bx);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto nomoreatmos;
+ context._cmp(context.al, context.data.byte(184));
+ if (!context.flags.z()) goto wrongatmos;
+ context.ax = context.data.word(context.bx+1);
+ context._cmp(context.ax, context.cx);
+ if (!context.flags.z()) goto wrongatmos;
+ context.ax = context.data.word(context.bx+3);
+ context._cmp(context.al, context.data.byte(507));
+ if (context.flags.z()) goto playingalready;
+ context._cmp(context.data.byte(9), 45);
+ if (!context.flags.z()) goto notweb;
+ context._cmp(context.data.word(23), 45);
+ if (context.flags.z()) goto wrongatmos;
+notweb:
+ playchannel0(context);
+ context._cmp(context.data.byte(184), 2);
+ context._cmp(context.data.byte(149), 0);
+ if (context.flags.z()) goto fullvol;
+ if (!context.flags.z()) goto notlouisvol;
+ context._cmp(context.data.byte(149), 10);
+ if (!context.flags.z()) goto notlouisvol;
+ context._cmp(context.data.byte(148), 22);
+ if (!context.flags.z()) goto notlouisvol;
+ context.data.byte(386) = 5;
+notlouisvol:
+playingalready:
+ context._cmp(context.data.byte(184), 2);
+ if (!context.flags.z()) goto notlouisvol2;
+ context._cmp(context.data.byte(148), 22);
+ if (context.flags.z()) goto louisvol;
+ context._cmp(context.data.byte(148), 11);
+ if (!context.flags.z()) goto notlouisvol2;
+fullvol:
+ context.data.byte(386) = 0;
+notlouisvol2:
+ return;
+louisvol:
+ context.data.byte(386) = 5;
+ return;
+wrongatmos:
+ context._add(context.bx, 5);
+ goto nextatmos;
+nomoreatmos:
+ cancelch0(context);
+ return;
+}
+
+static void walkintoroom(Context & context) {
+ context._cmp(context.data.byte(9), 14);
+ if (!context.flags.z()) goto notlair;
+ context._cmp(context.data.byte(148), 22);
+ if (!context.flags.z()) goto notlair;
+ context.data.byte(478) = 1;
+ context.data.byte(477) = 1;
+ autosetwalk(context);
+notlair:
+ return;
+}
+
+static void afterintroroom(Context & context) {
+ context._cmp(context.data.byte(186), 0);
+ if (context.flags.z()) goto notnewintro;
+ clearwork(context);
+ findroominloc(context);
+ context.data.byte(62) = 1;
+ drawfloor(context);
+ reelsonscreen(context);
+ spriteupdate(context);
+ printsprites(context);
+ worktoscreen(context);
+ context.data.byte(186) = 0;
+notnewintro:
+ return;
+}
+
+static void obname(Context & context) {
context._cmp(context.data.byte(473), 0);
if (context.flags.z()) goto notnewpath;
context.data.byte(473) = 0;
@@ -12480,7 +18735,25 @@ toofaraway:
return;
}
-static inline void commandonly(Context & context) {
+static void finishedwalking(Context & context) {
+ context._cmp(context.data.byte(492), 254);
+ if (!context.flags.z()) goto iswalking;
+ context.al = context.data.byte(133);
+ context._cmp(context.al, context.data.byte(135));
+iswalking:
+ return;
+}
+
+static void examineobtext(Context & context) {
+ context.bl = context.data.byte(99);
+ context.bh = context.data.byte(100);
+ context.al = 1;
+ commandwithob(context);
+ return;
+}
+
+static void commandwithob(Context & context) {
+ context.push(context.ax);
context.push(context.ax);
context.push(context.bx);
context.push(context.cx);
@@ -12498,6 +18771,7 @@ static inline void commandonly(Context & context) {
context.cx = context.pop();
context.bx = context.pop();
context.ax = context.pop();
+ context.push(context.bx);
context.ah = 0;
context._add(context.ax, context.ax);
context.bx = context.ax;
@@ -12511,15 +18785,44 @@ static inline void commandonly(Context & context) {
context.al = 0;
context.ah = 0;
printdirect(context);
+ context.ax = context.pop();
+ context.di = 5674;
+ copyname(context);
+ context.ax = context.pop();
+ context.di = context.data.word(84);
+ context._cmp(context.al, 0);
+ if (context.flags.z()) goto noadd;
+ context._add(context.di, 5);
+noadd:
+ context.bx = context.data.word(81);
+ context.es = context.cs;
+ context.si = 5674;
+ context.dl = context.data.byte(82);
+ context.al = 0;
+ context.ah = 0;
+ printdirect(context);
context.data.byte(109) = 1;
return;
}
-static inline void printmessage2(Context & context) {
- context.push(context.dx);
+static void commandonly(Context & context) {
+ context.push(context.ax);
context.push(context.bx);
+ context.push(context.cx);
+ context.push(context.dx);
+ context.push(context.es);
+ context.push(context.ds);
+ context.push(context.si);
context.push(context.di);
- context.push(context.ax);
+ deltextline(context);
+ context.di = context.pop();
+ context.si = context.pop();
+ context.ds = context.pop();
+ context.es = context.pop();
+ context.dx = context.pop();
+ context.cx = context.pop();
+ context.bx = context.pop();
+ context.ax = context.pop();
context.ah = 0;
context._add(context.ax, context.ax);
context.bx = context.ax;
@@ -12527,2367 +18830,688 @@ static inline void printmessage2(Context & context) {
context.ax = context.data.word(context.bx);
context._add(context.ax, 66*2);
context.si = context.ax;
- context.ax = context.pop();
-searchmess:
- context.push(context.ax);
- findnextcolon(context);
- context.ax = context.pop();
- context._sub(context.ah, 1);
- if (!context.flags.z()) goto searchmess;
- context.di = context.pop();
- context.bx = context.pop();
- context.dx = context.pop();
+ context.di = context.data.word(79);
+ context.bx = context.data.word(81);
+ context.dl = context.data.byte(82);
context.al = 0;
context.ah = 0;
printdirect(context);
+ context.data.byte(109) = 1;
return;
}
-static inline void usetempcharset(Context & context) {
- context.ax = context.data.word(406);
- context.data.word(268) = context.ax;
- return;
-}
-
-static inline void blank(Context & context) {
- context._cmp(context.data.byte(100), 199);
- if (context.flags.z()) goto alreadyblnk;
- context.data.byte(100) = 199;
- context.al = 0;
- commandonly(context);
-alreadyblnk:
- return;
-}
-
-static inline void allpointer(Context & context) {
- readmouse(context);
- showpointer(context);
- dumppointer(context);
- return;
-}
-
-static inline void hangoncurs(Context & context) {
-monloop1:
- context.push(context.cx);
- printcurs(context);
- vsync(context);
- delcurs(context);
- context.cx = context.pop();
- if (--context.cx) goto monloop1;
- return;
-}
-
-static inline void readkey(Context & context) {
- context.bx = context.data.word(396);
- context._cmp(context.bx, context.data.word(394));
- if (context.flags.z()) goto nokey;
- context._add(context.bx, 1);
- context._and(context.bx, 15);
- context.data.word(396) = context.bx;
- context.di = 5715;
- context._add(context.di, context.bx);
- context.al = context.data.byte(context.di);
- context.data.byte(142) = context.al;
- return;
-nokey:
- context.data.byte(142) = 0;
- return;
-}
-
-static inline void convertkey(Context & context) {
- context._and(context.al, 127);
- context.ah = 0;
- context.di = 5731;
- context._add(context.di, context.ax);
- context.al = context.data.byte(context.di);
- return;
-}
-
-static inline void randomnum2(Context & context) {
- context.push(context.ds);
- context.push(context.es);
- context.push(context.di);
+static void printmessage(Context & context) {
+ context.push(context.dx);
context.push(context.bx);
- context.push(context.ax);
- randomnumber(context);
- context.cl = context.al;
- context.ax = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- return;
-}
-
-static inline void loadtempcharset(Context & context) {
- standardload(context);
- context.data.word(406) = context.ax;
- return;
-}
-
-static inline void getridofall(Context & context) {
- context.es = context.data.word(416);
- deallocatemem(context);
- context.es = context.data.word(444);
- deallocatemem(context);
- context.es = context.data.word(430);
- deallocatemem(context);
- context.es = context.data.word(432);
- deallocatemem(context);
- context.es = context.data.word(434);
- deallocatemem(context);
- context.es = context.data.word(450);
- deallocatemem(context);
- context.es = context.data.word(448);
- deallocatemem(context);
- context.es = context.data.word(440);
- deallocatemem(context);
- context.es = context.data.word(442);
- deallocatemem(context);
- context.es = context.data.word(436);
- deallocatemem(context);
- context.es = context.data.word(446);
- deallocatemem(context);
- context.es = context.data.word(438);
- deallocatemem(context);
- return;
-}
-
-static inline void restoreall(Context & context) {
- context.al = context.data.byte(9);
- getroomdata(context);
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- allocateload(context);
- context.ds = context.ax;
- context.data.word(416) = context.ax;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(400);
- context.dx = 0;
- context.cx = 132*66;
- context.al = 0;
- fillspace(context);
- loadseg(context);
- sortoutmap(context);
- allocateload(context);
- context.data.word(444) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(430) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(432) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(434) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(450) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(448) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(440) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(442) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(436) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(446) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(438) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- closefile(context);
- setallchanges(context);
- return;
-}
-
-static inline void disablepath(Context & context) {
- context.push(context.cx);
- context._xchg(context.al, context.ah);
- context.cx = -6;
-looky2:
- context._add(context.cx, 6);
- context._sub(context.al, 10);
- if (!context.flags.c()) goto looky2;
- context.al = context.ah;
- context._sub(context.cx, 1);
-lookx2:
- context._add(context.cx, 1);
- context._sub(context.al, 11);
- if (!context.flags.c()) goto lookx2;
- context.al = context.cl;
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(450);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context.ax = context.pop();
+ context.push(context.di);
context.ah = 0;
context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 0;
- context.data.byte(context.bx+6) = context.al;
- return;
-}
-
-static inline void getridoftempcharset(Context & context) {
- context.es = context.data.word(406);
- deallocatemem(context);
- return;
-}
-
-static inline void getridoftempsp(Context & context) {
- context.es = context.data.word(464);
- deallocatemem(context);
- return;
-}
-
-static inline void seecommandtail(Context & context) {
- context.data.word(372) = 0x220;
- context.data.byte(378) = 5;
- context.data.byte(379) = 1;
- context.data.byte(73) = 0;
- context.bx = 2;
- context.ax = context.data.word(context.bx);
- context.dx = context.es;
- context._sub(context.ax, context.dx);
- context.data.word(534) = context.ax;
- context.bx = 0x02c;
- context.ax = context.data.word(context.bx);
- context.push(context.es);
- context.push(context.bx);
- context.es = context.ax;
- context.bx = 0;
-findblaster:
+ context.bx = context.ax;
+ context.es = context.data.word(452);
context.ax = context.data.word(context.bx);
- context._cmp(context.ax, 0);
- if (context.flags.z()) goto endofenvironment;
- context._cmp(context.al, 'B');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.ah, 'L');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.data.byte(context.bx+2), 'A');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.data.byte(context.bx+3), 'S');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.data.byte(context.bx+4), 'T');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.data.byte(context.bx+5), 'E');
- if (!context.flags.z()) goto notblast;
- context._cmp(context.data.byte(context.bx+6), 'R');
- if (!context.flags.z()) goto notblast;
- context._add(context.bx, 7);
- parseblaster(context);
- goto endofenvironment;
-notblast:
- context._add(context.bx, 1);
- goto findblaster;
-endofenvironment:
+ context._add(context.ax, 66*2);
+ context.si = context.ax;
+ context.di = context.pop();
context.bx = context.pop();
- context.es = context.pop();
- context.bx = 0x81;
- parseblaster(context);
- return;
-}
-
-static inline void checkbasemem(Context & context) {
- context.bx = context.data.word(534);
- context._cmp(context.bx, 0x9360);
- if (!context.flags.c()) goto enoughmem;
- context.data.byte(532) = 5;
- { quickquit(context); return; };
-enoughmem:
- return;
-}
-
-static inline void checkforemm(Context & context) {
- return;
-}
-
-static inline void trysoundalloc(Context & context) {
- context._cmp(context.data.byte(358), 1);
- if (context.flags.z()) goto gotsoundbuff;
- context._add(context.data.byte(357), 1);
- context.bx = (16384+2048)/16;
- allocatemem(context);
- context.data.word(353) = context.ax;
- context.push(context.ax);
- context.al = context.ah;
- context.cl = 4;
- context._shr(context.al, context.cl);
- context.data.byte(356) = context.al;
- context.ax = context.pop();
- context.cl = 4;
- context._shl(context.ax, context.cl);
- context.data.word(355) = context.ax;
- context._cmp(context.ax, 0x0b7ff);
- if (!context.flags.c()) goto soundfail;
- context.es = context.data.word(353);
- context.di = 0;
- context.cx = 16384/2;
- context.ax = 0x7f7f;
- while(--context.cx) context._stosw();
- context.data.byte(358) = 1;
- return;
-soundfail:
- context.es = context.data.word(353);
- deallocatemem(context);
-gotsoundbuff:
- return;
-}
-
-static inline void allocatework(Context & context) {
- context.bx = 0x1000;
- allocatemem(context);
- context.data.word(400) = context.ax;
- return;
-}
-
-static inline void allocatebuffers(Context & context) {
- context.bx = 0+2080+30000+(16*114)+((114+2)*2)+18000/16;
- allocatemem(context);
- context.data.word(398) = context.ax;
- trysoundalloc(context);
- context.bx = 0+(66*60)/16;
- allocatemem(context);
- context.data.word(418) = context.ax;
- trysoundalloc(context);
- context.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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537)+68-context.data.byte(1)/16;
- allocatemem(context);
- context.data.word(412) = context.ax;
- trysoundalloc(context);
- context.bx = 16*80/16;
- allocatemem(context);
- context.data.word(426) = context.ax;
- trysoundalloc(context);
- context.bx = 64*128/16;
- allocatemem(context);
- context.data.word(428) = context.ax;
- trysoundalloc(context);
- context.bx = 22*8*20*8/16;
- allocatemem(context);
- context.data.word(402) = context.ax;
- allocatework(context);
- context.bx = 2048/16;
- allocatemem(context);
- context.data.word(420) = context.ax;
- context.bx = 2048/16;
- allocatemem(context);
- context.data.word(422) = context.ax;
- return;
-}
-
-static inline void clearbuffers(Context & context) {
- context.es = context.data.word(412);
- context.cx = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537)+68-context.data.byte(1)/2;
- context.ax = 0;
- context.di = 0;
- while(--context.cx) context._stosw();
- context.es = context.data.word(398);
- context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2;
- context.ax = 0x0ffff;
- context.di = 0;
- while(--context.cx) context._stosw();
- context.es = context.data.word(412);
- context.di = 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)+(250*4)+(256*30)+(6*64);
- context.ds = context.cs;
- context.si = 537;
- context.cx = 991-context.data.byte(537);
- while(--context.cx) context._movsb();
- context.es = context.data.word(412);
- context.di = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537);
- context.ds = context.cs;
- context.si = 1;
- context.cx = 68-context.data.byte(1);
- while(--context.cx) context._movsb();
- clearchanges(context);
- return;
-}
-
-static inline void clearpalette(Context & context) {
- context.data.byte(344) = 0;
- clearstartpal(context);
- dumpcurrent(context);
- return;
-}
-
-static inline void readsetdata(Context & context) {
- context.dx = 1870;
- standardload(context);
- context.data.word(404) = context.ax;
- context.dx = 1935;
- standardload(context);
- context.data.word(408) = context.ax;
- context.dx = 1948;
- standardload(context);
- context.data.word(410) = context.ax;
- context.dx = 1832;
- standardload(context);
- context.data.word(414) = context.ax;
- context.dx = 2234;
- standardload(context);
- context.data.word(454) = context.ax;
- context.dx = 2286;
- standardload(context);
- context.data.word(452) = context.ax;
- context.ax = context.data.word(404);
- context.data.word(268) = context.ax;
- context._cmp(context.data.byte(378), 255);
- if (context.flags.z()) goto novolumeload;
- context.dx = 2299;
- openfile(context);
- context.cx = 2048-256;
- context.ds = context.data.word(353);
- context.dx = 16384;
- readfromfile(context);
- closefile(context);
-novolumeload:
- return;
-}
-
-static inline void loadpalfromiff(Context & context) {
- context.dx = 2494;
- openfile(context);
- context.cx = 2000;
- context.ds = context.data.word(402);
- context.dx = 0;
- readfromfile(context);
- closefile(context);
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
- context.ds = context.data.word(402);
- context.si = 0x30;
- context.cx = 768;
-palloop:
- context._lodsb();
- context._shr(context.al, 1);
- context._shr(context.al, 1);
- context._cmp(context.data.byte(73), 1);
- if (!context.flags.z()) goto nought;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto nought;
- context.ah = context.al;
- context._shr(context.ah, 1);
- context._add(context.al, context.ah);
- context._shr(context.ah, 1);
- context._add(context.al, context.ah);
- context._cmp(context.al, 64);
- if (context.flags.c()) goto nought;
- context.al = 63;
-nought:
- context._stosb();
- if (--context.cx) goto palloop;
- return;
-}
-
-static inline void biblequote(Context & context) {
- mode640x480(context);
- context.dx = 2390;
- showpcx(context);
- fadescreenups(context);
- context.cx = 80;
- hangone(context);
- context.cx = 560;
- hangone(context);
- fadescreendowns(context);
- context.cx = 200;
- hangone(context);
- cancelch0(context);
- return;
-}
-
-static inline void runintroseq(Context & context) {
- context.data.byte(103) = 0;
-moreintroseq:
- vsync(context);
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto earlyendrun;
- spriteupdate(context);
- vsync(context);
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto earlyendrun;
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afterintroroom(context);
- usetimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto earlyendrun;
- dumpmap(context);
- dumptimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto earlyendrun;
- context._cmp(context.data.byte(103), 1);
- if (!context.flags.z()) goto moreintroseq;
- return;
-earlyendrun:
- context.ax = context.pop();
- context.ax = context.pop();
- getridoftemptext(context);
- clearbeforeload(context);
- return;
-}
-
-static inline void intro(Context & context) {
- context.dx = 2260;
- loadtemptext(context);
- loadpalfromiff(context);
- setmode(context);
- context.data.byte(188) = 50;
- clearpalette(context);
- loadintroroom(context);
- context.data.byte(386) = 7;
- context.data.byte(388) = -1;
- context.data.byte(387) = 0;
- context.al = 12;
- context.ah = 255;
- playchannel0(context);
- fadescreenups(context);
- runintroseq(context);
- clearbeforeload(context);
- context.data.byte(188) = 52;
- loadintroroom(context);
- runintroseq(context);
- clearbeforeload(context);
- context.data.byte(188) = 53;
- loadintroroom(context);
- runintroseq(context);
- clearbeforeload(context);
- allpalette(context);
- context.data.byte(188) = 54;
- loadintroroom(context);
- runintroseq(context);
- getridoftemptext(context);
- clearbeforeload(context);
- return;
-}
-
-static inline void titles(Context & context) {
- clearpalette(context);
- biblequote(context);
- intro(context);
- return;
-}
-
-static inline void dumpcurrent(Context & context) {
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3);
- context.ds = context.data.word(412);
- vsync(context);
- context.al = 0;
- context.cx = 128;
- showgroup(context);
- vsync(context);
- context.al = 128;
- context.cx = 128;
- showgroup(context);
- return;
-}
-
-static inline void allpalette(Context & context) {
- context.es = context.data.word(412);
- context.ds = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
- context.cx = 768/2;
- while(--context.cx) context._movsw();
- dumpcurrent(context);
- return;
-}
-
-static inline void realcredits(Context & context) {
- context.data.byte(531) = 33;
- loadroomssample(context);
- context.data.byte(386) = 0;
- mode640x480(context);
- context.cx = 35;
- hangon(context);
- context.dx = 2403;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- allpalette(context);
- context.cx = 80;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context.dx = 2416;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- allpalette(context);
- context.cx = 80;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context.dx = 2429;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- allpalette(context);
- context.cx = 80;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context.dx = 2442;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- allpalette(context);
- context.cx = 80;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context.dx = 2455;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- allpalette(context);
- context.cx = 80;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context.dx = 2468;
- showpcx(context);
- fadescreenups(context);
- context.cx = 60;
- hangone(context);
- context.al = 13;
- context.ah = 0;
- playchannel0(context);
- context.cx = 350;
- hangone(context);
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- return;
-}
-
-static inline void credits(Context & context) {
- clearpalette(context);
- realcredits(context);
- return;
-}
-
-static inline void cls(Context & context) {
- context.ax = 0x0a000;
- context.es = context.ax;
- context.di = 0;
- context.cx = 0x7fff;
- context.ax = 0;
- while(--context.cx) context._stosw();
- return;
-}
-
-static inline void loadsavebox(Context & context) {
- context.dx = 1974;
- loadintotemp(context);
- return;
-}
-
-static inline void showopbox(Context & context) {
- context.ds = context.data.word(458);
- context.di = 60;
- context.bx = 52;
+ context.dx = context.pop();
context.al = 0;
context.ah = 0;
- showframe(context);
- context.ds = context.data.word(458);
- context.di = 60;
- context.bx = 52+55;
- context.al = 4;
- context.ah = 0;
- showframe(context);
- return;
-}
-
-static inline void showdecisions(Context & context) {
- createpanel2(context);
- showopbox(context);
- context.ds = context.data.word(458);
- context.di = 60+17;
- context.bx = 52+13;
- context.al = 6;
- context.ah = 0;
- showframe(context);
- undertextline(context);
- return;
-}
-
-static inline void decide(Context & context) {
- setmode(context);
- loadpalfromiff(context);
- clearpalette(context);
- context.data.byte(234) = 0;
- context.data.word(21) = 0;
- context.data.byte(231) = 0;
- context.data.word(79) = 70;
- context.data.word(81) = 182-8;
- context.data.byte(82) = 181;
- context.data.byte(131) = 1;
- loadsavebox(context);
- showdecisions(context);
- worktoscreen(context);
- fadescreenup(context);
- context.data.byte(103) = 0;
-waitdecide:
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- context.bx = 4884;
- checkcoords(context);
- context._cmp(context.data.byte(103), 0);
- if (context.flags.z()) goto waitdecide;
- context._cmp(context.data.byte(103), 4);
- if (context.flags.z()) goto hasloadedroom;
- getridoftemp(context);
-hasloadedroom:
- context.data.word(79) = 13;
- context.data.word(81) = 182;
- context.data.byte(82) = 240;
- return;
-}
-
-static inline void clearchanges(Context & context) {
- context.es = context.data.word(412);
- context.cx = 250*2;
- context.ax = 0x0ffff;
- context.di = 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);
- while(--context.cx) context._stosw();
- context.ds = context.data.word(412);
- context.si = 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)+(250*4)+(256*30)+(6*64);
- context.es = context.cs;
- context.di = 537;
- context.cx = 991-context.data.byte(537);
- while(--context.cx) context._movsb();
- context.ds = context.data.word(412);
- context.si = 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)+(250*4)+(256*30)+(6*64)+991-context.data.byte(537);
- context.es = context.cs;
- context.di = 1;
- context.cx = 68-context.data.byte(1);
- while(--context.cx) context._movsb();
- context.data.byte(10) = 0;
- context.data.word(12) = 0;
- context.data.word(14) = 0;
- context.es = context.data.word(398);
- context.cx = 0+2080+30000+(16*114)+((114+2)*2)+18000/2;
- context.ax = 0x0ffff;
- context.di = 0;
- while(--context.cx) context._stosw();
- context.es = context.cs;
- context.di = 7798;
- context.al = 1;
- context._stosb();
- context._stosb();
- context.al = 0;
- context._stosb();
- context.al = 1;
- context._stosb();
- context.ax = 0;
- context.cx = 6;
- while(--context.cx) context._stosw();
+ printdirect(context);
return;
}
-static inline void fillspace(Context & context) {
- context.push(context.es);
- context.push(context.ds);
+static void printmessage2(Context & context) {
context.push(context.dx);
- context.push(context.di);
context.push(context.bx);
- context.di = context.dx;
- context.es = context.ds;
- while(--context.cx) context._stosb();
- context.bx = context.pop();
- context.di = context.pop();
- context.dx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void sortoutmap(Context & context) {
- context.push(context.es);
context.push(context.di);
- context.ds = context.data.word(400);
- context.si = 0;
- context.es = context.data.word(418);
- context.di = 0;
- context.cx = 60;
-blimey:
- context.push(context.cx);
- context.push(context.si);
- context.cx = 66;
- while(--context.cx) context._movsb();
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 132);
- if (--context.cx) goto blimey;
- context.di = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void deletetaken(Context & context) {
- context.es = context.data.word(426);
- context.ah = context.data.byte(184);
- context.ds = context.data.word(398);
- context.si = 0+2080+30000;
- context.cx = 114;
-takenloop:
- context.al = context.data.byte(context.si+11);
- context._cmp(context.al, context.ah);
- if (!context.flags.z()) goto notinhere;
- context.bl = context.data.byte(context.si+1);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context.data.byte(context.bx+2) = 254;
-notinhere:
- context._add(context.si, 16);
- if (--context.cx) goto takenloop;
- return;
-}
-
-static inline void dochange(Context & context) {
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto object;
- context._cmp(context.ch, 1);
- if (context.flags.z()) goto freeobject;
-path:
- context.push(context.cx);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
context.push(context.ax);
- context.al = context.ch;
- context._sub(context.al, 100);
context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.bx = context.pop();
- context._add(context.bx, context.ax);
- context._add(context.bx, 0);
- context.es = context.data.word(450);
- context.cx = context.pop();
- context.data.byte(context.bx+6) = context.cl;
-nopath:
- return;
-object:
- context.push(context.cx);
- getsetad(context);
- context.cx = context.pop();
- context.data.byte(context.bx+58) = context.cl;
- return;
-freeobject:
- context.push(context.cx);
- getfreead(context);
- context.cx = context.pop();
- context._cmp(context.data.byte(context.bx+2), 255);
- if (!context.flags.z()) goto beenpickedup;
- context.data.byte(context.bx+2) = context.cl;
-beenpickedup:
- return;
-}
-
-static inline void setallchanges(Context & context) {
- context.es = context.data.word(412);
- context.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);
-setallloop:
+ context._add(context.ax, context.ax);
+ context.bx = context.ax;
+ context.es = context.data.word(452);
context.ax = context.data.word(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto endsetloop;
- context.cx = context.data.word(context.bx+2);
- context._add(context.bx, 4);
- context._cmp(context.ah, context.data.byte(184));
- if (!context.flags.z()) goto setallloop;
- context.push(context.es);
- context.push(context.bx);
- dochange(context);
+ context._add(context.ax, 66*2);
+ context.si = context.ax;
+ context.ax = context.pop();
+searchmess:
+ context.push(context.ax);
+ findnextcolon(context);
+ context.ax = context.pop();
+ context._sub(context.ah, 1);
+ if (!context.flags.z()) goto searchmess;
+ context.di = context.pop();
context.bx = context.pop();
- context.es = context.pop();
- goto setallloop;
-endsetloop:
- return;
-}
-
-static inline void autoappear(Context & context) {
- context._cmp(context.data.byte(9), 32);
- if (!context.flags.z()) goto notinalley;
- context.al = 5;
- resetlocation(context);
- context.al = 10;
- setlocation(context);
- context.data.byte(183) = 10;
- return;
-notinalley:
- context._cmp(context.data.byte(184), 24);
- if (!context.flags.z()) goto notinedens;
- context._cmp(context.data.byte(42), 1);
- if (!context.flags.z()) goto edenspart2;
- context._add(context.data.byte(42), 1);
- context.al = 44;
- placesetobject(context);
- context.al = 18;
- placesetobject(context);
- context.al = 93;
- placesetobject(context);
- context.al = 92;
- removesetobject(context);
- context.al = 55;
- removesetobject(context);
- context.al = 75;
- removesetobject(context);
- context.al = 84;
- removesetobject(context);
- context.al = 85;
- removesetobject(context);
- return;
-edenspart2:
- context._cmp(context.data.byte(43), 1);
- if (!context.flags.z()) goto notedens2;
- context.al = 44;
- removesetobject(context);
- context.al = 93;
- removesetobject(context);
- context.al = 55;
- placesetobject(context);
- context._add(context.data.byte(43), 1);
-notedens2:
- return;
-notinedens:
- context._cmp(context.data.byte(184), 25);
- if (!context.flags.z()) goto notonsartroof;
- context.data.byte(34) = 3;
- context.al = 6;
- resetlocation(context);
- context.al = 11;
- setlocation(context);
- context.data.byte(183) = 11;
- return;
-notonsartroof:
- context._cmp(context.data.byte(184), 2);
- if (!context.flags.z()) goto notinlouiss;
- context._cmp(context.data.byte(41), 0);
- if (context.flags.z()) goto notinlouiss;
- context.al = 23;
- placesetobject(context);
-notinlouiss:
+ context.dx = context.pop();
+ context.al = 0;
+ context.ah = 0;
+ printdirect(context);
return;
}
-static inline void startloading(Context & context) {
- context.data.byte(64) = 0;
- context.al = context.data.byte(context.bx+13);
- context.data.byte(531) = context.al;
- context.al = context.data.byte(context.bx+15);
- context.data.byte(148) = context.al;
- context.al = context.data.byte(context.bx+16);
- context.data.byte(149) = context.al;
- context.al = context.data.byte(context.bx+20);
- context.data.byte(35) = context.al;
- context.al = context.data.byte(context.bx+21);
- context.data.byte(475) = context.al;
- context.data.byte(478) = context.al;
- context.data.byte(477) = context.al;
- context.al = context.data.byte(context.bx+22);
- context.data.byte(133) = context.al;
- context.data.byte(135) = context.al;
- context.al = context.data.byte(context.bx+23);
- context.data.byte(39) = context.al;
- context.al = context.data.byte(context.bx+24);
- context.data.byte(36) = context.al;
- context.al = context.data.byte(context.bx+25);
- context.data.byte(38) = context.al;
- context.data.byte(65) = -1;
- context.al = context.data.byte(context.bx+27);
- context.push(context.ax);
- context.al = context.data.byte(context.bx+31);
- context.ah = context.data.byte(184);
- context.data.byte(184) = context.al;
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- allocateload(context);
- context.ds = context.ax;
- context.data.word(416) = context.ax;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(400);
- context.dx = 0;
- context.cx = 132*66;
+static void blocknametext(Context & context) {
+ context.bl = context.data.byte(99);
+ context.bh = context.data.byte(100);
context.al = 0;
- fillspace(context);
- loadseg(context);
- sortoutmap(context);
- allocateload(context);
- context.data.word(444) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(428);
- context.dx = 0;
- context.cx = 64*128;
- context.al = 255;
- fillspace(context);
- loadseg(context);
- allocateload(context);
- context.data.word(430) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(432) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(434) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(450) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(448) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(440) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(442) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(436) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(446) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(426);
- context.dx = 0;
- context.cx = 16*80;
- context.al = 255;
- fillspace(context);
- loadseg(context);
- allocateload(context);
- context.data.word(438) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- closefile(context);
- findroominloc(context);
- deletetaken(context);
- setallchanges(context);
- autoappear(context);
- context.al = context.data.byte(188);
- getroomdata(context);
- context.data.byte(65) = -1;
- context.data.byte(56) = 0;
- context.data.word(98) = 160;
- context.data.byte(188) = 255;
- context.data.byte(492) = 254;
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z()) goto dontwalkin;
- context.data.byte(475) = context.al;
- context.push(context.bx);
- autosetwalk(context);
- context.bx = context.pop();
-dontwalkin:
- findxyfrompath(context);
+ commandwithob(context);
return;
}
-static inline void loadroom(Context & context) {
- context.data.byte(74) = 1;
- context.data.word(328) = 0;
- context.data.word(138) = 0;
- context.data.word(121) = 104;
- context.data.word(123) = 38;
- context.data.word(79) = 13;
- context.data.word(81) = 182;
- context.data.byte(82) = 240;
- context.al = context.data.byte(188);
- context.data.byte(9) = context.al;
- getroomdata(context);
- startloading(context);
- loadroomssample(context);
- switchryanon(context);
- drawflags(context);
- getdimension(context);
+static void personnametext(Context & context) {
+ context.bl = context.data.byte(99);
+ context._and(context.bl, 127);
+ context.bh = context.data.byte(100);
+ context.al = 2;
+ commandwithob(context);
return;
}
-static inline void clearsprites(Context & context) {
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
- context.al = 255;
- context.cx = 32*16;
- while(--context.cx) context._stosb();
+static void walktotext(Context & context) {
+ context.bl = context.data.byte(99);
+ context.bh = context.data.byte(100);
+ context.al = 3;
+ commandwithob(context);
return;
}
-static inline void initman(Context & context) {
- context.al = context.data.byte(151);
- context.ah = context.data.byte(152);
- context.si = context.ax;
- context.cx = 49464;
- context.dx = context.data.word(414);
- context.di = 0;
- makesprite(context);
- context.data.byte(context.bx+23) = 4;
- context.data.byte(context.bx+22) = 0;
- context.data.byte(context.bx+29) = 0;
+static void getflagunderp(Context & context) {
+ context.cx = context.data.word(198);
+ context._sub(context.cx, context.data.word(117));
+ context.ax = context.data.word(200);
+ context._sub(context.ax, context.data.word(119));
+ context.ch = context.al;
+ checkone(context);
+ context.data.byte(153) = context.cl;
+ context.data.byte(154) = context.ch;
return;
}
-static inline void entrytexts(Context & context) {
- context._cmp(context.data.byte(9), 21);
- if (!context.flags.z()) goto notloc15;
- context.al = 28;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-notloc15:
- context._cmp(context.data.byte(9), 30);
- if (!context.flags.z()) goto notloc43;
- context.al = 27;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-notloc43:
- context._cmp(context.data.byte(9), 23);
- if (!context.flags.z()) goto notloc23;
- context.al = 29;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-notloc23:
- context._cmp(context.data.byte(9), 31);
- if (!context.flags.z()) goto notloc44;
- context.al = 30;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-notloc44:
- context._cmp(context.data.byte(9), 20);
- if (!context.flags.z()) goto notsarters2;
- context.al = 31;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-notsarters2:
- context._cmp(context.data.byte(9), 24);
- if (!context.flags.z()) goto notedenlob;
- context.al = 32;
- context.cx = 60;
- context.dx = 3;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+static void setwalk(Context & context) {
+ context._cmp(context.data.byte(492), 254);
+ if (!context.flags.z()) goto alreadywalking;
+ context.al = context.data.byte(474);
+ context._cmp(context.al, context.data.byte(475));
+ if (context.flags.z()) goto cantwalk2;
+ context._cmp(context.data.byte(32), 1);
+ if (context.flags.z()) goto holdingreel;
+ context._cmp(context.data.byte(32), 2);
+ if (context.flags.z()) goto cantwalk;
+ context.data.byte(478) = context.al;
+ context.data.byte(477) = context.al;
+ context._cmp(context.data.word(202), 2);
+ if (!context.flags.z()) goto notwalkandexam;
+ context._cmp(context.data.byte(100), 3);
+ if (context.flags.z()) goto notwalkandexam;
+ context.data.byte(306) = 1;
+ context.al = context.data.byte(100);
+ context.data.byte(307) = context.al;
+ context.al = context.data.byte(99);
+ context.data.byte(308) = context.al;
+notwalkandexam:
+ autosetwalk(context);
+cantwalk:
return;
-notedenlob:
- context._cmp(context.data.byte(9), 34);
- if (!context.flags.z()) goto noteden2;
- context.al = 33;
- context.cx = 60;
- context.dx = 3;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+cantwalk2:
+ facerightway(context);
return;
-noteden2:
+alreadywalking:
+ context.al = context.data.byte(474);
+ context.data.byte(477) = context.al;
return;
-}
-
-static inline void purgealocation(Context & context) {
- context.push(context.ax);
- context.es = context.data.word(398);
- context.di = 0+2080+30000;
- context.bx = context.pop();
- context.cx = 0;
-purgeloc:
- context._cmp(context.bl, context.data.byte(context.di+0));
- if (!context.flags.z()) goto dontpurge;
- context._cmp(context.data.byte(context.di+2), 0);
- if (!context.flags.z()) goto dontpurge;
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.cx);
- deleteexobject(context);
- context.cx = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
-dontpurge:
- context._add(context.di, 16);
- context._add(context.cx, 1);
- context._cmp(context.cx, 114);
- if (!context.flags.z()) goto purgeloc;
+holdingreel:
+ context.data.byte(33) = context.al;
+ context.data.byte(32) = 2;
return;
}
-static inline void resetlocation(Context & context) {
- context.push(context.ax);
- context._cmp(context.al, 5);
- if (!context.flags.z()) goto notdelhotel;
- purgealocation(context);
- context.al = 21;
- purgealocation(context);
- context.al = 22;
- purgealocation(context);
- context.al = 27;
- purgealocation(context);
- goto clearedlocations;
-notdelhotel:
- context._cmp(context.al, 8);
- if (!context.flags.z()) goto notdeltvstud;
- purgealocation(context);
- context.al = 28;
- purgealocation(context);
- goto clearedlocations;
-notdeltvstud:
- context._cmp(context.al, 6);
- if (!context.flags.z()) goto notdelsarters;
- purgealocation(context);
- context.al = 20;
- purgealocation(context);
- context.al = 25;
- purgealocation(context);
- goto clearedlocations;
-notdelsarters:
- context._cmp(context.al, 13);
- if (!context.flags.z()) goto notdelboathouse;
- purgealocation(context);
- context.al = 29;
- purgealocation(context);
- goto clearedlocations;
-notdelboathouse:
-clearedlocations:
- context.ax = context.pop();
- context.ah = 0;
- context.bx = context.ax;
- context.dx = context.ds;
- context.es = context.dx;
- context._add(context.bx, 7798);
- context.data.byte(context.bx) = 0;
+static void autosetwalk(Context & context) {
+ context.al = context.data.byte(475);
+ context._cmp(context.data.byte(477), context.al);
+ if (!context.flags.z()) goto notsamealready;
return;
-}
-
-static inline void checkifpathison(Context & context) {
- context.push(context.ax);
+notsamealready:
getroomspaths(context);
- context.ax = context.pop();
+ checkdest(context);
+ context.push(context.bx);
+ context.al = context.data.byte(475);
context.ah = 0;
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx+6);
- context._cmp(context.al, 255);
- return;
-}
-
-static inline void turnpathon(Context & context) {
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 255;
- context.ch = context.data.byte(185);
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- getroomspaths(context);
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z()) goto nopathon;
+ context.al = context.data.byte(context.bx);
context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 255;
- context.data.byte(context.bx+6) = context.al;
-nopathon:
- return;
-}
-
-static inline void turnanypathon(Context & context) {
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 255;
- context.ch = context.ah;
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- context.al = context.ah;
+ context._sub(context.ax, 12);
+ context.data.word(480) = context.ax;
+ context.al = context.data.byte(context.bx+1);
context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(450);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context.ax = context.pop();
+ context._sub(context.ax, 12);
+ context.data.word(482) = context.ax;
+ context.bx = context.pop();
+ context.al = context.data.byte(478);
context.ah = 0;
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.bx, context.ax);
- context.al = 255;
- context.data.byte(context.bx+6) = context.al;
- return;
-}
-
-static inline void entryanims(Context & context) {
- context.data.word(23) = -1;
- context.data.byte(32) = -1;
- context._cmp(context.data.byte(9), 33);
- if (!context.flags.z()) goto notinthebeach;
- switchryanoff(context);
- context.data.word(21) = 76*2;
- context.data.word(23) = 0;
- context.data.word(25) = 76;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- return;
-notinthebeach:
- context._cmp(context.data.byte(9), 44);
- if (!context.flags.z()) goto notsparkys;
- context.al = 8;
- resetlocation(context);
- context.data.word(21) = 50*2;
- context.data.word(23) = 247;
- context.data.word(25) = 297;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-notsparkys:
- context._cmp(context.data.byte(9), 22);
- if (!context.flags.z()) goto notinthelift;
- context.data.word(21) = 31*2;
- context.data.word(23) = 0;
- context.data.word(25) = 30;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-notinthelift:
- context._cmp(context.data.byte(9), 26);
- if (!context.flags.z()) goto notunderchurch;
- context.data.byte(292) = 2;
- context.data.byte(295) = 1;
- return;
-notunderchurch:
- context._cmp(context.data.byte(9), 45);
- if (!context.flags.z()) goto notenterdream;
- context.data.byte(54) = 0;
- context.data.word(21) = 296;
- context.data.word(23) = 45;
- context.data.word(25) = 198;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-notenterdream:
- context._cmp(context.data.byte(184), 46);
- if (!context.flags.z()) goto notcrystal;
- context._cmp(context.data.byte(43), 1);
- if (!context.flags.z()) goto notcrystal;
- context.al = 0;
- removefreeobject(context);
- return;
-notcrystal:
- context._cmp(context.data.byte(9), 9);
- if (!context.flags.z()) goto nottopchurch;
- context.al = 2;
- checkifpathison(context);
- if (context.flags.z()) goto nottopchurch;
- context._cmp(context.data.byte(44), 0);
- if (context.flags.z()) goto nottopchurch;
- context.al = 3;
- checkifpathison(context);
- if (!context.flags.z()) goto makedoorsopen;
- context.al = 2;
- turnpathon(context);
-makedoorsopen:
- context.al = 4;
- removesetobject(context);
- context.al = 5;
- placesetobject(context);
- return;
-nottopchurch:
- context._cmp(context.data.byte(9), 47);
- if (!context.flags.z()) goto notdreamcentre;
- context.al = 4;
- placesetobject(context);
- context.al = 5;
- placesetobject(context);
- return;
-notdreamcentre:
- context._cmp(context.data.byte(9), 38);
- if (!context.flags.z()) goto notcarpark;
- context.data.word(21) = 57*2;
- context.data.word(23) = 4;
- context.data.word(25) = 57;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-notcarpark:
- context._cmp(context.data.byte(9), 32);
- if (!context.flags.z()) goto notalley;
- context.data.word(21) = 66*2;
- context.data.word(23) = 0;
- context.data.word(25) = 66;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-notalley:
- context._cmp(context.data.byte(9), 24);
- if (!context.flags.z()) goto notedensagain;
- context.al = 2;
- context.ah = context.data.byte(185);
- context._sub(context.ah, 1);
- turnanypathon(context);
-notedensagain:
- return;
-}
-
-static inline void deleteexframe(Context & context) {
- context.di = 0;
+ context.al = context.data.byte(context.bx);
context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context.al = context.data.byte(context.di);
+ context._sub(context.ax, 12);
+ context.data.word(484) = context.ax;
+ context.al = context.data.byte(context.bx+1);
context.ah = 0;
- context.cl = context.data.byte(context.di+1);
- context.ch = 0;
- context._mul(context.cx);
- context.si = context.data.word(context.di+2);
- context.push(context.si);
- context._add(context.si, 0+2080);
- context.cx = 30000;
- context._sub(context.cx, context.data.word(context.di+2));
- context.di = context.si;
- context._add(context.si, context.ax);
- context.push(context.ax);
- context.ds = context.es;
- while(--context.cx) context._movsb();
- context.bx = context.pop();
- context._sub(context.data.word(12), context.bx);
- context.si = context.pop();
- context.cx = 114*3;
- context.di = 0;
-shuffleadsdown:
- context.ax = context.data.word(context.di+2);
- context._cmp(context.ax, context.si);
- if (context.flags.c()) goto beforethisone;
- context._sub(context.ax, context.bx);
-beforethisone:
- context.data.word(context.di+2) = context.ax;
- context._add(context.di, 6);
- if (--context.cx) goto shuffleadsdown;
+ context._sub(context.ax, 12);
+ context.data.word(486) = context.ax;
+ bresenhams(context);
+ context._cmp(context.data.byte(493), 0);
+ if (context.flags.z()) goto normalline;
+ context.al = context.data.byte(494);
+ context._sub(context.al, 1);
+ context.data.byte(492) = context.al;
+ context.data.byte(493) = 1;
return;
-}
-
-static inline void deleteextext(Context & context) {
- context.di = 0+2080+30000+(16*114);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context.ax = context.data.word(context.di);
- context.si = context.ax;
- context.di = context.ax;
- context._add(context.si, 0+2080+30000+(16*114)+((114+2)*2));
- context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2));
- context.ax = 0;
-findlenextext:
- context.cl = context.data.byte(context.si);
- context._add(context.ax, 1);
- context._add(context.si, 1);
- context._cmp(context.cl, 0);
- if (!context.flags.z()) goto findlenextext;
- context.cx = 18000;
- context.bx = context.si;
- context._sub(context.bx, 0+2080+30000+(16*114)+((114+2)*2));
- context.push(context.bx);
- context.push(context.ax);
- context._sub(context.cx, context.bx);
- while(--context.cx) context._movsb();
- context.bx = context.pop();
- context._sub(context.data.word(14), context.bx);
- context.si = context.pop();
- context.cx = 114;
- context.di = 0+2080+30000+(16*114);
-shuffletextads:
- context.ax = context.data.word(context.di);
- context._cmp(context.ax, context.si);
- if (context.flags.c()) goto beforethistext;
- context._sub(context.ax, context.bx);
-beforethistext:
- context.data.word(context.di) = context.ax;
- context._add(context.di, 2);
- if (--context.cx) goto shuffletextads;
+normalline:
+ context.data.byte(492) = 0;
return;
}
-static inline void deleteexobject(Context & context) {
- context.push(context.cx);
- context.push(context.cx);
- context.push(context.cx);
- context.push(context.cx);
- context.al = 255;
- context.cx = 16;
- while(--context.cx) context._stosb();
- context.ax = context.pop();
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- deleteexframe(context);
- context.ax = context.pop();
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._add(context.al, 1);
- deleteexframe(context);
- context.ax = context.pop();
- deleteextext(context);
- context.bx = context.pop();
- context.bh = context.bl;
- context.bl = 4;
- context.di = 0+2080+30000;
- context.cx = 0;
-deleteconts:
- context._cmp(context.data.word(context.di+2), context.bx);
- if (!context.flags.z()) goto notinsideex;
+static void checkdest(Context & context) {
context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- deleteexobject(context);
- context.di = context.pop();
- context.cx = context.pop();
+ context._add(context.bx, 12*8);
+ context.ah = context.data.byte(475);
+ context.cl = 4;
+ context._shl(context.ah, context.cl);
+ context.al = context.data.byte(478);
+ context.cl = 24;
+ context.ch = context.data.byte(478);
+checkdestloop:
+ context.dh = context.data.byte(context.bx);
+ context._and(context.dh, 0xf0);
+ context.dl = context.data.byte(context.bx);
+ context._and(context.dl, 0xf);
+ context._cmp(context.ax, context.dx);
+ if (!context.flags.z()) goto nextcheck;
+ context.al = context.data.byte(context.bx+1);
+ context._and(context.al, 15);
+ context.data.byte(478) = context.al;
+ context.bx = context.pop();
+ return;
+nextcheck:
+ context.dl = context.data.byte(context.bx);
+ context._and(context.dl, 0xf0);
+ context._shr(context.dl, 1);
+ context._shr(context.dl, 1);
+ context._shr(context.dl, 1);
+ context._shr(context.dl, 1);
+ context.dh = context.data.byte(context.bx);
+ context._and(context.dh, 0xf);
+ context._shl(context.dh, 1);
+ context._shl(context.dh, 1);
+ context._shl(context.dh, 1);
+ context._shl(context.dh, 1);
+ context._cmp(context.ax, context.dx);
+ if (!context.flags.z()) goto nextcheck2;
+ context.ch = context.data.byte(context.bx+1);
+ context._and(context.ch, 15);
+nextcheck2:
+ context._add(context.bx, 2);
+ context._sub(context.cl, 1);
+ if (!context.flags.z()) goto checkdestloop;
+ context.data.byte(478) = context.ch;
context.bx = context.pop();
-notinsideex:
- context._add(context.di, 16);
- context._add(context.cx, 1);
- context._cmp(context.cx, 114);
- if (!context.flags.z()) goto deleteconts;
return;
}
-static inline void purgeanitem(Context & context) {
- context.es = context.data.word(398);
- context.di = 0+2080+30000;
- context.bl = context.data.byte(184);
- context.cx = 0;
-lookforpurge:
- context.al = context.data.byte(context.di+2);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto cantpurge;
- context._cmp(context.data.byte(context.di+12), 2);
- if (context.flags.z()) goto iscup;
- context._cmp(context.data.byte(context.di+12), 255);
- if (!context.flags.z()) goto cantpurge;
-iscup:
- context._cmp(context.data.byte(context.di+11), context.bl);
- if (context.flags.z()) goto cantpurge;
- deleteexobject(context);
- return;
-cantpurge:
- context._add(context.di, 16);
+static void bresenhams(Context & context) {
+ workoutframes(context);
+ context.dx = context.ds;
+ context.es = context.dx;
+ context.di = 8344;
+ context.si = 1;
+ context.data.byte(493) = 0;
+ context.cx = context.data.word(484);
+ context._sub(context.cx, context.data.word(480));
+ if (context.flags.z()) goto vertline;
+ if (!context.flags.s()) goto line1;
+ context._neg(context.cx);
+ context.bx = context.data.word(484);
+ context._xchg(context.bx, context.data.word(480));
+ context.data.word(484) = context.bx;
+ context.bx = context.data.word(486);
+ context._xchg(context.bx, context.data.word(482));
+ context.data.word(486) = context.bx;
+ context.data.byte(493) = 1;
+line1:
+ context.bx = context.data.word(486);
+ context._sub(context.bx, context.data.word(482));
+ if (context.flags.z()) goto horizline;
+ if (!context.flags.s()) goto line3;
+ context._neg(context.bx);
+ context._neg(context.si);
+line3:
+ context.push(context.si);
+ context.data.byte(491) = 0;
+ context._cmp(context.bx, context.cx);
+ if (context.flags.le()) goto line4;
+ context.data.byte(491) = 1;
+ context._xchg(context.bx, context.cx);
+line4:
+ context._shl(context.bx, 1);
+ context.data.word(488) = context.bx;
+ context._sub(context.bx, context.cx);
+ context.si = context.bx;
+ context._sub(context.bx, context.cx);
+ context.data.word(490) = context.bx;
+ context.ax = context.data.word(480);
+ context.bx = context.data.word(482);
+ context.ah = context.bl;
context._add(context.cx, 1);
- context._cmp(context.cx, 114);
- if (!context.flags.z()) goto lookforpurge;
- context.di = 0+2080+30000;
- context.bl = context.data.byte(184);
- context.cx = 0;
-lookforpurge2:
- context.al = context.data.byte(context.di+2);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto cantpurge2;
- context._cmp(context.data.byte(context.di+12), 255);
- if (!context.flags.z()) goto cantpurge2;
- deleteexobject(context);
- return;
-cantpurge2:
- context._add(context.di, 16);
+ context.bx = context.pop();
+ context._cmp(context.data.byte(491), 1);
+ if (context.flags.z()) goto hislope;
+ goto loslope;
+vertline:
+ context.ax = context.data.word(482);
+ context.bx = context.data.word(486);
+ context.cx = context.bx;
+ context._sub(context.cx, context.ax);
+ if (!context.flags.ge()) goto line31;
+ context._neg(context.cx);
+ context.ax = context.bx;
+ context.data.byte(493) = 1;
+line31:
context._add(context.cx, 1);
- context._cmp(context.cx, 114);
- if (!context.flags.z()) goto lookforpurge2;
- return;
-}
-
-static inline void emergencypurge(Context & context) {
-checkpurgeagain:
- context.ax = context.data.word(12);
- context._add(context.ax, 4000);
- context._cmp(context.ax, 30000);
- if (context.flags.c()) goto notnearframeend;
- purgeanitem(context);
- goto checkpurgeagain;
-notnearframeend:
- context.ax = context.data.word(14);
- context._add(context.ax, 400);
- context._cmp(context.ax, 18000);
- if (context.flags.c()) goto notneartextend;
- purgeanitem(context);
- goto checkpurgeagain;
-notneartextend:
- return;
-}
-
-static inline void getexpos(Context & context) {
- context.es = context.data.word(398);
- context.al = 0;
- context.di = 0+2080+30000;
-tryanotherex:
- context._cmp(context.data.byte(context.di+2), 255);
- if (context.flags.z()) goto foundnewex;
- context._add(context.di, 16);
+ context.bx = context.data.word(480);
+ context._xchg(context.ax, context.bx);
+ context.ah = context.bl;
+ context.bx = context.si;
+line32:
+ context._stosw();
+ context._add(context.ah, context.bl);
+ if (--context.cx) goto line32;
+ goto lineexit;
+horizline:
+ context.ax = context.data.word(480);
+ context.bx = context.data.word(482);
+ context.ah = context.bl;
+ context._add(context.cx, 1);
+horizloop:
+ context._stosw();
context._add(context.al, 1);
- context._cmp(context.al, 114);
- if (!context.flags.z()) goto tryanotherex;
-foundnewex:
- context.data.byte(10) = context.al;
+ if (--context.cx) goto horizloop;
+ goto lineexit;
+loslope:
+loloop:
+ context._stosw();
+ context._add(context.al, 1);
+ context._or(context.si, context.si);
+ if (!context.flags.s()) goto line12;
+ context._add(context.si, context.data.word(488));
+ if (--context.cx) goto loloop;
+ goto lineexit;
+line12:
+ context._add(context.si, context.data.word(490));
+ context._add(context.ah, context.bl);
+ if (--context.cx) goto loloop;
+ goto lineexit;
+hislope:
+hiloop:
+ context._stosw();
+ context._add(context.ah, context.bl);
+ context._or(context.si, context.si);
+ if (!context.flags.s()) goto line23;
+ context._add(context.si, context.data.word(488));
+ if (--context.cx) goto hiloop;
+ goto lineexit;
+line23:
+ context._add(context.si, context.data.word(490));
+ context._add(context.al, 1);
+ if (--context.cx) goto hiloop;
+lineexit:
+ context._sub(context.di, 8344);
+ context.ax = context.di;
+ context._shr(context.ax, 1);
+ context.data.byte(494) = context.al;
return;
}
-static inline void transfermap(Context & context) {
- context.di = context.data.word(12);
- context.push(context.di);
- context.al = context.data.byte(10);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context.cx = 6;
- context._mul(context.cx);
- context.es = context.data.word(398);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context._add(context.di, 0+2080);
- context.push(context.bx);
- context.al = context.data.byte(90);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context.cx = 6;
- context._mul(context.cx);
- context.ds = context.data.word(446);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context.si = 0+2080;
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context.cl = context.data.byte(context.bx+1);
- context.ch = 0;
- context._add(context.si, context.data.word(context.bx+2));
- context.dx = context.data.word(context.bx+4);
- context.bx = context.pop();
- context.data.byte(context.bx+0) = context.al;
- context.data.byte(context.bx+1) = context.cl;
- context.data.word(context.bx+4) = context.dx;
- context._mul(context.cx);
- context.cx = context.ax;
- context.push(context.cx);
- while(--context.cx) context._movsb();
- context.cx = context.pop();
- context.ax = context.pop();
- context.data.word(context.bx+2) = context.ax;
- context._add(context.data.word(12), context.cx);
+static void workoutframes(Context & context) {
+ context.bx = context.data.word(480);
+ context._add(context.bx, 32);
+ context.ax = context.data.word(484);
+ context._add(context.ax, 32);
+ context._sub(context.bx, context.ax);
+ if (!context.flags.c()) goto notneg1;
+ context._neg(context.bx);
+notneg1:
+ context.cx = context.data.word(482);
+ context._add(context.cx, 32);
+ context.ax = context.data.word(486);
+ context._add(context.ax, 32);
+ context._sub(context.cx, context.ax);
+ if (!context.flags.c()) goto notneg2;
+ context._neg(context.cx);
+notneg2:
+ context._cmp(context.bx, context.cx);
+ if (!context.flags.c()) goto tendstohoriz;
+ context.dl = 2;
+ context.ax = context.cx;
+ context._shr(context.ax, 1);
+ context._cmp(context.bx, context.ax);
+ if (context.flags.c()) goto gotquad;
+ context.dl = 1;
+ goto gotquad;
+tendstohoriz:
+ context.dl = 0;
+ context.ax = context.bx;
+ context._shr(context.ax, 1);
+ context._cmp(context.cx, context.ax);
+ if (context.flags.c()) goto gotquad;
+ context.dl = 1;
+ goto gotquad;
+gotquad:
+ context.bx = context.data.word(480);
+ context._add(context.bx, 32);
+ context.ax = context.data.word(484);
+ context._add(context.ax, 32);
+ context._sub(context.bx, context.ax);
+ if (context.flags.c()) goto isinright;
+isinleft:
+ context.cx = context.data.word(482);
+ context._add(context.cx, 32);
+ context.ax = context.data.word(486);
+ context._add(context.ax, 32);
+ context._sub(context.cx, context.ax);
+ if (!context.flags.c()) goto topleft;
+ context._cmp(context.dl, 1);
+ if (context.flags.z()) goto noswap1;
+ context._xor(context.dl, 2);
+noswap1:
+ context._add(context.dl, 4);
+ goto success;
+topleft:
+ context._add(context.dl, 6);
+ goto success;
+isinright:
+ context.cx = context.data.word(482);
+ context._add(context.cx, 32);
+ context.ax = context.data.word(486);
+ context._add(context.ax, 32);
+ context._sub(context.cx, context.ax);
+ if (!context.flags.c()) goto botright;
+ context._add(context.dl, 2);
+ goto success;
+botright:
+ context._cmp(context.dl, 1);
+ if (context.flags.z()) goto noswap2;
+ context._xor(context.dl, 2);
+noswap2:
+success:
+ context._and(context.dl, 7);
+ context.data.byte(135) = context.dl;
+ context.data.byte(136) = 0;
return;
}
-static inline void transferinv(Context & context) {
- context.di = context.data.word(12);
- context.push(context.di);
- context.al = context.data.byte(10);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context._add(context.ax, 1);
- context.cx = 6;
- context._mul(context.cx);
- context.es = context.data.word(398);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context._add(context.di, 0+2080);
- context.push(context.bx);
- context.al = context.data.byte(90);
+static void getroomspaths(Context & context) {
+ context.al = context.data.byte(185);
context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context._add(context.ax, 1);
- context.cx = 6;
+ context.cx = 144;
context._mul(context.cx);
- context.ds = context.data.word(446);
+ context.es = context.data.word(450);
context.bx = 0;
context._add(context.bx, context.ax);
- context.si = 0+2080;
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context.cl = context.data.byte(context.bx+1);
- context.ch = 0;
- context._add(context.si, context.data.word(context.bx+2));
- context.dx = context.data.word(context.bx+4);
- context.bx = context.pop();
- context.data.byte(context.bx+0) = context.al;
- context.data.byte(context.bx+1) = context.cl;
- context.data.word(context.bx+4) = context.dx;
- context._mul(context.cx);
- context.cx = context.ax;
- context.push(context.cx);
- while(--context.cx) context._movsb();
- context.cx = context.pop();
- context.ax = context.pop();
- context.data.word(context.bx+2) = context.ax;
- context._add(context.data.word(12), context.cx);
return;
}
-static inline void transfertext(Context & context) {
- context.es = context.data.word(398);
- context.al = context.data.byte(10);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = 0+2080+30000+(16*114);
- context._add(context.bx, context.ax);
- context.di = context.data.word(14);
- context.data.word(context.bx) = context.di;
- context._add(context.di, 0+2080+30000+(16*114)+((114+2)*2));
- context.al = context.data.byte(90);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.ds = context.data.word(438);
- context.bx = 0;
- context._add(context.bx, context.ax);
- context.si = 0+(82*2);
- context.ax = context.data.word(context.bx);
- context._add(context.si, context.ax);
-moretext:
+static void copyname(Context & context) {
+ context.push(context.di);
+ findobname(context);
+ context.di = context.pop();
+ context.es = context.cs;
+copytext:
+ context.cx = 28;
+make:
context._lodsb();
- context._stosb();
- context._add(context.data.word(14), 1);
+ context._cmp(context.al, ':');
+ if (context.flags.z()) goto finishmakename;
context._cmp(context.al, 0);
- if (!context.flags.z()) goto moretext;
+ if (context.flags.z()) goto finishmakename;
+ context._stosb();
+ if (--context.cx) goto make;
+finishmakename:
+ context._add(context.cx, 1);
+ context.al = 0;
+ context._stosb();
return;
-}
-
-static inline void transfercontoex(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- context.push(context.dx);
- context.push(context.es);
- context.push(context.bx);
- getexpos(context);
- context.si = context.pop();
- context.ds = context.pop();
- context.push(context.di);
- context.cx = 8;
- while(--context.cx) context._movsw();
- context.di = context.pop();
- context.dx = context.pop();
- context.al = context.data.byte(184);
- context.data.byte(context.di) = context.al;
- context.data.byte(context.di+11) = context.al;
- context.al = context.data.byte(90);
- context.data.byte(context.di+1) = context.al;
- context.data.byte(context.di+3) = context.dl;
- context.data.byte(context.di+2) = 4;
- transfermap(context);
- transferinv(context);
- transfertext(context);
- context.si = context.pop();
- context.ds = context.pop();
- context.data.byte(context.si+2) = 255;
+ context.al = 255;
+ while(--context.cx) context._stosb();
return;
}
-static inline void pickupconts(Context & context) {
- context.al = context.data.byte(context.si+7);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto notopenable;
- context.al = context.data.byte(89);
- context.ah = context.data.byte(102);
- context.dl = context.data.byte(10);
- context.es = context.data.word(426);
- context.bx = 0;
- context.cx = 0;
-pickupcontloop:
- context.push(context.cx);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.dx);
+static void findobname(Context & context) {
context.push(context.ax);
- context._cmp(context.data.byte(context.bx+2), context.ah);
- if (!context.flags.z()) goto notinsidethis;
- context._cmp(context.data.byte(context.bx+3), context.al);
- if (!context.flags.z()) goto notinsidethis;
- context.data.byte(90) = context.cl;
- transfercontoex(context);
-notinsidethis:
+ context.ah = 0;
+ context._add(context.ax, context.ax);
+ context.bx = context.ax;
context.ax = context.pop();
- context.dx = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 16);
- context._add(context.cx, 1);
- context._cmp(context.cx, 80);
- if (!context.flags.z()) goto pickupcontloop;
-notopenable:
- return;
-}
-
-static inline void transfertoex(Context & context) {
- emergencypurge(context);
- getexpos(context);
- context.al = context.data.byte(10);
+ context._cmp(context.ah, 5);
+ if (!context.flags.z()) goto notpersonname;
context.push(context.ax);
- context.push(context.di);
- context.al = context.data.byte(89);
+ context._and(context.al, 127);
context.ah = 0;
- context.bx = 16;
+ context.bx = 64*2;
context._mul(context.bx);
- context.ds = context.data.word(426);
context.si = context.ax;
- context.cx = 8;
- while(--context.cx) context._movsw();
- context.di = context.pop();
- context.al = context.data.byte(184);
- context.data.byte(context.di) = context.al;
- context.data.byte(context.di+11) = context.al;
- context.al = context.data.byte(89);
- context.data.byte(context.di+1) = context.al;
- context.data.byte(context.di+2) = 4;
- context.data.byte(context.di+3) = 255;
- context.al = context.data.byte(107);
- context.data.byte(context.di+4) = context.al;
- context.al = context.data.byte(89);
- context.data.byte(90) = context.al;
- transfermap(context);
- transferinv(context);
- transfertext(context);
- context.al = context.data.byte(89);
- context.ah = 0;
- context.bx = 16;
- context._mul(context.bx);
- context.ds = context.data.word(426);
+ context.ds = context.data.word(448);
+ context._add(context.si, 0+24);
+ context.cx = 0+24+(1026*2);
+ context.ax = context.data.word(context.si);
+ context._add(context.ax, context.cx);
context.si = context.ax;
- context.data.byte(context.si+2) = 254;
- pickupconts(context);
context.ax = context.pop();
return;
-}
-
-static inline void pickupob(Context & context) {
- context.data.byte(107) = context.ah;
- context.data.byte(102) = 2;
- context.data.byte(89) = context.al;
- context.data.byte(99) = context.al;
- getanyad(context);
- transfertoex(context);
- return;
-}
-
-static inline void initialinv(Context & context) {
- context._cmp(context.data.byte(184), 24);
- if (context.flags.z()) goto isedens;
- return;
-isedens:
- context.al = 11;
- context.ah = 5;
- pickupob(context);
- context.al = 12;
- context.ah = 6;
- pickupob(context);
- context.al = 13;
- context.ah = 7;
- pickupob(context);
- context.al = 14;
- context.ah = 8;
- pickupob(context);
- context.al = 18;
- context.al = 18;
- context.ah = 0;
- pickupob(context);
- context.al = 19;
- context.ah = 1;
- pickupob(context);
- context.al = 20;
- context.ah = 9;
- pickupob(context);
- context.al = 16;
- context.ah = 2;
- pickupob(context);
- context.data.byte(32) = 1;
- context.data.word(29) = 0;
- context.data.word(31) = 6;
- context.data.byte(27) = 1;
- context.data.byte(26) = 1;
- switchryanoff(context);
- return;
-}
-
-static inline void startup1(Context & context) {
- clearpalette(context);
- context.data.byte(61) = 0;
- context.data.byte(142) = '0';
- context.data.byte(105) = 0;
- createpanel(context);
- context.data.byte(62) = 1;
- drawfloor(context);
- showicon(context);
- getunderzoom(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- atmospheres(context);
- worktoscreen(context);
- fadescreenup(context);
- return;
-}
-
-static inline void clearreels(Context & context) {
- context.es = context.data.word(430);
- deallocatemem(context);
- context.es = context.data.word(432);
- deallocatemem(context);
- context.es = context.data.word(434);
- deallocatemem(context);
- return;
-}
-
-static inline void clearrest(Context & context) {
- context.es = context.data.word(418);
- context.cx = 66*60/2;
- context.ax = 0;
- context.di = 0;
- while(--context.cx) context._stosw();
- context.es = context.data.word(416);
- deallocatemem(context);
- context.es = context.data.word(444);
- deallocatemem(context);
- context.es = context.data.word(450);
- deallocatemem(context);
- context.es = context.data.word(448);
- deallocatemem(context);
- context.es = context.data.word(440);
- deallocatemem(context);
- context.es = context.data.word(442);
- deallocatemem(context);
- context.es = context.data.word(436);
- deallocatemem(context);
- context.es = context.data.word(446);
- deallocatemem(context);
- context.es = context.data.word(438);
- deallocatemem(context);
+notpersonname:
+ context._cmp(context.ah, 4);
+ if (!context.flags.z()) goto notextraname;
+ context.ds = context.data.word(398);
+ context._add(context.bx, 0+2080+30000+(16*114));
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2));
+ context.si = context.ax;
return;
-}
-
-static inline void clearbeforeload(Context & context) {
- context._cmp(context.data.byte(74), 1);
- if (!context.flags.z()) goto noclear;
- clearreels(context);
- clearrest(context);
- context.data.byte(74) = 0;
-noclear:
+notextraname:
+ context._cmp(context.ah, 2);
+ if (!context.flags.z()) goto notfreename;
+ context.ds = context.data.word(438);
+ context._add(context.bx, 0);
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, 0+(82*2));
+ context.si = context.ax;
return;
-}
-
-static inline void startup(Context & context) {
- context.data.byte(142) = 0;
- context.data.byte(105) = 0;
- createpanel(context);
- context.data.byte(62) = 1;
- drawfloor(context);
- showicon(context);
- getunderzoom(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- atmospheres(context);
+notfreename:
+ context._cmp(context.ah, 1);
+ if (!context.flags.z()) goto notsetname;
+ context.ds = context.data.word(440);
+ context._add(context.bx, 0);
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, 0+(130*2));
+ context.si = context.ax;
return;
-}
-
-static inline void worktoscreenm(Context & context) {
- animpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- worktoscreen(context);
- delpointer(context);
+notsetname:
+ context.ds = context.data.word(442);
+ context._add(context.bx, 0);
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, 0+(98*2));
+ context.si = context.ax;
return;
}
-static inline void readcitypic(Context & context) {
- context.dx = 2013;
- loadintotemp(context);
+static void showicon(Context & context) {
+ context._cmp(context.data.byte(184), 50);
+ if (!context.flags.c()) goto isdream1;
+ showpanel(context);
+ showman(context);
+ roomname(context);
+ panelicons1(context);
+ zoomicon(context);
return;
-}
-
-static inline void showcity(Context & context) {
- clearwork(context);
- context.ds = context.data.word(458);
- context.di = 57;
- context.bx = 32;
- context.al = 0;
+isdream1:
+ context.ds = context.data.word(464);
+ context.di = 72;
+ context.bx = 2;
+ context.al = 45;
context.ah = 0;
showframe(context);
- context.ds = context.data.word(458);
- context.di = 120+57;
- context.bx = 32;
- context.al = 1;
+ context.ds = context.data.word(464);
+ context.di = 72+47;
+ context.bx = 2;
+ context.al = 46;
context.ah = 0;
showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 69-10;
+ context.bx = 21;
+ context.al = 49;
+ context.ah = 0;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 160+88;
+ context.bx = 2;
+ context.al = 45;
+ context.ah = 4;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 160+43;
+ context.bx = 2;
+ context.al = 46;
+ context.ah = 4;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 160+101;
+ context.bx = 21;
+ context.al = 49;
+ context.ah = 4;
+ showframe(context);
+ middlepanel(context);
return;
}
-static inline void loadintotemp2(Context & context) {
- context.ds = context.cs;
- standardload(context);
- context.data.word(460) = context.ax;
- return;
-}
-
-static inline void loadintotemp3(Context & context) {
- context.ds = context.cs;
- standardload(context);
- context.data.word(462) = context.ax;
- return;
-}
-
-static inline void readdesticon(Context & context) {
- context.dx = 2026;
- loadintotemp(context);
- context.dx = 2039;
- loadintotemp2(context);
- context.dx = 1974;
- loadintotemp3(context);
- return;
-}
-
-static inline void loadtraveltext(Context & context) {
- context.dx = 2247;
- standardload(context);
- context.data.word(456) = context.ax;
+static void middlepanel(Context & context) {
+ context.ds = context.data.word(464);
+ context.di = 72+47+20;
+ context.bx = 0;
+ context.al = 48;
+ context.ah = 0;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 72+19;
+ context.bx = 21;
+ context.al = 47;
+ context.ah = 0;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 160+23;
+ context.bx = 0;
+ context.al = 48;
+ context.ah = 4;
+ showframe(context);
+ context.ds = context.data.word(464);
+ context.di = 160+71;
+ context.bx = 21;
+ context.al = 47;
+ context.ah = 4;
+ showframe(context);
return;
}
-static inline void showarrows(Context & context) {
- context.di = 116-12;
- context.bx = 16;
- context.ds = context.data.word(458);
+static void showman(Context & context) {
+ context.ds = context.data.word(408);
+ context.di = 0;
+ context.bx = 0;
context.al = 0;
context.ah = 0;
showframe(context);
- context.di = 226+12;
- context.bx = 16;
- context.ds = context.data.word(458);
+ context.ds = context.data.word(408);
+ context.di = 0;
+ context.bx = 114;
context.al = 1;
context.ah = 0;
showframe(context);
- context.di = 280;
- context.bx = 14;
- context.ds = context.data.word(458);
+ context._cmp(context.data.byte(4), 0);
+ if (context.flags.z()) goto notverycool;
+ context.ds = context.data.word(408);
+ context.di = 28;
+ context.bx = 25;
context.al = 2;
context.ah = 0;
showframe(context);
+notverycool:
return;
}
-static inline void getdestinfo(Context & context) {
- context.al = context.data.byte(183);
- context.ah = 0;
- context.push(context.ax);
- context.dx = context.ds;
- context.es = context.dx;
- context.si = 7798;
- context._add(context.si, context.ax);
- context.cl = context.data.byte(context.si);
- context.ax = context.pop();
- context.push(context.cx);
- context.dx = context.ds;
- context.es = context.dx;
- context.si = 7813;
- context._add(context.si, context.ax);
- context.ax = context.pop();
- return;
-}
-
-static inline void locationpic(Context & context) {
- getdestinfo(context);
- context.al = context.data.byte(context.si);
- context.push(context.es);
- context.push(context.si);
- context.di = 0;
- context._cmp(context.al, 6);
- if (!context.flags.c()) goto secondlot;
- context.ds = context.data.word(458);
- context._add(context.al, 4);
- goto gotgraphic;
-secondlot:
- context._sub(context.al, 6);
- context.ds = context.data.word(460);
-gotgraphic:
- context._add(context.di, 104);
- context.bx = 138+14;
+static void showpanel(Context & context) {
+ context.ds = context.data.word(408);
+ context.di = 72;
+ context.bx = 0;
+ context.al = 19;
context.ah = 0;
showframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.al = context.data.byte(183);
- context._cmp(context.al, context.data.byte(184));
- if (!context.flags.z()) goto notinthisone;
- context.al = 3;
- context.di = 104;
- context.bx = 140+14;
- context.ds = context.data.word(458);
+ context.ds = context.data.word(408);
+ context.di = 192;
+ context.bx = 0;
+ context.al = 19;
context.ah = 0;
showframe(context);
-notinthisone:
- context.bl = context.data.byte(183);
+ return;
+}
+
+static void roomname(Context & context) {
+ context.di = 88;
+ context.bx = 18;
+ context.al = 53;
+ context.dl = 240;
+ printmessage(context);
+ context.bl = context.data.byte(185);
+ context._cmp(context.bl, 32);
+ if (context.flags.c()) goto notover32;
+ context._sub(context.bl, 32);
+notover32:
context.bh = 0;
context._add(context.bx, context.bx);
- context.es = context.data.word(456);
- context.si = context.data.word(context.bx);
- context._add(context.si, 66*2);
- context.di = 50;
- context.bx = 20;
- context.dl = 241;
+ context.es = context.data.word(436);
+ context._add(context.bx, 0);
+ context.ax = context.data.word(context.bx);
+ context._add(context.ax, 0+(38*2));
+ context.si = context.ax;
+ context.data.word(77) = 7;
+ context.di = 88;
+ context.bx = 25;
+ context.dl = 120;
+ context._cmp(context.data.byte(3), 1);
+ if (context.flags.z()) goto gotpl;
+ context.dl = 160;
+gotpl:
context.al = 0;
context.ah = 0;
printdirect(context);
+ context.data.word(77) = 10;
+ usecharset1(context);
return;
}
-static inline void getridoftemp2(Context & context) {
- context.es = context.data.word(460);
- deallocatemem(context);
- return;
-}
-
-static inline void getridoftemp3(Context & context) {
- context.es = context.data.word(462);
- deallocatemem(context);
- return;
-}
-
-static inline void selectlocation(Context & context) {
- context.data.byte(237) = 0;
- clearbeforeload(context);
- context.data.byte(103) = 0;
- context.data.byte(231) = 22;
- readcitypic(context);
- showcity(context);
- getridoftemp(context);
- readdesticon(context);
- loadtraveltext(context);
- showpanel(context);
- showman(context);
- showarrows(context);
- showexit(context);
- locationpic(context);
- undertextline(context);
- context.data.byte(100) = 255;
- readmouse(context);
- context.data.byte(231) = 0;
- showpointer(context);
- worktoscreen(context);
- context.al = 9;
- context.ah = 255;
- playchannel0(context);
- context.data.byte(188) = 255;
-select:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context._cmp(context.data.byte(103), 1);
- if (context.flags.z()) goto quittravel;
- context.bx = 2714;
- checkcoords(context);
- context._cmp(context.data.byte(188), 255);
- if (context.flags.z()) goto select;
- context.al = context.data.byte(188);
- context._cmp(context.al, context.data.byte(9));
- if (context.flags.z()) goto quittravel;
- getridoftemp(context);
- getridoftemp2(context);
- getridoftemp3(context);
- context.es = context.data.word(456);
- deallocatemem(context);
- return;
-quittravel:
- context.al = context.data.byte(184);
- context.data.byte(188) = context.al;
- context.data.byte(103) = 0;
- getridoftemp(context);
- getridoftemp2(context);
- getridoftemp3(context);
- context.es = context.data.word(456);
- deallocatemem(context);
- return;
-}
-
-static inline void newplace(Context & context) {
- context._cmp(context.data.byte(60), 1);
- if (context.flags.z()) goto istravel;
- context._cmp(context.data.byte(189), -1);
- if (!context.flags.z()) goto isautoloc;
- return;
-isautoloc:
- context.al = context.data.byte(189);
- context.data.byte(188) = context.al;
- context.data.byte(189) = -1;
- return;
-istravel:
- context.data.byte(60) = 0;
- selectlocation(context);
- return;
-}
-
-static inline void checkcoords(Context & context) {
-loop048:
- context.ax = context.data.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto nonefound;
- context.push(context.bx);
- context._cmp(context.data.word(198), context.ax);
- if (context.flags.l()) goto over045;
- context.ax = context.data.word(context.bx+2);
- context._cmp(context.data.word(198), context.ax);
- if (!context.flags.ge()) goto over045;
- context.ax = context.data.word(context.bx+4);
- context._cmp(context.data.word(200), context.ax);
- if (context.flags.l()) goto over045;
- context.ax = context.data.word(context.bx+6);
- context._cmp(context.data.word(200), context.ax);
- if (!context.flags.ge()) goto over045;
- context.ax = context.data.word(context.bx+8);
- __dispatch_call(context, context.ax);
-finished:
- context.ax = context.pop();
- return;
-over045:
- context.bx = context.pop();
- context._add(context.bx, 10);
- goto loop048;
-nonefound:
+static void usecharset1(Context & context) {
+ context.ax = context.data.word(404);
+ context.data.word(268) = context.ax;
return;
}
-static inline void finishedwalking(Context & context) {
- context._cmp(context.data.byte(492), 254);
- if (!context.flags.z()) goto iswalking;
- context.al = context.data.byte(133);
- context._cmp(context.al, context.data.byte(135));
-iswalking:
+static void usetempcharset(Context & context) {
+ context.ax = context.data.word(406);
+ context.data.word(268) = context.ax;
return;
}
-static inline void showexit(Context & context) {
+static void showexit(Context & context) {
context.ds = context.data.word(408);
context.di = 274;
context.bx = 154;
@@ -14897,957 +19521,270 @@ static inline void showexit(Context & context) {
return;
}
-static inline void getanyad(Context & context) {
- context._cmp(context.data.byte(102), 4);
- if (context.flags.z()) goto isex;
- context._cmp(context.data.byte(102), 2);
- if (context.flags.z()) goto isfree;
- context.al = context.data.byte(99);
- getsetad(context);
- context.ax = context.data.word(context.bx+4);
- return;
-isfree:
- context.al = context.data.byte(99);
- getfreead(context);
- context.ax = context.data.word(context.bx+7);
- return;
-isex:
- context.al = context.data.byte(99);
- getexad(context);
- context.ax = context.data.word(context.bx+7);
- return;
-}
-
-static inline void obicons(Context & context) {
- context.al = context.data.byte(99);
- getanyad(context);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto cantopenit;
+static void panelicons1(Context & context) {
+ context.di = 0;
+ context._cmp(context.data.byte(3), 1);
+ if (context.flags.z()) goto watchison;
+ context.di = 48;
+watchison:
+ context.push(context.di);
context.ds = context.data.word(410);
- context.di = 210;
- context.bx = 1;
- context.al = 4;
+ context._add(context.di, 204);
+ context.bx = 4;
+ context.al = 2;
context.ah = 0;
showframe(context);
-cantopenit:
- context.ds = context.data.word(410);
- context.di = 260;
- context.bx = 1;
- context.al = 1;
+ context.di = context.pop();
+ context.push(context.di);
+ context._cmp(context.data.byte(8), 1);
+ if (context.flags.z()) goto zoomisoff;
+ context.ds = context.data.word(408);
+ context._add(context.di, 228);
+ context.bx = 8;
+ context.al = 5;
context.ah = 0;
showframe(context);
+zoomisoff:
+ context.di = context.pop();
+ showwatch(context);
return;
}
-static inline void obpicture(Context & context) {
- context.al = context.data.byte(99);
- context.ah = context.data.byte(102);
- context._cmp(context.ah, 1);
- if (context.flags.z()) goto setframe;
- context._cmp(context.ah, 4);
- if (context.flags.z()) goto exframe;
- context.ds = context.data.word(446);
- context.di = 160;
- context.bx = 68;
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._add(context.al, 1);
- context.ah = 128;
- showframe(context);
- return;
-setframe:
- return;
-exframe:
- context.ds = context.data.word(398);
- context.di = 160;
- context.bx = 68;
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._add(context.al, 1);
- context.ah = 128;
+static void showwatch(Context & context) {
+ context._cmp(context.data.byte(3), 0);
+ if (context.flags.z()) goto nowristwatch;
+ context.ds = context.data.word(408);
+ context.di = 250;
+ context.bx = 1;
+ context.al = 6;
+ context.ah = 0;
showframe(context);
+ showtime(context);
+nowristwatch:
return;
}
-static inline void searchforsame(Context & context) {
- context.si = context.cx;
-searchagain:
- context._add(context.si, 1);
- context.al = context.data.byte(context.bx);
-search:
- context._cmp(context.data.byte(context.si), context.al);
- if (context.flags.z()) goto gotstartletter;
- context._add(context.cx, 1);
- context._add(context.si, 1);
- context._cmp(context.si, 8000);
- if (context.flags.c()) goto search;
- context.si = context.bx;
- context.ax = context.pop();
- return;
-gotstartletter:
- context.push(context.bx);
- context.push(context.si);
-keepchecking:
- context._add(context.si, 1);
- context._add(context.bx, 1);
- context.al = context.data.byte(context.bx);
- context.ah = context.data.byte(context.si);
- context._cmp(context.al, ':');
- if (context.flags.z()) goto foundmatch;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto foundmatch;
- context._cmp(context.al, context.ah);
- if (context.flags.z()) goto keepchecking;
- context.si = context.pop();
- context.bx = context.pop();
- goto searchagain;
-foundmatch:
- context.si = context.pop();
- context.bx = context.pop();
- return;
-}
-
-static inline void getobtextstart(Context & context) {
- context.es = context.data.word(438);
- context.si = 0;
- context.cx = 0+(82*2);
- context._cmp(context.data.byte(102), 2);
- if (context.flags.z()) goto describe;
- context.es = context.data.word(440);
- context.si = 0;
- context.cx = 0+(130*2);
- context._cmp(context.data.byte(102), 1);
- if (context.flags.z()) goto describe;
- context.es = context.data.word(398);
- context.si = 0+2080+30000+(16*114);
- context.cx = 0+2080+30000+(16*114)+((114+2)*2);
-describe:
- context.al = context.data.byte(99);
+static void zoomicon(Context & context) {
+ context._cmp(context.data.byte(8), 0);
+ if (context.flags.z()) goto nozoom1;
+ context.ds = context.data.word(408);
+ context.di = 8;
+ context.bx = 132-1;
+ context.al = 8;
context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.ax = context.data.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context.bx = context.ax;
-tryagain:
- context.push(context.si);
- findnextcolon(context);
- context.al = context.data.byte(context.si);
- context.cx = context.si;
- context.si = context.pop();
- context._cmp(context.data.byte(102), 1);
- if (!context.flags.z()) goto cantmakeoneup;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto findsometext;
- context._cmp(context.al, ':');
- if (context.flags.z()) goto findsometext;
-cantmakeoneup:
- return;
-findsometext:
- searchforsame(context);
- goto tryagain;
+ showframe(context);
+nozoom1:
return;
}
-static inline void getlocation(Context & context) {
+static void showblink(Context & context) {
+ context._cmp(context.data.byte(131), 1);
+ if (context.flags.z()) goto finblink1;
+ context._add(context.data.byte(472), 1);
+ context._cmp(context.data.byte(4), 0);
+ if (!context.flags.z()) goto finblink1;
+ context._cmp(context.data.byte(184), 50);
+ if (!context.flags.c()) goto eyesshut;
+ context.al = context.data.byte(472);
+ context._cmp(context.al, 3);
+ if (!context.flags.z()) goto finblink1;
+ context.data.byte(472) = 0;
+ context.al = context.data.byte(471);
+ context._add(context.al, 1);
+ context.data.byte(471) = context.al;
+ context._cmp(context.al, 6);
+ if (context.flags.c()) goto nomorethan6;
+ context.al = 6;
+nomorethan6:
context.ah = 0;
- context.bx = context.ax;
- context.dx = context.ds;
- context.es = context.dx;
- context._add(context.bx, 7798);
+ context.bx = 5691;
+ context._add(context.bx, context.ax);
context.al = context.data.byte(context.bx);
- return;
-}
-
-static inline void setlocation(Context & context) {
+ context.ds = context.data.word(408);
+ context.di = 44;
+ context.bx = 32;
context.ah = 0;
- context.bx = context.ax;
- context.dx = context.ds;
- context.es = context.dx;
- context._add(context.bx, 7798);
- context.data.byte(context.bx) = 1;
+ showframe(context);
+finblink1:
return;
-}
-
-static inline void getridofreels(Context & context) {
- context._cmp(context.data.byte(74), 0);
- if (context.flags.z()) goto dontgetrid;
- context.es = context.data.word(430);
- deallocatemem(context);
- context.es = context.data.word(432);
- deallocatemem(context);
- context.es = context.data.word(434);
- deallocatemem(context);
-dontgetrid:
+eyesshut:
return;
}
-static inline void loadkeypad(Context & context) {
- context.dx = 1961;
- loadintotemp(context);
+static void dumpblink(Context & context) {
+ context._cmp(context.data.byte(4), 0);
+ if (!context.flags.z()) goto nodumpeye;
+ context._cmp(context.data.byte(472), 0);
+ if (!context.flags.z()) goto nodumpeye;
+ context.al = context.data.byte(471);
+ context._cmp(context.al, 6);
+ if (!context.flags.c()) goto nodumpeye;
+ context.push(context.ds);
+ context.di = 44;
+ context.bx = 32;
+ context.cl = 16;
+ context.ch = 12;
+ multidump(context);
+ context.ds = context.pop();
+nodumpeye:
return;
}
-static inline void hangonw(Context & context) {
-hangloopw:
- context.push(context.cx);
- delpointer(context);
- readmouse(context);
+static void worktoscreenm(Context & context) {
animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
- if (--context.cx) goto hangloopw;
- return;
-}
-
-static inline void getroomdata(Context & context) {
- context.ah = 0;
- context.cx = 32;
- context._mul(context.cx);
- context.bx = 5971;
- context._add(context.bx, context.ax);
- return;
-}
-
-static inline void allocateload(Context & context) {
- context.push(context.es);
- context.push(context.di);
- context.bx = context.data.word(context.di);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.di = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void restorereels(Context & context) {
- context._cmp(context.data.byte(74), 0);
- if (context.flags.z()) goto dontrestore;
- context.al = context.data.byte(184);
- getroomdata(context);
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- dontloadseg(context);
- dontloadseg(context);
- dontloadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(430) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(432) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(434) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- closefile(context);
-dontrestore:
- return;
-}
-
-static inline void putbackobstuff(Context & context) {
- createpanel(context);
- showpanel(context);
- showman(context);
- obicons(context);
- showexit(context);
- obpicture(context);
- describeob(context);
- undertextline(context);
- context.data.byte(100) = 255;
readmouse(context);
showpointer(context);
+ vsync(context);
worktoscreen(context);
delpointer(context);
return;
}
-static inline void lookatcard(Context & context) {
- context.data.byte(131) = 1;
- getridofreels(context);
- loadkeypad(context);
- createpanel2(context);
- context.di = 160;
- context.bx = 80;
- context.ds = context.data.word(458);
- context.al = 42;
- context.ah = 128;
- showframe(context);
- getobtextstart(context);
- findnextcolon(context);
- findnextcolon(context);
- findnextcolon(context);
- context.di = 36;
- context.bx = 124;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.push(context.es);
- context.push(context.si);
- worktoscreenm(context);
- context.cx = 280;
- hangonw(context);
- createpanel2(context);
- context.di = 160;
- context.bx = 80;
- context.ds = context.data.word(458);
- context.al = 42;
- context.ah = 128;
- showframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 36;
- context.bx = 130;
- context.dl = 241;
+static void blank(Context & context) {
+ context._cmp(context.data.byte(100), 199);
+ if (context.flags.z()) goto alreadyblnk;
+ context.data.byte(100) = 199;
context.al = 0;
- context.ah = 0;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 200;
- hangonw(context);
- context.data.byte(131) = 0;
- getridoftemp(context);
- restorereels(context);
- putbackobstuff(context);
- return;
-}
-
-static inline void obsthatdothings(Context & context) {
- context.al = context.data.byte(99);
- context.ah = context.data.byte(102);
- context.cl = 'M';
- context.ch = 'E';
- context.dl = 'M';
- context.dh = 'B';
- compare(context);
- if (!context.flags.z()) goto notlouiscard;
- context.al = 4;
- getlocation(context);
- context._cmp(context.al, 1);
- if (context.flags.z()) goto seencard;
- context.al = 4;
- setlocation(context);
- lookatcard(context);
-seencard:
- return;
-notlouiscard:
- return;
-}
-
-static inline void findpuztext(Context & context) {
- context.ah = 0;
- context.si = context.ax;
- context._add(context.si, context.si);
- context.es = context.data.word(454);
- context.ax = context.data.word(context.si);
- context._add(context.ax, 66*2);
- context.si = context.ax;
- return;
-}
-
-static inline void additionaltext(Context & context) {
- context._add(context.bx, 10);
- context.push(context.bx);
- context.al = context.data.byte(99);
- context.ah = context.data.byte(102);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'E';
- compare(context);
- if (context.flags.z()) goto emptycup;
- context.al = context.data.byte(99);
- context.ah = context.data.byte(102);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'F';
- compare(context);
- if (context.flags.z()) goto fullcup;
- context.bx = context.pop();
- return;
-emptycup:
- context.al = 40;
- findpuztext(context);
- context.bx = context.pop();
- context.di = 36;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- return;
-fullcup:
- context.al = 39;
- findpuztext(context);
- context.bx = context.pop();
- context.di = 36;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- return;
-}
-
-static inline void describeob(Context & context) {
- getobtextstart(context);
- context.di = 33;
- context.bx = 92;
- context._cmp(context.data.byte(102), 1);
- if (!context.flags.z()) goto notsetd;
- context.bx = 82;
-notsetd:
- context.dl = 241;
- context.ah = 16;
- context.data.word(71) = 91+91;
- printdirect(context);
- context.data.word(71) = 0;
- context.di = 36;
- context.bx = 104;
- context._cmp(context.data.byte(102), 1);
- if (!context.flags.z()) goto notsetd2;
- context.bx = 94;
-notsetd2:
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- context.push(context.bx);
- obsthatdothings(context);
- context.bx = context.pop();
- additionaltext(context);
+ commandonly(context);
+alreadyblnk:
return;
}
-static inline void makemainscreen(Context & context) {
- createpanel(context);
- context.data.byte(62) = 1;
- drawfloor(context);
- spriteupdate(context);
- printsprites(context);
- reelsonscreen(context);
- showicon(context);
- getunderzoom(context);
- undertextline(context);
- context.data.byte(100) = 255;
- animpointer(context);
- worktoscreenm(context);
- context.data.byte(100) = 200;
- context.data.byte(131) = 0;
+static void allpointer(Context & context) {
+ readmouse(context);
+ showpointer(context);
+ dumppointer(context);
return;
}
-static inline void examineob(Context & context) {
- context.data.byte(234) = 0;
- context.data.word(328) = 0;
-examineagain:
- context.data.byte(237) = 0;
- context.data.byte(108) = 0;
- context.data.byte(110) = 255;
- context.data.byte(111) = 255;
- context.data.byte(104) = 0;
- context.al = context.data.byte(100);
- context.data.byte(102) = context.al;
- context.data.byte(89) = 0;
- context.data.byte(231) = 0;
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- obpicture(context);
- describeob(context);
- undertextline(context);
+static void hangonp(Context & context) {
+ context.push(context.cx);
+ context._add(context.cx, context.cx);
+ context.ax = context.pop();
+ context._add(context.cx, context.ax);
+ context.data.word(138) = 0;
+ context.al = context.data.byte(231);
+ context.ah = context.data.byte(106);
+ context.push(context.ax);
+ context.data.byte(234) = 3;
+ context.data.byte(106) = 0;
+ context.push(context.cx);
context.data.byte(100) = 255;
readmouse(context);
+ animpointer(context);
showpointer(context);
- worktoscreen(context);
+ vsync(context);
+ dumppointer(context);
+ context.cx = context.pop();
+hangloop:
+ context.push(context.cx);
delpointer(context);
-waitexam:
readmouse(context);
+ animpointer(context);
showpointer(context);
vsync(context);
dumppointer(context);
- dumptextline(context);
+ context.cx = context.pop();
+ context.ax = context.data.word(202);
+ context._cmp(context.ax, 0);
+ if (context.flags.z()) goto notpressed;
+ context._cmp(context.ax, context.data.word(212));
+ if (!context.flags.z()) goto getoutofit;
+notpressed:
+ if (--context.cx) goto hangloop;
+getoutofit:
delpointer(context);
- context.data.byte(103) = 0;
- context.bx = 2494;
- context._cmp(context.data.byte(104), 0);
- if (context.flags.z()) goto notuseinv;
- context.bx = 2556;
- context._cmp(context.data.byte(104), 1);
- if (context.flags.z()) goto notuseinv;
- context.bx = 2618;
-notuseinv:
- checkcoords(context);
- context._cmp(context.data.byte(108), 0);
- if (context.flags.z()) goto norex;
- goto examineagain;
-norex:
- context._cmp(context.data.byte(103), 0);
- if (context.flags.z()) goto waitexam;
- context.data.byte(106) = 0;
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto iswatching;
- context._cmp(context.data.byte(188), 255);
- if (!context.flags.z()) goto justgetback;
-iswatching:
- makemainscreen(context);
- context.data.byte(104) = 0;
- context.data.byte(110) = 255;
- return;
-justgetback:
- context.data.byte(104) = 0;
- context.data.byte(110) = 255;
- return;
-}
-
-static inline void facerightway(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- getroomspaths(context);
- context.al = context.data.byte(475);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx+7);
- context.data.byte(135) = context.al;
- context.data.byte(134) = context.al;
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void setwalk(Context & context) {
- context._cmp(context.data.byte(492), 254);
- if (!context.flags.z()) goto alreadywalking;
- context.al = context.data.byte(474);
- context._cmp(context.al, context.data.byte(475));
- if (context.flags.z()) goto cantwalk2;
- context._cmp(context.data.byte(32), 1);
- if (context.flags.z()) goto holdingreel;
- context._cmp(context.data.byte(32), 2);
- if (context.flags.z()) goto cantwalk;
- context.data.byte(478) = context.al;
- context.data.byte(477) = context.al;
- context._cmp(context.data.word(202), 2);
- if (!context.flags.z()) goto notwalkandexam;
- context._cmp(context.data.byte(100), 3);
- if (context.flags.z()) goto notwalkandexam;
- context.data.byte(306) = 1;
- context.al = context.data.byte(100);
- context.data.byte(307) = context.al;
- context.al = context.data.byte(99);
- context.data.byte(308) = context.al;
-notwalkandexam:
- autosetwalk(context);
-cantwalk:
- return;
-cantwalk2:
- facerightway(context);
- return;
-alreadywalking:
- context.al = context.data.byte(474);
- context.data.byte(477) = context.al;
- return;
-holdingreel:
- context.data.byte(33) = context.al;
- context.data.byte(32) = 2;
- return;
-}
-
-static inline void examineobtext(Context & context) {
- context.bl = context.data.byte(99);
- context.bh = context.data.byte(100);
- context.al = 1;
- commandwithob(context);
- return;
-}
-
-static inline void blocknametext(Context & context) {
- context.bl = context.data.byte(99);
- context.bh = context.data.byte(100);
- context.al = 0;
- commandwithob(context);
- return;
-}
-
-static inline void personnametext(Context & context) {
- context.bl = context.data.byte(99);
- context._and(context.bl, 127);
- context.bh = context.data.byte(100);
- context.al = 2;
- commandwithob(context);
- return;
-}
-
-static inline void deltextline(Context & context) {
- context.di = context.data.word(79);
- context.bx = context.data.word(81);
- context._sub(context.bx, 3);
- context.ds = context.data.word(412);
- context.si = 0;
- context.cl = 228;
- context.ch = 13;
- multiput(context);
- return;
-}
-
-static inline void findobname(Context & context) {
- context.push(context.ax);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
context.ax = context.pop();
- context._cmp(context.ah, 5);
- if (!context.flags.z()) goto notpersonname;
- context.push(context.ax);
- context._and(context.al, 127);
- context.ah = 0;
- context.bx = 64*2;
- context._mul(context.bx);
- context.si = context.ax;
- context.ds = context.data.word(448);
- context._add(context.si, 0+24);
- context.cx = 0+24+(1026*2);
- context.ax = context.data.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context.ax = context.pop();
- return;
-notpersonname:
- context._cmp(context.ah, 4);
- if (!context.flags.z()) goto notextraname;
- context.ds = context.data.word(398);
- context._add(context.bx, 0+2080+30000+(16*114));
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 0+2080+30000+(16*114)+((114+2)*2));
- context.si = context.ax;
- return;
-notextraname:
- context._cmp(context.ah, 2);
- if (!context.flags.z()) goto notfreename;
- context.ds = context.data.word(438);
- context._add(context.bx, 0);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 0+(82*2));
- context.si = context.ax;
- return;
-notfreename:
- context._cmp(context.ah, 1);
- if (!context.flags.z()) goto notsetname;
- context.ds = context.data.word(440);
- context._add(context.bx, 0);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 0+(130*2));
- context.si = context.ax;
- return;
-notsetname:
- context.ds = context.data.word(442);
- context._add(context.bx, 0);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 0+(98*2));
- context.si = context.ax;
- return;
-}
-
-static inline void copyname(Context & context) {
- context.push(context.di);
- findobname(context);
- context.di = context.pop();
- context.es = context.cs;
-copytext:
- context.cx = 28;
-make:
- context._lodsb();
- context._cmp(context.al, ':');
- if (context.flags.z()) goto finishmakename;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto finishmakename;
- context._stosb();
- if (--context.cx) goto make;
-finishmakename:
- context._add(context.cx, 1);
- context.al = 0;
- context._stosb();
- return;
- context.al = 255;
- while(--context.cx) context._stosb();
+ context.data.byte(231) = context.al;
+ context.data.byte(106) = context.ah;
+ context.data.byte(234) = 0;
return;
}
-static inline void commandwithob(Context & context) {
- context.push(context.ax);
- context.push(context.ax);
- context.push(context.bx);
+static void hangonw(Context & context) {
+hangloopw:
context.push(context.cx);
- context.push(context.dx);
- context.push(context.es);
- context.push(context.ds);
- context.push(context.si);
- context.push(context.di);
- deltextline(context);
- context.di = context.pop();
- context.si = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
- context.dx = context.pop();
+ delpointer(context);
+ readmouse(context);
+ animpointer(context);
+ showpointer(context);
+ vsync(context);
+ dumppointer(context);
context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
- context.push(context.bx);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(452);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 66*2);
- context.si = context.ax;
- context.di = context.data.word(79);
- context.bx = context.data.word(81);
- context.dl = context.data.byte(82);
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.ax = context.pop();
- context.di = 5674;
- copyname(context);
- context.ax = context.pop();
- context.di = context.data.word(84);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto noadd;
- context._add(context.di, 5);
-noadd:
- context.bx = context.data.word(81);
- context.es = context.cs;
- context.si = 5674;
- context.dl = context.data.byte(82);
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.byte(109) = 1;
+ if (--context.cx) goto hangloopw;
return;
}
-static inline void walktotext(Context & context) {
- context.bl = context.data.byte(99);
- context.bh = context.data.byte(100);
- context.al = 3;
- commandwithob(context);
+static void hangoncurs(Context & context) {
+monloop1:
+ context.push(context.cx);
+ printcurs(context);
+ vsync(context);
+ delcurs(context);
+ context.cx = context.pop();
+ if (--context.cx) goto monloop1;
return;
}
-static inline void walkandexamine(Context & context) {
- finishedwalking(context);
- if (!context.flags.z()) goto noobselect;
- context.al = context.data.byte(307);
- context.data.byte(100) = context.al;
- context.al = context.data.byte(308);
- context.data.byte(99) = context.al;
- context.data.byte(306) = 0;
- context._cmp(context.data.byte(100), 5);
- if (context.flags.z()) goto noobselect;
- examineob(context);
- return;
-wantstowalk:
- setwalk(context);
- context.data.byte(473) = 1;
-noobselect:
- return;
-diff:
- context.data.byte(99) = context.al;
- context.data.byte(100) = context.ah;
-diff2:
- context._cmp(context.data.byte(492), 254);
- if (!context.flags.z()) goto middleofwalk;
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto middleofwalk;
- context.al = context.data.byte(133);
- context._cmp(context.al, context.data.byte(135));
- if (!context.flags.z()) goto middleofwalk;
- context._cmp(context.data.byte(100), 3);
- if (!context.flags.z()) goto notblock;
- context.bl = context.data.byte(475);
- context._cmp(context.bl, context.data.byte(474));
- if (!context.flags.z()) goto dontcheck;
- context.cl = context.data.byte(151);
- context._add(context.cl, 12);
- context.ch = context.data.byte(152);
- context._add(context.ch, 12);
- checkone(context);
- context._cmp(context.cl, 2);
- if (context.flags.c()) goto isblock;
-dontcheck:
- getflagunderp(context);
- context._cmp(context.data.byte(153), 2);
- if (context.flags.c()) goto isblock;
- context._cmp(context.data.byte(153), 128);
- if (!context.flags.c()) goto isblock;
- goto toofaraway;
-notblock:
- context.bl = context.data.byte(475);
- context._cmp(context.bl, context.data.byte(474));
- if (!context.flags.z()) goto toofaraway;
- context._cmp(context.data.byte(100), 3);
- if (context.flags.z()) goto isblock;
- context._cmp(context.data.byte(100), 5);
- if (context.flags.z()) goto isaperson;
- examineobtext(context);
- return;
-middleofwalk:
- blocknametext(context);
- return;
-isblock:
- blocknametext(context);
- return;
-isaperson:
- personnametext(context);
- return;
-toofaraway:
- walktotext(context);
+static void getunderzoom(Context & context) {
+ context.di = 8+5;
+ context.bx = 132+4;
+ context.ds = context.data.word(412);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
+ context.cl = 46;
+ context.ch = 40;
+ multiget(context);
return;
}
-static inline void mainscreen(Context & context) {
- context.data.byte(237) = 0;
- context.bx = 4949;
- context._cmp(context.data.byte(3), 1);
- if (context.flags.z()) goto checkmain;
- context.bx = 5011;
-checkmain:
- checkcoords(context);
- context._cmp(context.data.byte(306), 0);
- if (context.flags.z()) goto finishmain;
- walkandexamine(context);
-finishmain:
+static void dumpzoom(Context & context) {
+ context._cmp(context.data.byte(8), 1);
+ if (!context.flags.z()) goto notzoomon;
+ context.di = 8+5;
+ context.bx = 132+4;
+ context.cl = 46;
+ context.ch = 40;
+ multidump(context);
+notzoomon:
return;
}
-static inline void getflagunderp(Context & context) {
- context.cx = context.data.word(198);
- context._sub(context.cx, context.data.word(117));
- context.ax = context.data.word(200);
- context._sub(context.ax, context.data.word(119));
- context.ch = context.al;
- checkone(context);
- context.data.byte(153) = context.cl;
- context.data.byte(154) = context.ch;
+static void putunderzoom(Context & context) {
+ context.di = 8+5;
+ context.bx = 132+4;
+ context.ds = context.data.word(412);
+ context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
+ context.cl = 46;
+ context.ch = 40;
+ multiput(context);
return;
}
-static inline void animpointer(Context & context) {
- context._cmp(context.data.byte(234), 2);
- if (context.flags.z()) goto combathand;
- context._cmp(context.data.byte(234), 3);
- if (context.flags.z()) goto mousehand;
- context._cmp(context.data.word(21), 0);
- if (context.flags.z()) goto notwatchpoint;
- context.data.byte(231) = 11;
- return;
-notwatchpoint:
- context.data.byte(231) = 0;
- context._cmp(context.data.byte(237), 0);
- if (context.flags.z()) goto gothand;
- context._cmp(context.data.byte(476), 0);
- if (context.flags.z()) goto gothand;
-arrow:
- getflagunderp(context);
- context._cmp(context.cl, 2);
- if (context.flags.c()) goto gothand;
- context._cmp(context.cl, 128);
- if (!context.flags.c()) goto gothand;
- context.data.byte(231) = 3;
- context._test(context.cl, 4);
- if (!context.flags.z()) goto gothand;
- context.data.byte(231) = 4;
- context._test(context.cl, 16);
- if (!context.flags.z()) goto gothand;
- context.data.byte(231) = 5;
- context._test(context.cl, 2);
- if (!context.flags.z()) goto gothand;
- context.data.byte(231) = 6;
- context._test(context.cl, 8);
- if (!context.flags.z()) goto gothand;
- context.data.byte(231) = 8;
-gothand:
- return;
-mousehand:
- context._cmp(context.data.byte(235), 0);
- if (context.flags.z()) goto rightspeed3;
- context._sub(context.data.byte(235), 1);
- goto finflashmouse;
-rightspeed3:
- context.data.byte(235) = 5;
- context._add(context.data.byte(236), 1);
- context._cmp(context.data.byte(236), 16);
- if (!context.flags.z()) goto finflashmouse;
- context.data.byte(236) = 0;
-finflashmouse:
- context.al = context.data.byte(236);
+static void crosshair(Context & context) {
+ context._cmp(context.data.byte(100), 3);
+ if (context.flags.z()) goto nocross;
+ context._cmp(context.data.byte(100), 10);
+ if (!context.flags.c()) goto nocross;
+ context.es = context.data.word(400);
+ context.ds = context.data.word(408);
+ context.di = 8+24;
+ context.bx = 132+19;
+ context.al = 9;
context.ah = 0;
- context.bx = 5698;
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
- context.data.byte(231) = context.al;
- return;
-combathand:
- context.data.byte(231) = 0;
- context._cmp(context.data.byte(184), 14);
- if (!context.flags.z()) goto notarrow;
- context._cmp(context.data.byte(100), 211);
- if (!context.flags.z()) goto notarrow;
- context.data.byte(231) = 5;
-notarrow:
+ showframe(context);
return;
-}
-
-static inline void showblink(Context & context) {
- context._cmp(context.data.byte(131), 1);
- if (context.flags.z()) goto finblink1;
- context._add(context.data.byte(472), 1);
- context._cmp(context.data.byte(4), 0);
- if (!context.flags.z()) goto finblink1;
- context._cmp(context.data.byte(184), 50);
- if (!context.flags.c()) goto eyesshut;
- context.al = context.data.byte(472);
- context._cmp(context.al, 3);
- if (!context.flags.z()) goto finblink1;
- context.data.byte(472) = 0;
- context.al = context.data.byte(471);
- context._add(context.al, 1);
- context.data.byte(471) = context.al;
- context._cmp(context.al, 6);
- if (context.flags.c()) goto nomorethan6;
- context.al = 6;
-nomorethan6:
- context.ah = 0;
- context.bx = 5691;
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
+nocross:
+ context.es = context.data.word(400);
context.ds = context.data.word(408);
- context.di = 44;
- context.bx = 32;
+ context.di = 8+24;
+ context.bx = 132+19;
+ context.al = 29;
context.ah = 0;
showframe(context);
-finblink1:
- return;
-eyesshut:
return;
}
-static inline void showpointer(Context & context) {
+static void showpointer(Context & context) {
showblink(context);
context.di = context.data.word(198);
context.data.word(220) = context.di;
@@ -15955,38 +19892,27 @@ notsmally2:
return;
}
-static inline void readmouse1(Context & context) {
- context.ax = context.data.word(198);
- context.data.word(214) = context.ax;
- context.ax = context.data.word(200);
- context.data.word(216) = context.ax;
- mousecall(context);
- context.data.word(198) = context.cx;
- context.data.word(200) = context.dx;
- context.data.word(204) = context.bx;
- return;
-}
-
-static inline void dumpblink(Context & context) {
- context._cmp(context.data.byte(4), 0);
- if (!context.flags.z()) goto nodumpeye;
- context._cmp(context.data.byte(472), 0);
- if (!context.flags.z()) goto nodumpeye;
- context.al = context.data.byte(471);
- context._cmp(context.al, 6);
- if (!context.flags.c()) goto nodumpeye;
- context.push(context.ds);
- context.di = 44;
- context.bx = 32;
- context.cl = 16;
- context.ch = 12;
- multidump(context);
- context.ds = context.pop();
-nodumpeye:
+static void delpointer(Context & context) {
+ context.ax = context.data.word(220);
+ context._cmp(context.ax, 0x0ffff);
+ if (context.flags.z()) goto nevershown;
+ context.data.word(224) = context.ax;
+ context.ax = context.data.word(222);
+ context.data.word(226) = context.ax;
+ context.cl = context.data.byte(227);
+ context.data.byte(229) = context.cl;
+ context.ch = context.data.byte(228);
+ context.data.byte(230) = context.ch;
+ context.ds = context.data.word(412);
+ context.si = 0+(228*13)+32+60;
+ context.di = context.data.word(224);
+ context.bx = context.data.word(226);
+ multiput(context);
+nevershown:
return;
}
-static inline void dumppointer(Context & context) {
+static void dumppointer(Context & context) {
dumpblink(context);
context.cl = context.data.byte(229);
context.ch = context.data.byte(230);
@@ -16007,228 +19933,111 @@ notboth:
return;
}
-static inline void dumptextline(Context & context) {
- context._cmp(context.data.byte(109), 1);
- if (!context.flags.z()) goto nodumptextline;
- context.data.byte(109) = 0;
+static void undertextline(Context & context) {
context.di = context.data.word(79);
context.bx = context.data.word(81);
context._sub(context.bx, 3);
+ context.ds = context.data.word(412);
+ context.si = 0;
context.cl = 228;
context.ch = 13;
- multidump(context);
-nodumptextline:
+ multiget(context);
return;
}
-static inline void delpointer(Context & context) {
- context.ax = context.data.word(220);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto nevershown;
- context.data.word(224) = context.ax;
- context.ax = context.data.word(222);
- context.data.word(226) = context.ax;
- context.cl = context.data.byte(227);
- context.data.byte(229) = context.cl;
- context.ch = context.data.byte(228);
- context.data.byte(230) = context.ch;
+static void deltextline(Context & context) {
+ context.di = context.data.word(79);
+ context.bx = context.data.word(81);
+ context._sub(context.bx, 3);
context.ds = context.data.word(412);
- context.si = 0+(228*13)+32+60;
- context.di = context.data.word(224);
- context.bx = context.data.word(226);
+ context.si = 0;
+ context.cl = 228;
+ context.ch = 13;
multiput(context);
-nevershown:
return;
}
-static inline void findnextcolon(Context & context) {
-isntcolon:
- context.al = context.data.byte(context.si);
- context._add(context.si, 1);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto endofcolon;
- context._cmp(context.al, ':');
- if (!context.flags.z()) goto isntcolon;
-endofcolon:
- return;
-}
-
-static inline void printboth(Context & context) {
- context.push(context.ax);
- context.push(context.cx);
- context.push(context.bx);
- context.push(context.di);
- printchar(context);
- context.ax = context.pop();
- context.push(context.di);
- context.di = context.ax;
+static void dumptextline(Context & context) {
+ context._cmp(context.data.byte(109), 1);
+ if (!context.flags.z()) goto nodumptextline;
+ context.data.byte(109) = 0;
+ context.di = context.data.word(79);
+ context.bx = context.data.word(81);
+ context._sub(context.bx, 3);
+ context.cl = 228;
+ context.ch = 13;
multidump(context);
- context.di = context.pop();
- context.bx = context.pop();
- context.cx = context.pop();
- context.ax = context.pop();
- return;
-}
-
-static inline void waitframes(Context & context) {
- context.push(context.di);
- context.push(context.bx);
- context.push(context.es);
- context.push(context.si);
- context.push(context.ds);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- delpointer(context);
- context.ax = context.data.word(202);
- context.ds = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
+nodumptextline:
return;
}
-static inline void printslow(Context & context) {
- context.data.byte(231) = 1;
- context.data.byte(234) = 3;
- context.ds = context.data.word(404);
-printloopslow6:
- context.push(context.bx);
- context.push(context.di);
- context.push(context.dx);
- getnumber(context);
- context.ch = 0;
-printloopslow5:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.es);
- context.ax = context.data.word(context.si);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- context.push(context.ds);
- modifychar(context);
- printboth(context);
- context.ds = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.data.word(context.si+1);
- context._add(context.si, 1);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto finishslow;
- context._cmp(context.al, ':');
- if (context.flags.z()) goto finishslow;
- context._cmp(context.cl, 1);
- if (context.flags.z()) goto afterslow;
- context.push(context.di);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- modifychar(context);
- context.data.word(71) = 91;
- printboth(context);
- context.data.word(71) = 0;
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- waitframes(context);
- context._cmp(context.ax, 0);
- if (context.flags.z()) goto keepgoing;
- context._cmp(context.ax, context.data.word(212));
- if (!context.flags.z()) goto finishslow2;
-keepgoing:
- waitframes(context);
-noslow:
- context._cmp(context.ax, 0);
- if (context.flags.z()) goto afterslow;
- context._cmp(context.ax, context.data.word(212));
- if (!context.flags.z()) goto finishslow2;
-afterslow:
- context.es = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 1);
- if (--context.cx) goto printloopslow5;
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context._add(context.bx, 10);
- goto printloopslow6;
-finishslow:
- context.cx = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.al = 0;
+static void animpointer(Context & context) {
+ context._cmp(context.data.byte(234), 2);
+ if (context.flags.z()) goto combathand;
+ context._cmp(context.data.byte(234), 3);
+ if (context.flags.z()) goto mousehand;
+ context._cmp(context.data.word(21), 0);
+ if (context.flags.z()) goto notwatchpoint;
+ context.data.byte(231) = 11;
return;
-finishslow2:
- context.cx = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.al = 1;
+notwatchpoint:
+ context.data.byte(231) = 0;
+ context._cmp(context.data.byte(237), 0);
+ if (context.flags.z()) goto gothand;
+ context._cmp(context.data.byte(476), 0);
+ if (context.flags.z()) goto gothand;
+arrow:
+ getflagunderp(context);
+ context._cmp(context.cl, 2);
+ if (context.flags.c()) goto gothand;
+ context._cmp(context.cl, 128);
+ if (!context.flags.c()) goto gothand;
+ context.data.byte(231) = 3;
+ context._test(context.cl, 4);
+ if (!context.flags.z()) goto gothand;
+ context.data.byte(231) = 4;
+ context._test(context.cl, 16);
+ if (!context.flags.z()) goto gothand;
+ context.data.byte(231) = 5;
+ context._test(context.cl, 2);
+ if (!context.flags.z()) goto gothand;
+ context.data.byte(231) = 6;
+ context._test(context.cl, 8);
+ if (!context.flags.z()) goto gothand;
+ context.data.byte(231) = 8;
+gothand:
return;
-}
-
-static inline void hangonp(Context & context) {
- context.push(context.cx);
- context._add(context.cx, context.cx);
- context.ax = context.pop();
- context._add(context.cx, context.ax);
- context.data.word(138) = 0;
- context.al = context.data.byte(231);
- context.ah = context.data.byte(106);
- context.push(context.ax);
- context.data.byte(234) = 3;
- context.data.byte(106) = 0;
- context.push(context.cx);
- context.data.byte(100) = 255;
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
-hangloop:
- context.push(context.cx);
- delpointer(context);
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
- context.ax = context.data.word(202);
- context._cmp(context.ax, 0);
- if (context.flags.z()) goto notpressed;
- context._cmp(context.ax, context.data.word(212));
- if (!context.flags.z()) goto getoutofit;
-notpressed:
- if (--context.cx) goto hangloop;
-getoutofit:
- delpointer(context);
- context.ax = context.pop();
+mousehand:
+ context._cmp(context.data.byte(235), 0);
+ if (context.flags.z()) goto rightspeed3;
+ context._sub(context.data.byte(235), 1);
+ goto finflashmouse;
+rightspeed3:
+ context.data.byte(235) = 5;
+ context._add(context.data.byte(236), 1);
+ context._cmp(context.data.byte(236), 16);
+ if (!context.flags.z()) goto finflashmouse;
+ context.data.byte(236) = 0;
+finflashmouse:
+ context.al = context.data.byte(236);
+ context.ah = 0;
+ context.bx = 5698;
+ context._add(context.bx, context.ax);
+ context.al = context.data.byte(context.bx);
context.data.byte(231) = context.al;
- context.data.byte(106) = context.ah;
- context.data.byte(234) = 0;
+ return;
+combathand:
+ context.data.byte(231) = 0;
+ context._cmp(context.data.byte(184), 14);
+ if (!context.flags.z()) goto notarrow;
+ context._cmp(context.data.byte(100), 211);
+ if (!context.flags.z()) goto notarrow;
+ context.data.byte(231) = 5;
+notarrow:
return;
}
-static inline void readmouse(Context & context) {
+static void readmouse(Context & context) {
context.ax = context.data.word(202);
context.data.word(212) = context.ax;
context.ax = context.data.word(198);
@@ -16242,198 +20051,19 @@ static inline void readmouse(Context & context) {
return;
}
-static inline void redrawmainscrn(Context & context) {
- context.data.word(328) = 0;
- createpanel(context);
- context.data.byte(62) = 0;
- drawfloor(context);
- printsprites(context);
- reelsonscreen(context);
- showicon(context);
- getunderzoom(context);
- undertextline(context);
- readmouse(context);
- context.data.byte(100) = 255;
- return;
-}
-
-static inline void dolook(Context & context) {
- createpanel(context);
- showicon(context);
- undertextline(context);
- worktoscreenm(context);
- context.data.byte(100) = 255;
- dumptextline(context);
- context.bl = context.data.byte(185);
- context._and(context.bl, 31);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(436);
- context._add(context.bx, 0);
- context.si = context.data.word(context.bx);
- context._add(context.si, 0+(38*2));
- findnextcolon(context);
- context.di = 66;
- context._cmp(context.data.byte(184), 50);
- if (context.flags.c()) goto notdream3;
- context.di = 40;
-notdream3:
- context.bx = 80;
- context.dl = 241;
- printslow(context);
- context._cmp(context.al, 1);
- if (context.flags.z()) goto afterlook;
- context.cx = 400;
- hangonp(context);
-afterlook:
- context.data.byte(234) = 0;
- context.data.byte(100) = 0;
- redrawmainscrn(context);
- worktoscreenm(context);
- return;
-}
-
-static inline void autolook(Context & context) {
+static void readmouse1(Context & context) {
context.ax = context.data.word(198);
- context._cmp(context.ax, context.data.word(214));
- if (!context.flags.z()) goto diffmouse;
+ context.data.word(214) = context.ax;
context.ax = context.data.word(200);
- context._cmp(context.ax, context.data.word(216));
- if (!context.flags.z()) goto diffmouse;
- context._sub(context.data.word(98), 1);
- context._cmp(context.data.word(98), 0);
- if (!context.flags.z()) goto noautolook;
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto noautolook;
- dolook(context);
-noautolook:
- return;
-diffmouse:
- context.data.word(98) = 1000;
- return;
-}
-
-static inline void watchcount(Context & context) {
- context._cmp(context.data.byte(3), 0);
- if (context.flags.z()) goto nowatchworn;
- context._add(context.data.byte(146), 1);
- context._cmp(context.data.byte(146), 9);
- if (context.flags.z()) goto flashdots;
- context._cmp(context.data.byte(146), 18);
- if (context.flags.z()) goto uptime;
-nowatchworn:
- return;
-flashdots:
- context.ax = 91*3+21;
- context.di = 268+4;
- context.bx = 21;
- context.ds = context.data.word(404);
- showframe(context);
- goto finishwatch;
-uptime:
- context.data.byte(146) = 0;
- context._add(context.data.byte(5), 1);
- context._cmp(context.data.byte(5), 60);
- if (!context.flags.z()) goto finishtime;
- context.data.byte(5) = 0;
- context._add(context.data.byte(6), 1);
- context._cmp(context.data.byte(6), 60);
- if (!context.flags.z()) goto finishtime;
- context.data.byte(6) = 0;
- context._add(context.data.byte(7), 1);
- context._cmp(context.data.byte(7), 24);
- if (!context.flags.z()) goto finishtime;
- context.data.byte(7) = 0;
-finishtime:
- showtime(context);
-finishwatch:
- context.data.byte(266) = 1;
- return;
-}
-
-static inline void putunderzoom(Context & context) {
- context.di = 8+5;
- context.bx = 132+4;
- context.ds = context.data.word(412);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
- context.cl = 46;
- context.ch = 40;
- multiput(context);
- return;
-}
-
-static inline void crosshair(Context & context) {
- context._cmp(context.data.byte(100), 3);
- if (context.flags.z()) goto nocross;
- context._cmp(context.data.byte(100), 10);
- if (!context.flags.c()) goto nocross;
- context.es = context.data.word(400);
- context.ds = context.data.word(408);
- context.di = 8+24;
- context.bx = 132+19;
- context.al = 9;
- context.ah = 0;
- showframe(context);
- return;
-nocross:
- context.es = context.data.word(400);
- context.ds = context.data.word(408);
- context.di = 8+24;
- context.bx = 132+19;
- context.al = 29;
- context.ah = 0;
- showframe(context);
- return;
-}
-
-static inline void zoom(Context & context) {
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto inwatching;
- context._cmp(context.data.byte(8), 1);
- if (context.flags.z()) goto zoomswitch;
-inwatching:
- return;
-zoomswitch:
- context._cmp(context.data.byte(100), 199);
- if (context.flags.c()) goto zoomit;
-cantzoom:
- putunderzoom(context);
- return;
-zoomit:
- context.ax = context.data.word(222);
- context._sub(context.ax, 9);
- context.cx = 320;
- context._mul(context.cx);
- context._add(context.ax, context.data.word(220));
- context._sub(context.ax, 11);
- context.si = context.ax;
- context.ax = 132+4;
- context.cx = 320;
- context._mul(context.cx);
- context._add(context.ax, 8+5);
- context.di = context.ax;
- context.es = context.data.word(400);
- context.ds = context.data.word(400);
- context.cx = 20;
-zoomloop:
- context.push(context.cx);
- context.cx = 23;
-zoomloop2:
- context._lodsb();
- context.ah = context.al;
- context._stosw();
- context.data.word(context.di+320-2) = context.ax;
- if (--context.cx) goto zoomloop2;
- context._add(context.si, 320-23);
- context._add(context.di, 320-46+320);
- context.cx = context.pop();
- if (--context.cx) goto zoomloop;
- crosshair(context);
- context.data.byte(75) = 1;
+ context.data.word(216) = context.ax;
+ mousecall(context);
+ context.data.word(198) = context.cx;
+ context.data.word(200) = context.dx;
+ context.data.word(204) = context.bx;
return;
}
-static inline void readmouse2(Context & context) {
+static void readmouse2(Context & context) {
context.ax = context.data.word(198);
context.data.word(214) = context.ax;
context.ax = context.data.word(200);
@@ -16445,607 +20075,7 @@ static inline void readmouse2(Context & context) {
return;
}
-static inline void dumpzoom(Context & context) {
- context._cmp(context.data.byte(8), 1);
- if (!context.flags.z()) goto notzoomon;
- context.di = 8+5;
- context.bx = 132+4;
- context.cl = 46;
- context.ch = 40;
- multidump(context);
-notzoomon:
- return;
-}
-
-static inline void findpathofpoint(Context & context) {
- context.push(context.ax);
- context.bx = 0;
- context.es = context.data.word(450);
- context.al = context.data.byte(185);
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.cx = context.pop();
- context.dl = 0;
-pathloop:
- context.al = context.data.byte(context.bx+6);
- context._cmp(context.al, 255);
- if (!context.flags.z()) goto flunkedit;
- context.ax = context.data.word(context.bx+2);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto flunkedit;
- context._cmp(context.cl, context.al);
- if (context.flags.c()) goto flunkedit;
- context._cmp(context.ch, context.ah);
- if (context.flags.c()) goto flunkedit;
- context.ax = context.data.word(context.bx+4);
- context._cmp(context.cl, context.al);
- if (!context.flags.c()) goto flunkedit;
- context._cmp(context.ch, context.ah);
- if (!context.flags.c()) goto flunkedit;
- goto gotvalidpath;
-flunkedit:
- context._add(context.bx, 8);
- context._add(context.dl, 1);
- context._cmp(context.dl, 12);
- if (!context.flags.z()) goto pathloop;
- context.dl = 255;
-gotvalidpath:
- return;
-}
-
-static inline void findxyfrompath(Context & context) {
- getroomspaths(context);
- context.al = context.data.byte(475);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.ax = context.data.word(context.bx);
- context._sub(context.al, 12);
- context._sub(context.ah, 12);
- context.data.byte(151) = context.al;
- context.data.byte(152) = context.ah;
- return;
-}
-
-static inline void showpanel(Context & context) {
- context.ds = context.data.word(408);
- context.di = 72;
- context.bx = 0;
- context.al = 19;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(408);
- context.di = 192;
- context.bx = 0;
- context.al = 19;
- context.ah = 0;
- showframe(context);
- return;
-}
-
-static inline void showman(Context & context) {
- context.ds = context.data.word(408);
- context.di = 0;
- context.bx = 0;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(408);
- context.di = 0;
- context.bx = 114;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context._cmp(context.data.byte(4), 0);
- if (context.flags.z()) goto notverycool;
- context.ds = context.data.word(408);
- context.di = 28;
- context.bx = 25;
- context.al = 2;
- context.ah = 0;
- showframe(context);
-notverycool:
- return;
-}
-
-static inline void printmessage(Context & context) {
- context.push(context.dx);
- context.push(context.bx);
- context.push(context.di);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(452);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 66*2);
- context.si = context.ax;
- context.di = context.pop();
- context.bx = context.pop();
- context.dx = context.pop();
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- return;
-}
-
-static inline void usecharset1(Context & context) {
- context.ax = context.data.word(404);
- context.data.word(268) = context.ax;
- return;
-}
-
-static inline void roomname(Context & context) {
- context.di = 88;
- context.bx = 18;
- context.al = 53;
- context.dl = 240;
- printmessage(context);
- context.bl = context.data.byte(185);
- context._cmp(context.bl, 32);
- if (context.flags.c()) goto notover32;
- context._sub(context.bl, 32);
-notover32:
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(436);
- context._add(context.bx, 0);
- context.ax = context.data.word(context.bx);
- context._add(context.ax, 0+(38*2));
- context.si = context.ax;
- context.data.word(77) = 7;
- context.di = 88;
- context.bx = 25;
- context.dl = 120;
- context._cmp(context.data.byte(3), 1);
- if (context.flags.z()) goto gotpl;
- context.dl = 160;
-gotpl:
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.word(77) = 10;
- usecharset1(context);
- return;
-}
-
-static inline void showtime(Context & context) {
- context._cmp(context.data.byte(3), 0);
- if (context.flags.z()) goto nowatch;
- context.al = context.data.byte(5);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3+10);
- context.ds = context.data.word(404);
- context.di = 282+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3+10);
- context.ds = context.data.word(404);
- context.di = 282+9;
- context.bx = 21;
- showframe(context);
- context.al = context.data.byte(6);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(404);
- context.di = 270+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(404);
- context.di = 270+11;
- context.bx = 21;
- showframe(context);
- context.al = context.data.byte(7);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(404);
- context.di = 256+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(404);
- context.di = 256+11;
- context.bx = 21;
- showframe(context);
- context.ax = 91*3+20;
- context.ds = context.data.word(404);
- context.di = 267+5;
- context.bx = 21;
- showframe(context);
-nowatch:
- return;
-}
-
-static inline void showwatch(Context & context) {
- context._cmp(context.data.byte(3), 0);
- if (context.flags.z()) goto nowristwatch;
- context.ds = context.data.word(408);
- context.di = 250;
- context.bx = 1;
- context.al = 6;
- context.ah = 0;
- showframe(context);
- showtime(context);
-nowristwatch:
- return;
-}
-
-static inline void panelicons1(Context & context) {
- context.di = 0;
- context._cmp(context.data.byte(3), 1);
- if (context.flags.z()) goto watchison;
- context.di = 48;
-watchison:
- context.push(context.di);
- context.ds = context.data.word(410);
- context._add(context.di, 204);
- context.bx = 4;
- context.al = 2;
- context.ah = 0;
- showframe(context);
- context.di = context.pop();
- context.push(context.di);
- context._cmp(context.data.byte(8), 1);
- if (context.flags.z()) goto zoomisoff;
- context.ds = context.data.word(408);
- context._add(context.di, 228);
- context.bx = 8;
- context.al = 5;
- context.ah = 0;
- showframe(context);
-zoomisoff:
- context.di = context.pop();
- showwatch(context);
- return;
-}
-
-static inline void zoomicon(Context & context) {
- context._cmp(context.data.byte(8), 0);
- if (context.flags.z()) goto nozoom1;
- context.ds = context.data.word(408);
- context.di = 8;
- context.bx = 132-1;
- context.al = 8;
- context.ah = 0;
- showframe(context);
-nozoom1:
- return;
-}
-
-static inline void middlepanel(Context & context) {
- context.ds = context.data.word(464);
- context.di = 72+47+20;
- context.bx = 0;
- context.al = 48;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 72+19;
- context.bx = 21;
- context.al = 47;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 160+23;
- context.bx = 0;
- context.al = 48;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 160+71;
- context.bx = 21;
- context.al = 47;
- context.ah = 4;
- showframe(context);
- return;
-}
-
-static inline void showicon(Context & context) {
- context._cmp(context.data.byte(184), 50);
- if (!context.flags.c()) goto isdream1;
- showpanel(context);
- showman(context);
- roomname(context);
- panelicons1(context);
- zoomicon(context);
- return;
-isdream1:
- context.ds = context.data.word(464);
- context.di = 72;
- context.bx = 2;
- context.al = 45;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 72+47;
- context.bx = 2;
- context.al = 46;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 69-10;
- context.bx = 21;
- context.al = 49;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 160+88;
- context.bx = 2;
- context.al = 45;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 160+43;
- context.bx = 2;
- context.al = 46;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(464);
- context.di = 160+101;
- context.bx = 21;
- context.al = 49;
- context.ah = 4;
- showframe(context);
- middlepanel(context);
- return;
-}
-
-static inline void getunderzoom(Context & context) {
- context.di = 8+5;
- context.bx = 132+4;
- context.ds = context.data.word(412);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5);
- context.cl = 46;
- context.ch = 40;
- multiget(context);
- return;
-}
-
-static inline void walkintoroom(Context & context) {
- context._cmp(context.data.byte(9), 14);
- if (!context.flags.z()) goto notlair;
- context._cmp(context.data.byte(148), 22);
- if (!context.flags.z()) goto notlair;
- context.data.byte(478) = 1;
- context.data.byte(477) = 1;
- autosetwalk(context);
-notlair:
- return;
-}
-
-static inline void isryanholding(Context & context) {
- context._sub(context.al, 'A');
- context._sub(context.ah, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.es = context.data.word(398);
- context.bx = 0+2080+30000;
- context.dl = 0;
-searchinv:
- context._cmp(context.data.byte(context.bx+2), 4);
- if (!context.flags.z()) goto nofindininv;
- context._cmp(context.al, context.data.byte(context.bx+12));
- if (!context.flags.z()) goto nofindininv;
- context._cmp(context.ah, context.data.byte(context.bx+13));
- if (!context.flags.z()) goto nofindininv;
- context._cmp(context.cl, context.data.byte(context.bx+14));
- if (!context.flags.z()) goto nofindininv;
- context._cmp(context.ch, context.data.byte(context.bx+15));
- if (!context.flags.z()) goto nofindininv;
- context.al = context.dl;
- context._cmp(context.al, 114);
- return;
-nofindininv:
- context._add(context.bx, 16);
- context._add(context.dl, 1);
- context._cmp(context.dl, 114);
- if (!context.flags.z()) goto searchinv;
- context.al = context.dl;
- context._cmp(context.al, 114);
- return;
-}
-
-static inline void findexobject(Context & context) {
- context._sub(context.al, 'A');
- context._sub(context.ah, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.es = context.data.word(398);
- context.bx = 0+2080+30000;
- context.dl = 0;
-findexloop:
- context._cmp(context.al, context.data.byte(context.bx+12));
- if (!context.flags.z()) goto nofindex;
- context._cmp(context.ah, context.data.byte(context.bx+13));
- if (!context.flags.z()) goto nofindex;
- context._cmp(context.cl, context.data.byte(context.bx+14));
- if (!context.flags.z()) goto nofindex;
- context._cmp(context.ch, context.data.byte(context.bx+15));
- if (!context.flags.z()) goto nofindex;
- context.al = context.dl;
- return;
-nofindex:
- context._add(context.bx, 16);
- context._add(context.dl, 1);
- context._cmp(context.dl, 114);
- if (!context.flags.z()) goto findexloop;
- context.al = context.dl;
- return;
-}
-
-static inline void getexad(Context & context) {
- context.ah = 0;
- context.bx = 16;
- context._mul(context.bx);
- context.bx = context.ax;
- context.es = context.data.word(398);
- context._add(context.bx, 0+2080+30000);
- return;
-}
-
-static inline void getanyaddir(Context & context) {
- context._cmp(context.ah, 4);
- if (context.flags.z()) goto isex3;
- context._cmp(context.ah, 2);
- if (context.flags.z()) goto isfree3;
- getsetad(context);
- return;
-isfree3:
- getfreead(context);
- return;
-isex3:
- getexad(context);
- return;
-}
-
-static inline void compare(Context & context) {
- context._sub(context.dl, 'A');
- context._sub(context.dh, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.push(context.cx);
- context.push(context.dx);
- getanyaddir(context);
- context.dx = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.word(context.bx+12), context.cx);
- if (!context.flags.z()) goto comparefin;
- context._cmp(context.data.word(context.bx+14), context.dx);
-comparefin:
- return;
-}
-
-static inline void setuptimeduse(Context & context) {
- context._cmp(context.data.word(328), 0);
- if (!context.flags.z()) goto cantsetup;
- context.data.byte(335) = context.bh;
- context.data.byte(336) = context.bl;
- context.data.word(330) = context.cx;
- context._add(context.dx, context.cx);
- context.data.word(328) = context.dx;
- context.bl = context.al;
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(454);
- context.cx = 66*2;
- context.ax = context.data.word(context.bx);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
- context.data.word(332) = context.es;
- context.data.word(334) = context.bx;
-cantsetup:
- return;
-}
-
-static inline void reminders(Context & context) {
- context._cmp(context.data.byte(184), 24);
- if (!context.flags.z()) goto notinedenslift;
- context._cmp(context.data.byte(148), 44);
- if (!context.flags.z()) goto notinedenslift;
- context._cmp(context.data.byte(2), 0);
- if (!context.flags.z()) goto notfirst;
- context.al = 'D';
- context.ah = 'K';
- context.cl = 'E';
- context.ch = 'Y';
- isryanholding(context);
- if (context.flags.z()) goto forgotone;
- context.al = 'C';
- context.ah = 'S';
- context.cl = 'H';
- context.ch = 'R';
- findexobject(context);
- context._cmp(context.al, 114);
- if (context.flags.z()) goto forgotone;
- context.ax = context.data.word(context.bx+2);
- context._cmp(context.al, 4);
- if (!context.flags.z()) goto forgotone;
- context._cmp(context.ah, 255);
- if (context.flags.z()) goto havegotcard;
- context.cl = 'P';
- context.ch = 'U';
- context.dl = 'R';
- context.dh = 'S';
- context._xchg(context.al, context.ah);
- compare(context);
- if (!context.flags.z()) goto forgotone;
-havegotcard:
- context._add(context.data.byte(2), 1);
-notfirst:
- return;
-forgotone:
- context.al = 50;
- context.bl = 54;
- context.bh = 70;
- context.cx = 48;
- context.dx = 8;
- setuptimeduse(context);
- return;
-notinedenslift:
- return;
-}
-
-static inline void afternewroom(Context & context) {
- context._cmp(context.data.byte(186), 0);
- if (context.flags.z()) goto notnew;
- context.data.word(328) = 0;
- createpanel(context);
- context.data.byte(100) = 0;
- findroominloc(context);
- context._cmp(context.data.byte(63), 1);
- if (context.flags.z()) goto ryansoff;
- context.al = context.data.byte(151);
- context._add(context.al, 12);
- context.ah = context.data.byte(152);
- context._add(context.ah, 12);
- findpathofpoint(context);
- context.data.byte(475) = context.dl;
- findxyfrompath(context);
- context.data.byte(187) = 1;
-ryansoff:
- context.data.byte(62) = 1;
- drawfloor(context);
- context.data.word(98) = 160;
- context.data.byte(186) = 0;
- showicon(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- mainscreen(context);
- getunderzoom(context);
- zoom(context);
- worktoscreenm(context);
- walkintoroom(context);
- reminders(context);
- atmospheres(context);
-notnew:
- return;
-}
-
-static inline void readmouse3(Context & context) {
+static void readmouse3(Context & context) {
context.ax = context.data.word(198);
context.data.word(214) = context.ax;
context.ax = context.data.word(200);
@@ -17057,7 +20087,7 @@ static inline void readmouse3(Context & context) {
return;
}
-static inline void readmouse4(Context & context) {
+static void readmouse4(Context & context) {
context.ax = context.data.word(202);
context.data.word(212) = context.ax;
context.ax = context.data.word(198);
@@ -17075,360 +20105,64 @@ static inline void readmouse4(Context & context) {
return;
}
-static inline void dumpwatch(Context & context) {
- context._cmp(context.data.byte(266), 1);
- if (!context.flags.z()) goto nodumpwatch;
- context.di = 256;
- context.bx = 21;
- context.cl = 40;
- context.ch = 12;
- multidump(context);
- context.data.byte(266) = 0;
-nodumpwatch:
+static void readkey(Context & context) {
+ context.bx = context.data.word(396);
+ context._cmp(context.bx, context.data.word(394));
+ if (context.flags.z()) goto nokey;
+ context._add(context.bx, 1);
+ context._and(context.bx, 15);
+ context.data.word(396) = context.bx;
+ context.di = 5715;
+ context._add(context.di, context.bx);
+ context.al = context.data.byte(context.di);
+ context.data.byte(142) = context.al;
return;
-}
-
-static inline void screenupdate(Context & context) {
- newplace(context);
- mainscreen(context);
- animpointer(context);
- showpointer(context);
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto iswatchingmode;
- context._cmp(context.data.byte(188), 255);
- if (!context.flags.z()) goto finishearly;
-iswatchingmode:
- vsync(context);
- readmouse1(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- autolook(context);
- spriteupdate(context);
- watchcount(context);
- zoom(context);
- showpointer(context);
- context._cmp(context.data.byte(391), 0);
- if (!context.flags.z()) goto finishearly;
- vsync(context);
- readmouse2(context);
- dumppointer(context);
- dumpzoom(context);
- delpointer(context);
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afternewroom(context);
- showpointer(context);
- vsync(context);
- readmouse3(context);
- dumppointer(context);
- dumpmap(context);
- dumptimedtext(context);
- delpointer(context);
- showpointer(context);
- vsync(context);
- readmouse4(context);
- dumppointer(context);
- dumpwatch(context);
- delpointer(context);
-finishearly:
+nokey:
+ context.data.byte(142) = 0;
return;
}
-static inline void greyscalesum(Context & context) {
- context.es = context.data.word(412);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
- context.cx = 256;
-greysumloop1:
- context.push(context.cx);
- context.bx = 0;
- context.al = context.data.byte(context.si);
- context.ah = 0;
- context.cx = 20;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.si+1);
- context.ah = 0;
- context.cx = 59;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.si+2);
+static void convertkey(Context & context) {
+ context._and(context.al, 127);
context.ah = 0;
- context.cx = 11;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = -1;
-greysumloop2:
- context._add(context.al, 1);
- context._sub(context.bx, 100);
- if (!context.flags.c()) goto greysumloop2;
- context.bl = context.al;
- context.al = context.bl;
- context.ah = context.data.byte(348);
- context._cmp(context.al, 0);
- context._add(context.al, context.ah);
-noaddr:
- context._stosb();
- context.ah = context.data.byte(347);
- context.al = context.bl;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto noaddg;
- context._add(context.al, context.ah);
-noaddg:
- context._stosb();
- context.ah = context.data.byte(349);
- context.al = context.bl;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto noaddb;
- context._add(context.al, context.ah);
-noaddb:
- context._stosb();
- context._add(context.si, 3);
- context.cx = context.pop();
- if (--context.cx) goto greysumloop1;
- return;
-}
-
-static inline void endpaltostart(Context & context) {
- context.es = context.data.word(412);
- context.ds = context.data.word(412);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
- context.cx = 768/2;
- while(--context.cx) context._movsw();
- return;
-}
-
-static inline void createpanel(Context & context) {
- context.di = 0;
- context.bx = 8;
- context.ds = context.data.word(410);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 8;
- context.ds = context.data.word(410);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 0;
- context.bx = 104;
- context.ds = context.data.word(410);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 104;
- context.ds = context.data.word(410);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- return;
-}
-
-static inline void createpanel2(Context & context) {
- createpanel(context);
- context.di = 0;
- context.bx = 0;
- context.ds = context.data.word(410);
- context.al = 5;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 0;
- context.ds = context.data.word(410);
- context.al = 5;
- context.ah = 2;
- showframe(context);
- return;
-}
-
-static inline void fadescreenup(Context & context) {
- clearstartpal(context);
- paltoendpal(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 128;
- return;
-}
-
-static inline void hangone(Context & context) {
-hangonloope:
- context.push(context.cx);
- vsync(context);
- context.cx = context.pop();
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto hangonearly;
- if (--context.cx) goto hangonloope;
- return;
-hangonearly:
- context.ax = context.pop();
- context.ax = context.pop();
+ context.di = 5731;
+ context._add(context.di, context.ax);
+ context.al = context.data.byte(context.di);
return;
}
-static inline void rollem(Context & context) {
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- context.ds = context.data.word(402);
- context.si = 0;
- multiget(context);
- context.es = context.data.word(466);
- context.si = 49*2;
- context.ax = context.data.word(context.si);
- context.si = context.ax;
- context._add(context.si, 66*2);
- context.cx = 80;
-endcredits21:
- context.push(context.cx);
- context.bx = 10;
- context.cx = context.data.word(77);
-endcredits22:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.di);
+static void randomnum1(Context & context) {
+ context.push(context.ds);
context.push(context.es);
- context.push(context.bx);
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- context.ds = context.data.word(402);
- context.si = 0;
- multiput(context);
- vsync(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.si = context.pop();
- context.push(context.si);
context.push(context.di);
- context.push(context.es);
context.push(context.bx);
- context.cx = 18;
-onelot2:
context.push(context.cx);
- context.di = 25;
- context.dx = 161;
- context.ax = 0;
- printdirect(context);
- context._add(context.bx, context.data.word(77));
+ randomnumber(context);
context.cx = context.pop();
- if (--context.cx) goto onelot2;
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- multidump(context);
context.bx = context.pop();
- context.es = context.pop();
context.di = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto endearly2;
- context._sub(context.bx, 1);
- if (--context.cx) goto endcredits22;
- context.cx = context.pop();
-looknext2:
- context.al = context.data.byte(context.si);
- context._add(context.si, 1);
- context._cmp(context.al, ':');
- if (context.flags.z()) goto gotnext2;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto gotnext2;
- goto looknext2;
-gotnext2:
- context._cmp(context.data.byte(392), 1);
- if (context.flags.z()) goto endearly;
- if (--context.cx) goto endcredits21;
- context.cx = 120;
- hangone(context);
- return;
-endearly2:
- context.cx = context.pop();
-endearly:
- return;
-}
-
-static inline void rollendcredits2(Context & context) {
- rollem(context);
- return;
-}
-
-static inline void showgun(Context & context) {
- context.data.byte(348) = 0;
- context.data.byte(347) = 0;
- context.data.byte(349) = 0;
- paltostartpal(context);
- paltoendpal(context);
- greyscalesum(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 128;
- context.cx = 130;
- hangon(context);
- endpaltostart(context);
- clearendpal(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 128;
- context.cx = 200;
- hangon(context);
- context.data.byte(531) = 34;
- loadroomssample(context);
- context.data.byte(386) = 0;
- context.dx = 2364;
- loadintotemp(context);
- createpanel2(context);
- context.ds = context.data.word(458);
- context.al = 0;
- context.ah = 0;
- context.di = 100;
- context.bx = 4;
- showframe(context);
- context.ds = context.data.word(458);
- context.al = 1;
- context.ah = 0;
- context.di = 158;
- context.bx = 106;
- showframe(context);
- worktoscreen(context);
- getridoftemp(context);
- fadescreenup(context);
- context.cx = 160;
- hangon(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.dx = 2273;
- loadtemptext(context);
- rollendcredits2(context);
- getridoftemptext(context);
+ context.es = context.pop();
+ context.ds = context.pop();
return;
}
-static inline void fadescreendown(Context & context) {
- paltostartpal(context);
- clearendpal(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 128;
+static void randomnum2(Context & context) {
+ context.push(context.ds);
+ context.push(context.es);
+ context.push(context.di);
+ context.push(context.bx);
+ context.push(context.ax);
+ randomnumber(context);
+ context.cl = context.al;
+ context.ax = context.pop();
+ context.bx = context.pop();
+ context.di = context.pop();
+ context.es = context.pop();
+ context.ds = context.pop();
return;
}
-static inline void hangon(Context & context) {
+static void hangon(Context & context) {
hangonloop:
context.push(context.cx);
vsync(context);
@@ -17437,89 +20171,41 @@ hangonloop:
return;
}
-static inline void paltostartpal(Context & context) {
- context.es = context.data.word(412);
- context.ds = context.data.word(412);
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
- context.cx = 768/2;
- while(--context.cx) context._movsw();
- return;
-}
-
-static inline void clearendpal(Context & context) {
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
- context.cx = 768;
- context.al = 0;
- while(--context.cx) context._stosb();
- return;
-}
-
-static inline void fadescreendowns(Context & context) {
- paltostartpal(context);
- clearendpal(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 64;
- return;
-}
-
-static inline void loadtemptext(Context & context) {
+static void loadtraveltext(Context & context) {
+ context.dx = 2247;
standardload(context);
- context.data.word(466) = context.ax;
+ context.data.word(456) = context.ax;
return;
}
-static inline void twodigitnum(Context & context) {
- context.ah = context.cl;
- context._sub(context.ah, 1);
-numloop1:
- context._add(context.ah, 1);
- context._sub(context.al, 10);
- if (!context.flags.c()) goto numloop1;
- context._add(context.al, 10);
- context._add(context.al, context.cl);
+static void loadintotemp(Context & context) {
+ context.ds = context.cs;
+ standardload(context);
+ context.data.word(458) = context.ax;
return;
}
-static inline void cancelch1(Context & context) {
- context.data.word(521) = 0;
- context.data.byte(515) = 255;
+static void loadintotemp2(Context & context) {
+ context.ds = context.cs;
+ standardload(context);
+ context.data.word(460) = context.ax;
return;
}
-static inline void loadroomssample(Context & context) {
- context.al = context.data.byte(531);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto loadedalready;
- context._cmp(context.al, context.data.byte(530));
- if (context.flags.z()) goto loadedalready;
- context.data.byte(530) = context.al;
- context.al = context.data.byte(530);
- context.cl = '0';
- twodigitnum(context);
- context.di = 1909;
- context._xchg(context.al, context.ah);
- context.data.word(context.di+10) = context.ax;
- context.dx = context.di;
- loadsecondsample(context);
-loadedalready:
+static void loadintotemp3(Context & context) {
+ context.ds = context.cs;
+ standardload(context);
+ context.data.word(462) = context.ax;
return;
}
-static inline void readheader(Context & context) {
- context.ds = context.cs;
- context.dx = 5881;
- context.cx = 5958-context.data.byte(5881);
- readfromfile(context);
- context.es = context.cs;
- context.di = 5952;
+static void loadtempcharset(Context & context) {
+ standardload(context);
+ context.data.word(406) = context.ax;
return;
}
-static inline void standardload(Context & context) {
+static void standardload(Context & context) {
openfile(context);
readheader(context);
context.bx = context.data.word(context.di);
@@ -17537,1317 +20223,410 @@ static inline void standardload(Context & context) {
return;
}
-static inline void loadintotemp(Context & context) {
- context.ds = context.cs;
+static void loadtemptext(Context & context) {
standardload(context);
- context.data.word(458) = context.ax;
- return;
-}
-
-static inline void showmonk(Context & context) {
- context.al = 0;
- context.ah = 128;
- context.di = 160;
- context.bx = 72;
- context.ds = context.data.word(458);
- showframe(context);
- return;
-}
-
-static inline void getridoftemp(Context & context) {
- context.es = context.data.word(458);
- deallocatemem(context);
+ context.data.word(466) = context.ax;
return;
}
-static inline void monkspeaking(Context & context) {
- context.data.byte(531) = 35;
+static void loadroom(Context & context) {
+ context.data.byte(74) = 1;
+ context.data.word(328) = 0;
+ context.data.word(138) = 0;
+ context.data.word(121) = 104;
+ context.data.word(123) = 38;
+ context.data.word(79) = 13;
+ context.data.word(81) = 182;
+ context.data.byte(82) = 240;
+ context.al = context.data.byte(188);
+ context.data.byte(9) = context.al;
+ getroomdata(context);
+ startloading(context);
loadroomssample(context);
- context.dx = 2377;
- loadintotemp(context);
- clearwork(context);
- showmonk(context);
- worktoscreen(context);
- context.data.byte(386) = 7;
- context.data.byte(388) = -1;
- context.data.byte(387) = 0;
- context.al = 12;
- context.ah = 255;
- playchannel0(context);
- fadescreenups(context);
- context.cx = 300;
- hangon(context);
- context.al = 40;
-nextmonkspeak:
- context.push(context.ax);
- context.ah = 0;
- context.si = context.ax;
- context._add(context.si, context.si);
- context.es = context.data.word(466);
- context.ax = context.data.word(context.si);
- context._add(context.ax, 66*2);
- context.si = context.ax;
-nextbit:
- context.di = 36;
- context.bx = 140;
- context.dl = 239;
- printdirect(context);
- context.push(context.ax);
- context.push(context.si);
- context.push(context.es);
- worktoscreen(context);
- clearwork(context);
- showmonk(context);
- context.cx = 240;
- hangon(context);
- context.es = context.pop();
- context.si = context.pop();
- context.ax = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto nextbit;
- context.ax = context.pop();
- context._add(context.al, 1);
- context._cmp(context.al, 44);
- if (!context.flags.z()) goto nextmonkspeak;
- context.data.byte(388) = 1;
- context.data.byte(387) = 7;
- fadescreendowns(context);
- context.cx = 300;
- hangon(context);
- getridoftemp(context);
- return;
-}
-
-static inline void loadintroroom(Context & context) {
- context.data.byte(139) = 0;
- context.data.byte(9) = 255;
- loadroom(context);
- context.data.word(121) = 72;
- context.data.word(123) = 16;
- clearsprites(context);
- context.data.byte(61) = 0;
- context.data.byte(142) = '0';
- context.data.byte(105) = 0;
- clearwork(context);
- context.data.byte(62) = 1;
- drawfloor(context);
- reelsonscreen(context);
- spriteupdate(context);
- printsprites(context);
- worktoscreen(context);
+ switchryanon(context);
+ drawflags(context);
+ getdimension(context);
return;
}
-static inline void clearstartpal(Context & context) {
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3);
- context.cx = 256;
-wholeloop1:
- context.ax = 0;
- context._stosw();
- context.al = 0;
- context._stosb();
- if (--context.cx) goto wholeloop1;
+static void loadroomssample(Context & context) {
+ context.al = context.data.byte(531);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto loadedalready;
+ context._cmp(context.al, context.data.byte(530));
+ if (context.flags.z()) goto loadedalready;
+ context.data.byte(530) = context.al;
+ context.al = context.data.byte(530);
+ context.cl = '0';
+ twodigitnum(context);
+ context.di = 1909;
+ context._xchg(context.al, context.ah);
+ context.data.word(context.di+10) = context.ax;
+ context.dx = context.di;
+ loadsecondsample(context);
+loadedalready:
return;
}
-static inline void paltoendpal(Context & context) {
- context.es = context.data.word(412);
- context.ds = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768;
- context.si = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768;
- context.cx = 768/2;
- while(--context.cx) context._movsw();
- return;
-}
-
-static inline void fadescreenups(Context & context) {
- clearstartpal(context);
- paltoendpal(context);
- context.data.byte(344) = 1;
- context.data.byte(346) = 63;
- context.data.byte(343) = 0;
- context.data.byte(345) = 64;
+static void getridofreels(Context & context) {
+ context._cmp(context.data.byte(74), 0);
+ if (context.flags.z()) goto dontgetrid;
+ context.es = context.data.word(430);
+ deallocatemem(context);
+ context.es = context.data.word(432);
+ deallocatemem(context);
+ context.es = context.data.word(434);
+ deallocatemem(context);
+dontgetrid:
return;
}
-static inline void playchannel0(Context & context) {
- context._cmp(context.data.byte(378), 255);
- if (context.flags.z()) goto dontbother4;
- context.push(context.es);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- context.push(context.si);
- context.data.byte(507) = context.al;
- context.es = context.data.word(420);
- context._cmp(context.al, 12);
- if (context.flags.c()) goto notsecondbank;
- context.es = context.data.word(422);
- context._sub(context.al, 12);
-notsecondbank:
- context.data.byte(508) = context.ah;
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context.data.word(502) = context.ax;
- context.ax = context.data.word(context.bx+1);
- context.data.word(504) = context.ax;
- context.ax = context.data.word(context.bx+3);
- context.data.word(506) = context.ax;
- context._cmp(context.data.byte(508), 0);
- if (context.flags.z()) goto nosetloop;
- context.ax = context.data.word(502);
- context.data.word(510) = context.ax;
- context.ax = context.data.word(504);
- context.data.word(512) = context.ax;
- context.ax = context.data.word(506);
- context.data.word(514) = context.ax;
-nosetloop:
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
-dontbother4:
+static void getridofall(Context & context) {
+ context.es = context.data.word(416);
+ deallocatemem(context);
+ context.es = context.data.word(444);
+ deallocatemem(context);
+ context.es = context.data.word(430);
+ deallocatemem(context);
+ context.es = context.data.word(432);
+ deallocatemem(context);
+ context.es = context.data.word(434);
+ deallocatemem(context);
+ context.es = context.data.word(450);
+ deallocatemem(context);
+ context.es = context.data.word(448);
+ deallocatemem(context);
+ context.es = context.data.word(440);
+ deallocatemem(context);
+ context.es = context.data.word(442);
+ deallocatemem(context);
+ context.es = context.data.word(436);
+ deallocatemem(context);
+ context.es = context.data.word(446);
+ deallocatemem(context);
+ context.es = context.data.word(438);
+ deallocatemem(context);
return;
}
-static inline void cancelch0(Context & context) {
- context.data.byte(508) = 0;
- context.data.word(506) = 0;
- context.data.byte(507) = 255;
+static void restorereels(Context & context) {
+ context._cmp(context.data.byte(74), 0);
+ if (context.flags.z()) goto dontrestore;
+ context.al = context.data.byte(184);
+ getroomdata(context);
+ context.dx = context.bx;
+ openfile(context);
+ readheader(context);
+ dontloadseg(context);
+ dontloadseg(context);
+ dontloadseg(context);
+ dontloadseg(context);
+ allocateload(context);
+ context.data.word(430) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(432) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(434) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ closefile(context);
+dontrestore:
return;
}
-static inline void atmospheres(Context & context) {
- context.cl = context.data.byte(148);
- context.ch = context.data.byte(149);
- context.bx = 5073;
-nextatmos:
- context.al = context.data.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto nomoreatmos;
- context._cmp(context.al, context.data.byte(184));
- if (!context.flags.z()) goto wrongatmos;
- context.ax = context.data.word(context.bx+1);
- context._cmp(context.ax, context.cx);
- if (!context.flags.z()) goto wrongatmos;
- context.ax = context.data.word(context.bx+3);
- context._cmp(context.al, context.data.byte(507));
- if (context.flags.z()) goto playingalready;
- context._cmp(context.data.byte(9), 45);
- if (!context.flags.z()) goto notweb;
- context._cmp(context.data.word(23), 45);
- if (context.flags.z()) goto wrongatmos;
-notweb:
- playchannel0(context);
- context._cmp(context.data.byte(184), 2);
- context._cmp(context.data.byte(149), 0);
- if (context.flags.z()) goto fullvol;
- if (!context.flags.z()) goto notlouisvol;
- context._cmp(context.data.byte(149), 10);
- if (!context.flags.z()) goto notlouisvol;
- context._cmp(context.data.byte(148), 22);
- if (!context.flags.z()) goto notlouisvol;
- context.data.byte(386) = 5;
-notlouisvol:
-playingalready:
- context._cmp(context.data.byte(184), 2);
- if (!context.flags.z()) goto notlouisvol2;
- context._cmp(context.data.byte(148), 22);
- if (context.flags.z()) goto louisvol;
- context._cmp(context.data.byte(148), 11);
- if (!context.flags.z()) goto notlouisvol2;
-fullvol:
- context.data.byte(386) = 0;
-notlouisvol2:
- return;
-louisvol:
- context.data.byte(386) = 5;
- return;
-wrongatmos:
- context._add(context.bx, 5);
- goto nextatmos;
-nomoreatmos:
- cancelch0(context);
+static void restoreall(Context & context) {
+ context.al = context.data.byte(9);
+ getroomdata(context);
+ context.dx = context.bx;
+ openfile(context);
+ readheader(context);
+ allocateload(context);
+ context.ds = context.ax;
+ context.data.word(416) = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ context.ds = context.data.word(400);
+ context.dx = 0;
+ context.cx = 132*66;
+ context.al = 0;
+ fillspace(context);
+ loadseg(context);
+ sortoutmap(context);
+ allocateload(context);
+ context.data.word(444) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ dontloadseg(context);
+ allocateload(context);
+ context.data.word(430) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(432) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(434) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(450) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(448) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(440) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(442) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(436) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(446) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ dontloadseg(context);
+ allocateload(context);
+ context.data.word(438) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ closefile(context);
+ setallchanges(context);
return;
}
-static inline void spriteupdate(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
- context.al = context.data.byte(63);
- context.data.byte(context.bx+31) = context.al;
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
- context.cx = 16;
-_tmp18:
- context.push(context.cx);
- context.push(context.bx);
- context.ax = context.data.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto _tmp18a;
+static void sortoutmap(Context & context) {
context.push(context.es);
- context.push(context.ds);
- context.cx = context.data.word(context.bx+2);
- context.data.word(context.bx+24) = context.cx;
- __dispatch_call(context, context.ax);
- context.ds = context.pop();
- context.es = context.pop();
-_tmp18a:
- context.bx = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.byte(186), 1);
- if (context.flags.z()) goto _tmp18b;
- context._add(context.bx, 32);
- if (--context.cx) goto _tmp18;
-_tmp18b:
- return;
-}
-
-static inline void maptopanel(Context & context) {
- context.di = context.data.word(125);
- context._add(context.di, context.data.word(117));
- context.bx = context.data.word(127);
- context._add(context.bx, context.data.word(119));
- context.ds = context.data.word(402);
+ context.push(context.di);
+ context.ds = context.data.word(400);
context.si = 0;
- context.cl = context.data.byte(128);
- context.ch = context.data.byte(129);
- multiput(context);
- return;
-}
-
-static inline void deleverything(Context & context) {
- context.al = context.data.byte(129);
- context.ah = 0;
- context._add(context.ax, context.data.word(123));
- context._cmp(context.ax, 182);
- if (!context.flags.c()) goto bigroom;
- maptopanel(context);
- return;
-bigroom:
- context._sub(context.data.byte(129), 8);
- maptopanel(context);
- context._add(context.data.byte(129), 8);
- return;
-}
-
-static inline void printasprite(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- context.si = context.bx;
- context.ds = context.data.word(context.si+6);
- context.al = context.data.byte(context.si+11);
- context.ah = 0;
- context._cmp(context.al, 220);
- if (context.flags.c()) goto notnegative1;
- context.ah = 255;
-notnegative1:
- context.bx = context.ax;
- context._add(context.bx, context.data.word(119));
- context.al = context.data.byte(context.si+10);
- context.ah = 0;
- context._cmp(context.al, 220);
- if (context.flags.c()) goto notnegative2;
- context.ah = 255;
-notnegative2:
- context.di = context.ax;
- context._add(context.di, context.data.word(117));
- context.al = context.data.byte(context.si+15);
- context.ah = 0;
- context._cmp(context.data.byte(context.si+30), 0);
- if (context.flags.z()) goto steadyframe;
- context.ah = 8;
-steadyframe:
- context._cmp(context.data.byte(182), 6);
- if (!context.flags.z()) goto notquickp;
-notquickp:
- showframe(context);
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void printsprites(Context & context) {
- context.es = context.data.word(412);
- context.cx = 0;
-priorityloop:
- context.push(context.cx);
- context.data.byte(182) = context.cl;
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
- context.cx = 16;
-prtspriteloop:
+ context.es = context.data.word(418);
+ context.di = 0;
+ context.cx = 60;
+blimey:
context.push(context.cx);
- context.push(context.bx);
- context.ax = context.data.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto skipsprite;
- context.al = context.data.byte(182);
- context._cmp(context.al, context.data.byte(context.bx+23));
- if (!context.flags.z()) goto skipsprite;
- context._cmp(context.data.byte(context.bx+31), 1);
- if (context.flags.z()) goto skipsprite;
- printasprite(context);
-skipsprite:
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 32);
- if (--context.cx) goto prtspriteloop;
+ context.push(context.si);
+ context.cx = 66;
+ while(--context.cx) context._movsb();
+ context.si = context.pop();
context.cx = context.pop();
- context._add(context.cx, 1);
- context._cmp(context.cx, 7);
- if (!context.flags.z()) goto priorityloop;
- return;
-}
-
-static inline void undertextline(Context & context) {
- context.di = context.data.word(79);
- context.bx = context.data.word(81);
- context._sub(context.bx, 3);
- context.ds = context.data.word(412);
- context.si = 0;
- context.cl = 228;
- context.ch = 13;
- multiget(context);
- return;
-}
-
-static inline void reconstruct(Context & context) {
- context._cmp(context.data.byte(130), 0);
- if (context.flags.z()) goto noneedtorecon;
- context.data.byte(62) = 1;
- drawfloor(context);
- spriteupdate(context);
- printsprites(context);
- context._cmp(context.data.byte(184), 20);
- if (!context.flags.z()) goto notfudge;
- undertextline(context);
-notfudge:
- context.data.byte(130) = 0;
-noneedtorecon:
- return;
-}
-
-static inline void updatepeople(Context & context) {
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5);
- context.data.word(18) = context.di;
- context.cx = 12*5;
- context.al = 255;
- while(--context.cx) context._stosb();
- context._add(context.data.word(138), 1);
- context.es = context.cs;
- context.bx = 537;
- context.di = 1003;
-updateloop:
- context.al = context.data.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto endupdate;
- context._cmp(context.al, context.data.byte(184));
- if (!context.flags.z()) goto notinthisroom;
- context.cx = context.data.word(context.bx+1);
- context._cmp(context.cl, context.data.byte(148));
- if (!context.flags.z()) goto notinthisroom;
- context._cmp(context.ch, context.data.byte(149));
- if (!context.flags.z()) goto notinthisroom;
- context.push(context.di);
- context.ax = context.data.word(context.di);
- __dispatch_call(context, context.ax);
+ context._add(context.si, 132);
+ if (--context.cx) goto blimey;
context.di = context.pop();
-notinthisroom:
- context._add(context.bx, 8);
- context._add(context.di, 2);
- goto updateloop;
-endupdate:
- return;
-}
-
-static inline void getreelstart(Context & context) {
- context.ax = context.data.word(239);
- context.cx = 40;
- context._mul(context.cx);
- context.es = context.data.word(450);
- context.si = context.ax;
- context._add(context.si, 0+(36*144));
- return;
-}
-
-static inline void placesetobject(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- context.cl = 0;
- context.ch = 0;
- findormake(context);
- getsetad(context);
- context.data.byte(context.bx+58) = 0;
- context.bx = context.pop();
context.es = context.pop();
return;
}
-static inline void getsetad(Context & context) {
- context.ah = 0;
- context.bx = 64;
- context._mul(context.bx);
- context.bx = context.ax;
- context.es = context.data.word(428);
- return;
-}
-
-static inline void removesetobject(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- context.cl = 255;
- context.ch = 0;
- findormake(context);
- getsetad(context);
- context.data.byte(context.bx+58) = 255;
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void findormake(Context & context) {
- context.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);
+static void startloading(Context & context) {
+ context.data.byte(64) = 0;
+ context.al = context.data.byte(context.bx+13);
+ context.data.byte(531) = context.al;
+ context.al = context.data.byte(context.bx+15);
+ context.data.byte(148) = context.al;
+ context.al = context.data.byte(context.bx+16);
+ context.data.byte(149) = context.al;
+ context.al = context.data.byte(context.bx+20);
+ context.data.byte(35) = context.al;
+ context.al = context.data.byte(context.bx+21);
+ context.data.byte(475) = context.al;
+ context.data.byte(478) = context.al;
+ context.data.byte(477) = context.al;
+ context.al = context.data.byte(context.bx+22);
+ context.data.byte(133) = context.al;
+ context.data.byte(135) = context.al;
+ context.al = context.data.byte(context.bx+23);
+ context.data.byte(39) = context.al;
+ context.al = context.data.byte(context.bx+24);
+ context.data.byte(36) = context.al;
+ context.al = context.data.byte(context.bx+25);
+ context.data.byte(38) = context.al;
+ context.data.byte(65) = -1;
+ context.al = context.data.byte(context.bx+27);
context.push(context.ax);
- context.es = context.data.word(412);
+ context.al = context.data.byte(context.bx+31);
context.ah = context.data.byte(184);
-changeloop:
- context._cmp(context.data.byte(context.bx), 255);
- if (context.flags.z()) goto haventfound;
- context._cmp(context.ax, context.data.word(context.bx));
- if (!context.flags.z()) goto nofoundchange;
- context._cmp(context.ch, context.data.byte(context.bx+3));
- if (context.flags.z()) goto foundchange;
-nofoundchange:
- context._add(context.bx, 4);
- goto changeloop;
-foundchange:
- context.ax = context.pop();
- context.data.byte(context.bx+2) = context.cl;
- return;
-haventfound:
- context.data.word(context.bx) = context.ax;
- context.data.word(context.bx+2) = context.cx;
+ context.data.byte(184) = context.al;
+ context.dx = context.bx;
+ openfile(context);
+ readheader(context);
+ allocateload(context);
+ context.ds = context.ax;
+ context.data.word(416) = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ context.ds = context.data.word(400);
+ context.dx = 0;
+ context.cx = 132*66;
+ context.al = 0;
+ fillspace(context);
+ loadseg(context);
+ sortoutmap(context);
+ allocateload(context);
+ context.data.word(444) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ context.ds = context.data.word(428);
+ context.dx = 0;
+ context.cx = 64*128;
+ context.al = 255;
+ fillspace(context);
+ loadseg(context);
+ allocateload(context);
+ context.data.word(430) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(432) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(434) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(450) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(448) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(440) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(442) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(436) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ allocateload(context);
+ context.data.word(446) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ context.ds = context.data.word(426);
+ context.dx = 0;
+ context.cx = 16*80;
+ context.al = 255;
+ fillspace(context);
+ loadseg(context);
+ allocateload(context);
+ context.data.word(438) = context.ax;
+ context.ds = context.ax;
+ context.dx = 0;
+ loadseg(context);
+ closefile(context);
+ findroominloc(context);
+ deletetaken(context);
+ setallchanges(context);
+ autoappear(context);
+ context.al = context.data.byte(188);
+ getroomdata(context);
+ context.data.byte(65) = -1;
+ context.data.byte(56) = 0;
+ context.data.word(98) = 160;
+ context.data.byte(188) = 255;
+ context.data.byte(492) = 254;
context.ax = context.pop();
- return;
-}
-
-static inline void placefreeobject(Context & context) {
- context.push(context.es);
- context.push(context.bx);
- context.cl = 0;
- context.ch = 1;
- findormake(context);
- getfreead(context);
- context.data.byte(context.bx+2) = 0;
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void getfreead(Context & context) {
- context.ah = 0;
- context.cl = 4;
- context._shl(context.ax, context.cl);
- context.bx = context.ax;
- context.es = context.data.word(426);
- return;
-}
-
-static inline void removefreeobject(Context & context) {
- context.push(context.es);
+ context._cmp(context.al, 255);
+ if (context.flags.z()) goto dontwalkin;
+ context.data.byte(475) = context.al;
context.push(context.bx);
- getfreead(context);
- context.data.byte(context.bx+2) = 255;
+ autosetwalk(context);
context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void switchryanoff(Context & context) {
- context.data.byte(63) = 1;
- return;
-}
-
-static inline void switchryanon(Context & context) {
- context.data.byte(63) = 255;
- return;
-}
-
-static inline void movemap(Context & context) {
- context._cmp(context.ah, 32);
- if (!context.flags.z()) goto notmapup2;
- context._sub(context.data.byte(149), 20);
- context.data.byte(186) = 1;
- return;
-notmapup2:
- context._cmp(context.ah, 16);
- if (!context.flags.z()) goto notmapupspec;
- context._sub(context.data.byte(149), 10);
- context.data.byte(186) = 1;
- return;
-notmapupspec:
- context._cmp(context.ah, 8);
- if (!context.flags.z()) goto notmapdownspec;
- context._add(context.data.byte(149), 10);
- context.data.byte(186) = 1;
- return;
-notmapdownspec:
- context._cmp(context.ah, 2);
- if (!context.flags.z()) goto notmaprightspec;
- context._add(context.data.byte(148), 11);
- context.data.byte(186) = 1;
- return;
-notmaprightspec:
- context._sub(context.data.byte(148), 11);
- context.data.byte(186) = 1;
- return;
-}
-
-static inline void dealwithspecial(Context & context) {
- context._sub(context.al, 220);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto notplset;
- context.al = context.ah;
- placesetobject(context);
- context.data.byte(130) = 1;
- return;
-notplset:
- context._cmp(context.al, 1);
- if (!context.flags.z()) goto notremset;
- context.al = context.ah;
- removesetobject(context);
- context.data.byte(130) = 1;
- return;
-notremset:
- context._cmp(context.al, 2);
- if (!context.flags.z()) goto notplfree;
- context.al = context.ah;
- placefreeobject(context);
- context.data.byte(130) = 1;
- return;
-notplfree:
- context._cmp(context.al, 3);
- if (!context.flags.z()) goto notremfree;
- context.al = context.ah;
- removefreeobject(context);
- context.data.byte(130) = 1;
- return;
-notremfree:
- context._cmp(context.al, 4);
- if (!context.flags.z()) goto notryanoff;
- switchryanoff(context);
- return;
-notryanoff:
- context._cmp(context.al, 5);
- if (!context.flags.z()) goto notryanon;
- context.data.byte(135) = context.ah;
- context.data.byte(133) = context.ah;
- switchryanon(context);
- return;
-notryanon:
- context._cmp(context.al, 6);
- if (!context.flags.z()) goto notchangeloc;
- context.data.byte(188) = context.ah;
- return;
-notchangeloc:
- movemap(context);
- return;
-}
-
-static inline void findsource(Context & context) {
- context.ax = context.data.word(160);
- context._cmp(context.ax, 160);
- if (!context.flags.c()) goto over1000;
- context.ds = context.data.word(430);
- context.data.word(244) = 0;
- return;
-over1000:
- context._cmp(context.ax, 320);
- if (!context.flags.c()) goto over1001;
- context.ds = context.data.word(432);
- context.data.word(244) = 160;
- return;
-over1001:
- context.ds = context.data.word(434);
- context.data.word(244) = 320;
- return;
-}
-
-static inline void showreelframe(Context & context) {
- context.al = context.data.byte(context.si+2);
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, context.data.word(117));
- context.al = context.data.byte(context.si+3);
- context.bx = context.ax;
- context._add(context.bx, context.data.word(119));
- context.ax = context.data.word(context.si);
- context.data.word(160) = context.ax;
- findsource(context);
- context.ax = context.data.word(160);
- context._sub(context.ax, context.data.word(244));
- context.ah = 8;
- showframe(context);
- return;
-}
-
-static inline void soundonreels(Context & context) {
- context.bl = context.data.byte(184);
- context._add(context.bl, context.bl);
- context._xor(context.bh, context.bh);
- context._add(context.bx, 1254);
- context.si = context.data.word(context.bx);
-reelsoundloop:
- context.al = context.data.byte(context.si);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto endreelsound;
- context.ax = context.data.word(context.si+1);
- context._cmp(context.ax, context.data.word(239));
- if (!context.flags.z()) goto skipreelsound;
- context._cmp(context.ax, context.data.word(351));
- if (context.flags.z()) goto skipreelsound;
- context.data.word(351) = context.ax;
- context.al = context.data.byte(context.si);
- context._cmp(context.al, 64);
- if (context.flags.c()) { playchannel1(context); return; };
- context._cmp(context.al, 128);
- if (context.flags.c()) goto channel0once;
- context._and(context.al, 63);
- context.ah = 255;
- { playchannel0(context); return; };
-channel0once:
- context._and(context.al, 63);
- context.ah = 0;
- { playchannel0(context); return; };
-skipreelsound:
- context._add(context.si, 3);
- goto reelsoundloop;
-endreelsound:
- context.ax = context.data.word(351);
- context._cmp(context.ax, context.data.word(239));
- if (context.flags.z()) goto nochange2;
- context.data.word(351) = -1;
-nochange2:
+dontwalkin:
+ findxyfrompath(context);
return;
}
-static inline void plotreel(Context & context) {
- getreelstart(context);
-retryreel:
- context.push(context.es);
- context.push(context.si);
- context.ax = context.data.word(context.si+2);
- context._cmp(context.al, 220);
- if (context.flags.c()) goto normalreel;
- context._cmp(context.al, 255);
- if (context.flags.z()) goto normalreel;
- dealwithspecial(context);
- context._add(context.data.word(239), 1);
- context.si = context.pop();
- context.es = context.pop();
- context._add(context.si, 40);
- goto retryreel;
-normalreel:
- context.cx = 8;
-plotloop:
+static void disablepath(Context & context) {
context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- context.ax = context.data.word(context.si);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto notplot;
- showreelframe(context);
-notplot:
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context._add(context.si, 5);
- if (--context.cx) goto plotloop;
- soundonreels(context);
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void checkforshake(Context & context) {
- context._cmp(context.data.byte(184), 26);
- if (!context.flags.z()) goto notstartshake;
- context._cmp(context.ax, 104);
- if (!context.flags.z()) goto notstartshake;
- context.data.byte(68) = -1;
-notstartshake:
- return;
-}
-
-static inline void getroomspaths(Context & context) {
- context.al = context.data.byte(185);
+ context._xchg(context.al, context.ah);
+ context.cx = -6;
+looky2:
+ context._add(context.cx, 6);
+ context._sub(context.al, 10);
+ if (!context.flags.c()) goto looky2;
+ context.al = context.ah;
+ context._sub(context.cx, 1);
+lookx2:
+ context._add(context.cx, 1);
+ context._sub(context.al, 11);
+ if (!context.flags.c()) goto lookx2;
+ context.al = context.cl;
context.ah = 0;
context.cx = 144;
context._mul(context.cx);
context.es = context.data.word(450);
context.bx = 0;
context._add(context.bx, context.ax);
- return;
-}
-
-static inline void checkdest(Context & context) {
- context.push(context.bx);
- context._add(context.bx, 12*8);
- context.ah = context.data.byte(475);
- context.cl = 4;
- context._shl(context.ah, context.cl);
- context.al = context.data.byte(478);
- context.cl = 24;
- context.ch = context.data.byte(478);
-checkdestloop:
- context.dh = context.data.byte(context.bx);
- context._and(context.dh, 0b11110000);
- context.dl = context.data.byte(context.bx);
- context._and(context.dl, 0b00001111);
- context._cmp(context.ax, context.dx);
- if (!context.flags.z()) goto nextcheck;
- context.al = context.data.byte(context.bx+1);
- context._and(context.al, 15);
- context.data.byte(478) = context.al;
- context.bx = context.pop();
- return;
-nextcheck:
- context.dl = context.data.byte(context.bx);
- context._and(context.dl, 0b11110000);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context.dh = context.data.byte(context.bx);
- context._and(context.dh, 0b00001111);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._cmp(context.ax, context.dx);
- if (!context.flags.z()) goto nextcheck2;
- context.ch = context.data.byte(context.bx+1);
- context._and(context.ch, 15);
-nextcheck2:
- context._add(context.bx, 2);
- context._sub(context.cl, 1);
- if (!context.flags.z()) goto checkdestloop;
- context.data.byte(478) = context.ch;
- context.bx = context.pop();
- return;
-}
-
-static inline void workoutframes(Context & context) {
- context.bx = context.data.word(480);
- context._add(context.bx, 32);
- context.ax = context.data.word(484);
- context._add(context.ax, 32);
- context._sub(context.bx, context.ax);
- if (!context.flags.c()) goto notneg1;
- context._neg(context.bx);
-notneg1:
- context.cx = context.data.word(482);
- context._add(context.cx, 32);
- context.ax = context.data.word(486);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c()) goto notneg2;
- context._neg(context.cx);
-notneg2:
- context._cmp(context.bx, context.cx);
- if (!context.flags.c()) goto tendstohoriz;
- context.dl = 2;
- context.ax = context.cx;
- context._shr(context.ax, 1);
- context._cmp(context.bx, context.ax);
- if (context.flags.c()) goto gotquad;
- context.dl = 1;
- goto gotquad;
-tendstohoriz:
- context.dl = 0;
- context.ax = context.bx;
- context._shr(context.ax, 1);
- context._cmp(context.cx, context.ax);
- if (context.flags.c()) goto gotquad;
- context.dl = 1;
- goto gotquad;
-gotquad:
- context.bx = context.data.word(480);
- context._add(context.bx, 32);
- context.ax = context.data.word(484);
- context._add(context.ax, 32);
- context._sub(context.bx, context.ax);
- if (context.flags.c()) goto isinright;
-isinleft:
- context.cx = context.data.word(482);
- context._add(context.cx, 32);
- context.ax = context.data.word(486);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c()) goto topleft;
- context._cmp(context.dl, 1);
- if (context.flags.z()) goto noswap1;
- context._xor(context.dl, 2);
-noswap1:
- context._add(context.dl, 4);
- goto success;
-topleft:
- context._add(context.dl, 6);
- goto success;
-isinright:
- context.cx = context.data.word(482);
- context._add(context.cx, 32);
- context.ax = context.data.word(486);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c()) goto botright;
- context._add(context.dl, 2);
- goto success;
-botright:
- context._cmp(context.dl, 1);
- if (context.flags.z()) goto noswap2;
- context._xor(context.dl, 2);
-noswap2:
-success:
- context._and(context.dl, 7);
- context.data.byte(135) = context.dl;
- context.data.byte(136) = 0;
- return;
-}
-
-static inline void bresenhams(Context & context) {
- workoutframes(context);
- context.dx = context.ds;
- context.es = context.dx;
- context.di = 8344;
- context.si = 1;
- context.data.byte(493) = 0;
- context.cx = context.data.word(484);
- context._sub(context.cx, context.data.word(480));
- if (context.flags.z()) goto vertline;
- if (!context.flags.s()) goto line1;
- context._neg(context.cx);
- context.bx = context.data.word(484);
- context._xchg(context.bx, context.data.word(480));
- context.data.word(484) = context.bx;
- context.bx = context.data.word(486);
- context._xchg(context.bx, context.data.word(482));
- context.data.word(486) = context.bx;
- context.data.byte(493) = 1;
-line1:
- context.bx = context.data.word(486);
- context._sub(context.bx, context.data.word(482));
- if (context.flags.z()) goto horizline;
- if (!context.flags.s()) goto line3;
- context._neg(context.bx);
- context._neg(context.si);
-line3:
- context.push(context.si);
- context.data.byte(491) = 0;
- context._cmp(context.bx, context.cx);
- if (context.flags.le()) goto line4;
- context.data.byte(491) = 1;
- context._xchg(context.bx, context.cx);
-line4:
- context._shl(context.bx, 1);
- context.data.word(488) = context.bx;
- context._sub(context.bx, context.cx);
- context.si = context.bx;
- context._sub(context.bx, context.cx);
- context.data.word(490) = context.bx;
- context.ax = context.data.word(480);
- context.bx = context.data.word(482);
- context.ah = context.bl;
- context._add(context.cx, 1);
- context.bx = context.pop();
- context._cmp(context.data.byte(491), 1);
- if (context.flags.z()) goto hislope;
- goto loslope;
-vertline:
- context.ax = context.data.word(482);
- context.bx = context.data.word(486);
- context.cx = context.bx;
- context._sub(context.cx, context.ax);
- if (!context.flags.ge()) goto line31;
- context._neg(context.cx);
- context.ax = context.bx;
- context.data.byte(493) = 1;
-line31:
- context._add(context.cx, 1);
- context.bx = context.data.word(480);
- context._xchg(context.ax, context.bx);
- context.ah = context.bl;
- context.bx = context.si;
-line32:
- context._stosw();
- context._add(context.ah, context.bl);
- if (--context.cx) goto line32;
- goto lineexit;
-horizline:
- context.ax = context.data.word(480);
- context.bx = context.data.word(482);
- context.ah = context.bl;
- context._add(context.cx, 1);
-horizloop:
- context._stosw();
- context._add(context.al, 1);
- if (--context.cx) goto horizloop;
- goto lineexit;
-loslope:
-loloop:
- context._stosw();
- context._add(context.al, 1);
- context._or(context.si, context.si);
- if (!context.flags.s()) goto line12;
- context._add(context.si, context.data.word(488));
- if (--context.cx) goto loloop;
- goto lineexit;
-line12:
- context._add(context.si, context.data.word(490));
- context._add(context.ah, context.bl);
- if (--context.cx) goto loloop;
- goto lineexit;
-hislope:
-hiloop:
- context._stosw();
- context._add(context.ah, context.bl);
- context._or(context.si, context.si);
- if (!context.flags.s()) goto line23;
- context._add(context.si, context.data.word(488));
- if (--context.cx) goto hiloop;
- goto lineexit;
-line23:
- context._add(context.si, context.data.word(490));
- context._add(context.al, 1);
- if (--context.cx) goto hiloop;
-lineexit:
- context._sub(context.di, 8344);
- context.ax = context.di;
- context._shr(context.ax, 1);
- context.data.byte(494) = context.al;
- return;
-}
-
-static inline void autosetwalk(Context & context) {
- context.al = context.data.byte(475);
- context._cmp(context.data.byte(477), context.al);
- if (!context.flags.z()) goto notsamealready;
- return;
-notsamealready:
- getroomspaths(context);
- checkdest(context);
- context.push(context.bx);
- context.al = context.data.byte(475);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(480) = context.ax;
- context.al = context.data.byte(context.bx+1);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(482) = context.ax;
- context.bx = context.pop();
- context.al = context.data.byte(478);
+ context.ax = context.pop();
context.ah = 0;
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(484) = context.ax;
- context.al = context.data.byte(context.bx+1);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(486) = context.ax;
- bresenhams(context);
- context._cmp(context.data.byte(493), 0);
- if (context.flags.z()) goto normalline;
- context.al = context.data.byte(494);
- context._sub(context.al, 1);
- context.data.byte(492) = context.al;
- context.data.byte(493) = 1;
- return;
-normalline:
- context.data.byte(492) = 0;
+ context.al = 0;
+ context.data.byte(context.bx+6) = context.al;
return;
}
-static inline void watchreel(Context & context) {
- context._cmp(context.data.word(23), -1);
- if (context.flags.z()) goto notplayingreel;
+static void findxyfrompath(Context & context) {
+ getroomspaths(context);
context.al = context.data.byte(475);
- context._cmp(context.al, context.data.byte(477));
- if (!context.flags.z()) goto waitstopwalk;
- context.al = context.data.byte(135);
- context._cmp(context.al, context.data.byte(133));
- if (context.flags.z()) goto notwatchpath;
-waitstopwalk:
- return;
-notwatchpath:
- context._sub(context.data.byte(26), 1);
- context._cmp(context.data.byte(26), -1);
- if (!context.flags.z()) goto showwatchreel;
- context.al = context.data.byte(27);
- context.data.byte(26) = context.al;
- context.ax = context.data.word(23);
- context._cmp(context.ax, context.data.word(25));
- if (!context.flags.z()) goto ismorereel;
- context._cmp(context.data.word(21), 0);
- if (!context.flags.z()) goto showwatchreel;
- context.data.word(23) = -1;
- context.data.byte(32) = -1;
- context._cmp(context.data.word(29), -1);
- if (context.flags.z()) goto nomorereel;
- context.data.byte(32) = 1;
- goto notplayingreel;
-ismorereel:
- context._add(context.data.word(23), 1);
-showwatchreel:
- context.ax = context.data.word(23);
- context.data.word(239) = context.ax;
- plotreel(context);
- context.ax = context.data.word(239);
- context.data.word(23) = context.ax;
- checkforshake(context);
-nomorereel:
- return;
-notplayingreel:
- context._cmp(context.data.byte(32), 1);
- if (!context.flags.z()) goto notholdingreel;
- context.ax = context.data.word(29);
- context.data.word(239) = context.ax;
- plotreel(context);
- return;
-notholdingreel:
- context._cmp(context.data.byte(32), 2);
- if (!context.flags.z()) goto notreleasehold;
- context._sub(context.data.byte(26), 1);
- context._cmp(context.data.byte(26), -1);
- if (!context.flags.z()) goto notlastspeed2;
- context.al = context.data.byte(27);
- context.data.byte(26) = context.al;
- context._add(context.data.word(29), 1);
-notlastspeed2:
- context.ax = context.data.word(29);
- context._cmp(context.ax, context.data.word(31));
- if (!context.flags.z()) goto ismorereel2;
- context.data.word(29) = -1;
- context.data.byte(32) = -1;
- context.al = context.data.byte(33);
- context.data.byte(478) = context.al;
- context.data.byte(477) = context.al;
- autosetwalk(context);
- return;
-ismorereel2:
- context.ax = context.data.word(29);
- context.data.word(239) = context.ax;
- plotreel(context);
- return;
-notreleasehold:
- return;
-}
-
-static inline void randomnum1(Context & context) {
- context.push(context.ds);
- context.push(context.es);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.cx);
- randomnumber(context);
- context.cx = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- return;
-}
-
-static inline void playchannel1(Context & context) {
- context._cmp(context.data.byte(378), 255);
- if (context.flags.z()) goto dontbother5;
- context._cmp(context.data.byte(515), 7);
- if (context.flags.z()) goto dontbother5;
- context.push(context.es);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- context.push(context.si);
- context.data.byte(515) = context.al;
- context.es = context.data.word(420);
- context._cmp(context.al, 12);
- if (context.flags.c()) goto notsecondbank1;
- context.es = context.data.word(422);
- context._sub(context.al, 12);
-notsecondbank1:
context.ah = 0;
context._add(context.ax, context.ax);
- context.bx = context.ax;
+ context._add(context.ax, context.ax);
context._add(context.ax, context.ax);
context._add(context.bx, context.ax);
- context.al = context.data.byte(context.bx);
- context.ah = 0;
- context.data.word(517) = context.ax;
- context.ax = context.data.word(context.bx+1);
- context.data.word(519) = context.ax;
- context.ax = context.data.word(context.bx+3);
- context.data.word(521) = context.ax;
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
-dontbother5:
- return;
-}
-
-static inline void showrain(Context & context) {
- context.ds = context.data.word(414);
- context.si = 6*58;
- context.ax = context.data.word(context.si+2);
- context.si = context.ax;
- context._add(context.si, 2080);
- context.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)+(250*4)+(256*30);
- context.es = context.data.word(412);
- context._cmp(context.data.byte(context.bx), 255);
- if (context.flags.z()) goto nothunder;
-morerain:
- context.es = context.data.word(412);
- context._cmp(context.data.byte(context.bx), 255);
- if (context.flags.z()) goto finishrain;
- context.al = context.data.byte(context.bx+1);
- context.ah = 0;
- context._add(context.ax, context.data.word(119));
- context._add(context.ax, context.data.word(127));
- context.cx = 320;
- context._mul(context.cx);
- context.cl = context.data.byte(context.bx);
- context.ch = 0;
- context._add(context.ax, context.cx);
- context._add(context.ax, context.data.word(117));
- context._add(context.ax, context.data.word(125));
- context.di = context.ax;
- context.cl = context.data.byte(context.bx+2);
- context.ch = 0;
- context.ax = context.data.word(context.bx+3);
- context.dl = context.data.byte(context.bx+5);
- context.dh = 0;
- context._sub(context.ax, context.dx);
- context._and(context.ax, 511);
- context.data.word(context.bx+3) = context.ax;
- context._add(context.bx, 6);
- context.push(context.si);
- context._add(context.si, context.ax);
- context.es = context.data.word(400);
- context.ah = 0;
- context.dx = 320-2;
-rainloop:
- context._lodsb();
- context._cmp(context.al, context.ah);
- if (context.flags.z()) goto noplot;
- context._stosb();
- context._add(context.di, context.dx);
- if (--context.cx) goto rainloop;
- context.si = context.pop();
- goto morerain;
-noplot:
- context._add(context.di, 320-1);
- if (--context.cx) goto rainloop;
- context.si = context.pop();
- goto morerain;
-finishrain:
- context._cmp(context.data.word(521), 0);
- if (!context.flags.z()) goto nothunder;
- context._cmp(context.data.byte(184), 2);
- if (!context.flags.z()) goto notlouisthund;
- context._cmp(context.data.byte(45), 1);
- if (!context.flags.z()) goto nothunder;
-notlouisthund:
- context._cmp(context.data.byte(184), 55);
- if (context.flags.z()) goto nothunder;
- randomnum1(context);
- context._cmp(context.al, 1);
- if (!context.flags.c()) goto nothunder;
- context.al = 7;
- context._cmp(context.data.byte(507), 6);
- if (context.flags.z()) goto isthunder1;
- context.al = 4;
-isthunder1:
- playchannel1(context);
-nothunder:
- return;
-}
-
-static inline void reelsonscreen(Context & context) {
- reconstruct(context);
- updatepeople(context);
- watchreel(context);
- showrain(context);
- usetimedtext(context);
- return;
-}
-
-static inline void clearwork(Context & context) {
- context.ax = 0x0;
- context.es = context.data.word(400);
- context.di = 0;
- context.cx = (200*320)/64;
-clearloop:
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- if (--context.cx) goto clearloop;
+ context.ax = context.data.word(context.bx);
+ context._sub(context.al, 12);
+ context._sub(context.ah, 12);
+ context.data.byte(151) = context.al;
+ context.data.byte(152) = context.ah;
return;
}
-static inline void findroominloc(Context & context) {
+static void findroominloc(Context & context) {
context.al = context.data.byte(149);
context.cx = -6;
looky:
@@ -18864,2010 +20643,125 @@ lookx:
return;
}
-static inline void eraseoldobs(Context & context) {
- context._cmp(context.data.byte(62), 0);
- if (context.flags.z()) goto donterase;
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
- context.cx = 16;
-oberase:
- context.push(context.cx);
- context.push(context.bx);
- context.ax = context.data.word(context.bx+20);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z()) goto notthisob;
- context.di = context.bx;
- context.al = 255;
- context.cx = 32;
- while(--context.cx) context._stosb();
-notthisob:
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 32);
- if (--context.cx) goto oberase;
-donterase:
- return;
-}
-
-static inline void drawflags(Context & context) {
- context.es = context.data.word(412);
- context.di = 0+(228*13)+32+60+(32*32);
- context.al = context.data.byte(149);
- context.ah = 0;
- context.cx = 66;
- context._mul(context.cx);
- context.bl = context.data.byte(148);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.si = 0;
- context._add(context.si, context.ax);
- context.cx = 10;
-_tmp28:
- context.push(context.cx);
- context.cx = 11;
-_tmp28a:
- context.ds = context.data.word(418);
- context._lodsb();
- context.ds = context.data.word(416);
- context.push(context.si);
- context.push(context.ax);
+static void getroomdata(Context & context) {
context.ah = 0;
- context._add(context.ax, context.ax);
- context.si = 0;
- context._add(context.si, context.ax);
- context._movsw();
- context.ax = context.pop();
- context._stosb();
- context.si = context.pop();
- if (--context.cx) goto _tmp28a;
- context._add(context.si, 66-11);
- context.cx = context.pop();
- if (--context.cx) goto _tmp28;
- return;
-}
-
-static inline void addalong(Context & context) {
- context.ah = 11;
-addloop:
- context._cmp(context.data.byte(context.bx), 0);
- if (!context.flags.z()) goto gotalong;
- context._add(context.bx, 3);
- context._sub(context.ah, 1);
- if (!context.flags.z()) goto addloop;
- context.al = 0;
- return;
-gotalong:
- context.al = 1;
- return;
-}
-
-static inline void addlength(Context & context) {
- context.ah = 10;
-addloop2:
- context._cmp(context.data.byte(context.bx), 0);
- if (!context.flags.z()) goto gotlength;
- context._add(context.bx, 3*11);
- context._sub(context.ah, 1);
- if (!context.flags.z()) goto addloop2;
- context.al = 0;
- return;
-gotlength:
- context.al = 1;
- return;
-}
-
-static inline void getdimension(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32);
- context.ch = 0;
-dimloop1:
- addalong(context);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto finishdim1;
- context._add(context.ch, 1);
- goto dimloop1;
-finishdim1:
- context.bx = 0+(228*13)+32+60+(32*32);
- context.cl = 0;
-dimloop2:
- context.push(context.bx);
- addlength(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto finishdim2;
- context._add(context.cl, 1);
- context._add(context.bx, 3);
- goto dimloop2;
-finishdim2:
- context.bx = 0+(228*13)+32+60+(32*32)+(11*3*9);
- context.dh = 10;
-dimloop3:
- context.push(context.bx);
- addalong(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto finishdim3;
- context._sub(context.dh, 1);
- context._sub(context.bx, 11*3);
- goto dimloop3;
-finishdim3:
- context.bx = 0+(228*13)+32+60+(32*32)+(3*10);
- context.dl = 11;
-dimloop4:
- context.push(context.bx);
- addlength(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto finishdim4;
- context._sub(context.dl, 1);
- context._sub(context.bx, 3);
- goto dimloop4;
-finishdim4:
- context.al = context.cl;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.word(125) = context.ax;
- context.al = context.ch;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.word(127) = context.ax;
- context._sub(context.dl, context.cl);
- context._sub(context.dh, context.ch);
- context.al = context.dl;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.byte(128) = context.al;
- context.al = context.dh;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.byte(129) = context.al;
- return;
-}
-
-static inline void calcmapad(Context & context) {
- getdimension(context);
- context.push(context.cx);
- context.push(context.dx);
- context.al = 11;
- context._sub(context.al, context.dl);
- context._sub(context.al, context.cl);
- context._sub(context.al, context.cl);
- context.ax.cbw();
- context.bx = 8;
- context._mul(context.bx);
- context._add(context.ax, context.data.word(121));
- context.data.word(117) = context.ax;
- context.dx = context.pop();
- context.cx = context.pop();
- context.al = 10;
- context._sub(context.al, context.dh);
- context._sub(context.al, context.ch);
- context._sub(context.al, context.ch);
- context.ax.cbw();
- context.bx = 8;
- context._mul(context.bx);
- context._add(context.ax, context.data.word(123));
- context.data.word(119) = context.ax;
- return;
-}
-
-static inline void doblocks(Context & context) {
- context.es = context.data.word(400);
- context.ax = context.data.word(119);
- context.cx = 320;
+ context.cx = 32;
context._mul(context.cx);
- context.di = context.data.word(117);
- context._add(context.di, context.ax);
- context.al = context.data.byte(149);
- context.ah = 0;
- context.bx = 66;
- context._mul(context.bx);
- context.bl = context.data.byte(148);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.si = 0;
- context._add(context.si, context.ax);
- context.cx = 10;
-loop120:
- context.push(context.di);
- context.push(context.cx);
- context.cx = 11;
-loop124:
- context.push(context.cx);
- context.push(context.di);
- context.ds = context.data.word(418);
- context._lodsb();
- context.ds = context.data.word(416);
- context.push(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto zeroblock;
- context.ah = context.al;
- context.al = 0;
- context.si = 0+192;
- context._add(context.si, context.ax);
- context.bh = 14;
- context.bh = 4;
-firstbitofblock:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._add(context.di, 320-16);
- context._sub(context.bh, 1);
- if (!context.flags.z()) goto firstbitofblock;
- context.bh = 12;
-loop125:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context.ax = 0x0dfdf;
- context._stosw();
- context._stosw();
- context._add(context.di, 320-20);
- context._sub(context.bh, 1);
- if (!context.flags.z()) goto loop125;
- context._add(context.di, 4);
- context.ax = 0x0dfdf;
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._add(context.di, 320-16);
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._add(context.di, 320-16);
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._add(context.di, 320-16);
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
- context._stosw();
-zeroblock:
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.di, 16);
- if (--context.cx) goto loop124;
- context._add(context.si, 66-11);
- context.cx = context.pop();
- context.di = context.pop();
- context._add(context.di, 320*16);
- if (--context.cx) goto loop120;
- return;
-}
-
-static inline void makesprite(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768;
-_tmp17:
- context._cmp(context.data.byte(context.bx+15), 255);
- if (context.flags.z()) goto _tmp17a;
- context._add(context.bx, 32);
- goto _tmp17;
-_tmp17a:
- context.data.word(context.bx) = context.cx;
- context.data.word(context.bx+10) = context.si;
- context.data.word(context.bx+6) = context.dx;
- context.data.word(context.bx+8) = context.di;
- context.data.word(context.bx+2) = 0x0ffff;
- context.data.byte(context.bx+15) = 0;
- context.data.byte(context.bx+18) = 0;
- return;
-}
-
-static inline void makebackob(Context & context) {
- context._cmp(context.data.byte(62), 0);
- if (context.flags.z()) goto nomake;
- context.al = context.data.byte(context.si+5);
- context.ah = context.data.byte(context.si+8);
- context.push(context.si);
- context.push(context.ax);
- context.push(context.si);
- context.ax = context.data.word(168);
- context.bx = context.data.word(170);
- context.ah = context.bl;
- context.si = context.ax;
- context.cx = 49520;
- context.dx = context.data.word(444);
- context.di = 0;
- makesprite(context);
- context.ax = context.pop();
- context.data.word(context.bx+20) = context.ax;
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (!context.flags.z()) goto usedpriority;
- context.al = 0;
-usedpriority:
- context.data.byte(context.bx+23) = context.al;
- context.data.byte(context.bx+30) = context.ah;
- context.data.byte(context.bx+16) = 0;
- context.data.byte(context.bx+18) = 0;
- context.data.byte(context.bx+19) = 0;
- context.si = context.pop();
-nomake:
- return;
-}
-
-static inline void showallobs(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32);
- context.data.word(18) = context.bx;
- context.di = context.bx;
- context.cx = 128*5;
- context.al = 255;
- while(--context.cx) context._stosb();
- context.es = context.data.word(444);
- context.data.word(166) = context.es;
- context.ax = 0;
- context.data.word(164) = context.ax;
- context.ax = 0+2080;
- context.data.word(162) = context.ax;
- context.data.byte(181) = 0;
- context.ds = context.data.word(428);
- context.si = 0;
- context.cx = 128;
-showobsloop:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.si);
- context._add(context.si, 58);
- context.es = context.data.word(428);
- getmapad(context);
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto blankframe;
- context.al = context.data.byte(context.si+18);
- context.ah = 0;
- context.data.word(160) = context.ax;
- context._cmp(context.al, 255);
- if (context.flags.z()) goto blankframe;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.al = context.data.byte(context.si+18);
- context.data.byte(context.si+17) = context.al;
- context._cmp(context.data.byte(context.si+8), 0);
- if (!context.flags.z()) goto animating;
- context._cmp(context.data.byte(context.si+5), 5);
- if (context.flags.z()) goto animating;
- context._cmp(context.data.byte(context.si+5), 6);
- if (context.flags.z()) goto animating;
- context.ax = context.data.word(160);
- context.ah = 0;
- context._add(context.di, context.data.word(117));
- context._add(context.bx, context.data.word(119));
- showframe(context);
- goto drawnsetob;
-animating:
- makebackob(context);
-drawnsetob:
- context.si = context.data.word(18);
- context.es = context.data.word(412);
- context.al = context.data.byte(179);
- context.ah = context.data.byte(180);
- context.data.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(176);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.data.word(context.si+2) = context.ax;
- context.al = context.data.byte(181);
- context.data.byte(context.si+4) = context.al;
- context._add(context.si, 5);
- context.data.word(18) = context.si;
-blankframe:
- context._add(context.data.byte(181), 1);
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 64);
- context._sub(context.cx, 1);
- if (context.flags.z()) goto finishedsetobs;
- goto showobsloop;
-finishedsetobs:
- return;
-}
-
-static inline void showallfree(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5);
- context.data.word(18) = context.bx;
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5);
- context.cx = 80*5;
- context.al = 255;
- while(--context.cx) context._stosb();
- context.es = context.data.word(446);
- context.data.word(166) = context.es;
- context.ax = 0;
- context.data.word(164) = context.ax;
- context.ax = 0+2080;
- context.data.word(162) = context.ax;
- context.al = 0;
- context.data.byte(158) = context.al;
- context.ds = context.data.word(426);
- context.si = 2;
- context.cx = 0;
-loop127:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.si);
- context.es = context.data.word(426);
- getmapad(context);
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto over138;
- context.al = context.data.byte(158);
- context.ah = 0;
- context.dx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.dx);
- context.data.word(160) = context.ax;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- context.es = context.data.word(402);
- context.ds = context.data.word(166);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context._cmp(context.cx, 0);
- if (context.flags.z()) goto over138;
- context.ax = context.data.word(160);
- context.ah = 0;
- context._add(context.di, context.data.word(117));
- context._add(context.bx, context.data.word(119));
- showframe(context);
- context.si = context.data.word(18);
- context.es = context.data.word(412);
- context.al = context.data.byte(179);
- context.ah = context.data.byte(180);
- context.data.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(176);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.data.word(context.si+2) = context.ax;
- context.ax = context.pop();
- context.cx = context.pop();
- context.push(context.cx);
- context.push(context.ax);
- context.data.byte(context.si+4) = context.cl;
- context._add(context.si, 5);
- context.data.word(18) = context.si;
-over138:
- context._add(context.data.byte(158), 1);
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 16);
- context._add(context.cx, 1);
- context._cmp(context.cx, 80);
- if (context.flags.z()) goto finfree;
- goto loop127;
-finfree:
- return;
-}
-
-static inline void getxad(Context & context) {
- context.cl = context.data.byte(context.si);
- context._add(context.si, 1);
- context.al = context.data.byte(context.si);
- context._add(context.si, 1);
- context.ah = context.data.byte(context.si);
- context._add(context.si, 1);
- context._cmp(context.cl, 0);
- if (!context.flags.z()) goto over148;
- context._sub(context.al, context.data.byte(148));
- if (context.flags.c()) goto over148;
- context._cmp(context.al, 11);
- if (!context.flags.c()) goto over148;
- context.cl = 4;
- context._shl(context.al, context.cl);
- context._or(context.al, context.ah);
- context.ah = 0;
- context.ch = 1;
- return;
-over148:
- context.ch = 0;
- return;
-}
-
-static inline void getyad(Context & context) {
- context.al = context.data.byte(context.si);
- context._add(context.si, 1);
- context.ah = context.data.byte(context.si);
- context._add(context.si, 1);
- context._sub(context.al, context.data.byte(149));
- if (context.flags.c()) goto over147;
- context._cmp(context.al, 10);
- if (!context.flags.c()) goto over147;
- context.cl = 4;
- context._shl(context.al, context.cl);
- context._or(context.al, context.ah);
- context.ah = 0;
- context.ch = 1;
- return;
-over147:
- context.ch = 0;
- return;
-}
-
-static inline void getmapad(Context & context) {
- getxad(context);
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto over146;
- context.data.word(168) = context.ax;
- getyad(context);
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto over146;
- context.data.word(170) = context.ax;
- context.ch = 1;
-over146:
- return;
-}
-
-static inline void calcfrframe(Context & context) {
- context.dx = context.data.word(166);
- context.ax = context.data.word(162);
- context.push(context.ax);
- context.cx = context.data.word(164);
- context.ax = context.data.word(160);
- context.ds = context.dx;
- context.bx = 6;
- context._mul(context.bx);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
- context.cx = context.data.word(context.bx);
- context.ax = context.data.word(context.bx+2);
- context.dx = context.data.word(context.bx+4);
- context.bx = context.pop();
- context.push(context.dx);
- context._add(context.ax, context.bx);
- context.data.word(178) = context.ax;
- context.data.word(176) = context.cx;
- context.ax = context.pop();
- context.push(context.ax);
- context.ah = 0;
- context.data.word(172) = context.ax;
- context.ax = context.pop();
- context.al = context.ah;
- context.ah = 0;
- context.data.word(174) = context.ax;
- return;
-nullframe:
- context.ax = context.pop();
- context.cx = 0;
- context.data.word(176) = context.cx;
- return;
-}
-
-static inline void finalframe(Context & context) {
- context.ax = context.data.word(170);
- context._add(context.ax, context.data.word(174));
- context.bx = context.data.word(168);
- context._add(context.bx, context.data.word(172));
- context.data.byte(179) = context.bl;
- context.data.byte(180) = context.al;
- context.di = context.data.word(168);
- context.bx = context.data.word(170);
- return;
-}
-
-static inline void showallex(Context & context) {
- context.es = context.data.word(412);
- context.bx = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5);
- context.data.word(18) = context.bx;
- context.di = 0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5);
- context.cx = 100*5;
- context.al = 255;
- while(--context.cx) context._stosb();
- context.es = context.data.word(398);
- context.data.word(166) = context.es;
- context.ax = 0;
- context.data.word(164) = context.ax;
- context.ax = 0+2080;
- context.data.word(162) = context.ax;
- context.data.byte(157) = 0;
- context.si = 0+2080+30000+2;
- context.cx = 0;
-exloop:
- context.push(context.cx);
- context.push(context.si);
- context.es = context.data.word(398);
- context.push(context.si);
- context.ch = 0;
- context._cmp(context.data.byte(context.si), 255);
- if (context.flags.z()) goto notinroom;
- context.al = context.data.byte(context.si-2);
- context._cmp(context.al, context.data.byte(184));
- if (!context.flags.z()) goto notinroom;
- getmapad(context);
-notinroom:
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z()) goto blankex;
- context.al = context.data.byte(157);
- context.ah = 0;
- context.dx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.dx);
- context.data.word(160) = context.ax;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- context.es = context.data.word(402);
- context.ds = context.data.word(166);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context._cmp(context.cx, 0);
- if (context.flags.z()) goto blankex;
- context.ax = context.data.word(160);
- context.ah = 0;
- context._add(context.di, context.data.word(117));
- context._add(context.bx, context.data.word(119));
- showframe(context);
- context.si = context.data.word(18);
- context.es = context.data.word(412);
- context.al = context.data.byte(179);
- context.ah = context.data.byte(180);
- context.data.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(176);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.data.word(context.si+2) = context.ax;
- context.ax = context.pop();
- context.cx = context.pop();
- context.push(context.cx);
- context.push(context.ax);
- context.data.byte(context.si+4) = context.cl;
- context._add(context.si, 5);
- context.data.word(18) = context.si;
-blankex:
- context._add(context.data.byte(157), 1);
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 16);
- context._add(context.cx, 1);
- context._cmp(context.cx, 100);
- if (context.flags.z()) goto finex;
- goto exloop;
-finex:
- return;
-}
-
-static inline void paneltomap(Context & context) {
- context.di = context.data.word(125);
- context._add(context.di, context.data.word(117));
- context.bx = context.data.word(127);
- context._add(context.bx, context.data.word(119));
- context.ds = context.data.word(402);
- context.si = 0;
- context.cl = context.data.byte(128);
- context.ch = context.data.byte(129);
- multiget(context);
+ context.bx = 5971;
+ context._add(context.bx, context.ax);
return;
}
-static inline void checkone(Context & context) {
- context.push(context.cx);
- context.al = context.ch;
- context.ah = 0;
- context.cl = 4;
- context._shr(context.ax, context.cl);
- context.dl = context.al;
- context.cx = context.pop();
- context.al = context.cl;
- context.ah = 0;
- context.cl = 4;
- context._shr(context.ax, context.cl);
- context.ah = context.dl;
- context.push(context.ax);
- context.ch = 0;
- context.cl = context.al;
- context.push(context.cx);
- context.al = context.ah;
- context.ah = 0;
- context.cx = 11;
- context._mul(context.cx);
- context.cx = context.pop();
- context._add(context.ax, context.cx);
- context.cx = 3;
- context._mul(context.cx);
- context.si = context.ax;
- context.ds = context.data.word(412);
- context._add(context.si, 0+(228*13)+32+60+(32*32));
- context._lodsw();
- context.cx = context.ax;
- context._lodsb();
- context.dx = context.pop();
+static void readheader(Context & context) {
+ context.ds = context.cs;
+ context.dx = 5881;
+ context.cx = 5958-context.data.byte(5881);
+ readfromfile(context);
+ context.es = context.cs;
+ context.di = 5952;
return;
}
-static inline void getblockofpixel(Context & context) {
- context.push(context.cx);
+static void allocateload(Context & context) {
context.push(context.es);
context.push(context.di);
- context.ax = context.data.word(125);
- context._add(context.cl, context.al);
- context.ax = context.data.word(127);
- context._add(context.ch, context.al);
- checkone(context);
- context._and(context.cl, 1);
- if (!context.flags.z()) goto failrain;
- context.di = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- return;
-failrain:
+ context.bx = context.data.word(context.di);
+ context.cl = 4;
+ context._shr(context.bx, context.cl);
+ allocatemem(context);
context.di = context.pop();
context.es = context.pop();
- context.cx = context.pop();
- context.al = 0;
- return;
-}
-
-static inline void splitintolines(Context & context) {
-lookforlinestart:
- getblockofpixel(context);
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto foundlinestart;
- context._sub(context.cl, 1);
- context._add(context.ch, 1);
- context._cmp(context.cl, 0);
- if (context.flags.z()) goto endofthisline;
- context._cmp(context.ch, context.data.byte(129));
- if (!context.flags.c()) goto endofthisline;
- goto lookforlinestart;
-foundlinestart:
- context.data.word(context.di) = context.cx;
- context.bh = 1;
-lookforlineend:
- getblockofpixel(context);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto foundlineend;
- context._sub(context.cl, 1);
- context._add(context.ch, 1);
- context._cmp(context.cl, 0);
- if (context.flags.z()) goto foundlineend;
- context._cmp(context.ch, context.data.byte(129));
- if (!context.flags.c()) goto foundlineend;
- context._add(context.bh, 1);
- goto lookforlineend;
-foundlineend:
- context.push(context.cx);
- context.data.byte(context.di+2) = context.bh;
- randomnumber(context);
- context.data.byte(context.di+3) = context.al;
- randomnumber(context);
- context.data.byte(context.di+4) = context.al;
- randomnumber(context);
- context._and(context.al, 3);
- context._add(context.al, 4);
- context.data.byte(context.di+5) = context.al;
- context._add(context.di, 6);
- context.cx = context.pop();
- context._cmp(context.cl, 0);
- if (context.flags.z()) goto endofthisline;
- context._cmp(context.ch, context.data.byte(129));
- if (!context.flags.c()) goto endofthisline;
- goto lookforlinestart;
-endofthisline:
return;
}
-static inline void initrain(Context & context) {
- context.es = context.data.word(412);
- context.di = 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)+(250*4)+(256*30);
- context.bx = 1113;
-checkmorerain:
- context.al = context.data.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto finishinitrain;
- context._cmp(context.al, context.data.byte(184));
- if (!context.flags.z()) goto checkrain;
- context.al = context.data.byte(context.bx+1);
- context._cmp(context.al, context.data.byte(148));
- if (!context.flags.z()) goto checkrain;
- context.al = context.data.byte(context.bx+2);
- context._cmp(context.al, context.data.byte(149));
- if (!context.flags.z()) goto checkrain;
- context.al = context.data.byte(context.bx+3);
- context.data.byte(132) = context.al;
- goto dorain;
-checkrain:
- context._add(context.bx, 4);
- goto checkmorerain;
-dorain:
- context.cx = 4;
-initraintop:
- randomnumber(context);
- context._and(context.al, 31);
- context._add(context.al, 3);
- context._cmp(context.al, context.data.byte(132));
- if (!context.flags.c()) goto initraintop;
- context._add(context.cl, context.al);
- context._cmp(context.cl, context.data.byte(128));
- if (!context.flags.c()) goto initrainside;
- context.push(context.cx);
- splitintolines(context);
- context.cx = context.pop();
- goto initraintop;
-initrainside:
- context.cl = context.data.byte(128);
- context._sub(context.cl, 1);
-initrainside2:
- randomnumber(context);
- context._and(context.al, 31);
- context._add(context.al, 3);
- context._cmp(context.al, context.data.byte(132));
- if (!context.flags.c()) goto initrainside2;
- context._add(context.ch, context.al);
- context._cmp(context.ch, context.data.byte(129));
- if (!context.flags.c()) goto finishinitrain;
- context.push(context.cx);
- splitintolines(context);
- context.cx = context.pop();
- goto initrainside2;
-finishinitrain:
- context.al = 255;
- context._stosb();
- return;
-}
-
-static inline void drawfloor(Context & context) {
+static void fillspace(Context & context) {
context.push(context.es);
- context.push(context.bx);
- eraseoldobs(context);
- drawflags(context);
- calcmapad(context);
- doblocks(context);
- showallobs(context);
- showallfree(context);
- showallex(context);
- paneltomap(context);
- initrain(context);
- context.data.byte(62) = 0;
- context.bx = context.pop();
- context.es = context.pop();
- return;
-}
-
-static inline void width160(Context & context) {
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- width128:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- width110:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- width88:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- width80:
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- context._movsw();
- width63:
- context._movsw();
- width62:
- context._movsw();
- width61:
- context._movsw();
- width60:
- context._movsw();
- width59:
- context._movsw();
- width58:
- context._movsw();
- width57:
- context._movsw();
- width56:
- context._movsw();
- width55:
- context._movsw();
- width54:
- context._movsw();
- width53:
- context._movsw();
- width52:
- context._movsw();
- width51:
- context._movsw();
- width50:
- context._movsw();
- width49:
- context._movsw();
- width48:
- context._movsw();
- width47:
- context._movsw();
- width46:
- context._movsw();
- width45:
- context._movsw();
- width44:
- context._movsw();
- width43:
- context._movsw();
- width42:
- context._movsw();
- width41:
- context._movsw();
- width40:
- context._movsw();
- width39:
- context._movsw();
- width38:
- context._movsw();
- width37:
- context._movsw();
- width36:
- context._movsw();
- width35:
- context._movsw();
- width34:
- context._movsw();
- width33:
- context._movsw();
- width32:
- context._movsw();
- width31:
- context._movsw();
- width30:
- context._movsw();
- width29:
- context._movsw();
- width28:
- context._movsw();
- width27:
- context._movsw();
- width26:
- context._movsw();
- width25:
- context._movsw();
- width24:
- context._movsw();
- width23:
- context._movsw();
- width22:
- context._movsw();
- width21:
- context._movsw();
- width20:
- context._movsw();
- width19:
- context._movsw();
- width18:
- context._movsw();
- width17:
- context._movsw();
- width16:
- context._movsw();
- width15:
- context._movsw();
- width14:
- context._movsw();
- width13:
- context._movsw();
- width12:
- context._movsw();
- width11:
- context._movsw();
- width10:
- context._movsw();
- width9:
- context._movsw();
- width8:
- context._movsw();
- width7:
- context._movsw();
- width6:
- context._movsw();
- width5:
- context._movsw();
- width4:
- context._movsw();
- width3:
- context._movsw();
- width2:
- context._movsw();
- width1:
- context._movsw();
- width0:
- return;
-}
-
-static inline void worktoscreen(Context & context) {
- vsync(context);
- context.si = 0;
- context.di = 0;
- context.cx = 25;
- context.ds = context.data.word(400);
- context.dx = 0x0a000;
- context.es = context.dx;
-dumpallloop:
- width160(context);
- width160(context);
- width160(context);
- width160(context);
- width160(context);
- width160(context);
- width160(context);
- width160(context);
- if (--context.cx) goto dumpallloop;
- return;
-}
-
-static inline void afterintroroom(Context & context) {
- context._cmp(context.data.byte(186), 0);
- if (context.flags.z()) goto notnewintro;
- clearwork(context);
- findroominloc(context);
- context.data.byte(62) = 1;
- drawfloor(context);
- reelsonscreen(context);
- spriteupdate(context);
- printsprites(context);
- worktoscreen(context);
- context.data.byte(186) = 0;
-notnewintro:
- return;
-}
-
-static inline void multiget(Context & context) {
- context.ax = context.bx;
- context.bx = 320;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.es = context.data.word(400);
- context.es = context.ds;
- context.ds = context.es;
- context._xchg(context.di, context.si);
- context.al = context.cl;
- context.ah = 0;
- context.dx = 320;
- context._sub(context.dx, context.ax);
- context.al = context.cl;
- context._and(context.al, 1);
- if (!context.flags.z()) goto oddwidth2;
- context.bl = context.cl;
- context.bh = 0;
- context.ax = 1819;
- context._shr(context.bx, 1);
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-multiloop3:
- __dispatch_call(context, context.ax);
- context._add(context.si, context.dx);
- if (--context.cx) goto multiloop3;
- return;
-oddwidth2:
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-multiloop4:
- __dispatch_call(context, context.ax);
- context._movsb();
- context._add(context.si, context.dx);
- if (--context.cx) goto multiloop4;
- return;
-}
-
-static inline void getundertimed(Context & context) {
- context.al = context.data.byte(335);
- context._sub(context.al, 3);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(336);
- context.ah = 0;
- context.di = context.ax;
- context.ch = 30;
- context.cl = 240;
- context.ds = context.data.word(412);
- context.si = 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)+(250*4);
- multiget(context);
- return;
-}
-
-static inline void getnextword(Context & context) {
- context.bx = 0;
-getloop:
- context.ax = context.data.word(context.di);
- context._add(context.di, 1);
- context._add(context.bh, 1);
- context._cmp(context.al, ':');
- if (context.flags.z()) goto endall;
- context._cmp(context.al, 0);
- if (context.flags.z()) goto endall;
- context._cmp(context.al, 32);
- if (context.flags.z()) goto endword;
- modifychar(context);
- context._cmp(context.al, 255);
- if (context.flags.z()) goto getloop;
- context.push(context.ax);
- context._sub(context.al, 32);
- context.ah = 0;
- context._add(context.ax, context.data.word(71));
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.cl = context.data.byte(context.si+0);
- context.ax = context.pop();
- kernchars(context);
- context._add(context.bl, context.cl);
- goto getloop;
-endword:
- context._add(context.bl, 6);
- context.al = 0;
- return;
-endall:
- context._add(context.bl, 6);
- context.al = 1;
- return;
-}
-
-static inline void getnumber(Context & context) {
- context.cx = 0;
- context.push(context.si);
- context.push(context.bx);
- context.push(context.di);
context.push(context.ds);
- context.push(context.es);
- context.di = context.si;
-wordloop:
- context.push(context.cx);
context.push(context.dx);
- getnextword(context);
- context.dx = context.pop();
- context.cx = context.pop();
- context._cmp(context.al, 1);
- if (context.flags.z()) goto endoftext;
- context.al = context.cl;
- context.ah = 0;
- context.push(context.bx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.bx = context.pop();
- context._sub(context.ax, 10);
- context.dh = 0;
- context._cmp(context.ax, context.dx);
- if (!context.flags.c()) goto gotoverend;
- context._add(context.cl, context.bl);
- context._add(context.ch, context.bh);
- goto wordloop;
-gotoverend:
- context.al = context.dl;
- context._and(context.al, 1);
- if (context.flags.z()) goto notcentre;
- context.push(context.cx);
- context.al = context.dl;
- context._and(context.al, 0b11111110);
- context.ah = 0;
- context.ch = 0;
- context._sub(context.ax, context.cx);
- context._add(context.ax, 20);
- context._shr(context.ax, 1);
- context.cx = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context._add(context.di, context.ax);
- context.cl = context.ch;
- return;
-notcentre:
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context.cl = context.ch;
- return;
-endoftext:
- context.al = context.cl;
- context.ah = 0;
+ context.push(context.di);
context.push(context.bx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.bx = context.pop();
- context._sub(context.ax, 10);
- context.dh = 0;
- context._cmp(context.ax, context.dx);
- if (!context.flags.c()) goto gotoverend2;
- context._add(context.cl, context.bl);
- context._add(context.ch, context.bh);
-gotoverend2:
- context.al = context.dl;
- context._and(context.al, 1);
- if (context.flags.z()) goto notcent2;
- context.push(context.cx);
- context.al = context.dl;
- context._and(context.al, 0b11111110);
- context._add(context.al, 2);
- context.ah = 0;
- context.ch = 0;
- context._add(context.ax, 20);
- context._sub(context.ax, context.cx);
- context._shr(context.ax, 1);
- context.cx = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
+ context.di = context.dx;
+ context.es = context.ds;
+ while(--context.cx) context._stosb();
context.bx = context.pop();
- context.si = context.pop();
- context._add(context.di, context.ax);
- context.cl = context.ch;
- return;
-notcent2:
- context.es = context.pop();
- context.ds = context.pop();
context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context.cl = context.ch;
- return;
-}
-
-static inline void modifychar(Context & context) {
- context._cmp(context.al, 128);
- if (context.flags.c()) goto nomod;
- context._cmp(context.al, 160);
- if (!context.flags.z()) goto not160;
- context.al = 'Z'+1;
- return;
-not160:
- context._cmp(context.al, 130);
- if (!context.flags.z()) goto not130;
- context.al = 'Z'+2;
- return;
-not130:
- context._cmp(context.al, 161);
- if (!context.flags.z()) goto not161;
- context.al = 'Z'+3;
- return;
-not161:
- context._cmp(context.al, 162);
- if (!context.flags.z()) goto not162;
- context.al = 'Z'+4;
- return;
-not162:
- context._cmp(context.al, 163);
- if (!context.flags.z()) goto not163;
- context.al = 'Z'+5;
- return;
-not163:
- context._cmp(context.al, 164);
- if (!context.flags.z()) goto not164;
- context.al = 'Z'+6;
- return;
-not164:
- context._cmp(context.al, 165);
- if (!context.flags.z()) goto not165;
- context.al = ','-1;
- return;
-not165:
- context._cmp(context.al, 168);
- if (!context.flags.z()) goto not168;
- context.al = 'A'-1;
- return;
-not168:
- context._cmp(context.al, 173);
- if (!context.flags.z()) goto not173;
- context.al = 'A'-4;
- return;
-not173:
- context._cmp(context.al, 129);
- if (!context.flags.z()) goto not129;
- context.al = 'A'-5;
-not129:
- return;
-nomod:
- return;
-}
-
-static inline void frameoutfx(Context & context) {
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._add(context.dx, context.cx);
- context.cx = context.pop();
-frameloopfx1:
- context.push(context.cx);
- context.ch = 0;
-frameloopfx2:
- context._lodsb();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto backtosolidfx;
-backtootherfx:
- context._sub(context.di, 1);
- if (--context.cx) goto frameloopfx2;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._sub(context.ch, 1);
- if (!context.flags.z()) goto frameloopfx1;
- return;
-frameloopfx3:
- context._lodsb();
- context._cmp(context.al, 0);
- if (context.flags.z()) goto backtootherfx;
-backtosolidfx:
- context.data.byte(context.di) = context.al;
- context._sub(context.di, 1);
- if (--context.cx) goto frameloopfx3;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._sub(context.ch, 1);
- if (!context.flags.z()) goto frameloopfx1;
- return;
-}
-
-static inline void frameoutnm(Context & context) {
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._sub(context.dx, context.cx);
- context.cx = context.pop();
- context.al = context.cl;
- context._and(context.al, 1);
- if (!context.flags.z()) goto oddwidthframe;
- context.bl = context.cl;
- context.bh = 0;
- context.ax = 1819;
- context._shr(context.bx, 1);
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-nmloop1:
- __dispatch_call(context, context.ax);
- context._add(context.di, context.dx);
- if (--context.cx) goto nmloop1;
- return;
-oddwidthframe:
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-nmloop2:
- __dispatch_call(context, context.ax);
- context._movsb();
- context._add(context.di, context.dx);
- if (--context.cx) goto nmloop2;
- return;
-}
-
-static inline void frameoutbh(Context & context) {
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._sub(context.dx, context.cx);
- context.cx = context.pop();
-bhloop2:
- context.push(context.cx);
- context.ch = 0;
- context.ah = 255;
-bhloop1:
- context._cmp(context.data.byte(context.di), context.ah);
- if (!context.flags.z()) goto nofill;
- context._movsb();
- if (--context.cx) goto bhloop1;
- goto nextline;
-nofill:
- context._add(context.di, 1);
- context._add(context.si, 1);
- if (--context.cx) goto bhloop1;
-nextline:
- context._add(context.di, context.dx);
- context.cx = context.pop();
- context._sub(context.ch, 1);
- if (!context.flags.z()) goto bhloop2;
- return;
-}
-
-static inline void frameoutv(Context & context) {
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._sub(context.dx, context.cx);
- context.cx = context.pop();
-frameloop1:
- context.push(context.cx);
- context.ch = 0;
-frameloop2:
- context._lodsb();
- context._cmp(context.al, 0);
- if (!context.flags.z()) goto backtosolid;
-backtoother:
- context._add(context.di, 1);
- if (--context.cx) goto frameloop2;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._sub(context.ch, 1);
- if (!context.flags.z()) goto frameloop1;
- return;
-frameloop3:
- context._lodsb();
- context._cmp(context.al, 0);
- if (context.flags.z()) goto backtoother;
-backtosolid:
- context._stosb();
- if (--context.cx) goto frameloop3;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._sub(context.ch, 1);
- if (!context.flags.z()) goto frameloop1;
- return;
-}
-
-static inline void showframe(Context & context) {
- context.push(context.dx);
- context.push(context.ax);
- context.cx = context.ax;
- context._and(context.cx, 511);
- context._add(context.cx, context.cx);
- context.si = context.cx;
- context._add(context.cx, context.cx);
- context._add(context.si, context.cx);
- context._cmp(context.data.word(context.si), 0);
- if (!context.flags.z()) goto notblankshow;
- context.cx = 0;
- return;
-notblankshow:
- context._test(context.ah, 128);
- if (!context.flags.z()) goto skipoffsets;
- context.al = context.data.byte(context.si+4);
- context.ah = 0;
- context._add(context.di, context.ax);
- context.al = context.data.byte(context.si+5);
- context.ah = 0;
- context._add(context.bx, context.ax);
-skipoffsets:
- context.cx = context.data.word(context.si+0);
- context.ax = context.data.word(context.si+2);
- context._add(context.ax, 2080);
- context.si = context.ax;
- context.ax = context.pop();
- context.dx = context.pop();
- context._cmp(context.ah, 0);
- if (context.flags.z()) goto noeffects;
- context._test(context.ah, 128);
- if (context.flags.z()) goto notcentred;
- context.push(context.ax);
- context.al = context.cl;
- context.ah = 0;
- context._shr(context.ax, 1);
- context._sub(context.di, context.ax);
- context.al = context.ch;
- context.ah = 0;
- context._shr(context.ax, 1);
- context._sub(context.bx, context.ax);
- context.ax = context.pop();
-notcentred:
- context._test(context.ah, 64);
- if (context.flags.z()) goto notdiffdest;
- context.push(context.cx);
- frameoutfx(context);
- context.cx = context.pop();
- return;
-notdiffdest:
- context._test(context.ah, 8);
- if (context.flags.z()) goto notprintlist;
- context.push(context.ax);
- context.ax = context.di;
- context._sub(context.ax, context.data.word(117));
- context.push(context.bx);
- context._sub(context.bx, context.data.word(119));
- context.ah = context.bl;
- context.bx = context.pop();
- context.ax = context.pop();
-notprintlist:
- context._test(context.ah, 4);
- if (context.flags.z()) goto notflippedx;
- context.dx = 320;
- context.es = context.data.word(400);
- context.push(context.cx);
- frameoutfx(context);
- context.cx = context.pop();
- return;
-notflippedx:
- context._test(context.ah, 2);
- if (context.flags.z()) goto notnomask;
- context.dx = 320;
- context.es = context.data.word(400);
- context.push(context.cx);
- frameoutnm(context);
- context.cx = context.pop();
- return;
-notnomask:
- context._test(context.ah, 32);
- if (context.flags.z()) goto noeffects;
- context.dx = 320;
- context.es = context.data.word(400);
- context.push(context.cx);
- frameoutbh(context);
- context.cx = context.pop();
- return;
-noeffects:
- context.dx = 320;
- context.es = context.data.word(400);
- context.push(context.cx);
- frameoutv(context);
- context.cx = context.pop();
- return;
-}
-
-static inline void kernchars(Context & context) {
- context._cmp(context.al, 'a');
- if (context.flags.z()) goto iskern;
- context._cmp(context.al, 'u');
- if (context.flags.z()) goto iskern;
- return;
-iskern:
- context._cmp(context.ah, 'n');
- if (context.flags.z()) goto kernit;
- context._cmp(context.ah, 't');
- if (context.flags.z()) goto kernit;
- context._cmp(context.ah, 'r');
- if (context.flags.z()) goto kernit;
- context._cmp(context.ah, 'i');
- if (context.flags.z()) goto kernit;
- context._cmp(context.ah, 'l');
- if (context.flags.z()) goto kernit;
- return;
-kernit:
- context._sub(context.cl, 1);
- return;
-}
-
-static inline void printchar(Context & context) {
- context._cmp(context.al, 255);
- if (context.flags.z()) goto ignoreit;
- context.push(context.si);
- context.push(context.bx);
- context.push(context.di);
- context._sub(context.bx, 3);
- context.push(context.ax);
- context._sub(context.al, 32);
- context.ah = 0;
- context._add(context.ax, context.data.word(71));
- showframe(context);
- context.ax = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context._cmp(context.data.byte(72), 0);
- if (!context.flags.z()) goto nokern;
- kernchars(context);
-nokern:
- context.push(context.cx);
- context.ch = 0;
- context._add(context.di, context.cx);
- context.cx = context.pop();
-ignoreit:
- return;
-}
-
-static inline void printdirect(Context & context) {
- context.data.word(84) = context.di;
- context.ds = context.data.word(268);
-printloop6:
- context.push(context.bx);
- context.push(context.di);
- context.push(context.dx);
- getnumber(context);
- context.ch = 0;
-printloop5:
- context.ax = context.data.word(context.si);
- context._add(context.si, 1);
- context._cmp(context.al, 0);
- if (context.flags.z()) goto finishdirct;
- context._cmp(context.al, ':');
- if (context.flags.z()) goto finishdirct;
- context.push(context.cx);
- context.push(context.es);
- modifychar(context);
- printchar(context);
- context.data.word(84) = context.di;
+ context.ds = context.pop();
context.es = context.pop();
- context.cx = context.pop();
- if (--context.cx) goto printloop5;
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context._add(context.bx, context.data.word(77));
- goto printloop6;
-finishdirct:
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
return;
}
-static inline void multiput(Context & context) {
- context.ax = context.bx;
- context.bx = 320;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.es = context.data.word(400);
- context.al = context.cl;
- context.ah = 0;
- context.dx = 320;
- context._sub(context.dx, context.ax);
- context.al = context.cl;
- context._and(context.al, 1);
- if (!context.flags.z()) goto oddwidth3;
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-multiloop5:
- __dispatch_call(context, context.ax);
- context._add(context.di, context.dx);
- if (--context.cx) goto multiloop5;
- return;
-oddwidth3:
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.cl = context.ch;
- context.ch = 0;
-multiloop6:
- __dispatch_call(context, context.ax);
- context._movsb();
- context._add(context.di, context.dx);
- if (--context.cx) goto multiloop6;
- return;
-}
-
-static inline void putundertimed(Context & context) {
- context.al = context.data.byte(335);
- context._sub(context.al, 3);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(336);
- context.ah = 0;
- context.di = context.ax;
- context.ch = 30;
- context.cl = 240;
- context.ds = context.data.word(412);
- context.si = 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)+(250*4);
- multiput(context);
- return;
-}
-
-static inline void usetimedtext(Context & context) {
- context._cmp(context.data.word(328), 0);
- if (context.flags.z()) goto notext;
- context._sub(context.data.word(328), 1);
- context._cmp(context.data.word(328), 0);
- if (context.flags.z()) goto deltimedtext;
- context.ax = context.data.word(328);
- context._cmp(context.ax, context.data.word(330));
- if (context.flags.z()) goto firsttimed;
- if (!context.flags.c()) goto notext;
- goto notfirsttimed;
-firsttimed:
- getundertimed(context);
-notfirsttimed:
- context.bl = context.data.byte(335);
- context.bh = 0;
- context.al = context.data.byte(336);
- context.ah = 0;
- context.di = context.ax;
- context.es = context.data.word(332);
- context.si = context.data.word(334);
- context.dl = 237;
- context.ah = 0;
- printdirect(context);
- context.data.byte(337) = 1;
-notext:
- return;
-deltimedtext:
- putundertimed(context);
- context.data.byte(337) = 1;
- return;
-}
-
-static inline void dumpmap(Context & context) {
- context.di = context.data.word(125);
- context._add(context.di, context.data.word(117));
- context.bx = context.data.word(127);
- context._add(context.bx, context.data.word(119));
- context.cl = context.data.byte(128);
- context.ch = context.data.byte(129);
- multidump(context);
+static void getridoftemp(Context & context) {
+ context.es = context.data.word(458);
+ deallocatemem(context);
return;
}
-static inline void multidump(Context & context) {
- context.dx = 0x0a000;
- context.es = context.dx;
- context.ds = context.data.word(400);
- context.ax = context.bx;
- context.bx = 320;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = 320;
- context.si = context.di;
- context.al = context.cl;
- context._and(context.al, 1);
- if (!context.flags.z()) goto oddwidth;
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.bl = context.cl;
- context.bh = 0;
- context._neg(context.bx);
- context._add(context.bx, context.dx);
- context.cl = context.ch;
- context.ch = 0;
-multiloop1:
- __dispatch_call(context, context.ax);
- context._add(context.di, context.bx);
- context._add(context.si, context.bx);
- if (--context.cx) goto multiloop1;
- return;
-oddwidth:
- context.bl = context.cl;
- context.bh = 0;
- context._shr(context.bx, 1);
- context.ax = 1819;
- context._sub(context.ax, context.bx);
- context.bl = context.cl;
- context.bh = 0;
- context._neg(context.bx);
- context._add(context.bx, 320);
- context.cl = context.ch;
- context.ch = 0;
-multiloop2:
- __dispatch_call(context, context.ax);
- context._movsb();
- context._add(context.di, context.bx);
- context._add(context.si, context.bx);
- if (--context.cx) goto multiloop2;
+static void getridoftemptext(Context & context) {
+ context.es = context.data.word(466);
+ deallocatemem(context);
return;
}
-static inline void dumptimedtext(Context & context) {
- context._cmp(context.data.byte(337), 1);
- if (!context.flags.z()) goto nodumptimed;
- context.al = context.data.byte(335);
- context._sub(context.al, 3);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(336);
- context.ah = 0;
- context.di = context.ax;
- context.cl = 240;
- context.ch = 30;
- multidump(context);
- context.data.byte(337) = 0;
-nodumptimed:
+static void getridoftemp2(Context & context) {
+ context.es = context.data.word(460);
+ deallocatemem(context);
return;
}
-static inline void runendseq(Context & context) {
- atmospheres(context);
- context.data.byte(103) = 0;
-moreendseq:
- vsync(context);
- spriteupdate(context);
- vsync(context);
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afterintroroom(context);
- usetimedtext(context);
- vsync(context);
- dumpmap(context);
- dumptimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(103), 1);
- if (!context.flags.z()) goto moreendseq;
+static void getridoftemp3(Context & context) {
+ context.es = context.data.word(462);
+ deallocatemem(context);
return;
}
-static inline void gettingshot(Context & context) {
- context.data.byte(188) = 55;
- clearpalette(context);
- loadintroroom(context);
- fadescreenups(context);
- context.data.byte(387) = 0;
- context.data.byte(388) = -1;
- runendseq(context);
- clearbeforeload(context);
+static void getridoftempcharset(Context & context) {
+ context.es = context.data.word(406);
+ deallocatemem(context);
return;
}
-static inline void getridoftemptext(Context & context) {
- context.es = context.data.word(466);
+static void getridoftempsp(Context & context) {
+ context.es = context.data.word(464);
deallocatemem(context);
return;
}
-static inline void endgame(Context & context) {
- context.dx = 2273;
- loadtemptext(context);
- monkspeaking(context);
- gettingshot(context);
- getridoftemptext(context);
- context.data.byte(387) = 7;
- context.data.byte(388) = 1;
- context.cx = 200;
- hangon(context);
+static void readsetdata(Context & context) {
+ context.dx = 1870;
+ standardload(context);
+ context.data.word(404) = context.ax;
+ context.dx = 1935;
+ standardload(context);
+ context.data.word(408) = context.ax;
+ context.dx = 1948;
+ standardload(context);
+ context.data.word(410) = context.ax;
+ context.dx = 1832;
+ standardload(context);
+ context.data.word(414) = context.ax;
+ context.dx = 2234;
+ standardload(context);
+ context.data.word(454) = context.ax;
+ context.dx = 2286;
+ standardload(context);
+ context.data.word(452) = context.ax;
+ context.ax = context.data.word(404);
+ context.data.word(268) = context.ax;
+ context._cmp(context.data.byte(378), 255);
+ if (context.flags.z()) goto novolumeload;
+ context.dx = 2299;
+ openfile(context);
+ context.cx = 2048-256;
+ context.ds = context.data.word(353);
+ context.dx = 16384;
+ readfromfile(context);
+ closefile(context);
+novolumeload:
return;
}
-static inline void dreamweb(Context & context) {
+static void dreamweb(Context & context) {
seecommandtail(context);
checkbasemem(context);
soundstartup(context);
@@ -21536,6 +21430,8 @@ data.assign(src, src + sizeof(src));
};
+void __start(Context &context) { dreamweb(context); }
+
void __dispatch_call(Context &context, unsigned addr) {
switch(addr) {
case 0xc000: alleybarksound(context); break;
@@ -22132,7 +22028,6 @@ void __dispatch_call(Context &context, unsigned addr) {
case 0xc93c: getridofpit(context); break;
case 0xc940: pitinterupt(context); break;
case 0xc944: dreamweb(context); break;
- case 0xc944: dreamweb(context); break;
case 0xc948: entrytexts(context); break;
case 0xc94c: entryanims(context); break;
case 0xc950: initialinv(context); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 7cad64ee2e..f4d1801b96 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -13,40 +13,28 @@ namespace dreamgen {
typedef RegisterContext<Data> Context;
void __dispatch_call(Context &context, unsigned addr);
+ void __start(Context &context);
void randomnumber(Context &context);
void quickquit(Context &context);
void quickquit2(Context &context);
- void deallocatemem(Context &context);
- void vsync(Context &context);
- void closefile(Context &context);
- void readfromfile(Context &context);
- void allocatemem(Context &context);
- void openfile(Context &context);
- void loadsecondsample(Context &context);
- void mousecall(Context &context);
- void loadseg(Context &context);
- void dontloadseg(Context &context);
- void showgroup(Context &context);
- void showpcx(Context &context);
- void mode640x480(Context &context);
- void setmode(Context &context);
- void scanfornames(Context &context);
- void openfilenocheck(Context &context);
- void setsoundoff(Context &context);
- void loadsample(Context &context);
- void set16colpalette(Context &context);
- void gettime(Context &context);
- void fadedos(Context &context);
- void setmouse(Context &context);
- void setupemm(Context &context);
- void setkeyboardint(Context &context);
- void soundstartup(Context &context);
void keyboardread(Context &context);
void resetkeyboard(Context &context);
+ void setkeyboardint(Context &context);
+ void readfromfile(Context &context);
+ void closefile(Context &context);
void openforsave(Context &context);
+ void openfilenocheck(Context &context);
+ void openfile(Context &context);
void createfile(Context &context);
+ void dontloadseg(Context &context);
+ void mousecall(Context &context);
+ void setmouse(Context &context);
+ void gettime(Context &context);
+ void allocatemem(Context &context);
+ void deallocatemem(Context &context);
void removeemm(Context &context);
+ void setupemm(Context &context);
void pitinterupt(Context &context);
void getridofpit(Context &context);
void setuppit(Context &context);
@@ -63,15 +51,28 @@ namespace dreamgen {
void disablesoundint(Context &context);
void enablesoundint(Context &context);
void checksoundint(Context &context);
+ void setsoundoff(Context &context);
+ void soundstartup(Context &context);
+ void loadsecondsample(Context &context);
+ void loadsample(Context &context);
void loadspeech(Context &context);
+ void scanfornames(Context &context);
void saveseg(Context &context);
+ void loadseg(Context &context);
void loadposition(Context &context);
void saveposition(Context &context);
void error(Context &context);
void generalerror(Context &context);
void dosreturn(Context &context);
+ void set16colpalette(Context &context);
+ void mode640x480(Context &context);
+ void showgroup(Context &context);
+ void fadedos(Context &context);
void doshake(Context &context);
+ void vsync(Context &context);
+ void setmode(Context &context);
void readoneblock(Context &context);
+ void showpcx(Context &context);
}
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index ec3c9992a3..594357203f 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -40,6 +40,7 @@
#include "graphics/palette.h"
#include "dreamweb/dreamweb.h"
+#include "dreamweb/dreamgen.h"
namespace DreamWeb {
@@ -91,6 +92,9 @@ void DreamWebEngine::waitForVSync() {
Common::Error DreamWebEngine::run() {
_console = new DreamWebConsole(this);
+
+ dreamgen::Context context;
+ dreamgen::__start(context);
Common::EventManager *event_manager = _system->getEventManager();
getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this);