[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gNewSense-users] Scummvm games: software or data?
From: |
Mark H. Weaver |
Subject: |
[gNewSense-users] Scummvm games: software or data? |
Date: |
Sun, 20 May 2007 23:54:29 -0400 |
User-agent: |
KMail/1.9.1 |
It has been claimed that the scummvm games are merely data, and thus it is
okay to keep them in gNewSense even without source, the preferred form for
editing. That is a reasonable claim, but upon further investigation I
believe it is false.
Take a look at struct VirtualMachineState, in scummvm-0.8.0/scumm/script.h:
struct VirtualMachineState {
uint32 cutScenePtr[5];
byte cutSceneScript[5];
int16 cutSceneData[5];
int16 cutSceneScriptIndex;
byte cutSceneStackPointer;
ScriptSlot slot[NUM_SCRIPT_SLOT];
int32 localvar[NUM_SCRIPT_SLOT][26];
NestedScript nest[15];
byte numNestedScripts;
};
So, we have local variables and nested scripts. There's a debugger too.
Line 66 of scummvm-0.8.0/doc/05_04.tex tells how to enter the debugger in a
section of special keys specifically for Flight of the Amazon Queen.
Take a look at scummvm-0.8.0/scumm/script.cpp, which has the following
function:
/* Start executing script 'script' with the given parameters */
void ScummEngine::runScript(int script, bool freezeResistant,
bool recursive, int *lvarptr, int cycle) {
[...]
So we have recursion, local variables, and parameters.
In the same directory, look at the various script_v*.cpp files, for example
script_v6.cpp, which contains a list of opcodes. Here are some selected
opcodes, to give you an idea: o6_pushByte, o6_pushWord, o6_pushByteVar, ...,
o6_dup, o6_not, o6_eq, o6_neq, o6_gt, o6_lt, o6_le, o6_ge, o6_add,
o6_sub, ..., o6_pop, o6_byteArrayIndexedWrite, o6_if, o6_ifNot,
o6_startScript, ..., o6_jump, ...
I therefore claim that scummvm games are not merely data, but software.
Mark
- [gNewSense-users] Scummvm games: software or data?,
Mark H. Weaver <=