diff options
| author | Eugene Sandulenko | 2011-07-19 03:03:09 -0700 | 
|---|---|---|
| committer | Eugene Sandulenko | 2011-07-19 03:03:09 -0700 | 
| commit | 73cf347b94a41930b33d198755025b4a9a27dd62 (patch) | |
| tree | fdff4872516f6a49abd6383c5d38df9bbc03e8ca | |
| parent | e1ca235c4457e7f5f35dea688396845146fbf04a (diff) | |
| parent | 599c0f486262c1d3677c94f0122dab604e324084 (diff) | |
| download | scummvm-rg350-73cf347b94a41930b33d198755025b4a9a27dd62.tar.gz scummvm-rg350-73cf347b94a41930b33d198755025b4a9a27dd62.tar.bz2 scummvm-rg350-73cf347b94a41930b33d198755025b4a9a27dd62.zip  | |
Merge pull request #48 from tramboi/master
DREAMWEB: More porting into C++
| -rw-r--r-- | devtools/tasmrecover/dreamweb/vars.asm | 2 | ||||
| -rwxr-xr-x | devtools/tasmrecover/tasm-recover | 17 | ||||
| -rw-r--r-- | devtools/tasmrecover/tasm/cpp.py | 14 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.cpp | 2154 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.h | 804 | ||||
| -rw-r--r-- | engines/dreamweb/structs.h | 48 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.cpp | 680 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.h | 50 | 
8 files changed, 2273 insertions, 1496 deletions
diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm index 8646697e52..8678231a9d 100644 --- a/devtools/tasmrecover/dreamweb/vars.asm +++ b/devtools/tasmrecover/dreamweb/vars.asm @@ -273,7 +273,7 @@ savesource	dw	0  savex	db	0  savey	db	0  currentob	db	0 -priority	db	0 +priorityDep	db	0	; dep for deprecated, I leave a byte here to minimize changes to the generated code  destpos	db	0 diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index 54fc091f06..6b1c6d9d23 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -15,14 +15,29 @@ generator = cpp(context, "DreamGen", blacklist = [  	'multiget',  	'multiput',  	'multidump', -	'frameoutnm',  +	'frameoutnm', +	'frameoutbh', +	'frameoutfx',  	'cls',   	'printundermon', +	'kernchars', +	'getnextword',  	'worktoscreen',  	'width160',  	'convertkey',  	'readabyte',  	'readoneblock', +	'printsprites', +	'printasprite', +	'eraseoldobs', +	'clearsprites', +	'makesprite', +	'showframe', +	'initman', +	'walking', +	'spriteupdate', +	'dodoor', +	'liftsprite',  	'frameoutv',  	'modifychar',  	'lockmon' diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index dfdfb239f4..81c883da1e 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -544,14 +544,19 @@ namespace %s {  """\n#include "dreamweb/runtime.h"  namespace %s { - +#include "structs.h"  class %sContext : public Context {  public:  	void __start();  	void __dispatch_call(uint16 addr); +#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()  """   %(self.namespace, self.namespace)) + +		for name,addr in self.proc_addr: +			self.hd.write("\tstatic const uint16 addr_%s = 0x%04x;\n" %(name, addr)) +  		offsets = []  		for k, v in self.context.get_globals().items():  			if isinstance(v, op.var): @@ -564,7 +569,10 @@ public:  			self.hd.write("\tconst static uint16 k%s = %s;\n" %o)  		self.hd.write("\n")  		for p in set(self.methods): -			self.hd.write("\tvoid %s();\n" %p) +			if p in self.blacklist: +				self.hd.write("\t//void %s();\n" %p) +			else: +				self.hd.write("\tvoid %s();\n" %p)  		self.hd.write("};\n}\n\n#endif\n")  		self.hd.close() @@ -574,7 +582,7 @@ public:  		self.fd.write("\nvoid %sContext::__dispatch_call(uint16 addr) {\n\tswitch(addr) {\n" %self.namespace)  		self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1])  		for name,addr in self.proc_addr: -			self.fd.write("\t\tcase 0x%04x: %s(); break;\n" %(addr, name)) +			self.fd.write("\t\tcase addr_%s: %s(); break;\n" %(name, name))  		self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)ax);")  		self.fd.write("\n\t}\n}\n\n} /*namespace*/\n") diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index a25fae0874..b8a5e5122b 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2170,35 +2170,6 @@ forcenext:  	_cmp(al, al);  } -void DreamGenContext::clearsprites() { -	STACK_CHECK; -	es = data.word(kBuffers); -	di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -	al = 255; -	cx = (32)*16; -	_stosb(cx, true); -} - -void DreamGenContext::makesprite() { -	STACK_CHECK; -	es = data.word(kBuffers); -	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -_tmp17: -	_cmp(es.byte(bx+15), 255); -	if (flags.z()) -		goto _tmp17a; -	_add(bx, (32)); -	goto _tmp17; -_tmp17a: -	es.word(bx) = cx; -	es.word(bx+10) = si; -	es.word(bx+6) = dx; -	es.word(bx+8) = di; -	es.word(bx+2) = 0x0ffff; -	es.byte(bx+15) = 0; -	es.byte(bx+18) = 0; -} -  void DreamGenContext::delsprite() {  	STACK_CHECK;  	di = bx; @@ -2207,117 +2178,6 @@ void DreamGenContext::delsprite() {  	_stosb(cx, true);  } -void DreamGenContext::spriteupdate() { -	STACK_CHECK; -	es = data.word(kBuffers); -	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -	al = data.byte(kRyanon); -	es.byte(bx+31) = al; -	es = data.word(kBuffers); -	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -	cx = 16; -_tmp18: -	push(cx); -	push(bx); -	ax = es.word(bx); -	_cmp(ax, 0x0ffff); -	if (flags.z()) -		goto _tmp18a; -	push(es); -	push(ds); -	cx = es.word(bx+2); -	es.word(bx+24) = cx; -	__dispatch_call(ax); -	ds = pop(); -	es = pop(); -_tmp18a: -	bx = pop(); -	cx = pop(); -	_cmp(data.byte(kNowinnewroom), 1); -	if (flags.z()) -		return /* ($18b) */; -	_add(bx, (32)); -	if (--cx) -		goto _tmp18; -} - -void DreamGenContext::printsprites() { -	STACK_CHECK; -	es = data.word(kBuffers); -	cx = 0; -priorityloop: -	push(cx); -	data.byte(kPriority) = cl; -	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -	cx = 16; -prtspriteloop: -	push(cx); -	push(bx); -	ax = es.word(bx); -	_cmp(ax, 0x0ffff); -	if (flags.z()) -		goto skipsprite; -	al = data.byte(kPriority); -	_cmp(al, es.byte(bx+23)); -	if (!flags.z()) -		goto skipsprite; -	_cmp(es.byte(bx+31), 1); -	if (flags.z()) -		goto skipsprite; -	printasprite(); -skipsprite: -	bx = pop(); -	cx = pop(); -	_add(bx, (32)); -	if (--cx) -		goto prtspriteloop; -	cx = pop(); -	_inc(cx); -	_cmp(cx, 7); -	if (!flags.z()) -		goto priorityloop; -} - -void DreamGenContext::printasprite() { -	STACK_CHECK; -	push(es); -	push(bx); -	si = bx; -	ds = es.word(si+6); -	al = es.byte(si+11); -	ah = 0; -	_cmp(al, 220); -	if (flags.c()) -		goto notnegative1; -	ah = 255; -notnegative1: -	bx = ax; -	_add(bx, data.word(kMapady)); -	al = es.byte(si+10); -	ah = 0; -	_cmp(al, 220); -	if (flags.c()) -		goto notnegative2; -	ah = 255; -notnegative2: -	di = ax; -	_add(di, data.word(kMapadx)); -	al = es.byte(si+15); -	ah = 0; -	_cmp(es.byte(si+30), 0); -	if (flags.z()) -		goto steadyframe; -	ah = 8; -steadyframe: -	_cmp(data.byte(kPriority), 6); -	if (!flags.z()) -		goto notquickp; -notquickp: -	showframe(); -	bx = pop(); -	es = pop(); -} -  void DreamGenContext::checkone() {  	STACK_CHECK;  	push(cx); @@ -2374,20 +2234,6 @@ over1001:  	data.word(kTakeoff) = 320;  } -void DreamGenContext::initman() { -	STACK_CHECK; -	al = data.byte(kRyanx); -	ah = data.byte(kRyany); -	si = ax; -	cx = 49464; -	dx = data.word(kMainsprites); -	di = 0; -	makesprite(); -	es.byte(bx+23) = 4; -	es.byte(bx+22) = 0; -	es.byte(bx+29) = 0; -} -  void DreamGenContext::mainman() {  	STACK_CHECK;  	_cmp(data.byte(kResetmanxy), 1); @@ -2525,58 +2371,6 @@ decdir:  	es.byte(bx+29) = 0;  } -void DreamGenContext::walking() { -	STACK_CHECK; -	_cmp(data.byte(kLinedirection), 0); -	if (flags.z()) -		goto normalwalk; -	al = data.byte(kLinepointer); -	_dec(al); -	data.byte(kLinepointer) = al; -	_cmp(al, 200); -	if (!flags.c()) -		goto endofline; -	goto continuewalk; -normalwalk: -	al = data.byte(kLinepointer); -	_inc(al); -	data.byte(kLinepointer) = al; -	_cmp(al, data.byte(kLinelength)); -	if (!flags.c()) -		goto endofline; -continuewalk: -	ah = 0; -	_add(ax, ax); -	push(es); -	push(bx); -	dx = data; -	es = dx; -	bx = 8173; -	_add(bx, ax); -	ax = es.word(bx); -	bx = pop(); -	es = pop(); -	es.word(bx+10) = ax; -	return; -endofline: -	data.byte(kLinepointer) = 254; -	al = data.byte(kDestination); -	data.byte(kManspath) = al; -	_cmp(al, data.byte(kFinaldest)); -	if (flags.z()) -		goto finishedwalk; -	al = data.byte(kFinaldest); -	data.byte(kDestination) = al; -	push(es); -	push(bx); -	autosetwalk(); -	bx = pop(); -	es = pop(); -	return; -finishedwalk: -	facerightway(); -} -  void DreamGenContext::facerightway() {  	STACK_CHECK;  	push(es); @@ -3095,98 +2889,6 @@ steadyob:  	steady();  } -void DreamGenContext::liftsprite() { -	STACK_CHECK; -	al = data.byte(kLiftflag); -	_cmp(al, 0); -	if (flags.z()) -		goto liftclosed; -	_cmp(al, 1); -	if (flags.z()) -		goto liftopen; -	_cmp(al, 3); -	if (flags.z()) -		goto openlift; -	al = es.byte(bx+19); -	_cmp(al, 0); -	if (flags.z()) -		goto finishclose; -	_dec(al); -	_cmp(al, 11); -	if (!flags.z()) -		goto pokelift; -	push(ax); -	al = 3; -	liftnoise(); -	ax = pop(); -	goto pokelift; -finishclose: -	data.byte(kLiftflag) = 0; -	return; -openlift: -	al = es.byte(bx+19); -	_cmp(al, 12); -	if (flags.z()) -		goto endoflist; -	_inc(al); -	_cmp(al, 1); -	if (!flags.z()) -		goto pokelift; -	push(ax); -	al = 2; -	liftnoise(); -	ax = pop(); -pokelift: -	es.byte(bx+19) = al; -	ah = 0; -	push(di); -	_add(di, ax); -	al = ds.byte(di+18); -	di = pop(); -	es.byte(bx+15) = al; -	ds.byte(di+17) = al; -	return; -endoflist: -	data.byte(kLiftflag) = 1; -	return; -liftopen: -	al = data.byte(kLiftpath); -	push(es); -	push(bx); -	turnpathon(); -	bx = pop(); -	es = pop(); -	_cmp(data.byte(kCounttoclose), 0); -	if (flags.z()) -		goto nocountclose; -	_dec(data.byte(kCounttoclose)); -	_cmp(data.byte(kCounttoclose), 0); -	if (!flags.z()) -		goto nocountclose; -	data.byte(kLiftflag) = 2; -nocountclose: -	al = 12; -	goto pokelift; -liftclosed: -	al = data.byte(kLiftpath); -	push(es); -	push(bx); -	turnpathoff(); -	bx = pop(); -	es = pop(); -	_cmp(data.byte(kCounttoopen), 0); -	if (flags.z()) -		goto nocountopen; -	_dec(data.byte(kCounttoopen)); -	_cmp(data.byte(kCounttoopen), 0); -	if (!flags.z()) -		goto nocountopen; -	data.byte(kLiftflag) = 3; -nocountopen: -	al = 0; -	goto pokelift; -} -  void DreamGenContext::liftnoise() {  	STACK_CHECK;  	_cmp(data.byte(kReallocation), 5); @@ -3258,110 +2960,6 @@ void DreamGenContext::widedoor() {  	dodoor();  } -void DreamGenContext::dodoor() { -	STACK_CHECK; -	al = data.byte(kRyanx); -	ah = data.byte(kRyany); -	cl = es.byte(bx+10); -	ch = es.byte(bx+11); -	_cmp(al, cl); -	if (!flags.c()) -		goto rtofdoor; -	_sub(al, cl); -	_cmp(al, data.byte(kDoorcheck1)); -	if (!flags.c()) -		goto upordown; -	goto shutdoor; -rtofdoor: -	_sub(al, cl); -	_cmp(al, data.byte(kDoorcheck2)); -	if (!flags.c()) -		goto shutdoor; -upordown: -	_cmp(ah, ch); -	if (!flags.c()) -		goto botofdoor; -	_sub(ah, ch); -	_cmp(ah, data.byte(kDoorcheck3)); -	if (flags.c()) -		goto shutdoor; -	goto opendoor; -botofdoor: -	_sub(ah, ch); -	_cmp(ah, data.byte(kDoorcheck4)); -	if (!flags.c()) -		goto shutdoor; -opendoor: -	cl = es.byte(bx+19); -	_cmp(data.byte(kThroughdoor), 1); -	if (!flags.z()) -		goto notthrough; -	_cmp(cl, 0); -	if (!flags.z()) -		goto notthrough; -	cl = 6; -notthrough: -	_inc(cl); -	_cmp(cl, 1); -	if (!flags.z()) -		goto notdoorsound2; -	al = 0; -	_cmp(data.byte(kReallocation), 5); -	if (!flags.z()) -		goto nothoteldoor2; -	al = 13; -nothoteldoor2: -	playchannel1(); -notdoorsound2: -	ch = 0; -	push(di); -	_add(di, cx); -	al = ds.byte(di+18); -	_cmp(al, 255); -	if (!flags.z()) -		goto atlast1; -	_dec(di); -	_dec(cl); -atlast1: -	es.byte(bx+19) = cl; -	al = ds.byte(di+18); -	di = pop(); -	es.byte(bx+15) = al; -	ds.byte(di+17) = al; -	data.byte(kThroughdoor) = 1; -	return; -shutdoor: -	cl = es.byte(bx+19); -	_cmp(cl, 5); -	if (!flags.z()) -		goto notdoorsound1; -	al = 1; -	_cmp(data.byte(kReallocation), 5); -	if (!flags.z()) -		goto nothoteldoor1; -	al = 13; -nothoteldoor1: -	playchannel1(); -notdoorsound1: -	_cmp(cl, 0); -	if (flags.z()) -		goto atlast2; -	_dec(cl); -	es.byte(bx+19) = cl; -atlast2: -	ch = 0; -	push(di); -	_add(di, cx); -	al = ds.byte(di+18); -	di = pop(); -	es.byte(bx+15) = al; -	ds.byte(di+17) = al; -	_cmp(cl, 5); -	if (!flags.z()) -		return /* (notnearly) */; -	data.byte(kThroughdoor) = 0; -} -  void DreamGenContext::lockeddoorway() {  	STACK_CHECK;  	al = data.byte(kRyanx); @@ -4230,198 +3828,6 @@ zeroblock:  		goto loop120;  } -void DreamGenContext::showframe() { -	STACK_CHECK; -	push(dx); -	push(ax); -	cx = ax; -	_and(cx, 511); -	_add(cx, cx); -	si = cx; -	_add(cx, cx); -	_add(si, cx); -	_cmp(ds.word(si), 0); -	if (!flags.z()) -		goto notblankshow; -	ax = pop(); -	dx = pop(); -	cx = 0; -	return; -notblankshow: -	_test(ah, 128); -	if (!flags.z()) -		goto skipoffsets; -	al = ds.byte(si+4); -	ah = 0; -	_add(di, ax); -	al = ds.byte(si+5); -	ah = 0; -	_add(bx, ax); -skipoffsets: -	cx = ds.word(si+0); -	ax = ds.word(si+2); -	_add(ax, 2080); -	si = ax; -	ax = pop(); -	dx = pop(); -	_cmp(ah, 0); -	if (flags.z()) -		goto noeffects; -	_test(ah, 128); -	if (flags.z()) -		goto notcentred; -	push(ax); -	al = cl; -	ah = 0; -	_shr(ax, 1); -	_sub(di, ax); -	al = ch; -	ah = 0; -	_shr(ax, 1); -	_sub(bx, ax); -	ax = pop(); -notcentred: -	_test(ah, 64); -	if (flags.z()) -		goto notdiffdest; -	push(cx); -	frameoutfx(); -	cx = pop(); -	return; -notdiffdest: -	_test(ah, 8); -	if (flags.z()) -		goto notprintlist; -	push(ax); -	ax = di; -	_sub(ax, data.word(kMapadx)); -	push(bx); -	_sub(bx, data.word(kMapady)); -	ah = bl; -	bx = pop(); -	ax = pop(); -notprintlist: -	_test(ah, 4); -	if (flags.z()) -		goto notflippedx; -	dx = (320); -	es = data.word(kWorkspace); -	push(cx); -	frameoutfx(); -	cx = pop(); -	return; -notflippedx: -	_test(ah, 2); -	if (flags.z()) -		goto notnomask; -	dx = (320); -	es = data.word(kWorkspace); -	push(cx); -	frameoutnm(); -	cx = pop(); -	return; -notnomask: -	_test(ah, 32); -	if (flags.z()) -		goto noeffects; -	dx = (320); -	es = data.word(kWorkspace); -	push(cx); -	frameoutbh(); -	cx = pop(); -	return; -noeffects: -	dx = (320); -	es = data.word(kWorkspace); -	push(cx); -	frameoutv(); -	cx = pop(); -} - -void DreamGenContext::frameoutbh() { -	STACK_CHECK; -	push(dx); -	ax = bx; -	bx = dx; -	_mul(bx); -	_add(di, ax); -	dx = pop(); -	push(cx); -	ch = 0; -	_sub(dx, cx); -	cx = pop(); -bhloop2: -	push(cx); -	ch = 0; -	ah = 255; -bhloop1: -	_cmp(es.byte(di), ah); -	if (!flags.z()) -		goto nofill; -	_movsb(); -	if (--cx) -		goto bhloop1; -	goto nextline; -nofill: -	_inc(di); -	_inc(si); -	if (--cx) -		goto bhloop1; -nextline: -	_add(di, dx); -	cx = pop(); -	_dec(ch); -	if (!flags.z()) -		goto bhloop2; -} - -void DreamGenContext::frameoutfx() { -	STACK_CHECK; -	push(dx); -	ax = bx; -	bx = dx; -	_mul(bx); -	_add(di, ax); -	dx = pop(); -	push(cx); -	ch = 0; -	_add(dx, cx); -	cx = pop(); -frameloopfx1: -	push(cx); -	ch = 0; -frameloopfx2: -	_lodsb(); -	_cmp(al, 0); -	if (!flags.z()) -		goto backtosolidfx; -backtootherfx: -	_dec(di); -	if (--cx) -		goto frameloopfx2; -	cx = pop(); -	_add(di, dx); -	_dec(ch); -	if (!flags.z()) -		goto frameloopfx1; -	return; -frameloopfx3: -	_lodsb(); -	_cmp(al, 0); -	if (flags.z()) -		goto backtootherfx; -backtosolidfx: -	es.byte(di) = al; -	_dec(di); -	if (--cx) -		goto frameloopfx3; -	cx = pop(); -	_add(di, dx); -	_dec(ch); -	if (!flags.z()) -		goto frameloopfx1; -} -  void DreamGenContext::transferinv() {  	STACK_CHECK;  	di = data.word(kExframepos); @@ -5540,36 +4946,6 @@ nokern:  	cx = pop();  } -void DreamGenContext::kernchars() { -	STACK_CHECK; -	_cmp(al, 'a'); -	if (flags.z()) -		goto iskern; -	_cmp(al, 'u'); -	if (flags.z()) -		goto iskern; -	return; -iskern: -	_cmp(ah, 'n'); -	if (flags.z()) -		goto kernit; -	_cmp(ah, 't'); -	if (flags.z()) -		goto kernit; -	_cmp(ah, 'r'); -	if (flags.z()) -		goto kernit; -	_cmp(ah, 'i'); -	if (flags.z()) -		goto kernit; -	_cmp(ah, 'l'); -	if (flags.z()) -		goto kernit; -	return; -kernit: -	_dec(cl); -} -  void DreamGenContext::printslow() {  	STACK_CHECK;  	data.byte(kPointerframe) = 1; @@ -5941,48 +5317,6 @@ notcent2:  	cl = ch;  } -void DreamGenContext::getnextword() { -	STACK_CHECK; -	bx = 0; -getloop: -	ax = es.word(di); -	_inc(di); -	_inc(bh); -	_cmp(al, ':'); -	if (flags.z()) -		goto endall; -	_cmp(al, 0); -	if (flags.z()) -		goto endall; -	_cmp(al, 32); -	if (flags.z()) -		goto endword; -	modifychar(); -	_cmp(al, 255); -	if (flags.z()) -		goto getloop; -	push(ax); -	_sub(al, 32); -	ah = 0; -	_add(ax, data.word(kCharshift)); -	_add(ax, ax); -	si = ax; -	_add(ax, ax); -	_add(si, ax); -	cl = ds.byte(si+0); -	ax = pop(); -	kernchars(); -	_add(bl, cl); -	goto getloop; -endword: -	_add(bl, 6); -	al = 0; -	return; -endall: -	_add(bl, 6); -	al = 1; -} -  void DreamGenContext::fillryan() {  	STACK_CHECK;  	es = data.word(kBuffers); @@ -8501,33 +7835,6 @@ _tmp28a:  		goto _tmp28;  } -void DreamGenContext::eraseoldobs() { -	STACK_CHECK; -	_cmp(data.byte(kNewobs), 0); -	if (flags.z()) -		return /* (donterase) */; -	es = data.word(kBuffers); -	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768); -	cx = 16; -oberase: -	push(cx); -	push(bx); -	ax = es.word(bx+20); -	_cmp(ax, 0x0ffff); -	if (flags.z()) -		goto notthisob; -	di = bx; -	al = 255; -	cx = (32); -	_stosb(cx, true); -notthisob: -	bx = pop(); -	cx = pop(); -	_add(bx, (32)); -	if (--cx) -		goto oberase; -} -  void DreamGenContext::showallobs() {  	STACK_CHECK;  	es = data.word(kBuffers); @@ -22062,744 +21369,729 @@ dreamweb();  void DreamGenContext::__dispatch_call(uint16 addr) {  	switch(addr) { -		case 0xc000: alleybarksound(); break; -		case 0xc004: intromusic(); break; -		case 0xc008: foghornsound(); break; -		case 0xc00c: receptionist(); break; -		case 0xc010: smokebloke(); break; -		case 0xc014: attendant(); break; -		case 0xc018: manasleep(); break; -		case 0xc01c: eden(); break; -		case 0xc020: edeninbath(); break; -		case 0xc024: malefan(); break; -		case 0xc028: femalefan(); break; -		case 0xc02c: louis(); break; -		case 0xc030: louischair(); break; -		case 0xc034: manasleep2(); break; -		case 0xc038: mansatstill(); break; -		case 0xc03c: tattooman(); break; -		case 0xc040: drinker(); break; -		case 0xc044: bartender(); break; -		case 0xc048: othersmoker(); break; -		case 0xc04c: barwoman(); break; -		case 0xc050: interviewer(); break; -		case 0xc054: soldier1(); break; -		case 0xc058: rockstar(); break; -		case 0xc05c: helicopter(); break; -		case 0xc060: mugger(); break; -		case 0xc064: aide(); break; -		case 0xc068: businessman(); break; -		case 0xc06c: poolguard(); break; -		case 0xc070: security(); break; -		case 0xc074: heavy(); break; -		case 0xc078: bossman(); break; -		case 0xc07c: gamer(); break; -		case 0xc080: sparkydrip(); break; -		case 0xc084: carparkdrip(); break; -		case 0xc088: keeper(); break; -		case 0xc08c: candles1(); break; -		case 0xc090: smallcandle(); break; -		case 0xc094: intromagic1(); break; -		case 0xc098: candles(); break; -		case 0xc09c: candles2(); break; -		case 0xc0a0: gates(); break; -		case 0xc0a4: intromagic2(); break; -		case 0xc0a8: intromagic3(); break; -		case 0xc0ac: intromonks1(); break; -		case 0xc0b0: intromonks2(); break; -		case 0xc0b4: handclap(); break; -		case 0xc0b8: monks2text(); break; -		case 0xc0bc: intro1text(); break; -		case 0xc0c0: intro2text(); break; -		case 0xc0c4: intro3text(); break; -		case 0xc0c8: monkandryan(); break; -		case 0xc0cc: endgameseq(); break; -		case 0xc0d0: rollendcredits(); break; -		case 0xc0d4: priest(); break; -		case 0xc0d8: madmanstelly(); break; -		case 0xc0dc: madman(); break; -		case 0xc0e0: madmantext(); break; -		case 0xc0e4: madmode(); break; -		case 0xc0e8: priesttext(); break; -		case 0xc0ec: textforend(); break; -		case 0xc0f0: textformonk(); break; -		case 0xc0f4: drunk(); break; -		case 0xc0f8: advisor(); break; -		case 0xc0fc: copper(); break; -		case 0xc100: sparky(); break; -		case 0xc104: train(); break; -		case 0xc108: addtopeoplelist(); break; -		case 0xc10c: showgamereel(); break; -		case 0xc110: checkspeed(); break; -		case 0xc114: clearsprites(); break; -		case 0xc118: makesprite(); break; -		case 0xc11c: delsprite(); break; -		case 0xc120: spriteupdate(); break; -		case 0xc124: printsprites(); break; -		case 0xc128: printasprite(); break; -		case 0xc12c: checkone(); break; -		case 0xc130: findsource(); break; -		case 0xc134: initman(); break; -		case 0xc138: mainman(); break; -		case 0xc13c: aboutturn(); break; -		case 0xc140: walking(); break; -		case 0xc144: facerightway(); break; -		case 0xc148: checkforexit(); break; -		case 0xc14c: adjustdown(); break; -		case 0xc150: adjustup(); break; -		case 0xc154: adjustleft(); break; -		case 0xc158: adjustright(); break; -		case 0xc15c: reminders(); break; -		case 0xc160: initrain(); break; -		case 0xc164: splitintolines(); break; -		case 0xc168: getblockofpixel(); break; -		case 0xc16c: showrain(); break; -		case 0xc170: backobject(); break; -		case 0xc174: liftsprite(); break; -		case 0xc178: liftnoise(); break; -		case 0xc17c: random(); break; -		case 0xc180: steady(); break; -		case 0xc184: constant(); break; -		case 0xc188: doorway(); break; -		case 0xc18c: widedoor(); break; -		case 0xc190: dodoor(); break; -		case 0xc194: lockeddoorway(); break; -		case 0xc198: updatepeople(); break; -		case 0xc19c: getreelframeax(); break; -		case 0xc1a0: reelsonscreen(); break; -		case 0xc1a4: plotreel(); break; -		case 0xc1a8: soundonreels(); break; -		case 0xc1ac: reconstruct(); break; -		case 0xc1b0: dealwithspecial(); break; -		case 0xc1b4: movemap(); break; -		case 0xc1b8: getreelstart(); break; -		case 0xc1bc: showreelframe(); break; -		case 0xc1c0: deleverything(); break; -		case 0xc1c4: dumpeverything(); break; -		case 0xc1c8: allocatework(); break; -		case 0xc1cc: showpcx(); break; -		case 0xc1d8: loadpalfromiff(); break; -		case 0xc1dc: setmode(); break; -		case 0xc1ec: paneltomap(); break; -		case 0xc1f0: maptopanel(); break; -		case 0xc1f4: dumpmap(); break; -		case 0xc1f8: pixelcheckset(); break; -		case 0xc1fc: createpanel(); break; -		case 0xc200: createpanel2(); break; -		case 0xc204: clearwork(); break; -		case 0xc208: vsync(); break; -		case 0xc20c: doshake(); break; -		case 0xc210: zoom(); break; -		case 0xc214: delthisone(); break; -		case 0xc228: doblocks(); break; -		case 0xc22c: showframe(); break; -		case 0xc238: frameoutbh(); break; -		case 0xc23c: frameoutfx(); break; -		case 0xc240: transferinv(); break; -		case 0xc244: transfermap(); break; -		case 0xc248: fadedos(); break; -		case 0xc24c: dofade(); break; -		case 0xc250: clearendpal(); break; -		case 0xc254: clearpalette(); break; -		case 0xc258: fadescreenup(); break; -		case 0xc25c: fadetowhite(); break; -		case 0xc260: fadefromwhite(); break; -		case 0xc264: fadescreenups(); break; -		case 0xc268: fadescreendownhalf(); break; -		case 0xc26c: fadescreenuphalf(); break; -		case 0xc270: fadescreendown(); break; -		case 0xc274: fadescreendowns(); break; -		case 0xc278: clearstartpal(); break; -		case 0xc27c: showgun(); break; -		case 0xc280: rollendcredits2(); break; -		case 0xc284: rollem(); break; -		case 0xc288: fadecalculation(); break; -		case 0xc28c: greyscalesum(); break; -		case 0xc290: showgroup(); break; -		case 0xc294: paltostartpal(); break; -		case 0xc298: endpaltostart(); break; -		case 0xc29c: startpaltoend(); break; -		case 0xc2a0: paltoendpal(); break; -		case 0xc2a4: allpalette(); break; -		case 0xc2a8: dumpcurrent(); break; -		case 0xc2ac: fadedownmon(); break; -		case 0xc2b0: fadeupmon(); break; -		case 0xc2b4: fadeupmonfirst(); break; -		case 0xc2b8: fadeupyellows(); break; -		case 0xc2bc: initialmoncols(); break; -		case 0xc2c0: titles(); break; -		case 0xc2c4: endgame(); break; -		case 0xc2c8: monkspeaking(); break; -		case 0xc2cc: showmonk(); break; -		case 0xc2d0: gettingshot(); break; -		case 0xc2d4: credits(); break; -		case 0xc2d8: biblequote(); break; -		case 0xc2dc: hangone(); break; -		case 0xc2e0: intro(); break; -		case 0xc2e4: runintroseq(); break; -		case 0xc2e8: runendseq(); break; -		case 0xc2ec: loadintroroom(); break; -		case 0xc2f0: mode640x480(); break; -		case 0xc2f4: set16colpalette(); break; -		case 0xc2f8: realcredits(); break; -		case 0xc2fc: printchar(); break; -		case 0xc300: kernchars(); break; -		case 0xc304: printslow(); break; -		case 0xc308: waitframes(); break; -		case 0xc30c: printboth(); break; -		case 0xc310: printdirect(); break; -		case 0xc314: monprint(); break; -		case 0xc318: getnumber(); break; -		case 0xc31c: getnextword(); break; -		case 0xc320: fillryan(); break; -		case 0xc324: fillopen(); break; -		case 0xc328: findallryan(); break; -		case 0xc32c: findallopen(); break; -		case 0xc330: obtoinv(); break; -		case 0xc334: isitworn(); break; -		case 0xc338: makeworn(); break; -		case 0xc33c: examineob(); break; -		case 0xc340: makemainscreen(); break; -		case 0xc344: getbackfromob(); break; -		case 0xc348: incryanpage(); break; -		case 0xc34c: openinv(); break; -		case 0xc350: showryanpage(); break; -		case 0xc354: openob(); break; -		case 0xc358: obicons(); break; -		case 0xc35c: examicon(); break; -		case 0xc360: obpicture(); break; -		case 0xc364: describeob(); break; -		case 0xc368: additionaltext(); break; -		case 0xc36c: obsthatdothings(); break; -		case 0xc370: getobtextstart(); break; -		case 0xc374: searchforsame(); break; -		case 0xc378: findnextcolon(); break; -		case 0xc37c: inventory(); break; -		case 0xc380: setpickup(); break; -		case 0xc384: examinventory(); break; -		case 0xc388: reexfrominv(); break; -		case 0xc38c: reexfromopen(); break; -		case 0xc390: swapwithinv(); break; -		case 0xc394: swapwithopen(); break; -		case 0xc398: intoinv(); break; -		case 0xc39c: deletetaken(); break; -		case 0xc3a0: outofinv(); break; -		case 0xc3a4: getfreead(); break; -		case 0xc3a8: getexad(); break; -		case 0xc3ac: geteitherad(); break; -		case 0xc3b0: getanyad(); break; -		case 0xc3b4: getanyaddir(); break; -		case 0xc3b8: getopenedsize(); break; -		case 0xc3bc: getsetad(); break; -		case 0xc3c0: findinvpos(); break; -		case 0xc3c4: findopenpos(); break; -		case 0xc3c8: dropobject(); break; -		case 0xc3cc: droperror(); break; -		case 0xc3d0: cantdrop(); break; -		case 0xc3d4: wornerror(); break; -		case 0xc3d8: removeobfrominv(); break; -		case 0xc3dc: selectopenob(); break; -		case 0xc3e0: useopened(); break; -		case 0xc3e4: errormessage1(); break; -		case 0xc3e8: errormessage2(); break; -		case 0xc3ec: errormessage3(); break; -		case 0xc3f0: checkobjectsize(); break; -		case 0xc3f4: outofopen(); break; -		case 0xc3f8: transfertoex(); break; -		case 0xc3fc: pickupconts(); break; -		case 0xc400: transfercontoex(); break; -		case 0xc404: transfertext(); break; -		case 0xc408: getexpos(); break; -		case 0xc40c: purgealocation(); break; -		case 0xc410: emergencypurge(); break; -		case 0xc414: purgeanitem(); break; -		case 0xc418: deleteexobject(); break; -		case 0xc41c: deleteexframe(); break; -		case 0xc420: deleteextext(); break; -		case 0xc424: blockget(); break; -		case 0xc428: drawfloor(); break; -		case 0xc42c: calcmapad(); break; -		case 0xc430: getdimension(); break; -		case 0xc434: addalong(); break; -		case 0xc438: addlength(); break; -		case 0xc43c: drawflags(); break; -		case 0xc440: eraseoldobs(); break; -		case 0xc444: showallobs(); break; -		case 0xc448: makebackob(); break; -		case 0xc44c: showallfree(); break; -		case 0xc450: showallex(); break; -		case 0xc454: calcfrframe(); break; -		case 0xc458: finalframe(); break; -		case 0xc45c: adjustlen(); break; -		case 0xc460: getmapad(); break; -		case 0xc464: getxad(); break; -		case 0xc468: getyad(); break; -		case 0xc46c: autolook(); break; -		case 0xc470: look(); break; -		case 0xc474: dolook(); break; -		case 0xc478: redrawmainscrn(); break; -		case 0xc47c: getback1(); break; -		case 0xc480: talk(); break; -		case 0xc484: convicons(); break; -		case 0xc488: getpersframe(); break; -		case 0xc48c: starttalk(); break; -		case 0xc490: getpersontext(); break; -		case 0xc494: moretalk(); break; -		case 0xc498: dosometalk(); break; -		case 0xc49c: hangonpq(); break; -		case 0xc4a0: redes(); break; -		case 0xc4a4: newplace(); break; -		case 0xc4a8: selectlocation(); break; -		case 0xc4ac: showcity(); break; -		case 0xc4b0: lookatplace(); break; -		case 0xc4b4: getundercentre(); break; -		case 0xc4b8: putundercentre(); break; -		case 0xc4bc: locationpic(); break; -		case 0xc4c0: getdestinfo(); break; -		case 0xc4c4: showarrows(); break; -		case 0xc4c8: nextdest(); break; -		case 0xc4cc: lastdest(); break; -		case 0xc4d0: destselect(); break; -		case 0xc4d4: getlocation(); break; -		case 0xc4d8: setlocation(); break; -		case 0xc4dc: resetlocation(); break; -		case 0xc4e0: readdesticon(); break; -		case 0xc4e4: readcitypic(); break; -		case 0xc4e8: usemon(); break; -		case 0xc4ec: printoutermon(); break; -		case 0xc4f0: loadpersonal(); break; -		case 0xc4f4: loadnews(); break; -		case 0xc4f8: loadcart(); break; -		case 0xc4fc: lookininterface(); break; -		case 0xc500: turnonpower(); break; -		case 0xc504: randomaccess(); break; -		case 0xc508: powerlighton(); break; -		case 0xc50c: powerlightoff(); break; -		case 0xc510: accesslighton(); break; -		case 0xc514: accesslightoff(); break; -		case 0xc518: locklighton(); break; -		case 0xc51c: locklightoff(); break; -		case 0xc520: input(); break; -		case 0xc524: makecaps(); break; -		case 0xc528: delchar(); break; -		case 0xc52c: execcommand(); break; -		case 0xc530: neterror(); break; -		case 0xc534: dircom(); break; -		case 0xc538: searchforfiles(); break; -		case 0xc53c: signon(); break; -		case 0xc540: showkeys(); break; -		case 0xc544: read(); break; -		case 0xc548: dirfile(); break; -		case 0xc54c: getkeyandlogo(); break; -		case 0xc550: searchforstring(); break; -		case 0xc554: parser(); break; -		case 0xc558: scrollmonitor(); break; -		case 0xc560: monitorlogo(); break; -		case 0xc564: printlogo(); break; -		case 0xc568: showcurrentfile(); break; -		case 0xc56c: monmessage(); break; -		case 0xc570: processtrigger(); break; -		case 0xc574: triggermessage(); break; -		case 0xc578: printcurs(); break; -		case 0xc57c: delcurs(); break; -		case 0xc580: useobject(); break; -		case 0xc584: useroutine(); break; -		case 0xc588: wheelsound(); break; -		case 0xc58c: runtap(); break; -		case 0xc590: playguitar(); break; -		case 0xc594: hotelcontrol(); break; -		case 0xc598: hotelbell(); break; -		case 0xc59c: opentomb(); break; -		case 0xc5a0: usetrainer(); break; -		case 0xc5a4: nothelderror(); break; -		case 0xc5a8: usepipe(); break; -		case 0xc5ac: usefullcart(); break; -		case 0xc5b0: useplinth(); break; -		case 0xc5b4: chewy(); break; -		case 0xc5b8: useladder(); break; -		case 0xc5bc: useladderb(); break; -		case 0xc5c0: slabdoora(); break; -		case 0xc5c4: slabdoorb(); break; -		case 0xc5c8: slabdoord(); break; -		case 0xc5cc: slabdoorc(); break; -		case 0xc5d0: slabdoore(); break; -		case 0xc5d4: slabdoorf(); break; -		case 0xc5d8: useslab(); break; -		case 0xc5dc: usecart(); break; -		case 0xc5e0: useclearbox(); break; -		case 0xc5e4: usecoveredbox(); break; -		case 0xc5e8: userailing(); break; -		case 0xc5ec: useopenbox(); break; -		case 0xc5f0: wearwatch(); break; -		case 0xc5f4: wearshades(); break; -		case 0xc5f8: sitdowninbar(); break; -		case 0xc5fc: usechurchhole(); break; -		case 0xc600: usehole(); break; -		case 0xc604: usealtar(); break; -		case 0xc608: opentvdoor(); break; -		case 0xc60c: usedryer(); break; -		case 0xc610: openlouis(); break; -		case 0xc614: nextcolon(); break; -		case 0xc618: openyourneighbour(); break; -		case 0xc61c: usewindow(); break; -		case 0xc620: usebalcony(); break; -		case 0xc624: openryan(); break; -		case 0xc628: openpoolboss(); break; -		case 0xc62c: openeden(); break; -		case 0xc630: opensarters(); break; -		case 0xc634: isitright(); break; -		case 0xc638: drawitall(); break; -		case 0xc63c: openhoteldoor(); break; -		case 0xc640: openhoteldoor2(); break; -		case 0xc644: grafittidoor(); break; -		case 0xc648: trapdoor(); break; -		case 0xc64c: callhotellift(); break; -		case 0xc650: calledenslift(); break; -		case 0xc654: calledensdlift(); break; -		case 0xc658: usepoolreader(); break; -		case 0xc65c: uselighter(); break; -		case 0xc660: showseconduse(); break; -		case 0xc664: usecardreader1(); break; -		case 0xc668: usecardreader2(); break; -		case 0xc66c: usecardreader3(); break; -		case 0xc670: usecashcard(); break; -		case 0xc674: lookatcard(); break; -		case 0xc678: moneypoke(); break; -		case 0xc67c: usecontrol(); break; -		case 0xc680: usehatch(); break; -		case 0xc684: usewire(); break; -		case 0xc688: usehandle(); break; -		case 0xc68c: useelevator1(); break; -		case 0xc690: showfirstuse(); break; -		case 0xc694: useelevator3(); break; -		case 0xc698: useelevator4(); break; -		case 0xc69c: useelevator2(); break; -		case 0xc6a0: useelevator5(); break; -		case 0xc6a4: usekey(); break; -		case 0xc6a8: usestereo(); break; -		case 0xc6ac: usecooker(); break; -		case 0xc6b0: useaxe(); break; -		case 0xc6b4: useelvdoor(); break; -		case 0xc6b8: withwhat(); break; -		case 0xc6bc: selectob(); break; -		case 0xc6c0: compare(); break; -		case 0xc6c4: findsetobject(); break; -		case 0xc6c8: findexobject(); break; -		case 0xc6cc: isryanholding(); break; -		case 0xc6d0: checkinside(); break; -		case 0xc6d4: usetext(); break; -		case 0xc6d8: putbackobstuff(); break; -		case 0xc6dc: showpuztext(); break; -		case 0xc6e0: findpuztext(); break; -		case 0xc6e4: placesetobject(); break; -		case 0xc6e8: removesetobject(); break; -		case 0xc6ec: issetobonmap(); break; -		case 0xc6f0: placefreeobject(); break; -		case 0xc6f4: removefreeobject(); break; -		case 0xc6f8: findormake(); break; -		case 0xc6fc: switchryanon(); break; -		case 0xc700: switchryanoff(); break; -		case 0xc704: setallchanges(); break; -		case 0xc708: dochange(); break; -		case 0xc70c: autoappear(); break; -		case 0xc710: getundertimed(); break; -		case 0xc714: putundertimed(); break; -		case 0xc718: dumptimedtext(); break; -		case 0xc71c: setuptimeduse(); break; -		case 0xc720: setuptimedtemp(); break; -		case 0xc724: usetimedtext(); break; -		case 0xc728: edenscdplayer(); break; -		case 0xc72c: usewall(); break; -		case 0xc730: usechurchgate(); break; -		case 0xc734: usegun(); break; -		case 0xc738: useshield(); break; -		case 0xc73c: usebuttona(); break; -		case 0xc740: useplate(); break; -		case 0xc744: usewinch(); break; -		case 0xc748: entercode(); break; -		case 0xc74c: loadkeypad(); break; -		case 0xc750: quitkey(); break; -		case 0xc754: addtopresslist(); break; -		case 0xc758: buttonone(); break; -		case 0xc75c: buttontwo(); break; -		case 0xc760: buttonthree(); break; -		case 0xc764: buttonfour(); break; -		case 0xc768: buttonfive(); break; -		case 0xc76c: buttonsix(); break; -		case 0xc770: buttonseven(); break; -		case 0xc774: buttoneight(); break; -		case 0xc778: buttonnine(); break; -		case 0xc77c: buttonnought(); break; -		case 0xc780: buttonenter(); break; -		case 0xc784: buttonpress(); break; -		case 0xc788: showouterpad(); break; -		case 0xc78c: showkeypad(); break; -		case 0xc790: singlekey(); break; -		case 0xc794: dumpkeypad(); break; -		case 0xc798: usemenu(); break; -		case 0xc79c: dumpmenu(); break; -		case 0xc7a0: getundermenu(); break; -		case 0xc7a4: putundermenu(); break; -		case 0xc7a8: showoutermenu(); break; -		case 0xc7ac: showmenu(); break; -		case 0xc7b0: loadmenu(); break; -		case 0xc7b4: viewfolder(); break; -		case 0xc7b8: nextfolder(); break; -		case 0xc7bc: folderhints(); break; -		case 0xc7c0: lastfolder(); break; -		case 0xc7c4: loadfolder(); break; -		case 0xc7c8: showfolder(); break; -		case 0xc7cc: folderexit(); break; -		case 0xc7d0: showleftpage(); break; -		case 0xc7d4: showrightpage(); break; -		case 0xc7d8: entersymbol(); break; -		case 0xc7dc: quitsymbol(); break; -		case 0xc7e0: settopleft(); break; -		case 0xc7e4: settopright(); break; -		case 0xc7e8: setbotleft(); break; -		case 0xc7ec: setbotright(); break; -		case 0xc7f0: dumpsymbol(); break; -		case 0xc7f4: showsymbol(); break; -		case 0xc7f8: nextsymbol(); break; -		case 0xc7fc: updatesymboltop(); break; -		case 0xc800: updatesymbolbot(); break; -		case 0xc804: dumpsymbox(); break; -		case 0xc808: usediary(); break; -		case 0xc80c: showdiary(); break; -		case 0xc810: showdiarykeys(); break; -		case 0xc814: dumpdiarykeys(); break; -		case 0xc818: diarykeyp(); break; -		case 0xc81c: diarykeyn(); break; -		case 0xc820: showdiarypage(); break; -		case 0xc824: findtext1(); break; -		case 0xc828: zoomonoff(); break; -		case 0xc82c: saveload(); break; -		case 0xc830: dosaveload(); break; -		case 0xc834: getbackfromops(); break; -		case 0xc838: showmainops(); break; -		case 0xc83c: showdiscops(); break; -		case 0xc840: loadsavebox(); break; -		case 0xc844: loadgame(); break; -		case 0xc848: getbacktoops(); break; -		case 0xc84c: discops(); break; -		case 0xc850: savegame(); break; -		case 0xc854: actualsave(); break; -		case 0xc858: actualload(); break; -		case 0xc85c: selectslot2(); break; -		case 0xc860: checkinput(); break; -		case 0xc864: getnamepos(); break; -		case 0xc868: showopbox(); break; -		case 0xc86c: showloadops(); break; -		case 0xc870: showsaveops(); break; -		case 0xc874: selectslot(); break; -		case 0xc878: showslots(); break; -		case 0xc87c: shownames(); break; -		case 0xc880: dosreturn(); break; -		case 0xc884: error(); break; -		case 0xc888: namestoold(); break; -		case 0xc88c: oldtonames(); break; -		case 0xc890: savefilewrite(); break; -		case 0xc894: savefileread(); break; -		case 0xc898: saveposition(); break; -		case 0xc89c: loadposition(); break; -		case 0xc8a0: loadseg(); break; -		case 0xc8a4: makeheader(); break; -		case 0xc8a8: storeit(); break; -		case 0xc8ac: saveseg(); break; -		case 0xc8b0: findlen(); break; -		case 0xc8b4: scanfornames(); break; -		case 0xc8b8: decide(); break; -		case 0xc8bc: showdecisions(); break; -		case 0xc8c0: newgame(); break; -		case 0xc8c4: loadold(); break; -		case 0xc8c8: loadspeech(); break; -		case 0xc8cc: createname(); break; -		case 0xc8d0: loadsample(); break; -		case 0xc8d4: loadsecondsample(); break; -		case 0xc8d8: soundstartup(); break; -		case 0xc8dc: trysoundalloc(); break; -		case 0xc8e0: setsoundoff(); break; -		case 0xc8e4: checksoundint(); break; -		case 0xc8e8: enablesoundint(); break; -		case 0xc8ec: disablesoundint(); break; -		case 0xc8f0: interupttest(); break; -		case 0xc8f4: soundend(); break; -		case 0xc8f8: out22c(); break; -		case 0xc8fc: playchannel0(); break; -		case 0xc900: playchannel1(); break; -		case 0xc904: makenextblock(); break; -		case 0xc908: volumeadjust(); break; -		case 0xc90c: loopchannel0(); break; -		case 0xc910: cancelch0(); break; -		case 0xc914: cancelch1(); break; -		case 0xc918: channel0only(); break; -		case 0xc91c: channel1only(); break; -		case 0xc920: channel0tran(); break; -		case 0xc924: bothchannels(); break; -		case 0xc928: saveems(); break; -		case 0xc92c: restoreems(); break; -		case 0xc930: domix(); break; -		case 0xc934: dmaend(); break; -		case 0xc938: startdmablock(); break; -		case 0xc93c: setuppit(); break; -		case 0xc940: getridofpit(); break; -		case 0xc944: pitinterupt(); break; -		case 0xc948: dreamweb(); break; -		case 0xc94c: entrytexts(); break; -		case 0xc950: entryanims(); break; -		case 0xc954: initialinv(); break; -		case 0xc958: pickupob(); break; -		case 0xc95c: setupemm(); break; -		case 0xc960: removeemm(); break; -		case 0xc964: checkforemm(); break; -		case 0xc968: checkbasemem(); break; -		case 0xc96c: allocatebuffers(); break; -		case 0xc970: clearbuffers(); break; -		case 0xc974: clearchanges(); break; -		case 0xc978: clearbeforeload(); break; -		case 0xc97c: clearreels(); break; -		case 0xc980: clearrest(); break; -		case 0xc984: deallocatemem(); break; -		case 0xc988: allocatemem(); break; -		case 0xc990: parseblaster(); break; -		case 0xc994: startup(); break; -		case 0xc998: startup1(); break; -		case 0xc99c: screenupdate(); break; -		case 0xc9a0: watchreel(); break; -		case 0xc9a4: checkforshake(); break; -		case 0xc9a8: watchcount(); break; -		case 0xc9ac: showtime(); break; -		case 0xc9b0: dumpwatch(); break; -		case 0xc9b4: showbyte(); break; -		case 0xc9b8: onedigit(); break; -		case 0xc9bc: twodigitnum(); break; -		case 0xc9c0: showword(); break; -		case 0xc9c4: convnum(); break; -		case 0xc9c8: mainscreen(); break; -		case 0xc9cc: madmanrun(); break; -		case 0xc9d0: checkcoords(); break; -		case 0xc9d4: identifyob(); break; -		case 0xc9d8: checkifperson(); break; -		case 0xc9dc: checkifset(); break; -		case 0xc9e0: checkifex(); break; -		case 0xc9e4: checkiffree(); break; -		case 0xc9e8: isitdescribed(); break; -		case 0xc9ec: findpathofpoint(); break; -		case 0xc9f0: findfirstpath(); break; -		case 0xc9f4: turnpathon(); break; -		case 0xc9f8: turnpathoff(); break; -		case 0xc9fc: turnanypathon(); break; -		case 0xca00: turnanypathoff(); break; -		case 0xca04: checkifpathison(); break; -		case 0xca08: afternewroom(); break; -		case 0xca0c: atmospheres(); break; -		case 0xca10: walkintoroom(); break; -		case 0xca14: afterintroroom(); break; -		case 0xca18: obname(); break; -		case 0xca1c: finishedwalking(); break; -		case 0xca20: examineobtext(); break; -		case 0xca24: commandwithob(); break; -		case 0xca28: commandonly(); break; -		case 0xca2c: printmessage(); break; -		case 0xca30: printmessage2(); break; -		case 0xca34: blocknametext(); break; -		case 0xca38: personnametext(); break; -		case 0xca3c: walktotext(); break; -		case 0xca40: getflagunderp(); break; -		case 0xca44: setwalk(); break; -		case 0xca48: autosetwalk(); break; -		case 0xca4c: checkdest(); break; -		case 0xca50: bresenhams(); break; -		case 0xca54: workoutframes(); break; -		case 0xca58: getroomspaths(); break; -		case 0xca5c: copyname(); break; -		case 0xca60: findobname(); break; -		case 0xca64: showicon(); break; -		case 0xca68: middlepanel(); break; -		case 0xca6c: showman(); break; -		case 0xca70: showpanel(); break; -		case 0xca74: roomname(); break; -		case 0xca78: usecharset1(); break; -		case 0xca7c: usetempcharset(); break; -		case 0xca80: showexit(); break; -		case 0xca84: panelicons1(); break; -		case 0xca88: showwatch(); break; -		case 0xca8c: gettime(); break; -		case 0xca90: zoomicon(); break; -		case 0xca94: showblink(); break; -		case 0xca98: dumpblink(); break; -		case 0xca9c: worktoscreenm(); break; -		case 0xcaa0: blank(); break; -		case 0xcaa4: allpointer(); break; -		case 0xcaa8: hangonp(); break; -		case 0xcaac: hangonw(); break; -		case 0xcab0: hangoncurs(); break; -		case 0xcab4: getunderzoom(); break; -		case 0xcab8: dumpzoom(); break; -		case 0xcabc: putunderzoom(); break; -		case 0xcac0: crosshair(); break; -		case 0xcac4: showpointer(); break; -		case 0xcac8: delpointer(); break; -		case 0xcacc: dumppointer(); break; -		case 0xcad0: undertextline(); break; -		case 0xcad4: deltextline(); break; -		case 0xcad8: dumptextline(); break; -		case 0xcadc: animpointer(); break; -		case 0xcae0: setmouse(); break; -		case 0xcae4: readmouse(); break; -		case 0xcae8: mousecall(); break; -		case 0xcaec: readmouse1(); break; -		case 0xcaf0: readmouse2(); break; -		case 0xcaf4: readmouse3(); break; -		case 0xcaf8: readmouse4(); break; -		case 0xcafc: readkey(); break; -		case 0xcb04: randomnum1(); break; -		case 0xcb08: randomnum2(); break; -		case 0xcb10: hangon(); break; -		case 0xcb14: loadtraveltext(); break; -		case 0xcb18: loadintotemp(); break; -		case 0xcb1c: loadintotemp2(); break; -		case 0xcb20: loadintotemp3(); break; -		case 0xcb24: loadtempcharset(); break; -		case 0xcb28: standardload(); break; -		case 0xcb2c: loadtemptext(); break; -		case 0xcb30: loadroom(); break; -		case 0xcb34: loadroomssample(); break; -		case 0xcb38: getridofreels(); break; -		case 0xcb3c: getridofall(); break; -		case 0xcb40: restorereels(); break; -		case 0xcb44: restoreall(); break; -		case 0xcb48: sortoutmap(); break; -		case 0xcb4c: startloading(); break; -		case 0xcb50: disablepath(); break; -		case 0xcb54: findxyfrompath(); break; -		case 0xcb58: findroominloc(); break; -		case 0xcb5c: getroomdata(); break; -		case 0xcb60: readheader(); break; -		case 0xcb64: dontloadseg(); break; -		case 0xcb68: allocateload(); break; -		case 0xcb6c: fillspace(); break; -		case 0xcb70: getridoftemp(); break; -		case 0xcb74: getridoftemptext(); break; -		case 0xcb78: getridoftemp2(); break; -		case 0xcb7c: getridoftemp3(); break; -		case 0xcb80: getridoftempcharset(); break; -		case 0xcb84: getridoftempsp(); break; -		case 0xcb88: readsetdata(); break; -		case 0xcb8c: createfile(); break; -		case 0xcb90: openfile(); break; -		case 0xcb94: openfilefromc(); break; -		case 0xcb98: makename(); break; -		case 0xcb9c: openfilenocheck(); break; -		case 0xcba0: openforsave(); break; -		case 0xcba4: closefile(); break; -		case 0xcba8: readfromfile(); break; -		case 0xcbac: setkeyboardint(); break; -		case 0xcbb0: resetkeyboard(); break; -		case 0xcbb4: keyboardread(); break; -		case 0xcbb8: walkandexamine(); break; -		case 0xcbbc: doload(); break; -		case 0xcbc0: generalerror(); break; +		case addr_alleybarksound: alleybarksound(); break; +		case addr_intromusic: intromusic(); break; +		case addr_foghornsound: foghornsound(); break; +		case addr_receptionist: receptionist(); break; +		case addr_smokebloke: smokebloke(); break; +		case addr_attendant: attendant(); break; +		case addr_manasleep: manasleep(); break; +		case addr_eden: eden(); break; +		case addr_edeninbath: edeninbath(); break; +		case addr_malefan: malefan(); break; +		case addr_femalefan: femalefan(); break; +		case addr_louis: louis(); break; +		case addr_louischair: louischair(); break; +		case addr_manasleep2: manasleep2(); break; +		case addr_mansatstill: mansatstill(); break; +		case addr_tattooman: tattooman(); break; +		case addr_drinker: drinker(); break; +		case addr_bartender: bartender(); break; +		case addr_othersmoker: othersmoker(); break; +		case addr_barwoman: barwoman(); break; +		case addr_interviewer: interviewer(); break; +		case addr_soldier1: soldier1(); break; +		case addr_rockstar: rockstar(); break; +		case addr_helicopter: helicopter(); break; +		case addr_mugger: mugger(); break; +		case addr_aide: aide(); break; +		case addr_businessman: businessman(); break; +		case addr_poolguard: poolguard(); break; +		case addr_security: security(); break; +		case addr_heavy: heavy(); break; +		case addr_bossman: bossman(); break; +		case addr_gamer: gamer(); break; +		case addr_sparkydrip: sparkydrip(); break; +		case addr_carparkdrip: carparkdrip(); break; +		case addr_keeper: keeper(); break; +		case addr_candles1: candles1(); break; +		case addr_smallcandle: smallcandle(); break; +		case addr_intromagic1: intromagic1(); break; +		case addr_candles: candles(); break; +		case addr_candles2: candles2(); break; +		case addr_gates: gates(); break; +		case addr_intromagic2: intromagic2(); break; +		case addr_intromagic3: intromagic3(); break; +		case addr_intromonks1: intromonks1(); break; +		case addr_intromonks2: intromonks2(); break; +		case addr_handclap: handclap(); break; +		case addr_monks2text: monks2text(); break; +		case addr_intro1text: intro1text(); break; +		case addr_intro2text: intro2text(); break; +		case addr_intro3text: intro3text(); break; +		case addr_monkandryan: monkandryan(); break; +		case addr_endgameseq: endgameseq(); break; +		case addr_rollendcredits: rollendcredits(); break; +		case addr_priest: priest(); break; +		case addr_madmanstelly: madmanstelly(); break; +		case addr_madman: madman(); break; +		case addr_madmantext: madmantext(); break; +		case addr_madmode: madmode(); break; +		case addr_priesttext: priesttext(); break; +		case addr_textforend: textforend(); break; +		case addr_textformonk: textformonk(); break; +		case addr_drunk: drunk(); break; +		case addr_advisor: advisor(); break; +		case addr_copper: copper(); break; +		case addr_sparky: sparky(); break; +		case addr_train: train(); break; +		case addr_addtopeoplelist: addtopeoplelist(); break; +		case addr_showgamereel: showgamereel(); break; +		case addr_checkspeed: checkspeed(); break; +		case addr_delsprite: delsprite(); break; +		case addr_checkone: checkone(); break; +		case addr_findsource: findsource(); break; +		case addr_mainman: mainman(); break; +		case addr_aboutturn: aboutturn(); break; +		case addr_facerightway: facerightway(); break; +		case addr_checkforexit: checkforexit(); break; +		case addr_adjustdown: adjustdown(); break; +		case addr_adjustup: adjustup(); break; +		case addr_adjustleft: adjustleft(); break; +		case addr_adjustright: adjustright(); break; +		case addr_reminders: reminders(); break; +		case addr_initrain: initrain(); break; +		case addr_splitintolines: splitintolines(); break; +		case addr_getblockofpixel: getblockofpixel(); break; +		case addr_showrain: showrain(); break; +		case addr_backobject: backobject(); break; +		case addr_liftnoise: liftnoise(); break; +		case addr_random: random(); break; +		case addr_steady: steady(); break; +		case addr_constant: constant(); break; +		case addr_doorway: doorway(); break; +		case addr_widedoor: widedoor(); break; +		case addr_lockeddoorway: lockeddoorway(); break; +		case addr_updatepeople: updatepeople(); break; +		case addr_getreelframeax: getreelframeax(); break; +		case addr_reelsonscreen: reelsonscreen(); break; +		case addr_plotreel: plotreel(); break; +		case addr_soundonreels: soundonreels(); break; +		case addr_reconstruct: reconstruct(); break; +		case addr_dealwithspecial: dealwithspecial(); break; +		case addr_movemap: movemap(); break; +		case addr_getreelstart: getreelstart(); break; +		case addr_showreelframe: showreelframe(); break; +		case addr_deleverything: deleverything(); break; +		case addr_dumpeverything: dumpeverything(); break; +		case addr_allocatework: allocatework(); break; +		case addr_showpcx: showpcx(); break; +		case addr_loadpalfromiff: loadpalfromiff(); break; +		case addr_setmode: setmode(); break; +		case addr_paneltomap: paneltomap(); break; +		case addr_maptopanel: maptopanel(); break; +		case addr_dumpmap: dumpmap(); break; +		case addr_pixelcheckset: pixelcheckset(); break; +		case addr_createpanel: createpanel(); break; +		case addr_createpanel2: createpanel2(); break; +		case addr_clearwork: clearwork(); break; +		case addr_vsync: vsync(); break; +		case addr_doshake: doshake(); break; +		case addr_zoom: zoom(); break; +		case addr_delthisone: delthisone(); break; +		case addr_doblocks: doblocks(); break; +		case addr_transferinv: transferinv(); break; +		case addr_transfermap: transfermap(); break; +		case addr_fadedos: fadedos(); break; +		case addr_dofade: dofade(); break; +		case addr_clearendpal: clearendpal(); break; +		case addr_clearpalette: clearpalette(); break; +		case addr_fadescreenup: fadescreenup(); break; +		case addr_fadetowhite: fadetowhite(); break; +		case addr_fadefromwhite: fadefromwhite(); break; +		case addr_fadescreenups: fadescreenups(); break; +		case addr_fadescreendownhalf: fadescreendownhalf(); break; +		case addr_fadescreenuphalf: fadescreenuphalf(); break; +		case addr_fadescreendown: fadescreendown(); break; +		case addr_fadescreendowns: fadescreendowns(); break; +		case addr_clearstartpal: clearstartpal(); break; +		case addr_showgun: showgun(); break; +		case addr_rollendcredits2: rollendcredits2(); break; +		case addr_rollem: rollem(); break; +		case addr_fadecalculation: fadecalculation(); break; +		case addr_greyscalesum: greyscalesum(); break; +		case addr_showgroup: showgroup(); break; +		case addr_paltostartpal: paltostartpal(); break; +		case addr_endpaltostart: endpaltostart(); break; +		case addr_startpaltoend: startpaltoend(); break; +		case addr_paltoendpal: paltoendpal(); break; +		case addr_allpalette: allpalette(); break; +		case addr_dumpcurrent: dumpcurrent(); break; +		case addr_fadedownmon: fadedownmon(); break; +		case addr_fadeupmon: fadeupmon(); break; +		case addr_fadeupmonfirst: fadeupmonfirst(); break; +		case addr_fadeupyellows: fadeupyellows(); break; +		case addr_initialmoncols: initialmoncols(); break; +		case addr_titles: titles(); break; +		case addr_endgame: endgame(); break; +		case addr_monkspeaking: monkspeaking(); break; +		case addr_showmonk: showmonk(); break; +		case addr_gettingshot: gettingshot(); break; +		case addr_credits: credits(); break; +		case addr_biblequote: biblequote(); break; +		case addr_hangone: hangone(); break; +		case addr_intro: intro(); break; +		case addr_runintroseq: runintroseq(); break; +		case addr_runendseq: runendseq(); break; +		case addr_loadintroroom: loadintroroom(); break; +		case addr_mode640x480: mode640x480(); break; +		case addr_set16colpalette: set16colpalette(); break; +		case addr_realcredits: realcredits(); break; +		case addr_printchar: printchar(); break; +		case addr_printslow: printslow(); break; +		case addr_waitframes: waitframes(); break; +		case addr_printboth: printboth(); break; +		case addr_printdirect: printdirect(); break; +		case addr_monprint: monprint(); break; +		case addr_getnumber: getnumber(); break; +		case addr_fillryan: fillryan(); break; +		case addr_fillopen: fillopen(); break; +		case addr_findallryan: findallryan(); break; +		case addr_findallopen: findallopen(); break; +		case addr_obtoinv: obtoinv(); break; +		case addr_isitworn: isitworn(); break; +		case addr_makeworn: makeworn(); break; +		case addr_examineob: examineob(); break; +		case addr_makemainscreen: makemainscreen(); break; +		case addr_getbackfromob: getbackfromob(); break; +		case addr_incryanpage: incryanpage(); break; +		case addr_openinv: openinv(); break; +		case addr_showryanpage: showryanpage(); break; +		case addr_openob: openob(); break; +		case addr_obicons: obicons(); break; +		case addr_examicon: examicon(); break; +		case addr_obpicture: obpicture(); break; +		case addr_describeob: describeob(); break; +		case addr_additionaltext: additionaltext(); break; +		case addr_obsthatdothings: obsthatdothings(); break; +		case addr_getobtextstart: getobtextstart(); break; +		case addr_searchforsame: searchforsame(); break; +		case addr_findnextcolon: findnextcolon(); break; +		case addr_inventory: inventory(); break; +		case addr_setpickup: setpickup(); break; +		case addr_examinventory: examinventory(); break; +		case addr_reexfrominv: reexfrominv(); break; +		case addr_reexfromopen: reexfromopen(); break; +		case addr_swapwithinv: swapwithinv(); break; +		case addr_swapwithopen: swapwithopen(); break; +		case addr_intoinv: intoinv(); break; +		case addr_deletetaken: deletetaken(); break; +		case addr_outofinv: outofinv(); break; +		case addr_getfreead: getfreead(); break; +		case addr_getexad: getexad(); break; +		case addr_geteitherad: geteitherad(); break; +		case addr_getanyad: getanyad(); break; +		case addr_getanyaddir: getanyaddir(); break; +		case addr_getopenedsize: getopenedsize(); break; +		case addr_getsetad: getsetad(); break; +		case addr_findinvpos: findinvpos(); break; +		case addr_findopenpos: findopenpos(); break; +		case addr_dropobject: dropobject(); break; +		case addr_droperror: droperror(); break; +		case addr_cantdrop: cantdrop(); break; +		case addr_wornerror: wornerror(); break; +		case addr_removeobfrominv: removeobfrominv(); break; +		case addr_selectopenob: selectopenob(); break; +		case addr_useopened: useopened(); break; +		case addr_errormessage1: errormessage1(); break; +		case addr_errormessage2: errormessage2(); break; +		case addr_errormessage3: errormessage3(); break; +		case addr_checkobjectsize: checkobjectsize(); break; +		case addr_outofopen: outofopen(); break; +		case addr_transfertoex: transfertoex(); break; +		case addr_pickupconts: pickupconts(); break; +		case addr_transfercontoex: transfercontoex(); break; +		case addr_transfertext: transfertext(); break; +		case addr_getexpos: getexpos(); break; +		case addr_purgealocation: purgealocation(); break; +		case addr_emergencypurge: emergencypurge(); break; +		case addr_purgeanitem: purgeanitem(); break; +		case addr_deleteexobject: deleteexobject(); break; +		case addr_deleteexframe: deleteexframe(); break; +		case addr_deleteextext: deleteextext(); break; +		case addr_blockget: blockget(); break; +		case addr_drawfloor: drawfloor(); break; +		case addr_calcmapad: calcmapad(); break; +		case addr_getdimension: getdimension(); break; +		case addr_addalong: addalong(); break; +		case addr_addlength: addlength(); break; +		case addr_drawflags: drawflags(); break; +		case addr_showallobs: showallobs(); break; +		case addr_makebackob: makebackob(); break; +		case addr_showallfree: showallfree(); break; +		case addr_showallex: showallex(); break; +		case addr_calcfrframe: calcfrframe(); break; +		case addr_finalframe: finalframe(); break; +		case addr_adjustlen: adjustlen(); break; +		case addr_getmapad: getmapad(); break; +		case addr_getxad: getxad(); break; +		case addr_getyad: getyad(); break; +		case addr_autolook: autolook(); break; +		case addr_look: look(); break; +		case addr_dolook: dolook(); break; +		case addr_redrawmainscrn: redrawmainscrn(); break; +		case addr_getback1: getback1(); break; +		case addr_talk: talk(); break; +		case addr_convicons: convicons(); break; +		case addr_getpersframe: getpersframe(); break; +		case addr_starttalk: starttalk(); break; +		case addr_getpersontext: getpersontext(); break; +		case addr_moretalk: moretalk(); break; +		case addr_dosometalk: dosometalk(); break; +		case addr_hangonpq: hangonpq(); break; +		case addr_redes: redes(); break; +		case addr_newplace: newplace(); break; +		case addr_selectlocation: selectlocation(); break; +		case addr_showcity: showcity(); break; +		case addr_lookatplace: lookatplace(); break; +		case addr_getundercentre: getundercentre(); break; +		case addr_putundercentre: putundercentre(); break; +		case addr_locationpic: locationpic(); break; +		case addr_getdestinfo: getdestinfo(); break; +		case addr_showarrows: showarrows(); break; +		case addr_nextdest: nextdest(); break; +		case addr_lastdest: lastdest(); break; +		case addr_destselect: destselect(); break; +		case addr_getlocation: getlocation(); break; +		case addr_setlocation: setlocation(); break; +		case addr_resetlocation: resetlocation(); break; +		case addr_readdesticon: readdesticon(); break; +		case addr_readcitypic: readcitypic(); break; +		case addr_usemon: usemon(); break; +		case addr_printoutermon: printoutermon(); break; +		case addr_loadpersonal: loadpersonal(); break; +		case addr_loadnews: loadnews(); break; +		case addr_loadcart: loadcart(); break; +		case addr_lookininterface: lookininterface(); break; +		case addr_turnonpower: turnonpower(); break; +		case addr_randomaccess: randomaccess(); break; +		case addr_powerlighton: powerlighton(); break; +		case addr_powerlightoff: powerlightoff(); break; +		case addr_accesslighton: accesslighton(); break; +		case addr_accesslightoff: accesslightoff(); break; +		case addr_locklighton: locklighton(); break; +		case addr_locklightoff: locklightoff(); break; +		case addr_input: input(); break; +		case addr_makecaps: makecaps(); break; +		case addr_delchar: delchar(); break; +		case addr_execcommand: execcommand(); break; +		case addr_neterror: neterror(); break; +		case addr_dircom: dircom(); break; +		case addr_searchforfiles: searchforfiles(); break; +		case addr_signon: signon(); break; +		case addr_showkeys: showkeys(); break; +		case addr_read: read(); break; +		case addr_dirfile: dirfile(); break; +		case addr_getkeyandlogo: getkeyandlogo(); break; +		case addr_searchforstring: searchforstring(); break; +		case addr_parser: parser(); break; +		case addr_scrollmonitor: scrollmonitor(); break; +		case addr_monitorlogo: monitorlogo(); break; +		case addr_printlogo: printlogo(); break; +		case addr_showcurrentfile: showcurrentfile(); break; +		case addr_monmessage: monmessage(); break; +		case addr_processtrigger: processtrigger(); break; +		case addr_triggermessage: triggermessage(); break; +		case addr_printcurs: printcurs(); break; +		case addr_delcurs: delcurs(); break; +		case addr_useobject: useobject(); break; +		case addr_useroutine: useroutine(); break; +		case addr_wheelsound: wheelsound(); break; +		case addr_runtap: runtap(); break; +		case addr_playguitar: playguitar(); break; +		case addr_hotelcontrol: hotelcontrol(); break; +		case addr_hotelbell: hotelbell(); break; +		case addr_opentomb: opentomb(); break; +		case addr_usetrainer: usetrainer(); break; +		case addr_nothelderror: nothelderror(); break; +		case addr_usepipe: usepipe(); break; +		case addr_usefullcart: usefullcart(); break; +		case addr_useplinth: useplinth(); break; +		case addr_chewy: chewy(); break; +		case addr_useladder: useladder(); break; +		case addr_useladderb: useladderb(); break; +		case addr_slabdoora: slabdoora(); break; +		case addr_slabdoorb: slabdoorb(); break; +		case addr_slabdoord: slabdoord(); break; +		case addr_slabdoorc: slabdoorc(); break; +		case addr_slabdoore: slabdoore(); break; +		case addr_slabdoorf: slabdoorf(); break; +		case addr_useslab: useslab(); break; +		case addr_usecart: usecart(); break; +		case addr_useclearbox: useclearbox(); break; +		case addr_usecoveredbox: usecoveredbox(); break; +		case addr_userailing: userailing(); break; +		case addr_useopenbox: useopenbox(); break; +		case addr_wearwatch: wearwatch(); break; +		case addr_wearshades: wearshades(); break; +		case addr_sitdowninbar: sitdowninbar(); break; +		case addr_usechurchhole: usechurchhole(); break; +		case addr_usehole: usehole(); break; +		case addr_usealtar: usealtar(); break; +		case addr_opentvdoor: opentvdoor(); break; +		case addr_usedryer: usedryer(); break; +		case addr_openlouis: openlouis(); break; +		case addr_nextcolon: nextcolon(); break; +		case addr_openyourneighbour: openyourneighbour(); break; +		case addr_usewindow: usewindow(); break; +		case addr_usebalcony: usebalcony(); break; +		case addr_openryan: openryan(); break; +		case addr_openpoolboss: openpoolboss(); break; +		case addr_openeden: openeden(); break; +		case addr_opensarters: opensarters(); break; +		case addr_isitright: isitright(); break; +		case addr_drawitall: drawitall(); break; +		case addr_openhoteldoor: openhoteldoor(); break; +		case addr_openhoteldoor2: openhoteldoor2(); break; +		case addr_grafittidoor: grafittidoor(); break; +		case addr_trapdoor: trapdoor(); break; +		case addr_callhotellift: callhotellift(); break; +		case addr_calledenslift: calledenslift(); break; +		case addr_calledensdlift: calledensdlift(); break; +		case addr_usepoolreader: usepoolreader(); break; +		case addr_uselighter: uselighter(); break; +		case addr_showseconduse: showseconduse(); break; +		case addr_usecardreader1: usecardreader1(); break; +		case addr_usecardreader2: usecardreader2(); break; +		case addr_usecardreader3: usecardreader3(); break; +		case addr_usecashcard: usecashcard(); break; +		case addr_lookatcard: lookatcard(); break; +		case addr_moneypoke: moneypoke(); break; +		case addr_usecontrol: usecontrol(); break; +		case addr_usehatch: usehatch(); break; +		case addr_usewire: usewire(); break; +		case addr_usehandle: usehandle(); break; +		case addr_useelevator1: useelevator1(); break; +		case addr_showfirstuse: showfirstuse(); break; +		case addr_useelevator3: useelevator3(); break; +		case addr_useelevator4: useelevator4(); break; +		case addr_useelevator2: useelevator2(); break; +		case addr_useelevator5: useelevator5(); break; +		case addr_usekey: usekey(); break; +		case addr_usestereo: usestereo(); break; +		case addr_usecooker: usecooker(); break; +		case addr_useaxe: useaxe(); break; +		case addr_useelvdoor: useelvdoor(); break; +		case addr_withwhat: withwhat(); break; +		case addr_selectob: selectob(); break; +		case addr_compare: compare(); break; +		case addr_findsetobject: findsetobject(); break; +		case addr_findexobject: findexobject(); break; +		case addr_isryanholding: isryanholding(); break; +		case addr_checkinside: checkinside(); break; +		case addr_usetext: usetext(); break; +		case addr_putbackobstuff: putbackobstuff(); break; +		case addr_showpuztext: showpuztext(); break; +		case addr_findpuztext: findpuztext(); break; +		case addr_placesetobject: placesetobject(); break; +		case addr_removesetobject: removesetobject(); break; +		case addr_issetobonmap: issetobonmap(); break; +		case addr_placefreeobject: placefreeobject(); break; +		case addr_removefreeobject: removefreeobject(); break; +		case addr_findormake: findormake(); break; +		case addr_switchryanon: switchryanon(); break; +		case addr_switchryanoff: switchryanoff(); break; +		case addr_setallchanges: setallchanges(); break; +		case addr_dochange: dochange(); break; +		case addr_autoappear: autoappear(); break; +		case addr_getundertimed: getundertimed(); break; +		case addr_putundertimed: putundertimed(); break; +		case addr_dumptimedtext: dumptimedtext(); break; +		case addr_setuptimeduse: setuptimeduse(); break; +		case addr_setuptimedtemp: setuptimedtemp(); break; +		case addr_usetimedtext: usetimedtext(); break; +		case addr_edenscdplayer: edenscdplayer(); break; +		case addr_usewall: usewall(); break; +		case addr_usechurchgate: usechurchgate(); break; +		case addr_usegun: usegun(); break; +		case addr_useshield: useshield(); break; +		case addr_usebuttona: usebuttona(); break; +		case addr_useplate: useplate(); break; +		case addr_usewinch: usewinch(); break; +		case addr_entercode: entercode(); break; +		case addr_loadkeypad: loadkeypad(); break; +		case addr_quitkey: quitkey(); break; +		case addr_addtopresslist: addtopresslist(); break; +		case addr_buttonone: buttonone(); break; +		case addr_buttontwo: buttontwo(); break; +		case addr_buttonthree: buttonthree(); break; +		case addr_buttonfour: buttonfour(); break; +		case addr_buttonfive: buttonfive(); break; +		case addr_buttonsix: buttonsix(); break; +		case addr_buttonseven: buttonseven(); break; +		case addr_buttoneight: buttoneight(); break; +		case addr_buttonnine: buttonnine(); break; +		case addr_buttonnought: buttonnought(); break; +		case addr_buttonenter: buttonenter(); break; +		case addr_buttonpress: buttonpress(); break; +		case addr_showouterpad: showouterpad(); break; +		case addr_showkeypad: showkeypad(); break; +		case addr_singlekey: singlekey(); break; +		case addr_dumpkeypad: dumpkeypad(); break; +		case addr_usemenu: usemenu(); break; +		case addr_dumpmenu: dumpmenu(); break; +		case addr_getundermenu: getundermenu(); break; +		case addr_putundermenu: putundermenu(); break; +		case addr_showoutermenu: showoutermenu(); break; +		case addr_showmenu: showmenu(); break; +		case addr_loadmenu: loadmenu(); break; +		case addr_viewfolder: viewfolder(); break; +		case addr_nextfolder: nextfolder(); break; +		case addr_folderhints: folderhints(); break; +		case addr_lastfolder: lastfolder(); break; +		case addr_loadfolder: loadfolder(); break; +		case addr_showfolder: showfolder(); break; +		case addr_folderexit: folderexit(); break; +		case addr_showleftpage: showleftpage(); break; +		case addr_showrightpage: showrightpage(); break; +		case addr_entersymbol: entersymbol(); break; +		case addr_quitsymbol: quitsymbol(); break; +		case addr_settopleft: settopleft(); break; +		case addr_settopright: settopright(); break; +		case addr_setbotleft: setbotleft(); break; +		case addr_setbotright: setbotright(); break; +		case addr_dumpsymbol: dumpsymbol(); break; +		case addr_showsymbol: showsymbol(); break; +		case addr_nextsymbol: nextsymbol(); break; +		case addr_updatesymboltop: updatesymboltop(); break; +		case addr_updatesymbolbot: updatesymbolbot(); break; +		case addr_dumpsymbox: dumpsymbox(); break; +		case addr_usediary: usediary(); break; +		case addr_showdiary: showdiary(); break; +		case addr_showdiarykeys: showdiarykeys(); break; +		case addr_dumpdiarykeys: dumpdiarykeys(); break; +		case addr_diarykeyp: diarykeyp(); break; +		case addr_diarykeyn: diarykeyn(); break; +		case addr_showdiarypage: showdiarypage(); break; +		case addr_findtext1: findtext1(); break; +		case addr_zoomonoff: zoomonoff(); break; +		case addr_saveload: saveload(); break; +		case addr_dosaveload: dosaveload(); break; +		case addr_getbackfromops: getbackfromops(); break; +		case addr_showmainops: showmainops(); break; +		case addr_showdiscops: showdiscops(); break; +		case addr_loadsavebox: loadsavebox(); break; +		case addr_loadgame: loadgame(); break; +		case addr_getbacktoops: getbacktoops(); break; +		case addr_discops: discops(); break; +		case addr_savegame: savegame(); break; +		case addr_actualsave: actualsave(); break; +		case addr_actualload: actualload(); break; +		case addr_selectslot2: selectslot2(); break; +		case addr_checkinput: checkinput(); break; +		case addr_getnamepos: getnamepos(); break; +		case addr_showopbox: showopbox(); break; +		case addr_showloadops: showloadops(); break; +		case addr_showsaveops: showsaveops(); break; +		case addr_selectslot: selectslot(); break; +		case addr_showslots: showslots(); break; +		case addr_shownames: shownames(); break; +		case addr_dosreturn: dosreturn(); break; +		case addr_error: error(); break; +		case addr_namestoold: namestoold(); break; +		case addr_oldtonames: oldtonames(); break; +		case addr_savefilewrite: savefilewrite(); break; +		case addr_savefileread: savefileread(); break; +		case addr_saveposition: saveposition(); break; +		case addr_loadposition: loadposition(); break; +		case addr_loadseg: loadseg(); break; +		case addr_makeheader: makeheader(); break; +		case addr_storeit: storeit(); break; +		case addr_saveseg: saveseg(); break; +		case addr_findlen: findlen(); break; +		case addr_scanfornames: scanfornames(); break; +		case addr_decide: decide(); break; +		case addr_showdecisions: showdecisions(); break; +		case addr_newgame: newgame(); break; +		case addr_loadold: loadold(); break; +		case addr_loadspeech: loadspeech(); break; +		case addr_createname: createname(); break; +		case addr_loadsample: loadsample(); break; +		case addr_loadsecondsample: loadsecondsample(); break; +		case addr_soundstartup: soundstartup(); break; +		case addr_trysoundalloc: trysoundalloc(); break; +		case addr_setsoundoff: setsoundoff(); break; +		case addr_checksoundint: checksoundint(); break; +		case addr_enablesoundint: enablesoundint(); break; +		case addr_disablesoundint: disablesoundint(); break; +		case addr_interupttest: interupttest(); break; +		case addr_soundend: soundend(); break; +		case addr_out22c: out22c(); break; +		case addr_playchannel0: playchannel0(); break; +		case addr_playchannel1: playchannel1(); break; +		case addr_makenextblock: makenextblock(); break; +		case addr_volumeadjust: volumeadjust(); break; +		case addr_loopchannel0: loopchannel0(); break; +		case addr_cancelch0: cancelch0(); break; +		case addr_cancelch1: cancelch1(); break; +		case addr_channel0only: channel0only(); break; +		case addr_channel1only: channel1only(); break; +		case addr_channel0tran: channel0tran(); break; +		case addr_bothchannels: bothchannels(); break; +		case addr_saveems: saveems(); break; +		case addr_restoreems: restoreems(); break; +		case addr_domix: domix(); break; +		case addr_dmaend: dmaend(); break; +		case addr_startdmablock: startdmablock(); break; +		case addr_setuppit: setuppit(); break; +		case addr_getridofpit: getridofpit(); break; +		case addr_pitinterupt: pitinterupt(); break; +		case addr_dreamweb: dreamweb(); break; +		case addr_entrytexts: entrytexts(); break; +		case addr_entryanims: entryanims(); break; +		case addr_initialinv: initialinv(); break; +		case addr_pickupob: pickupob(); break; +		case addr_setupemm: setupemm(); break; +		case addr_removeemm: removeemm(); break; +		case addr_checkforemm: checkforemm(); break; +		case addr_checkbasemem: checkbasemem(); break; +		case addr_allocatebuffers: allocatebuffers(); break; +		case addr_clearbuffers: clearbuffers(); break; +		case addr_clearchanges: clearchanges(); break; +		case addr_clearbeforeload: clearbeforeload(); break; +		case addr_clearreels: clearreels(); break; +		case addr_clearrest: clearrest(); break; +		case addr_deallocatemem: deallocatemem(); break; +		case addr_allocatemem: allocatemem(); break; +		case addr_parseblaster: parseblaster(); break; +		case addr_startup: startup(); break; +		case addr_startup1: startup1(); break; +		case addr_screenupdate: screenupdate(); break; +		case addr_watchreel: watchreel(); break; +		case addr_checkforshake: checkforshake(); break; +		case addr_watchcount: watchcount(); break; +		case addr_showtime: showtime(); break; +		case addr_dumpwatch: dumpwatch(); break; +		case addr_showbyte: showbyte(); break; +		case addr_onedigit: onedigit(); break; +		case addr_twodigitnum: twodigitnum(); break; +		case addr_showword: showword(); break; +		case addr_convnum: convnum(); break; +		case addr_mainscreen: mainscreen(); break; +		case addr_madmanrun: madmanrun(); break; +		case addr_checkcoords: checkcoords(); break; +		case addr_identifyob: identifyob(); break; +		case addr_checkifperson: checkifperson(); break; +		case addr_checkifset: checkifset(); break; +		case addr_checkifex: checkifex(); break; +		case addr_checkiffree: checkiffree(); break; +		case addr_isitdescribed: isitdescribed(); break; +		case addr_findpathofpoint: findpathofpoint(); break; +		case addr_findfirstpath: findfirstpath(); break; +		case addr_turnpathon: turnpathon(); break; +		case addr_turnpathoff: turnpathoff(); break; +		case addr_turnanypathon: turnanypathon(); break; +		case addr_turnanypathoff: turnanypathoff(); break; +		case addr_checkifpathison: checkifpathison(); break; +		case addr_afternewroom: afternewroom(); break; +		case addr_atmospheres: atmospheres(); break; +		case addr_walkintoroom: walkintoroom(); break; +		case addr_afterintroroom: afterintroroom(); break; +		case addr_obname: obname(); break; +		case addr_finishedwalking: finishedwalking(); break; +		case addr_examineobtext: examineobtext(); break; +		case addr_commandwithob: commandwithob(); break; +		case addr_commandonly: commandonly(); break; +		case addr_printmessage: printmessage(); break; +		case addr_printmessage2: printmessage2(); break; +		case addr_blocknametext: blocknametext(); break; +		case addr_personnametext: personnametext(); break; +		case addr_walktotext: walktotext(); break; +		case addr_getflagunderp: getflagunderp(); break; +		case addr_setwalk: setwalk(); break; +		case addr_autosetwalk: autosetwalk(); break; +		case addr_checkdest: checkdest(); break; +		case addr_bresenhams: bresenhams(); break; +		case addr_workoutframes: workoutframes(); break; +		case addr_getroomspaths: getroomspaths(); break; +		case addr_copyname: copyname(); break; +		case addr_findobname: findobname(); break; +		case addr_showicon: showicon(); break; +		case addr_middlepanel: middlepanel(); break; +		case addr_showman: showman(); break; +		case addr_showpanel: showpanel(); break; +		case addr_roomname: roomname(); break; +		case addr_usecharset1: usecharset1(); break; +		case addr_usetempcharset: usetempcharset(); break; +		case addr_showexit: showexit(); break; +		case addr_panelicons1: panelicons1(); break; +		case addr_showwatch: showwatch(); break; +		case addr_gettime: gettime(); break; +		case addr_zoomicon: zoomicon(); break; +		case addr_showblink: showblink(); break; +		case addr_dumpblink: dumpblink(); break; +		case addr_worktoscreenm: worktoscreenm(); break; +		case addr_blank: blank(); break; +		case addr_allpointer: allpointer(); break; +		case addr_hangonp: hangonp(); break; +		case addr_hangonw: hangonw(); break; +		case addr_hangoncurs: hangoncurs(); break; +		case addr_getunderzoom: getunderzoom(); break; +		case addr_dumpzoom: dumpzoom(); break; +		case addr_putunderzoom: putunderzoom(); break; +		case addr_crosshair: crosshair(); break; +		case addr_showpointer: showpointer(); break; +		case addr_delpointer: delpointer(); break; +		case addr_dumppointer: dumppointer(); break; +		case addr_undertextline: undertextline(); break; +		case addr_deltextline: deltextline(); break; +		case addr_dumptextline: dumptextline(); break; +		case addr_animpointer: animpointer(); break; +		case addr_setmouse: setmouse(); break; +		case addr_readmouse: readmouse(); break; +		case addr_mousecall: mousecall(); break; +		case addr_readmouse1: readmouse1(); break; +		case addr_readmouse2: readmouse2(); break; +		case addr_readmouse3: readmouse3(); break; +		case addr_readmouse4: readmouse4(); break; +		case addr_readkey: readkey(); break; +		case addr_randomnum1: randomnum1(); break; +		case addr_randomnum2: randomnum2(); break; +		case addr_hangon: hangon(); break; +		case addr_loadtraveltext: loadtraveltext(); break; +		case addr_loadintotemp: loadintotemp(); break; +		case addr_loadintotemp2: loadintotemp2(); break; +		case addr_loadintotemp3: loadintotemp3(); break; +		case addr_loadtempcharset: loadtempcharset(); break; +		case addr_standardload: standardload(); break; +		case addr_loadtemptext: loadtemptext(); break; +		case addr_loadroom: loadroom(); break; +		case addr_loadroomssample: loadroomssample(); break; +		case addr_getridofreels: getridofreels(); break; +		case addr_getridofall: getridofall(); break; +		case addr_restorereels: restorereels(); break; +		case addr_restoreall: restoreall(); break; +		case addr_sortoutmap: sortoutmap(); break; +		case addr_startloading: startloading(); break; +		case addr_disablepath: disablepath(); break; +		case addr_findxyfrompath: findxyfrompath(); break; +		case addr_findroominloc: findroominloc(); break; +		case addr_getroomdata: getroomdata(); break; +		case addr_readheader: readheader(); break; +		case addr_dontloadseg: dontloadseg(); break; +		case addr_allocateload: allocateload(); break; +		case addr_fillspace: fillspace(); break; +		case addr_getridoftemp: getridoftemp(); break; +		case addr_getridoftemptext: getridoftemptext(); break; +		case addr_getridoftemp2: getridoftemp2(); break; +		case addr_getridoftemp3: getridoftemp3(); break; +		case addr_getridoftempcharset: getridoftempcharset(); break; +		case addr_getridoftempsp: getridoftempsp(); break; +		case addr_readsetdata: readsetdata(); break; +		case addr_createfile: createfile(); break; +		case addr_openfile: openfile(); break; +		case addr_openfilefromc: openfilefromc(); break; +		case addr_makename: makename(); break; +		case addr_openfilenocheck: openfilenocheck(); break; +		case addr_openforsave: openforsave(); break; +		case addr_closefile: closefile(); break; +		case addr_readfromfile: readfromfile(); break; +		case addr_setkeyboardint: setkeyboardint(); break; +		case addr_resetkeyboard: resetkeyboard(); break; +		case addr_keyboardread: keyboardread(); break; +		case addr_walkandexamine: walkandexamine(); break; +		case addr_doload: doload(); break; +		case addr_generalerror: generalerror(); break;  		default: ::error("invalid call to %04x dispatched", (uint16)ax);  	}  } diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 08053b6f54..032ad5847c 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -7,12 +7,736 @@  #include "dreamweb/runtime.h"  namespace DreamGen { - +#include "structs.h"  class DreamGenContext : public Context {  public:  	void __start();  	void __dispatch_call(uint16 addr); +#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f() +	static const uint16 addr_dreamweb = 0xc948; +	static const uint16 addr_keyboardread = 0xcbb4; +	static const uint16 addr_resetkeyboard = 0xcbb0; +	static const uint16 addr_setkeyboardint = 0xcbac; +	static const uint16 addr_readfromfile = 0xcba8; +	static const uint16 addr_closefile = 0xcba4; +	static const uint16 addr_openforsave = 0xcba0; +	static const uint16 addr_openfilenocheck = 0xcb9c; +	static const uint16 addr_makename = 0xcb98; +	static const uint16 addr_openfilefromc = 0xcb94; +	static const uint16 addr_openfile = 0xcb90; +	static const uint16 addr_createfile = 0xcb8c; +	static const uint16 addr_readsetdata = 0xcb88; +	static const uint16 addr_getridoftempsp = 0xcb84; +	static const uint16 addr_getridoftempcharset = 0xcb80; +	static const uint16 addr_getridoftemp3 = 0xcb7c; +	static const uint16 addr_getridoftemp2 = 0xcb78; +	static const uint16 addr_getridoftemptext = 0xcb74; +	static const uint16 addr_getridoftemp = 0xcb70; +	static const uint16 addr_fillspace = 0xcb6c; +	static const uint16 addr_allocateload = 0xcb68; +	static const uint16 addr_dontloadseg = 0xcb64; +	static const uint16 addr_readheader = 0xcb60; +	static const uint16 addr_getroomdata = 0xcb5c; +	static const uint16 addr_findroominloc = 0xcb58; +	static const uint16 addr_findxyfrompath = 0xcb54; +	static const uint16 addr_disablepath = 0xcb50; +	static const uint16 addr_startloading = 0xcb4c; +	static const uint16 addr_sortoutmap = 0xcb48; +	static const uint16 addr_restoreall = 0xcb44; +	static const uint16 addr_restorereels = 0xcb40; +	static const uint16 addr_getridofall = 0xcb3c; +	static const uint16 addr_getridofreels = 0xcb38; +	static const uint16 addr_loadroomssample = 0xcb34; +	static const uint16 addr_loadroom = 0xcb30; +	static const uint16 addr_loadtemptext = 0xcb2c; +	static const uint16 addr_standardload = 0xcb28; +	static const uint16 addr_loadtempcharset = 0xcb24; +	static const uint16 addr_loadintotemp3 = 0xcb20; +	static const uint16 addr_loadintotemp2 = 0xcb1c; +	static const uint16 addr_loadintotemp = 0xcb18; +	static const uint16 addr_loadtraveltext = 0xcb14; +	static const uint16 addr_hangon = 0xcb10; +	static const uint16 addr_randomnum2 = 0xcb08; +	static const uint16 addr_randomnum1 = 0xcb04; +	static const uint16 addr_readkey = 0xcafc; +	static const uint16 addr_readmouse4 = 0xcaf8; +	static const uint16 addr_readmouse3 = 0xcaf4; +	static const uint16 addr_readmouse2 = 0xcaf0; +	static const uint16 addr_readmouse1 = 0xcaec; +	static const uint16 addr_mousecall = 0xcae8; +	static const uint16 addr_readmouse = 0xcae4; +	static const uint16 addr_setmouse = 0xcae0; +	static const uint16 addr_animpointer = 0xcadc; +	static const uint16 addr_dumptextline = 0xcad8; +	static const uint16 addr_deltextline = 0xcad4; +	static const uint16 addr_undertextline = 0xcad0; +	static const uint16 addr_dumppointer = 0xcacc; +	static const uint16 addr_delpointer = 0xcac8; +	static const uint16 addr_showpointer = 0xcac4; +	static const uint16 addr_crosshair = 0xcac0; +	static const uint16 addr_putunderzoom = 0xcabc; +	static const uint16 addr_dumpzoom = 0xcab8; +	static const uint16 addr_getunderzoom = 0xcab4; +	static const uint16 addr_hangoncurs = 0xcab0; +	static const uint16 addr_hangonw = 0xcaac; +	static const uint16 addr_hangonp = 0xcaa8; +	static const uint16 addr_allpointer = 0xcaa4; +	static const uint16 addr_blank = 0xcaa0; +	static const uint16 addr_worktoscreenm = 0xca9c; +	static const uint16 addr_dumpblink = 0xca98; +	static const uint16 addr_showblink = 0xca94; +	static const uint16 addr_zoomicon = 0xca90; +	static const uint16 addr_gettime = 0xca8c; +	static const uint16 addr_showwatch = 0xca88; +	static const uint16 addr_panelicons1 = 0xca84; +	static const uint16 addr_showexit = 0xca80; +	static const uint16 addr_usetempcharset = 0xca7c; +	static const uint16 addr_usecharset1 = 0xca78; +	static const uint16 addr_roomname = 0xca74; +	static const uint16 addr_showpanel = 0xca70; +	static const uint16 addr_showman = 0xca6c; +	static const uint16 addr_middlepanel = 0xca68; +	static const uint16 addr_showicon = 0xca64; +	static const uint16 addr_findobname = 0xca60; +	static const uint16 addr_copyname = 0xca5c; +	static const uint16 addr_getroomspaths = 0xca58; +	static const uint16 addr_workoutframes = 0xca54; +	static const uint16 addr_bresenhams = 0xca50; +	static const uint16 addr_checkdest = 0xca4c; +	static const uint16 addr_autosetwalk = 0xca48; +	static const uint16 addr_setwalk = 0xca44; +	static const uint16 addr_getflagunderp = 0xca40; +	static const uint16 addr_walktotext = 0xca3c; +	static const uint16 addr_personnametext = 0xca38; +	static const uint16 addr_blocknametext = 0xca34; +	static const uint16 addr_printmessage2 = 0xca30; +	static const uint16 addr_printmessage = 0xca2c; +	static const uint16 addr_commandonly = 0xca28; +	static const uint16 addr_commandwithob = 0xca24; +	static const uint16 addr_examineobtext = 0xca20; +	static const uint16 addr_finishedwalking = 0xca1c; +	static const uint16 addr_obname = 0xca18; +	static const uint16 addr_afterintroroom = 0xca14; +	static const uint16 addr_walkintoroom = 0xca10; +	static const uint16 addr_atmospheres = 0xca0c; +	static const uint16 addr_afternewroom = 0xca08; +	static const uint16 addr_checkifpathison = 0xca04; +	static const uint16 addr_turnanypathoff = 0xca00; +	static const uint16 addr_turnanypathon = 0xc9fc; +	static const uint16 addr_turnpathoff = 0xc9f8; +	static const uint16 addr_turnpathon = 0xc9f4; +	static const uint16 addr_findfirstpath = 0xc9f0; +	static const uint16 addr_findpathofpoint = 0xc9ec; +	static const uint16 addr_isitdescribed = 0xc9e8; +	static const uint16 addr_checkiffree = 0xc9e4; +	static const uint16 addr_checkifex = 0xc9e0; +	static const uint16 addr_checkifset = 0xc9dc; +	static const uint16 addr_checkifperson = 0xc9d8; +	static const uint16 addr_identifyob = 0xc9d4; +	static const uint16 addr_checkcoords = 0xc9d0; +	static const uint16 addr_madmanrun = 0xc9cc; +	static const uint16 addr_mainscreen = 0xc9c8; +	static const uint16 addr_walkandexamine = 0xcbb8; +	static const uint16 addr_convnum = 0xc9c4; +	static const uint16 addr_showword = 0xc9c0; +	static const uint16 addr_twodigitnum = 0xc9bc; +	static const uint16 addr_onedigit = 0xc9b8; +	static const uint16 addr_showbyte = 0xc9b4; +	static const uint16 addr_dumpwatch = 0xc9b0; +	static const uint16 addr_showtime = 0xc9ac; +	static const uint16 addr_watchcount = 0xc9a8; +	static const uint16 addr_checkforshake = 0xc9a4; +	static const uint16 addr_watchreel = 0xc9a0; +	static const uint16 addr_screenupdate = 0xc99c; +	static const uint16 addr_startup1 = 0xc998; +	static const uint16 addr_startup = 0xc994; +	static const uint16 addr_parseblaster = 0xc990; +	static const uint16 addr_allocatemem = 0xc988; +	static const uint16 addr_deallocatemem = 0xc984; +	static const uint16 addr_clearrest = 0xc980; +	static const uint16 addr_clearreels = 0xc97c; +	static const uint16 addr_clearbeforeload = 0xc978; +	static const uint16 addr_clearchanges = 0xc974; +	static const uint16 addr_clearbuffers = 0xc970; +	static const uint16 addr_allocatebuffers = 0xc96c; +	static const uint16 addr_checkbasemem = 0xc968; +	static const uint16 addr_checkforemm = 0xc964; +	static const uint16 addr_removeemm = 0xc960; +	static const uint16 addr_setupemm = 0xc95c; +	static const uint16 addr_pickupob = 0xc958; +	static const uint16 addr_initialinv = 0xc954; +	static const uint16 addr_entryanims = 0xc950; +	static const uint16 addr_entrytexts = 0xc94c; +	static const uint16 addr_pitinterupt = 0xc944; +	static const uint16 addr_getridofpit = 0xc940; +	static const uint16 addr_setuppit = 0xc93c; +	static const uint16 addr_startdmablock = 0xc938; +	static const uint16 addr_dmaend = 0xc934; +	static const uint16 addr_domix = 0xc930; +	static const uint16 addr_restoreems = 0xc92c; +	static const uint16 addr_saveems = 0xc928; +	static const uint16 addr_bothchannels = 0xc924; +	static const uint16 addr_channel0tran = 0xc920; +	static const uint16 addr_channel1only = 0xc91c; +	static const uint16 addr_channel0only = 0xc918; +	static const uint16 addr_cancelch1 = 0xc914; +	static const uint16 addr_cancelch0 = 0xc910; +	static const uint16 addr_loopchannel0 = 0xc90c; +	static const uint16 addr_volumeadjust = 0xc908; +	static const uint16 addr_makenextblock = 0xc904; +	static const uint16 addr_playchannel1 = 0xc900; +	static const uint16 addr_playchannel0 = 0xc8fc; +	static const uint16 addr_out22c = 0xc8f8; +	static const uint16 addr_soundend = 0xc8f4; +	static const uint16 addr_interupttest = 0xc8f0; +	static const uint16 addr_disablesoundint = 0xc8ec; +	static const uint16 addr_enablesoundint = 0xc8e8; +	static const uint16 addr_checksoundint = 0xc8e4; +	static const uint16 addr_setsoundoff = 0xc8e0; +	static const uint16 addr_trysoundalloc = 0xc8dc; +	static const uint16 addr_soundstartup = 0xc8d8; +	static const uint16 addr_loadsecondsample = 0xc8d4; +	static const uint16 addr_loadsample = 0xc8d0; +	static const uint16 addr_createname = 0xc8cc; +	static const uint16 addr_loadspeech = 0xc8c8; +	static const uint16 addr_loadold = 0xc8c4; +	static const uint16 addr_doload = 0xcbbc; +	static const uint16 addr_newgame = 0xc8c0; +	static const uint16 addr_showdecisions = 0xc8bc; +	static const uint16 addr_decide = 0xc8b8; +	static const uint16 addr_scanfornames = 0xc8b4; +	static const uint16 addr_findlen = 0xc8b0; +	static const uint16 addr_saveseg = 0xc8ac; +	static const uint16 addr_storeit = 0xc8a8; +	static const uint16 addr_makeheader = 0xc8a4; +	static const uint16 addr_loadseg = 0xc8a0; +	static const uint16 addr_loadposition = 0xc89c; +	static const uint16 addr_saveposition = 0xc898; +	static const uint16 addr_savefileread = 0xc894; +	static const uint16 addr_savefilewrite = 0xc890; +	static const uint16 addr_oldtonames = 0xc88c; +	static const uint16 addr_namestoold = 0xc888; +	static const uint16 addr_error = 0xc884; +	static const uint16 addr_generalerror = 0xcbc0; +	static const uint16 addr_dosreturn = 0xc880; +	static const uint16 addr_shownames = 0xc87c; +	static const uint16 addr_showslots = 0xc878; +	static const uint16 addr_selectslot = 0xc874; +	static const uint16 addr_showsaveops = 0xc870; +	static const uint16 addr_showloadops = 0xc86c; +	static const uint16 addr_showopbox = 0xc868; +	static const uint16 addr_getnamepos = 0xc864; +	static const uint16 addr_checkinput = 0xc860; +	static const uint16 addr_selectslot2 = 0xc85c; +	static const uint16 addr_actualload = 0xc858; +	static const uint16 addr_actualsave = 0xc854; +	static const uint16 addr_savegame = 0xc850; +	static const uint16 addr_discops = 0xc84c; +	static const uint16 addr_getbacktoops = 0xc848; +	static const uint16 addr_loadgame = 0xc844; +	static const uint16 addr_loadsavebox = 0xc840; +	static const uint16 addr_showdiscops = 0xc83c; +	static const uint16 addr_showmainops = 0xc838; +	static const uint16 addr_getbackfromops = 0xc834; +	static const uint16 addr_dosaveload = 0xc830; +	static const uint16 addr_saveload = 0xc82c; +	static const uint16 addr_zoomonoff = 0xc828; +	static const uint16 addr_findtext1 = 0xc824; +	static const uint16 addr_showdiarypage = 0xc820; +	static const uint16 addr_diarykeyn = 0xc81c; +	static const uint16 addr_diarykeyp = 0xc818; +	static const uint16 addr_dumpdiarykeys = 0xc814; +	static const uint16 addr_showdiarykeys = 0xc810; +	static const uint16 addr_showdiary = 0xc80c; +	static const uint16 addr_usediary = 0xc808; +	static const uint16 addr_dumpsymbox = 0xc804; +	static const uint16 addr_updatesymbolbot = 0xc800; +	static const uint16 addr_updatesymboltop = 0xc7fc; +	static const uint16 addr_nextsymbol = 0xc7f8; +	static const uint16 addr_showsymbol = 0xc7f4; +	static const uint16 addr_dumpsymbol = 0xc7f0; +	static const uint16 addr_setbotright = 0xc7ec; +	static const uint16 addr_setbotleft = 0xc7e8; +	static const uint16 addr_settopright = 0xc7e4; +	static const uint16 addr_settopleft = 0xc7e0; +	static const uint16 addr_quitsymbol = 0xc7dc; +	static const uint16 addr_entersymbol = 0xc7d8; +	static const uint16 addr_showrightpage = 0xc7d4; +	static const uint16 addr_showleftpage = 0xc7d0; +	static const uint16 addr_folderexit = 0xc7cc; +	static const uint16 addr_showfolder = 0xc7c8; +	static const uint16 addr_loadfolder = 0xc7c4; +	static const uint16 addr_lastfolder = 0xc7c0; +	static const uint16 addr_folderhints = 0xc7bc; +	static const uint16 addr_nextfolder = 0xc7b8; +	static const uint16 addr_viewfolder = 0xc7b4; +	static const uint16 addr_loadmenu = 0xc7b0; +	static const uint16 addr_showmenu = 0xc7ac; +	static const uint16 addr_showoutermenu = 0xc7a8; +	static const uint16 addr_putundermenu = 0xc7a4; +	static const uint16 addr_getundermenu = 0xc7a0; +	static const uint16 addr_dumpmenu = 0xc79c; +	static const uint16 addr_usemenu = 0xc798; +	static const uint16 addr_dumpkeypad = 0xc794; +	static const uint16 addr_singlekey = 0xc790; +	static const uint16 addr_showkeypad = 0xc78c; +	static const uint16 addr_showouterpad = 0xc788; +	static const uint16 addr_buttonpress = 0xc784; +	static const uint16 addr_buttonenter = 0xc780; +	static const uint16 addr_buttonnought = 0xc77c; +	static const uint16 addr_buttonnine = 0xc778; +	static const uint16 addr_buttoneight = 0xc774; +	static const uint16 addr_buttonseven = 0xc770; +	static const uint16 addr_buttonsix = 0xc76c; +	static const uint16 addr_buttonfive = 0xc768; +	static const uint16 addr_buttonfour = 0xc764; +	static const uint16 addr_buttonthree = 0xc760; +	static const uint16 addr_buttontwo = 0xc75c; +	static const uint16 addr_buttonone = 0xc758; +	static const uint16 addr_addtopresslist = 0xc754; +	static const uint16 addr_quitkey = 0xc750; +	static const uint16 addr_loadkeypad = 0xc74c; +	static const uint16 addr_entercode = 0xc748; +	static const uint16 addr_usewinch = 0xc744; +	static const uint16 addr_useplate = 0xc740; +	static const uint16 addr_usebuttona = 0xc73c; +	static const uint16 addr_useshield = 0xc738; +	static const uint16 addr_usegun = 0xc734; +	static const uint16 addr_usechurchgate = 0xc730; +	static const uint16 addr_usewall = 0xc72c; +	static const uint16 addr_edenscdplayer = 0xc728; +	static const uint16 addr_usetimedtext = 0xc724; +	static const uint16 addr_setuptimedtemp = 0xc720; +	static const uint16 addr_setuptimeduse = 0xc71c; +	static const uint16 addr_dumptimedtext = 0xc718; +	static const uint16 addr_putundertimed = 0xc714; +	static const uint16 addr_getundertimed = 0xc710; +	static const uint16 addr_autoappear = 0xc70c; +	static const uint16 addr_dochange = 0xc708; +	static const uint16 addr_setallchanges = 0xc704; +	static const uint16 addr_switchryanoff = 0xc700; +	static const uint16 addr_switchryanon = 0xc6fc; +	static const uint16 addr_findormake = 0xc6f8; +	static const uint16 addr_removefreeobject = 0xc6f4; +	static const uint16 addr_placefreeobject = 0xc6f0; +	static const uint16 addr_issetobonmap = 0xc6ec; +	static const uint16 addr_removesetobject = 0xc6e8; +	static const uint16 addr_placesetobject = 0xc6e4; +	static const uint16 addr_findpuztext = 0xc6e0; +	static const uint16 addr_showpuztext = 0xc6dc; +	static const uint16 addr_putbackobstuff = 0xc6d8; +	static const uint16 addr_usetext = 0xc6d4; +	static const uint16 addr_checkinside = 0xc6d0; +	static const uint16 addr_isryanholding = 0xc6cc; +	static const uint16 addr_findexobject = 0xc6c8; +	static const uint16 addr_findsetobject = 0xc6c4; +	static const uint16 addr_compare = 0xc6c0; +	static const uint16 addr_selectob = 0xc6bc; +	static const uint16 addr_withwhat = 0xc6b8; +	static const uint16 addr_useelvdoor = 0xc6b4; +	static const uint16 addr_useaxe = 0xc6b0; +	static const uint16 addr_usecooker = 0xc6ac; +	static const uint16 addr_usestereo = 0xc6a8; +	static const uint16 addr_usekey = 0xc6a4; +	static const uint16 addr_useelevator5 = 0xc6a0; +	static const uint16 addr_useelevator2 = 0xc69c; +	static const uint16 addr_useelevator4 = 0xc698; +	static const uint16 addr_useelevator3 = 0xc694; +	static const uint16 addr_showfirstuse = 0xc690; +	static const uint16 addr_useelevator1 = 0xc68c; +	static const uint16 addr_usehandle = 0xc688; +	static const uint16 addr_usewire = 0xc684; +	static const uint16 addr_usehatch = 0xc680; +	static const uint16 addr_usecontrol = 0xc67c; +	static const uint16 addr_moneypoke = 0xc678; +	static const uint16 addr_lookatcard = 0xc674; +	static const uint16 addr_usecashcard = 0xc670; +	static const uint16 addr_usecardreader3 = 0xc66c; +	static const uint16 addr_usecardreader2 = 0xc668; +	static const uint16 addr_usecardreader1 = 0xc664; +	static const uint16 addr_showseconduse = 0xc660; +	static const uint16 addr_uselighter = 0xc65c; +	static const uint16 addr_usepoolreader = 0xc658; +	static const uint16 addr_calledensdlift = 0xc654; +	static const uint16 addr_calledenslift = 0xc650; +	static const uint16 addr_callhotellift = 0xc64c; +	static const uint16 addr_trapdoor = 0xc648; +	static const uint16 addr_grafittidoor = 0xc644; +	static const uint16 addr_openhoteldoor2 = 0xc640; +	static const uint16 addr_openhoteldoor = 0xc63c; +	static const uint16 addr_drawitall = 0xc638; +	static const uint16 addr_isitright = 0xc634; +	static const uint16 addr_opensarters = 0xc630; +	static const uint16 addr_openeden = 0xc62c; +	static const uint16 addr_openpoolboss = 0xc628; +	static const uint16 addr_openryan = 0xc624; +	static const uint16 addr_usebalcony = 0xc620; +	static const uint16 addr_usewindow = 0xc61c; +	static const uint16 addr_openyourneighbour = 0xc618; +	static const uint16 addr_nextcolon = 0xc614; +	static const uint16 addr_openlouis = 0xc610; +	static const uint16 addr_usedryer = 0xc60c; +	static const uint16 addr_opentvdoor = 0xc608; +	static const uint16 addr_usealtar = 0xc604; +	static const uint16 addr_usehole = 0xc600; +	static const uint16 addr_usechurchhole = 0xc5fc; +	static const uint16 addr_sitdowninbar = 0xc5f8; +	static const uint16 addr_wearshades = 0xc5f4; +	static const uint16 addr_wearwatch = 0xc5f0; +	static const uint16 addr_useopenbox = 0xc5ec; +	static const uint16 addr_userailing = 0xc5e8; +	static const uint16 addr_usecoveredbox = 0xc5e4; +	static const uint16 addr_useclearbox = 0xc5e0; +	static const uint16 addr_usecart = 0xc5dc; +	static const uint16 addr_useslab = 0xc5d8; +	static const uint16 addr_slabdoorf = 0xc5d4; +	static const uint16 addr_slabdoore = 0xc5d0; +	static const uint16 addr_slabdoorc = 0xc5cc; +	static const uint16 addr_slabdoord = 0xc5c8; +	static const uint16 addr_slabdoorb = 0xc5c4; +	static const uint16 addr_slabdoora = 0xc5c0; +	static const uint16 addr_useladderb = 0xc5bc; +	static const uint16 addr_useladder = 0xc5b8; +	static const uint16 addr_chewy = 0xc5b4; +	static const uint16 addr_useplinth = 0xc5b0; +	static const uint16 addr_usefullcart = 0xc5ac; +	static const uint16 addr_usepipe = 0xc5a8; +	static const uint16 addr_nothelderror = 0xc5a4; +	static const uint16 addr_usetrainer = 0xc5a0; +	static const uint16 addr_opentomb = 0xc59c; +	static const uint16 addr_hotelbell = 0xc598; +	static const uint16 addr_hotelcontrol = 0xc594; +	static const uint16 addr_playguitar = 0xc590; +	static const uint16 addr_runtap = 0xc58c; +	static const uint16 addr_wheelsound = 0xc588; +	static const uint16 addr_useroutine = 0xc584; +	static const uint16 addr_useobject = 0xc580; +	static const uint16 addr_delcurs = 0xc57c; +	static const uint16 addr_printcurs = 0xc578; +	static const uint16 addr_triggermessage = 0xc574; +	static const uint16 addr_processtrigger = 0xc570; +	static const uint16 addr_monmessage = 0xc56c; +	static const uint16 addr_showcurrentfile = 0xc568; +	static const uint16 addr_printlogo = 0xc564; +	static const uint16 addr_monitorlogo = 0xc560; +	static const uint16 addr_scrollmonitor = 0xc558; +	static const uint16 addr_parser = 0xc554; +	static const uint16 addr_searchforstring = 0xc550; +	static const uint16 addr_getkeyandlogo = 0xc54c; +	static const uint16 addr_dirfile = 0xc548; +	static const uint16 addr_read = 0xc544; +	static const uint16 addr_showkeys = 0xc540; +	static const uint16 addr_signon = 0xc53c; +	static const uint16 addr_searchforfiles = 0xc538; +	static const uint16 addr_dircom = 0xc534; +	static const uint16 addr_neterror = 0xc530; +	static const uint16 addr_execcommand = 0xc52c; +	static const uint16 addr_delchar = 0xc528; +	static const uint16 addr_makecaps = 0xc524; +	static const uint16 addr_input = 0xc520; +	static const uint16 addr_locklightoff = 0xc51c; +	static const uint16 addr_locklighton = 0xc518; +	static const uint16 addr_accesslightoff = 0xc514; +	static const uint16 addr_accesslighton = 0xc510; +	static const uint16 addr_powerlightoff = 0xc50c; +	static const uint16 addr_powerlighton = 0xc508; +	static const uint16 addr_randomaccess = 0xc504; +	static const uint16 addr_turnonpower = 0xc500; +	static const uint16 addr_lookininterface = 0xc4fc; +	static const uint16 addr_loadcart = 0xc4f8; +	static const uint16 addr_loadnews = 0xc4f4; +	static const uint16 addr_loadpersonal = 0xc4f0; +	static const uint16 addr_printoutermon = 0xc4ec; +	static const uint16 addr_usemon = 0xc4e8; +	static const uint16 addr_readcitypic = 0xc4e4; +	static const uint16 addr_readdesticon = 0xc4e0; +	static const uint16 addr_resetlocation = 0xc4dc; +	static const uint16 addr_setlocation = 0xc4d8; +	static const uint16 addr_getlocation = 0xc4d4; +	static const uint16 addr_destselect = 0xc4d0; +	static const uint16 addr_lastdest = 0xc4cc; +	static const uint16 addr_nextdest = 0xc4c8; +	static const uint16 addr_showarrows = 0xc4c4; +	static const uint16 addr_getdestinfo = 0xc4c0; +	static const uint16 addr_locationpic = 0xc4bc; +	static const uint16 addr_putundercentre = 0xc4b8; +	static const uint16 addr_getundercentre = 0xc4b4; +	static const uint16 addr_lookatplace = 0xc4b0; +	static const uint16 addr_showcity = 0xc4ac; +	static const uint16 addr_selectlocation = 0xc4a8; +	static const uint16 addr_newplace = 0xc4a4; +	static const uint16 addr_redes = 0xc4a0; +	static const uint16 addr_hangonpq = 0xc49c; +	static const uint16 addr_dosometalk = 0xc498; +	static const uint16 addr_moretalk = 0xc494; +	static const uint16 addr_getpersontext = 0xc490; +	static const uint16 addr_starttalk = 0xc48c; +	static const uint16 addr_getpersframe = 0xc488; +	static const uint16 addr_convicons = 0xc484; +	static const uint16 addr_talk = 0xc480; +	static const uint16 addr_getback1 = 0xc47c; +	static const uint16 addr_redrawmainscrn = 0xc478; +	static const uint16 addr_dolook = 0xc474; +	static const uint16 addr_look = 0xc470; +	static const uint16 addr_autolook = 0xc46c; +	static const uint16 addr_getyad = 0xc468; +	static const uint16 addr_getxad = 0xc464; +	static const uint16 addr_getmapad = 0xc460; +	static const uint16 addr_adjustlen = 0xc45c; +	static const uint16 addr_finalframe = 0xc458; +	static const uint16 addr_calcfrframe = 0xc454; +	static const uint16 addr_showallex = 0xc450; +	static const uint16 addr_showallfree = 0xc44c; +	static const uint16 addr_makebackob = 0xc448; +	static const uint16 addr_showallobs = 0xc444; +	static const uint16 addr_drawflags = 0xc43c; +	static const uint16 addr_addlength = 0xc438; +	static const uint16 addr_addalong = 0xc434; +	static const uint16 addr_getdimension = 0xc430; +	static const uint16 addr_calcmapad = 0xc42c; +	static const uint16 addr_drawfloor = 0xc428; +	static const uint16 addr_blockget = 0xc424; +	static const uint16 addr_deleteextext = 0xc420; +	static const uint16 addr_deleteexframe = 0xc41c; +	static const uint16 addr_deleteexobject = 0xc418; +	static const uint16 addr_purgeanitem = 0xc414; +	static const uint16 addr_emergencypurge = 0xc410; +	static const uint16 addr_purgealocation = 0xc40c; +	static const uint16 addr_getexpos = 0xc408; +	static const uint16 addr_transfertext = 0xc404; +	static const uint16 addr_transfercontoex = 0xc400; +	static const uint16 addr_pickupconts = 0xc3fc; +	static const uint16 addr_transfertoex = 0xc3f8; +	static const uint16 addr_outofopen = 0xc3f4; +	static const uint16 addr_checkobjectsize = 0xc3f0; +	static const uint16 addr_errormessage3 = 0xc3ec; +	static const uint16 addr_errormessage2 = 0xc3e8; +	static const uint16 addr_errormessage1 = 0xc3e4; +	static const uint16 addr_useopened = 0xc3e0; +	static const uint16 addr_selectopenob = 0xc3dc; +	static const uint16 addr_removeobfrominv = 0xc3d8; +	static const uint16 addr_wornerror = 0xc3d4; +	static const uint16 addr_cantdrop = 0xc3d0; +	static const uint16 addr_droperror = 0xc3cc; +	static const uint16 addr_dropobject = 0xc3c8; +	static const uint16 addr_findopenpos = 0xc3c4; +	static const uint16 addr_findinvpos = 0xc3c0; +	static const uint16 addr_getsetad = 0xc3bc; +	static const uint16 addr_getopenedsize = 0xc3b8; +	static const uint16 addr_getanyaddir = 0xc3b4; +	static const uint16 addr_getanyad = 0xc3b0; +	static const uint16 addr_geteitherad = 0xc3ac; +	static const uint16 addr_getexad = 0xc3a8; +	static const uint16 addr_getfreead = 0xc3a4; +	static const uint16 addr_outofinv = 0xc3a0; +	static const uint16 addr_deletetaken = 0xc39c; +	static const uint16 addr_intoinv = 0xc398; +	static const uint16 addr_swapwithopen = 0xc394; +	static const uint16 addr_swapwithinv = 0xc390; +	static const uint16 addr_reexfromopen = 0xc38c; +	static const uint16 addr_reexfrominv = 0xc388; +	static const uint16 addr_examinventory = 0xc384; +	static const uint16 addr_setpickup = 0xc380; +	static const uint16 addr_inventory = 0xc37c; +	static const uint16 addr_findnextcolon = 0xc378; +	static const uint16 addr_searchforsame = 0xc374; +	static const uint16 addr_getobtextstart = 0xc370; +	static const uint16 addr_obsthatdothings = 0xc36c; +	static const uint16 addr_additionaltext = 0xc368; +	static const uint16 addr_describeob = 0xc364; +	static const uint16 addr_obpicture = 0xc360; +	static const uint16 addr_examicon = 0xc35c; +	static const uint16 addr_obicons = 0xc358; +	static const uint16 addr_openob = 0xc354; +	static const uint16 addr_showryanpage = 0xc350; +	static const uint16 addr_openinv = 0xc34c; +	static const uint16 addr_incryanpage = 0xc348; +	static const uint16 addr_getbackfromob = 0xc344; +	static const uint16 addr_makemainscreen = 0xc340; +	static const uint16 addr_examineob = 0xc33c; +	static const uint16 addr_makeworn = 0xc338; +	static const uint16 addr_isitworn = 0xc334; +	static const uint16 addr_obtoinv = 0xc330; +	static const uint16 addr_findallopen = 0xc32c; +	static const uint16 addr_findallryan = 0xc328; +	static const uint16 addr_fillopen = 0xc324; +	static const uint16 addr_fillryan = 0xc320; +	static const uint16 addr_getnumber = 0xc318; +	static const uint16 addr_monprint = 0xc314; +	static const uint16 addr_printdirect = 0xc310; +	static const uint16 addr_printboth = 0xc30c; +	static const uint16 addr_waitframes = 0xc308; +	static const uint16 addr_printslow = 0xc304; +	static const uint16 addr_printchar = 0xc2fc; +	static const uint16 addr_realcredits = 0xc2f8; +	static const uint16 addr_set16colpalette = 0xc2f4; +	static const uint16 addr_mode640x480 = 0xc2f0; +	static const uint16 addr_loadintroroom = 0xc2ec; +	static const uint16 addr_runendseq = 0xc2e8; +	static const uint16 addr_runintroseq = 0xc2e4; +	static const uint16 addr_intro = 0xc2e0; +	static const uint16 addr_hangone = 0xc2dc; +	static const uint16 addr_biblequote = 0xc2d8; +	static const uint16 addr_credits = 0xc2d4; +	static const uint16 addr_gettingshot = 0xc2d0; +	static const uint16 addr_showmonk = 0xc2cc; +	static const uint16 addr_monkspeaking = 0xc2c8; +	static const uint16 addr_endgame = 0xc2c4; +	static const uint16 addr_titles = 0xc2c0; +	static const uint16 addr_initialmoncols = 0xc2bc; +	static const uint16 addr_fadeupyellows = 0xc2b8; +	static const uint16 addr_fadeupmonfirst = 0xc2b4; +	static const uint16 addr_fadeupmon = 0xc2b0; +	static const uint16 addr_fadedownmon = 0xc2ac; +	static const uint16 addr_dumpcurrent = 0xc2a8; +	static const uint16 addr_allpalette = 0xc2a4; +	static const uint16 addr_paltoendpal = 0xc2a0; +	static const uint16 addr_startpaltoend = 0xc29c; +	static const uint16 addr_endpaltostart = 0xc298; +	static const uint16 addr_paltostartpal = 0xc294; +	static const uint16 addr_showgroup = 0xc290; +	static const uint16 addr_greyscalesum = 0xc28c; +	static const uint16 addr_fadecalculation = 0xc288; +	static const uint16 addr_rollem = 0xc284; +	static const uint16 addr_rollendcredits2 = 0xc280; +	static const uint16 addr_showgun = 0xc27c; +	static const uint16 addr_clearstartpal = 0xc278; +	static const uint16 addr_fadescreendowns = 0xc274; +	static const uint16 addr_fadescreendown = 0xc270; +	static const uint16 addr_fadescreenuphalf = 0xc26c; +	static const uint16 addr_fadescreendownhalf = 0xc268; +	static const uint16 addr_fadescreenups = 0xc264; +	static const uint16 addr_fadefromwhite = 0xc260; +	static const uint16 addr_fadetowhite = 0xc25c; +	static const uint16 addr_fadescreenup = 0xc258; +	static const uint16 addr_clearpalette = 0xc254; +	static const uint16 addr_clearendpal = 0xc250; +	static const uint16 addr_dofade = 0xc24c; +	static const uint16 addr_fadedos = 0xc248; +	static const uint16 addr_transfermap = 0xc244; +	static const uint16 addr_transferinv = 0xc240; +	static const uint16 addr_doblocks = 0xc228; +	static const uint16 addr_delthisone = 0xc214; +	static const uint16 addr_zoom = 0xc210; +	static const uint16 addr_doshake = 0xc20c; +	static const uint16 addr_vsync = 0xc208; +	static const uint16 addr_clearwork = 0xc204; +	static const uint16 addr_createpanel2 = 0xc200; +	static const uint16 addr_createpanel = 0xc1fc; +	static const uint16 addr_pixelcheckset = 0xc1f8; +	static const uint16 addr_dumpmap = 0xc1f4; +	static const uint16 addr_maptopanel = 0xc1f0; +	static const uint16 addr_paneltomap = 0xc1ec; +	static const uint16 addr_setmode = 0xc1dc; +	static const uint16 addr_loadpalfromiff = 0xc1d8; +	static const uint16 addr_showpcx = 0xc1cc; +	static const uint16 addr_allocatework = 0xc1c8; +	static const uint16 addr_dumpeverything = 0xc1c4; +	static const uint16 addr_deleverything = 0xc1c0; +	static const uint16 addr_showreelframe = 0xc1bc; +	static const uint16 addr_getreelstart = 0xc1b8; +	static const uint16 addr_movemap = 0xc1b4; +	static const uint16 addr_dealwithspecial = 0xc1b0; +	static const uint16 addr_reconstruct = 0xc1ac; +	static const uint16 addr_soundonreels = 0xc1a8; +	static const uint16 addr_plotreel = 0xc1a4; +	static const uint16 addr_reelsonscreen = 0xc1a0; +	static const uint16 addr_getreelframeax = 0xc19c; +	static const uint16 addr_updatepeople = 0xc198; +	static const uint16 addr_lockeddoorway = 0xc194; +	static const uint16 addr_widedoor = 0xc18c; +	static const uint16 addr_doorway = 0xc188; +	static const uint16 addr_constant = 0xc184; +	static const uint16 addr_steady = 0xc180; +	static const uint16 addr_random = 0xc17c; +	static const uint16 addr_liftnoise = 0xc178; +	static const uint16 addr_backobject = 0xc170; +	static const uint16 addr_showrain = 0xc16c; +	static const uint16 addr_getblockofpixel = 0xc168; +	static const uint16 addr_splitintolines = 0xc164; +	static const uint16 addr_initrain = 0xc160; +	static const uint16 addr_reminders = 0xc15c; +	static const uint16 addr_adjustright = 0xc158; +	static const uint16 addr_adjustleft = 0xc154; +	static const uint16 addr_adjustup = 0xc150; +	static const uint16 addr_adjustdown = 0xc14c; +	static const uint16 addr_checkforexit = 0xc148; +	static const uint16 addr_facerightway = 0xc144; +	static const uint16 addr_aboutturn = 0xc13c; +	static const uint16 addr_mainman = 0xc138; +	static const uint16 addr_findsource = 0xc130; +	static const uint16 addr_checkone = 0xc12c; +	static const uint16 addr_delsprite = 0xc11c; +	static const uint16 addr_checkspeed = 0xc110; +	static const uint16 addr_showgamereel = 0xc10c; +	static const uint16 addr_addtopeoplelist = 0xc108; +	static const uint16 addr_train = 0xc104; +	static const uint16 addr_sparky = 0xc100; +	static const uint16 addr_copper = 0xc0fc; +	static const uint16 addr_advisor = 0xc0f8; +	static const uint16 addr_drunk = 0xc0f4; +	static const uint16 addr_textformonk = 0xc0f0; +	static const uint16 addr_textforend = 0xc0ec; +	static const uint16 addr_priesttext = 0xc0e8; +	static const uint16 addr_madmode = 0xc0e4; +	static const uint16 addr_madmantext = 0xc0e0; +	static const uint16 addr_madman = 0xc0dc; +	static const uint16 addr_madmanstelly = 0xc0d8; +	static const uint16 addr_priest = 0xc0d4; +	static const uint16 addr_rollendcredits = 0xc0d0; +	static const uint16 addr_endgameseq = 0xc0cc; +	static const uint16 addr_monkandryan = 0xc0c8; +	static const uint16 addr_intro3text = 0xc0c4; +	static const uint16 addr_intro2text = 0xc0c0; +	static const uint16 addr_intro1text = 0xc0bc; +	static const uint16 addr_monks2text = 0xc0b8; +	static const uint16 addr_handclap = 0xc0b4; +	static const uint16 addr_intromonks2 = 0xc0b0; +	static const uint16 addr_intromonks1 = 0xc0ac; +	static const uint16 addr_intromagic3 = 0xc0a8; +	static const uint16 addr_intromagic2 = 0xc0a4; +	static const uint16 addr_gates = 0xc0a0; +	static const uint16 addr_candles2 = 0xc09c; +	static const uint16 addr_candles = 0xc098; +	static const uint16 addr_intromagic1 = 0xc094; +	static const uint16 addr_smallcandle = 0xc090; +	static const uint16 addr_candles1 = 0xc08c; +	static const uint16 addr_keeper = 0xc088; +	static const uint16 addr_carparkdrip = 0xc084; +	static const uint16 addr_sparkydrip = 0xc080; +	static const uint16 addr_gamer = 0xc07c; +	static const uint16 addr_bossman = 0xc078; +	static const uint16 addr_heavy = 0xc074; +	static const uint16 addr_security = 0xc070; +	static const uint16 addr_poolguard = 0xc06c; +	static const uint16 addr_businessman = 0xc068; +	static const uint16 addr_aide = 0xc064; +	static const uint16 addr_mugger = 0xc060; +	static const uint16 addr_helicopter = 0xc05c; +	static const uint16 addr_rockstar = 0xc058; +	static const uint16 addr_soldier1 = 0xc054; +	static const uint16 addr_interviewer = 0xc050; +	static const uint16 addr_barwoman = 0xc04c; +	static const uint16 addr_othersmoker = 0xc048; +	static const uint16 addr_bartender = 0xc044; +	static const uint16 addr_drinker = 0xc040; +	static const uint16 addr_tattooman = 0xc03c; +	static const uint16 addr_mansatstill = 0xc038; +	static const uint16 addr_manasleep2 = 0xc034; +	static const uint16 addr_louischair = 0xc030; +	static const uint16 addr_louis = 0xc02c; +	static const uint16 addr_femalefan = 0xc028; +	static const uint16 addr_malefan = 0xc024; +	static const uint16 addr_edeninbath = 0xc020; +	static const uint16 addr_eden = 0xc01c; +	static const uint16 addr_manasleep = 0xc018; +	static const uint16 addr_attendant = 0xc014; +	static const uint16 addr_smokebloke = 0xc010; +	static const uint16 addr_receptionist = 0xc00c; +	static const uint16 addr_foghornsound = 0xc008; +	static const uint16 addr_intromusic = 0xc004; +	static const uint16 addr_alleybarksound = 0xc000;  	const static uint16 kStartvars = 0;  	const static uint16 kProgresspoints = 1;  	const static uint16 kWatchon = 2; @@ -153,7 +877,7 @@ public:  	const static uint16 kSavex = 178;  	const static uint16 kSavey = 179;  	const static uint16 kCurrentob = 180; -	const static uint16 kPriority = 181; +	const static uint16 kPrioritydep = 181;  	const static uint16 kDestpos = 182;  	const static uint16 kReallocation = 183;  	const static uint16 kRoomnum = 184; @@ -589,7 +1313,6 @@ public:  	void drawitall();  	void clearstartpal();  	void femalefan(); -	void greyscalesum();  	void showgamereel();  	void identifyob();  	void trysoundalloc(); @@ -602,14 +1325,15 @@ public:  	void clearbuffers();  	void neterror();  	void storeit(); +	void lockeddoorway();  	void isitworn();  	void putundertimed();  	void dumpmap(); -	void multidump(); +	//void multidump();  	void channel0only();  	void worktoscreenm();  	void removeemm(); -	void mansatstill(); +	//void frameoutbh();  	void getobtextstart();  	void loadfolder();  	void decide(); @@ -625,7 +1349,7 @@ public:  	void crosshair();  	void bresenhams();  	void getbackfromops(); -	void frameoutv(); +	//void frameoutv();  	void restoreall();  	void screenupdate();  	void addlength(); @@ -643,10 +1367,10 @@ public:  	void gettime();  	void clearwork();  	void loadtraveltext(); -	void worktoscreen(); +	//void worktoscreen();  	void getexpos();  	void fadedos(); -	void multiget(); +	//void multiget();  	void fadeupmonfirst();  	void drawfloor();  	void loadkeypad(); @@ -660,7 +1384,7 @@ public:  	void opentomb();  	void buttonfour();  	void animpointer(); -	void lockmon(); +	//void lockmon();  	void dochange();  	void getanyaddir();  	void showsaveops(); @@ -670,7 +1394,7 @@ public:  	void showdiscops();  	void advisor();  	void additionaltext(); -	void kernchars(); +	//void kernchars();  	void othersmoker();  	void autosetwalk();  	void setuptimedtemp(); @@ -718,14 +1442,15 @@ public:  	void addtopeoplelist();  	void hangoncurs();  	void sparkydrip(); -	void modifychar(); +	//void modifychar();  	void compare();  	void printcurs(); -	void convertkey(); +	//void convertkey();  	void outofopen();  	void dealwithspecial(); +	//void eraseoldobs();  	void dircom(); -	void liftsprite(); +	//void liftsprite();  	void dumpkeypad();  	void dumpzoom();  	void endgameseq(); @@ -785,8 +1510,8 @@ public:  	void isitdescribed();  	void hotelbell();  	void loadspeech(); -	void cls(); -	void printsprites(); +	//void cls(); +	//void printsprites();  	void dumptimedtext();  	void showallobs();  	void getnumber(); @@ -818,7 +1543,7 @@ public:  	void usekey();  	void locklighton();  	void useladderb(); -	void spriteupdate(); +	//void spriteupdate();  	void usetempcharset();  	void discops();  	void printdirect(); @@ -856,7 +1581,7 @@ public:  	void openhoteldoor();  	void removesetobject();  	void checkifperson(); -	void frameoutfx(); +	//void frameoutfx();  	void blank();  	void drinker();  	void nextcolon(); @@ -893,7 +1618,7 @@ public:  	void accesslighton();  	void dosreturn();  	void titles(); -	void quickquit(); +	//void quickquit();  	void showpointer();  	void usecooker();  	void loadmenu(); @@ -903,7 +1628,7 @@ public:  	void receptionist();  	void selectslot();  	void edenscdplayer(); -	void readoneblock(); +	//void readoneblock();  	void fadeupmon();  	void paltoendpal();  	void fadetowhite(); @@ -942,13 +1667,13 @@ public:  	void zoom();  	void outofinv();  	void viewfolder(); -	void walking(); +	//void walking();  	void diarykeyp(); -	void readabyte(); -	void showframe(); +	//void readabyte(); +	//void showframe();  	void random();  	void obicons(); -	void frameoutbh(); +	void mansatstill();  	void channel1only();  	void playguitar();  	void lastfolder(); @@ -957,8 +1682,9 @@ public:  	void showmonk();  	void diarykeyn();  	void set16colpalette(); -	void sparky(); +	void convicons();  	void interviewer(); +	void sparky();  	void purgeanitem();  	void madman();  	void createpanel(); @@ -1033,7 +1759,7 @@ public:  	void handclap();  	void smokebloke();  	void showexit(); -	void printundermon(); +	//void printundermon();  	void buttonnine();  	void findallopen();  	void loadintotemp3(); @@ -1049,13 +1775,13 @@ public:  	void settopright();  	void findsetobject();  	void singlekey(); -	void seecommandtail(); +	//void seecommandtail();  	void getundertimed();  	void hangone();  	void carparkdrip();  	void usediary();  	void deleteexobject(); -	void frameoutnm(); +	//void frameoutnm();  	void moneypoke();  	void destselect();  	void restoreems(); @@ -1065,7 +1791,7 @@ public:  	void openlouis();  	void buttonthree();  	void getundermenu(); -	void randomnumber(); +	//void randomnumber();  	void lookatcard();  	void helicopter();  	void scrollmonitor(); @@ -1097,7 +1823,7 @@ public:  	void addtopresslist();  	void walkandexamine();  	void dmaend(); -	void quickquit2(); +	//void quickquit2();  	void twodigitnum();  	void madmantext();  	void dumpcurrent(); @@ -1132,7 +1858,7 @@ public:  	void finalframe();  	void plotreel();  	void swapwithopen(); -	void makesprite(); +	//void makesprite();  	void dreamweb();  	void droperror();  	void openfilenocheck(); @@ -1162,7 +1888,7 @@ public:  	void read();  	void fadescreenups();  	void checkdest(); -	void initman(); +	//void initman();  	void loadpalfromiff();  	void facerightway();  	void startup1(); @@ -1175,12 +1901,12 @@ public:  	void gettingshot();  	void settopleft();  	void searchforstring(); -	void clearsprites(); +	//void clearsprites();  	void obpicture();  	void selectopenob();  	void widedoor();  	void security(); -	void printasprite(); +	//void printasprite();  	void buttonfive();  	void soundonreels();  	void usegun(); @@ -1205,10 +1931,10 @@ public:  	void makenextblock();  	void showpuztext();  	void addalong(); -	void width160(); +	//void width160();  	void incryanpage(); -	void dodoor(); -	void eraseoldobs(); +	//void dodoor(); +	void greyscalesum();  	void buttoneight();  	void opensarters();  	void findexobject(); @@ -1239,7 +1965,7 @@ public:  	void checkforshake();  	void usebuttona();  	void cancelch1(); -	void getnextword(); +	//void getnextword();  	void generalerror();  	void actualload();  	void allocateload(); @@ -1253,14 +1979,12 @@ public:  	void usechurchgate();  	void monkandryan();  	void allocatebuffers(); -	void convicons();  	void swapwithinv();  	void usecontrol();  	void buttonseven();  	void redrawmainscrn();  	void finishedwalking();  	void findallryan(); -	void lockeddoorway();  	void channel0tran();  	void buttonpress();  	void parseblaster(); @@ -1322,7 +2046,7 @@ public:  	void randomnum2();  	void loadsecondsample();  	void transfercontoex(); -	void multiput(); +	//void multiput();  	void isitright();  	void businessman();  	void switchryanoff(); diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h new file mode 100644 index 0000000000..23d8390a7d --- /dev/null +++ b/engines/dreamweb/structs.h @@ -0,0 +1,48 @@ +struct Sprite { +	uint16 updateCallback; +	uint16 w2; +	uint16 w4; +	uint16 w6; +	uint16 w8; +	uint8  x; +	uint8  y; +	uint16 w12; +	uint8  b14; +	uint8  b15; +	uint16 w16; +	uint8  delay; +	uint8  frame; +	uint16 obj_data; +	uint8  b22; +	uint8  priority; +	uint16 w24; +	uint16 w26; +	uint8  b28; +	uint8  b29; +	uint8  type; +	uint8  hidden; +}; + +struct ObjData { +	uint8 b0; +	uint8 b1; +	uint8 b2; +	uint8 b3; +	uint8 b4; +	uint8 b5; +	uint8 b6; +	uint8 delay; +	uint8 type; +	uint8 b9; +	uint8 b10; +	uint8 b11; +	uint8 b12; +	uint8 b13; +	uint8 b14; +	uint8 b15; +	uint8 b16; +	uint8 b17; +	uint8 b18[256]; // NB: Don't know the size yet +}; + + diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 2d3c819561..646c7e8909 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -83,21 +83,47 @@ void DreamGenContext::cls() {  	engine->cls();  } -void DreamGenContext::frameoutnm() { -	unsigned w = (uint8)cl, h = (uint8)ch; -	unsigned pitch = (uint16)dx; -	unsigned src = (uint16)si; -	int x = (uint16)di, y = (uint16)bx; -	unsigned dst = x + y * pitch; -	//debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)ds, (uint16)es); -	for(unsigned l = 0; l < h; ++l) { -		uint8 *src_p = ds.ptr(src + w * l, w); -		uint8 *dst_p = es.ptr(dst + pitch * l, w); -		memcpy(dst_p, src_p, w); +void DreamGenContext::frameoutnm(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +	dst += pitch * y + x; + +	for (uint16 j = 0; j < height; ++j) { +		memcpy(dst, src, width); +		dst += pitch; +		src += width; +	} +} + +void DreamGenContext::frameoutbh(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +	uint16 stride = pitch - width; +	dst += y * pitch + x; + +	for (uint16 i = 0; i < height; ++i) { +		for (uint16 j = 0; j < width; ++j) { +			if (*dst == 0xff) { +				*dst = *src; +			} +			++src; +			++dst; +		} +		dst += stride; +	} +} + +void DreamGenContext::frameoutfx(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +	uint16 stride = pitch - width; +	dst += y * pitch + x; +	dst -= width; + +	for (uint16 j = 0; j < height; ++j) { +		for (uint16 i = 0; i < width; ++i) { +			uint8 pixel = src[width - i - 1]; +			if (pixel) +				*dst = pixel; +			++dst; +		} +		src += width; +		dst += stride;  	} -	di += dst + pitch * h; -	si += w * h; -	cx = 0;  }  void DreamGenContext::seecommandtail() { @@ -191,6 +217,50 @@ void DreamGenContext::setmouse() {  	data.word(kOldpointerx) = 0xffff;  } +uint8 DreamGenContext::getnextword(uint8 *totalWidth, uint8 *charCount) { +	*totalWidth = 0; +	*charCount = 0; +	while(true) { +		uint8 firstChar = es.byte(di); +		++di; +		++*charCount; +		if ((firstChar == ':') || (firstChar == 0)) { //endall +			*totalWidth += 6; +			return 1; +		} +		if (firstChar == 32) { //endword +			*totalWidth += 6; +			return 0; +		} +		firstChar = engine->modifyChar(firstChar); +		if (firstChar != 255) { +			uint8 secondChar = es.byte(di); +			uint8 width = ds.byte(6*(firstChar - 32 + data.word(kCharshift))); +			width = kernchars(firstChar, secondChar, width); +			*totalWidth += width; +		} +	} +} + +void DreamGenContext::getnextword() { +	uint8 totalWidth, charCount; +	al = getnextword(&totalWidth, &charCount); +	bl = totalWidth; +	bh = charCount;	 +} + +uint8 DreamGenContext::kernchars(uint8 firstChar, uint8 secondChar, uint8 width) { +	if ((firstChar == 'a') || (al == 'u')) { +		if ((secondChar == 'n') || (secondChar == 't') || (secondChar == 'r') || (secondChar == 'i') || (secondChar == 'l')) +			return width-1; +	} +	return width; +} + +void DreamGenContext::kernchars() { +	cl = kernchars(al, ah, cl); +} +  void DreamGenContext::gettime() {  	TimeDate t;  	g_system->getTimeAndDate(t); @@ -528,19 +598,40 @@ void DreamGenContext::showpcx() {  	pcxFile.close();  } +/*  void DreamGenContext::frameoutv() {  	uint16 pitch = dx;  	uint16 width = cx & 0xff;  	uint16 height = cx >> 8; -	uint16 stride = pitch - width;  	const uint8* src = ds.ptr(si, width * height); -	uint8* base = es.ptr(di, stride * height); -	uint8* dst = base + pitch * bx; +	uint8* dst = es.ptr(0, pitch * height); + +	frameoutv(dst, src, pitch, width, height, di, bx); +} +*/ + +void DreamGenContext::frameoutv(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) { +	// NB : These resilience checks were not in the original engine, but did they result in undefined behaviour +	// or was something broken during porting to C++? +	assert(pitch == 320); + +	if(x >= 320) +		return; +	if(y >= 200) +		return; +	if(x + width > 320) { +		width = 320 - x; +	} +	if(y + height > 200) { +		height = 200 - y; +	} -	// NB: Original code assumes non-zero width and height, "for" are unneeded, do-while would suffice but would be less readable -	for (uint16 y = 0; y < height; ++y) { -		for (uint16 x = 0; x < width; ++x) { +	uint16 stride = pitch - width; +	dst += pitch * y + x; + +	for (uint16 j = 0; j < height; ++j) { +		for (uint16 i = 0; i < width; ++i) {  			uint8 pixel = *src++;  			if (pixel)  				*dst = pixel; @@ -550,6 +641,554 @@ void DreamGenContext::frameoutv() {  	}  } +Sprite* DreamGenContext::spritetable() { +	push(es); +	push(bx); + +	es = data.word(kBuffers); +	bx = kSpritetable; +	Sprite *sprite = (Sprite*)es.ptr(bx, 16*sizeof(Sprite)); + +	bx = pop(); +	es = pop(); + +	return sprite; +} + +uint16 DreamGenContext::showframeCPP(uint16 dst, uint16 src, uint16 x, uint16 y, uint8 frameNumber, uint8 effectsFlag) { +	es = dst; +	ds = src; +	di = x; +	bx = y; +	al = frameNumber; +	ah = effectsFlag; + +	si = (ax & 0x1ff) * 6; +	if (ds.word(si) == 0) { +		return 0; +	} + +//notblankshow: +	if ((effectsFlag & 128) == 0) { +		di += ds.byte(si+4); +		bx += ds.byte(si+5); +	} +//skipoffsets: +	cx = ds.word(si+0); +	uint8 width = cl; +	uint8 height = ch; +	uint16 written = cx; +	si = ds.word(si+2) + 2080; + +	if (effectsFlag) { +		if (effectsFlag & 128) { //centred +			di -= width / 2; +			bx -= height / 2; +		} +		if (effectsFlag & 64) { //diffdest +			frameoutfx(es.ptr(0, dx * height), ds.ptr(si, width * height), dx, width, height, di, bx); +			return written; +		} +		if (effectsFlag & 8) { //printlist +			push(ax); +			ax = di - data.word(kMapadx); +			push(bx); +			bx -= data.word(kMapady); +			ah = bl; +			bx = pop(); +			//addtoprintlist(); // NB: Commented in the original asm +			ax = pop(); +		} +		if (effectsFlag & 4) { //flippedx +			es = data.word(kWorkspace); +			frameoutfx(es.ptr(0, 320 * height), ds.ptr(si, width * height), 320, width, height, di, bx); +			return written; +		} +		if (effectsFlag & 2) { //nomask +			es = data.word(kWorkspace); +			frameoutnm(es.ptr(0, 320 * height), ds.ptr(si, width * height), 320, width, height, di, bx); +			return written; +		} +		if (effectsFlag & 32) { +			es = data.word(kWorkspace); +			frameoutbh(es.ptr(0, 320 * height), ds.ptr(si, width * height), 320, width, height, di, bx); +			return written; +		} +	} +//noeffects: +	es = data.word(kWorkspace); +	frameoutv(es.ptr(0, 65536), ds.ptr(si, width * height), 320, width, height, di, bx); +	return written; +} + +void DreamGenContext::showframe() { +	cx = showframeCPP(es, ds, di, bx, al, ah); +} + +void DreamGenContext::printsprites() { +	for (size_t priority = 0; priority < 7; ++priority) { +		Sprite *sprites = spritetable(); +		for (size_t j = 0; j < 16; ++j) { +			const Sprite &sprite = sprites[j]; +			if (READ_LE_UINT16(&sprite.updateCallback) == 0x0ffff) +				continue; +			if (priority != sprite.priority) +				continue; +			if (sprite.hidden == 1) +				continue; +			printasprite(&sprite); +		} +	} +} + +void DreamGenContext::printasprite(const Sprite* sprite) { +	push(es); +	push(bx); +	ds = READ_LE_UINT16(&sprite->w6); +	ax = sprite->y; +	if (al >= 220) { +		bx = data.word(kMapady) - (256 - al); +	} else { +		bx = ax + data.word(kMapady); +	} + +	ax = sprite->x; +	if (al >= 220) { +		di = data.word(kMapadx) - (256 - al); +	} else { +		di = ax + data.word(kMapadx); +	} +	 +	ax = sprite->b15; +	if (sprite->b29 != 0) +		ah = 8; +	showframe(); + +	bx = pop(); +	es = pop(); +} + +void DreamGenContext::eraseoldobs() { +	if (data.byte(kNewobs) == 0) +		return; + +	Sprite *sprites = spritetable(); +	for (size_t i=0; i<16; ++i) { +		Sprite &sprite = sprites[i]; +		if (READ_LE_UINT16(&sprite.obj_data) != 0xffff) { +			memset(&sprite, 0xff, sizeof(Sprite)); +		} +	} +} + +void DreamGenContext::clearsprites() { +	memset(spritetable(), 0xff, sizeof(Sprite)*16); +} + +Sprite* DreamGenContext::makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 somethingInDx, uint16 somethingInDi) { +	Sprite *sprite = spritetable(); +	while (sprite->b15 != 0xff) { // NB: No boundchecking in the original code either +		++sprite; +	} + +	WRITE_LE_UINT16(&sprite->updateCallback, updateCallback); +	sprite->x = x; +	sprite->y = y; +	WRITE_LE_UINT16(&sprite->w6, somethingInDx); +	WRITE_LE_UINT16(&sprite->w8, somethingInDi); +	sprite->w2 = 0xffff; +	sprite->b15 = 0; +	sprite->delay = 0; +	return sprite; +} + +void DreamGenContext::makesprite() { // NB: returns new sprite in es:bx  +	Sprite *sprite = makesprite(si & 0xff, si >> 8, cx, dx, di); + +	// Recover es:bx from sprite +	es = data.word(kBuffers); +	bx = kSpritetable; +	Sprite *sprites = (Sprite*)es.ptr(bx, sizeof(Sprite)*16); +	bx += sizeof(Sprite)*(sprite-sprites); +	// +} + +void DreamGenContext::spriteupdate() { +	Sprite *sprites = spritetable(); +	sprites[0].hidden = data.byte(kRyanon); + +	Sprite *sprite = sprites; +	for (size_t i=0; i<16; ++i) { +		uint16 updateCallback = READ_LE_UINT16(&sprite->updateCallback); +		if (updateCallback != 0xffff) { +			sprite->w24 = sprite->w2; +			if (updateCallback == addr_mainman) // NB : Let's consider the callback as an enum while more code is not ported to C++ +				mainmanCPP(sprite); +			else { +				assert(updateCallback == addr_backobject); +				backobject(sprite); +			} +		} +	 +		if (data.byte(kNowinnewroom) == 1) +			break; +		++sprite; +	} +} + +void DreamGenContext::initman() { +	Sprite *sprite = makesprite(data.byte(kRyanx), data.byte(kRyany), addr_mainman, data.word(kMainsprites), 0); +	sprite->priority = 4; +	sprite->b22 = 0; +	sprite->b29 = 0; + +	// Recover es:bx from sprite +	es = data.word(kBuffers); +	bx = kSpritetable; +	Sprite *sprites = (Sprite*)es.ptr(bx, sizeof(Sprite)*16); +	bx += 32*(sprite-sprites); +	// +} + +void DreamGenContext::mainmanCPP(Sprite* sprite) { +	push(es); +	push(ds); + +	// Recover es:bx from sprite +	es = data.word(kBuffers); +	bx = kSpritetable; +	Sprite *sprites = (Sprite*)es.ptr(bx, sizeof(Sprite)*16); +	bx += 32*(sprite-sprites); +	// + +	if (data.byte(kResetmanxy) == 1) { +		data.byte(kResetmanxy) = 0; +		sprite->x = data.byte(kRyanx); +		sprite->y = data.byte(kRyany); +		sprite->b29 = 0; +	} +	--sprite->b22; +	if (sprite->b22 != 0xff) { +		ds = pop(); +		es = pop(); +		return; +	} +	sprite->b22 = 0; +	if (data.byte(kTurntoface) != data.byte(kFacing)) { +		aboutturn(sprite); +	} else { +		if ((data.byte(kTurndirection) != 0) && (data.byte(kLinepointer) == 254)) { +			data.byte(kReasseschanges) = 1; +			if (data.byte(kFacing) == data.byte(kLeavedirection)) +				checkforexit(); +		} +		data.byte(kTurndirection) = 0; +		if (data.byte(kLinepointer) == 254) { +			sprite->b29 = 0; +		} else { +			++sprite->b29; +			if (sprite->b29 == 11) +				sprite->b29 = 1; +			walking(); +			if (data.byte(kLinepointer) != 254) { +				if ((data.byte(kFacing) & 1) == 0) +					walking(); +				else if ((sprite->b29 != 2) && (sprite->b29 != 7)) +					walking(); +			} +			if (data.byte(kLinepointer) == 254) { +				if (data.byte(kTurntoface) == data.byte(kFacing)) { +					data.byte(kReasseschanges) = 1; +					if (data.byte(kFacing) == data.byte(kLeavedirection)) +						checkforexit(); +				} +			} +		} +	} +	static const uint8 facelist[] = { 0,60,33,71,11,82,22,93 }; +	sprite->b15 = sprite->b29 + facelist[data.byte(kFacing)]; +	data.byte(kRyanx) = sprite->x; +	data.byte(kRyany) = sprite->y; + +	ds = pop(); +	es = pop(); +} + +void DreamGenContext::walking() { +	Sprite *sprite = (Sprite*)es.ptr(bx, sizeof(Sprite)); + +	uint8 comp; +	if (data.byte(kLinedirection) != 0) { +		--data.byte(kLinepointer); +		comp = 200; +	} else { +		++data.byte(kLinepointer); +		comp = data.byte(kLinelength); +	} +	if (data.byte(kLinepointer) < comp) { +		sprite->x = data.byte(kLinedata + data.byte(kLinepointer) * 2 + 0); +		sprite->y = data.byte(kLinedata + data.byte(kLinepointer) * 2 + 1); +		return; +	} + +	data.byte(kLinepointer) = 254; +	data.byte(kManspath) = data.byte(kDestination); +	if (data.byte(kDestination) == data.byte(kFinaldest)) { +		facerightway(); +		return; +	} +	data.byte(kDestination) = data.byte(kFinaldest); +	push(es); +	push(bx); +	autosetwalk(); +	bx = pop(); +	es = pop(); +} + +void DreamGenContext::aboutturn(Sprite* sprite) { +	if (data.byte(kTurndirection) == 1) +		goto incdir; +	else if ((int8)data.byte(kTurndirection) == -1) +		goto decdir; +	else { +		if (data.byte(kFacing) < data.byte(kTurntoface)) { +			uint8 delta = data.byte(kTurntoface) - data.byte(kFacing); +			if (delta >= 4) +				goto decdir; +			else +				goto incdir; +		} else { +			uint8 delta = data.byte(kFacing) - data.byte(kTurntoface); +			if (delta >= 4) +				goto incdir; +			else +				goto decdir; +		} +	} +incdir: +	data.byte(kTurndirection) = 1; +	data.byte(kFacing) = (data.byte(kFacing) + 1) & 7; +	sprite->b29 = 0; +	return; +decdir: +	data.byte(kTurndirection) = -1; +	data.byte(kFacing) = (data.byte(kFacing) - 1) & 7; +	sprite->b29 = 0; +} + +void DreamGenContext::backobject(Sprite* sprite) { +	push(es); +	push(ds); + +	// Recover es:bx from sprite +	es = data.word(kBuffers); +	bx = kSpritetable; +	Sprite *sprites = (Sprite*)es.ptr(bx, sizeof(Sprite)*16); +	bx += 32*(sprite-sprites); +	// + +	ds = data.word(kSetdat); +	di = READ_LE_UINT16(&sprite->obj_data); +	ObjData* objData = (ObjData*)ds.ptr(di, 0); + +	if (sprite->delay != 0) { +		--sprite->delay; +		ds = pop(); +		es = pop(); +		return; +	} + +	sprite->delay = objData->delay; +	if (objData->type == 6) +		widedoor(sprite, objData); +	else if (objData->type == 5) +		random(sprite, objData); +	else if (objData->type == 4) +		lockeddoorway(); +	else if (objData->type == 3) +		liftsprite(sprite, objData); +	else if (objData->type == 2) +		doorway(sprite, objData); +	else if (objData->type == 1) +		constant(sprite, objData); +	else +		steady(sprite, objData); + +	ds = pop(); +	es = pop(); +} + +void DreamGenContext::constant(Sprite* sprite, ObjData* objData) { +	++sprite->frame; +	if (objData->b18[sprite->frame] == 255) { +		sprite->frame = 0; +	} +	uint8 b18 = objData->b18[sprite->frame]; +	objData->b17 = b18; +	sprite->b15 = b18; +} + +void DreamGenContext::random(Sprite* sprite, ObjData* objData) { +	randomnum1(); +	uint16 r = ax; +	sprite->b15 = objData->b18[r&7]; +} + +void DreamGenContext::doorway(Sprite* sprite, ObjData* objData) { +	data.byte(kDoorcheck1) = -24; +	data.byte(kDoorcheck2) = 10; +	data.byte(kDoorcheck3) = -30; +	data.byte(kDoorcheck4) = 10; +	dodoor(sprite, objData); +} + +void DreamGenContext::widedoor(Sprite* sprite, ObjData* objData) { +	data.byte(kDoorcheck1) = -24; +	data.byte(kDoorcheck2) = 24; +	data.byte(kDoorcheck3) = -30; +	data.byte(kDoorcheck4) = 24; +	dodoor(sprite, objData); +} + +void DreamGenContext::dodoor() { +	Sprite *sprite = (Sprite*)es.ptr(bx, sizeof(Sprite)); +	ObjData *objData = (ObjData*)ds.ptr(di, 0); +	dodoor(sprite, objData); +} + +void DreamGenContext::dodoor(Sprite* sprite, ObjData* objData) { +	uint8 ryanx = data.byte(kRyanx); +	uint8 ryany = data.byte(kRyany); +	int8 deltax = ryanx - sprite->x; +	int8 deltay = ryany - sprite->y; +	if (ryanx < sprite->x) { +		if (deltax < (int8)data.byte(kDoorcheck1)) +			goto shutdoor; +	} else { +		if (deltax >= data.byte(kDoorcheck2)) +			goto shutdoor; +	} +	if (ryany < sprite->y) { +		if (deltay < (int8)data.byte(kDoorcheck3)) +			goto shutdoor; +	} else { +		if (deltay >= data.byte(kDoorcheck4)) +			goto shutdoor; +	} +//opendoor: +	if ((data.byte(kThroughdoor) == 1) && (sprite->frame == 0)) +		sprite->frame = 6; + +	++sprite->frame; +	if (sprite->frame == 1) { //doorsound2 +		if (data.byte(kReallocation) == 5) //hoteldoor2 +			al = 13; +		else +			al = 0; +		playchannel1(); +	} +	if (objData->b18[sprite->frame] == 255) { +		--sprite->frame; +	} +	sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	data.byte(kThroughdoor) = 1; +	return; +shutdoor: +	if (sprite->frame == 5) { //doorsound1; +		if (data.byte(kReallocation) == 5) //hoteldoor1 +			al = 13; +		else +			al = 1; +		playchannel1(); +	} +	if (sprite->frame != 0) { +		--sprite->frame; +	} +	sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	if (sprite->frame == 5) //nearly +		data.byte(kThroughdoor) = 0; +} + +void DreamGenContext::steady(Sprite* sprite, ObjData* objData) { +	uint8 b18 = objData->b18[0]; +	objData->b17 = b18; +	sprite->b15 = b18; +} + +void DreamGenContext::turnpathonCPP(uint8 param) { +	al = param; +	push(es); +	push(bx); +	turnpathon(); +	bx = pop(); +	es = pop(); +} + +void DreamGenContext::turnpathoffCPP(uint8 param) { +	al = param; +	push(es); +	push(bx); +	turnpathoff(); +	bx = pop(); +	es = pop(); +} + +void DreamGenContext::liftsprite() { +	Sprite *sprite = (Sprite*)es.ptr(bx, sizeof(Sprite)); +	ObjData *objData = (ObjData*)ds.ptr(di, 0); +	liftsprite(sprite, objData); +} + +void DreamGenContext::liftsprite(Sprite* sprite, ObjData* objData) { +	uint8 liftFlag = data.byte(kLiftflag); +	if (liftFlag == 0) { //liftclosed +		turnpathoffCPP(data.byte(kLiftpath)); + +		if (data.byte(kCounttoopen) != 0) { +			_dec(data.byte(kCounttoopen)); +			if (data.byte(kCounttoopen) == 0) +				data.byte(kLiftflag) = 3; +		} +		sprite->frame = 0; +		sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	} +	else if (liftFlag == 1) {  //liftopen +		turnpathonCPP(data.byte(kLiftpath)); + +		if (data.byte(kCounttoclose) != 0) { +			_dec(data.byte(kCounttoclose)); +			if (data.byte(kCounttoclose) == 0) +				data.byte(kLiftflag) = 2; +		} +		sprite->frame = 12; +		sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	}	 +	else if (liftFlag == 3) { //openlift +		if (sprite->frame == 12) { +			data.byte(kLiftflag) = 1; +			return; +		} +		++sprite->frame; +		if (sprite->frame == 1) { +			al = 2; +			liftnoise(); +		} +		sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	} else { //closeLift +		assert(liftFlag == 2); +		if (sprite->frame == 0) { +			data.byte(kLiftflag) = 0; +			return; +		} +		--sprite->frame; +		if (sprite->frame == 11) { +			al = 3; +			liftnoise(); +		} +		sprite->b15 = objData->b17 = objData->b18[sprite->frame]; +	} +} +  void DreamGenContext::modifychar() {  	al = engine->modifyChar(al);  } @@ -581,3 +1220,4 @@ void DreamGenContext::lockmon() {  }  } /*namespace dreamgen */ + diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h new file mode 100644 index 0000000000..7f82ba5a54 --- /dev/null +++ b/engines/dreamweb/stubs.h @@ -0,0 +1,50 @@ +	void multidump(); +	void frameoutv(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); +	void frameoutnm(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); +	void frameoutbh(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); +	void frameoutfx(uint8* dst, const uint8* src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y); +	void worktoscreen(); +	void multiget(); +	void convertkey(); +	void cls(); +	void printsprites(); +	void quickquit(); +	void readoneblock(); +	void printundermon(); +	void seecommandtail(); +	void randomnumber(); +	void quickquit2(); +	void getnextword(); +	uint8 getnextword(uint8 *totalWidth, uint8 *charCount); +	void kernchars(); +	uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width); +	Sprite* spritetable(); +	void showframe(); +	uint16 showframeCPP(uint16 dst, uint16 src, uint16 x, uint16 y, uint8 frameNumber, uint8 effectsFlag); +	void printasprite(const Sprite* sprite); +	void width160(); +	void multiput(); +	void eraseoldobs(); +	void clearsprites(); +	void makesprite(); +	Sprite* makesprite(uint8 x, uint8 y, uint16 updateCallback, uint16 somethingInDx, uint16 somethingInDi); +	void spriteupdate(); +	void initman(); +	void mainmanCPP(Sprite* sprite); +	void walking(); +	void aboutturn(Sprite* sprite); +	void backobject(Sprite* sprite); +	void constant(Sprite* sprite, ObjData* objData); +	void steady(Sprite* sprite, ObjData* objData); +	void random(Sprite* sprite, ObjData* objData); +	void dodoor(); +	void dodoor(Sprite* sprite, ObjData* objData); +	void doorway(Sprite* sprite, ObjData* objData); +	void widedoor(Sprite* sprite, ObjData* objData); +	void liftsprite(); +	void liftsprite(Sprite* sprite, ObjData* objData); +	void turnpathonCPP(uint8 param); +	void turnpathoffCPP(uint8 param); +	void modifychar(); +	void lockmon(); +  | 
