A question about some source code bits and bobs

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
marzipan
Posts: 301
Joined: Fri Nov 25, 2005 4:10 pm

A question about some source code bits and bobs

Post by marzipan »

Looking through the ScummVM source lately, I felt the need to ask a couple of questions...

engines\gob\inter_v1.cpp:

Code: Select all

	// Skipping the copy protection screen in Gobliiins
	if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob1) && (offset == 3905)
			&& !scumm_stricmp(_vm->_game->_curTotFile, _vm->_startTot.c_str())) {
		debugC(2, kDebugGameFlow, "Skipping copy protection screen");
		return false;
	}
	// Skipping the copy protection screen in Gobliins 2
	if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob2) && (offset == 1746)
			&& !scumm_stricmp(_vm->_game->_curTotFile, "intro0.tot")) {
		debugC(2, kDebugGameFlow, "Skipping copy protection screen");
		return false;
	}
Are the offsets decimal or hexadecimal based, and how do I find out what byte changes it makes exactly?

engines\cine\main_loop.cpp:

Code: Select all

       globalVars[VAR_BYPASS_PROTECTION] = 0; // set to 1 to bypass the copy protection
Is this similarly a "change offset" function?

Thanks.
User avatar
Strangerke
ScummVM Developer
Posts: 335
Joined: Wed Sep 06, 2006 8:39 am
Location: Belgium

Post by Strangerke »

Concerning Gob1 & Gob2, this workaround has been added because some versions were sold with a patched EXE (ie with this hack and without protection manuals). The values are decimal, and it simply skips a function call in the script.

I hope it helps :)
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

As for CINE... that is a flag which the game scripts themselves check, and if it's 1, the copy protection screen is bypassed. It's not a change in any offset, it was a feature in the original executable and game scripts
fingolfin
Retired
Posts: 1452
Joined: Wed Sep 21, 2005 4:12 pm

Post by fingolfin »

Hi marzipan,
what do you need this for, if I may ask? :)
User avatar
bobdevis
Posts: 567
Joined: Fri Jan 16, 2009 10:52 am

Post by bobdevis »

I believe you can safely assume any number in a C/C++ program without any special tag is always decimal. Hexadecimal values must have their '0x' tag.

The programmer might have faired into the murky depths of refining semantics (custom definition of '==' for example, like with strings) but people rarely do that.
Post Reply