Remove unused script opcodes

svn-id: r24495
This commit is contained in:
Travis Howell 2006-10-25 10:20:17 +00:00
parent a4be70e47b
commit 15915e805d
5 changed files with 31 additions and 41 deletions

View File

@ -1060,8 +1060,6 @@ public:
void o_defObj();
void o_here();
void o_doClassIcons();
void o_waitEndTune();
void o_ifEndTune();
void o_setAdjNoun();
void o_saveUserGame();
void o_loadUserGame();

View File

@ -358,8 +358,8 @@ static const char *const elvira1_opcodeNameTable[300] = {
"IWW|DO_CLASS_ICONS",
"WW|PLAY_TUNE",
/* 264 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Www|SET_ADJ_NOUN",
"WW|ZONE_DISK",
/* 268 */
@ -546,8 +546,8 @@ static const char *const elvira2_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WW|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -779,8 +779,8 @@ static const char *const waxworks_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WW|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -1021,8 +1021,8 @@ static const char *const simon1dos_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WW|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -1259,8 +1259,8 @@ static const char *const simon1talkie_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WW|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -1497,8 +1497,8 @@ static const char *const simon2dos_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WWB|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -1739,8 +1739,8 @@ static const char *const simon2talkie_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WWB|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
NULL,
/* 132 */
@ -1981,8 +1981,8 @@ static const char *const feeblefiles_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WWB|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
"|SET_TIME",
/* 132 */
@ -2234,8 +2234,8 @@ static const char *const puzzlepack_opcodeNameTable[256] = {
"IBB|DO_CLASS_ICONS",
"WWB|PLAY_TUNE",
/* 128 */
"W|WAIT_END_TUNE",
"W|IF_END_TUNE",
NULL,
NULL,
"Bww|SET_ADJ_NOUN",
"|SET_TIME",
/* 132 */

View File

@ -121,8 +121,6 @@ void AGOSEngine::setupCommonOpcodes(OpcodeProc *op) {
op[121] = &AGOSEngine::o_defObj;
op[125] = &AGOSEngine::o_here;
op[126] = &AGOSEngine::o_doClassIcons;
op[128] = &AGOSEngine::o_waitEndTune;
op[129] = &AGOSEngine::o_ifEndTune;
op[130] = &AGOSEngine::o_setAdjNoun;
op[132] = &AGOSEngine::o_saveUserGame;
op[133] = &AGOSEngine::o_loadUserGame;
@ -858,17 +856,6 @@ void AGOSEngine::o_doClassIcons() {
mouseOn();
}
void AGOSEngine::o_waitEndTune() {
// 128: dummy instruction
getVarOrWord();
}
void AGOSEngine::o_ifEndTune() {
// 129: dummy instruction
getVarOrWord();
setScriptCondition(true);
}
void AGOSEngine::o_setAdjNoun() {
// 130: set adj noun
uint var = getVarOrByte();

View File

@ -189,8 +189,6 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
op[261] = &AGOSEngine::o_here;
op[262] = &AGOSEngine::o_doClassIcons;
op[263] = &AGOSEngine::o1_playTune;
op[264] = &AGOSEngine::o_waitEndTune;
op[265] = &AGOSEngine::o_ifEndTune;
op[266] = &AGOSEngine::o_setAdjNoun;
op[267] = &AGOSEngine::oe1_zoneDisk;
op[268] = &AGOSEngine::o_saveUserGame;

View File

@ -215,8 +215,8 @@ Subroutine *AGOSEngine::getSubroutineByID(uint subroutine_id) {
}
}
if (subroutine_id != 160)
debug(0,"getSubroutineByID: subroutine %d not found", subroutine_id);
//if (subroutine_id != 160)
// debug(0,"getSubroutineByID: subroutine %d not found", subroutine_id);
return NULL;
}
@ -312,6 +312,7 @@ bool AGOSEngine::loadTablesOldIntoMem(uint subr_id) {
p += 6;
while (min_num) {
//printf("loadTablesOldIntoMem: min %d max %d\n", min_num, max_num);
if ((subr_id >= min_num) && (subr_id <= max_num)) {
_subroutineList = _subroutineListOrg;
_tablesHeapPtr = _tablesHeapPtrOrg;
@ -368,6 +369,7 @@ bool AGOSEngine::loadTablesNewIntoMem(uint subr_id) {
max_num = READ_BE_UINT16(p); p += 2;
//printf("loadTablesNewIntoMem: min %d max %d\n", min_num, max_num);
if (subr_id >= min_num && subr_id <= max_num) {
_subroutineList = _subroutineListOrg;
_tablesHeapPtr = _tablesHeapPtrOrg;
@ -513,9 +515,12 @@ SubroutineLine *AGOSEngine::createSubroutineLine(Subroutine *sub, int where) {
void AGOSEngine::runSubroutine101() {
Subroutine *sub;
sub = getSubroutineByID(101);
if (sub != NULL)
startSubroutineEx(sub);
for (int i = 0; i < 1000000; i++) {
sub = getSubroutineByID(i);
if (sub != NULL)
startSubroutine(sub);
}
error("Complete");
permitInput();
}
@ -537,9 +542,11 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
_classMode1 = 0;
_classMode2 = 0;
if (_startMainScript)
//if (_startMainScript)
dumpSubroutine(sub);
return 0;
if (++_recursionDepth > 40)
error("Recursion error");