[Scummvm-cvs-logs] SF.net SVN: scummvm: [25086] scummvm/trunk/engines/agi/id.cpp

dsx at users.sourceforge.net dsx at users.sourceforge.net
Mon Jan 15 00:23:45 CET 2007


Revision: 25086
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25086&view=rev
Author:   dsx
Date:     2007-01-14 15:23:44 -0800 (Sun, 14 Jan 2007)

Log Message:
-----------
Be more flexible w.r.t. interpreter version being emulated.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/id.cpp

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2007-01-14 22:01:47 UTC (rev 25085)
+++ scummvm/trunk/engines/agi/id.cpp	2007-01-14 23:23:44 UTC (rev 25086)
@@ -67,39 +67,32 @@
 
 	if (ver == 0) {
 		report("Unknown v2 Sierra game: %08x\n\n", crc);
-		agiSetRelease(0x2917);
+		agiSetRelease(ver = 0x2917);
 	}
 
 	/* setup the differences in the opcodes and other bits in the
 	 * AGI v2 specs
 	 */
 	if (opt.emuversion)
-		agiSetRelease(opt.emuversion);
+		agiSetRelease(ver = opt.emuversion);
 
+	// Should this go above the previous lines, so we can force emulation versions
+	// even for AGDS games? -- dsymonds
 	if (opt.agdsMode)
-		agiSetRelease(0x2440);	/* ALL AGDS games built for 2.440 */
+		agiSetRelease(ver = 0x2440);	/* ALL AGDS games built for 2.440 */
 
 	report("Seting up for version 0x%04X\n", ver);
 
-	switch (agiGetRelease()) {
-	case 0x2089:
-		logic_names_cmd[0x86].num_args = 0;	/* quit: 0 args */
-		logic_names_cmd[0x97].num_args = 3;	/* print.at: 3 args */
-		logic_names_cmd[0x98].num_args = 3;	/* print.at.v: 3 args */
-		break;
-	case 0x2272:
-		/* KQ3 0x88673 (2.272) requires print.at with 4 arguments */
-		break;
-	case 0x2440:
-		break;
-	case 0x2917:
-		break;
-	case 0x2936:
-		break;
-	default:
-		report("** Cannot setup for unknown version\n");
-		ec = err_UnknownAGIVersion;
-		break;
+	// 'quit' takes 0 args for 2.089
+	if (ver == 0x2089)
+		logic_names_cmd[0x86].num_args = 0;
+
+	// 'print.at' and 'print.at.v' take 3 args before 2.272
+	// This is documented in the specs as only < 2.440, but it seems
+	// that KQ3 (2.272) needs a 'print.at' taking 4 args.
+	if (ver < 0x2272) {
+		logic_names_cmd[0x97].num_args = 3;
+		logic_names_cmd[0x98].num_args = 3;
 	}
 
 	return ec;
@@ -121,17 +114,12 @@
 
 	report("Seting up for version 0x%04X\n", ver);
 
-	switch (agiGetRelease()) {
-	case 0x3086:
-		logic_names_cmd[0xad].num_args = 1;	/* 173 : 1 args */
-		break;
-	case 0x3149:
-		logic_names_cmd[0xad].num_args = 0;	/* 173 : 0 args */
-		break;
-	default:
-		report("Error: cannot setup for unknown version\n");
-		ec = err_UnknownAGIVersion;
-		break;
+	// 'unknown176' takes 1 arg for 3.002.086, not 0 args.
+	// 'unknown173' also takes 1 arg for 3.002.068, not 0 args.
+	// Is this actually used anywhere? -- dsymonds
+	if (ver == 0x3086) {
+		logic_names_cmd[0xb0].num_args = 1;
+		logic_names_cmd[0xad].num_args = 1;
 	}
 
 	return ec;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list