diff options
| author | Bertrand Augereau | 2011-08-20 12:33:21 +0200 | 
|---|---|---|
| committer | Bertrand Augereau | 2011-08-20 14:19:36 +0200 | 
| commit | b17561dd09c3a09e6c1a084a8006373e60f079b6 (patch) | |
| tree | 44f7105926ce8b663749745edc968d18da9e2d43 | |
| parent | 51fbc7200c3758e526195260d4c705de87f56733 (diff) | |
| download | scummvm-rg350-b17561dd09c3a09e6c1a084a8006373e60f079b6.tar.gz scummvm-rg350-b17561dd09c3a09e6c1a084a8006373e60f079b6.tar.bz2 scummvm-rg350-b17561dd09c3a09e6c1a084a8006373e60f079b6.zip  | |
DREAMWEB: 'deletetaken' ported to C++
| -rwxr-xr-x | devtools/tasmrecover/tasm-recover | 1 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.cpp | 26 | ||||
| -rw-r--r-- | engines/dreamweb/dreamgen.h | 3 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.cpp | 14 | ||||
| -rw-r--r-- | engines/dreamweb/stubs.h | 1 | 
5 files changed, 17 insertions, 28 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index c67111108c..6b95f3db4a 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -137,6 +137,7 @@ generator = cpp(context, "DreamGen", blacklist = [  	'findormake',  	'setallchanges',  	'dochange', +	'deletetaken',  	], skip_output = [  	# These functions are processed but not output  	'dreamweb', diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 0b3e57f11d..b3ca7508b7 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -5255,31 +5255,6 @@ doplace:  	delpointer();  } -void DreamGenContext::deletetaken() { -	STACK_CHECK; -	es = data.word(kFreedat); -	ah = data.byte(kReallocation); -	ds = data.word(kExtras); -	si = (0+2080+30000); -	cx = (114); -takenloop: -	al = ds.byte(si+11); -	_cmp(al, ah); -	if (!flags.z()) -		goto notinhere; -	bl = ds.byte(si+1); -	bh = 0; -	_add(bx, bx); -	_add(bx, bx); -	_add(bx, bx); -	_add(bx, bx); -	es.byte(bx+2) = 254; -notinhere: -	_add(si, 16); -	if (--cx) -		goto takenloop; -} -  void DreamGenContext::outofinv() {  	STACK_CHECK;  	findinvpos(); @@ -18424,7 +18399,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {  		case addr_swapwithinv: swapwithinv(); break;  		case addr_swapwithopen: swapwithopen(); break;  		case addr_intoinv: intoinv(); break; -		case addr_deletetaken: deletetaken(); break;  		case addr_outofinv: outofinv(); break;  		case addr_getfreead: getfreead(); break;  		case addr_getexad: getexad(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 7756a58c93..a6dff60400 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -506,7 +506,6 @@ public:  	static const uint16 addr_getexad = 0xc3a8;  	static const uint16 addr_getfreead = 0xc3a4;  	static const uint16 addr_outofinv = 0xc3a0; -	static const uint16 addr_deletetaken = 0xc39c;  	static const uint16 addr_intoinv = 0xc398;  	static const uint16 addr_swapwithopen = 0xc394;  	static const uint16 addr_swapwithinv = 0xc390; @@ -1638,7 +1637,7 @@ public:  	void errormessage1();  	void clearchanges();  	void errormessage3(); -	void deletetaken(); +	//void deletetaken();  	void putundermenu();  	void checkifex();  	void intromagic2(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 39c6e14b1f..2968a5e9b7 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1101,6 +1101,20 @@ void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) {  	}  } +void DreamGenContext::deletetaken() { +	ds = data.word(kExtras); +	si = kExdata; +	FreeObject *freeObjects = (FreeObject *)segRef(data.word(kFreedat)).ptr(0, 0); +	for(size_t i = 0; i < kNumexobjects; ++i) { +		uint8 location = ds.byte(si+11); +		if (location == data.byte(kReallocation)) { +			uint8 index = ds.byte(si+1); +			freeObjects[index].b2 = 254; +		} +		si += 16; +	} +} +  bool DreamGenContext::isCD() {  	// The original sources has two codepaths depending if the game is 'if cd' or not  	// This is a hack to guess which version to use with the assumption that if we have a cd version diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 6d18ce4902..3ffc608f1e 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -156,5 +156,6 @@  	void setallchanges();  	void dochange();  	void dochange(uint8 index, uint8 value, uint8 type); +	void deletetaken();  	bool isCD();  | 
