Add more code and stubs for WW

svn-id: r24121
This commit is contained in:
Travis Howell 2006-10-05 05:27:10 +00:00
parent d7ac158813
commit 5074da16d3
3 changed files with 49 additions and 4 deletions

View File

@ -749,6 +749,19 @@ byte *AGOSEngine::allocateItem(uint size) {
return org;
}
int AGOSEngine::getUserFlag(Item *item, int a) {
SubUserFlag *subUserFlag;
subUserFlag = (SubUserFlag *) findChildOfType(item, 9);
if (subUserFlag == NULL)
return 0;
if (a < 0 || a > 3)
return 0;
return subUserFlag->userFlags[a];
}
void AGOSEngine::setUserFlag(Item *item, int a, int b) {
SubUserFlag *subUserFlag;

View File

@ -514,6 +514,7 @@ protected:
uint32 readUint32Wrapper(const void *src);
int allocGamePcVars(Common::File *in);
int getUserFlag(Item *item, int a);
void setUserFlag(Item *item, int a, int b);
void createPlayer();
void allocateStringTable(int num);
@ -859,7 +860,7 @@ public:
void setScriptReturn(int ret);
int getScriptReturn();
// Opcodes, Simon 1 and later
// Opcodes, common
void o_at();
void o_notAt();
void o_carried();
@ -882,6 +883,8 @@ public:
void o_oflag();
void o_destroy();
void o_place();
void o_copyof();
void o_copyfo();
void o_copyff();
void o_clear();
void o_let();
@ -1019,6 +1022,8 @@ public:
void oww_menu();
void oww_textMenu();
void oww_ifDoorOpen();
void oww_opcode184();
void oww_opcode187();
// Opcodes, Simon 1 only
void o1_printLongText();

View File

@ -200,6 +200,8 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
op[51] = &AGOSEngine::o_place;
op[54] = &AGOSEngine::o_copyof;
op[55] = &AGOSEngine::o_copyfo;
op[56] = &AGOSEngine::o_copyff;
op[60] = &AGOSEngine::oe1_setFF;
@ -309,6 +311,8 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) {
void AGOSEngine::setupElvira2Opcodes(OpcodeProc *op) {
setupCommonOpcodes(op);
op[34] = &AGOSEngine::o_copyof;
op[35] = &AGOSEngine::o_copyfo;
op[83] = &AGOSEngine::o1_rescan;
op[98] = &AGOSEngine::o1_animate;
op[99] = &AGOSEngine::o1_stopAnimate;
@ -324,6 +328,8 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
setupCommonOpcodes(op);
// Confirmed
op[34] = &AGOSEngine::o_copyof;
op[35] = &AGOSEngine::o_copyfo;
op[54] = &AGOSEngine::oww_moveDirn;
op[55] = &AGOSEngine::oww_goto;
op[70] = &AGOSEngine::o1_printLongText;
@ -335,11 +341,14 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
op[106] = &AGOSEngine::oww_textMenu;
op[127] = &AGOSEngine::o1_playTune;
op[148] = &AGOSEngine::oww_ifDoorOpen;
op[175] = &AGOSEngine::o_getDollar2;
op[179] = &AGOSEngine::o_isAdjNoun;
op[180] = &AGOSEngine::o_b2Set;
op[181] = &AGOSEngine::o_b2Clear;
op[182] = &AGOSEngine::o_b2Zero;
op[183] = &AGOSEngine::o_b2NotZero;
op[184] = &AGOSEngine::oww_opcode184;
op[187] = &AGOSEngine::oww_opcode187;
// Code difference, check if triggered
op[161] = NULL;
@ -356,14 +365,11 @@ void AGOSEngine::setupWaxworksOpcodes(OpcodeProc *op) {
op[172] = NULL;
op[173] = NULL;
op[174] = NULL;
op[175] = NULL;
op[176] = NULL;
op[177] = NULL;
op[178] = NULL;
op[184] = NULL;
op[185] = NULL;
op[186] = NULL;
op[187] = NULL;
op[188] = NULL;
op[189] = NULL;
op[190] = NULL;
@ -702,6 +708,20 @@ void AGOSEngine::o_place() {
setItemParent(item, getNextItemPtr());
}
void AGOSEngine::o_copyof() {
// 34:
Item *item = getNextItemPtr();
uint tmp = getVarOrByte();
writeNextVarContents(getUserFlag(item, tmp));
}
void AGOSEngine::o_copyfo() {
// 35:
uint tmp = getNextVarContents();
Item *item = getNextItemPtr();
setUserFlag(item, getVarOrByte(), tmp);
}
void AGOSEngine::o_copyff() {
// 36: copy var
uint value = getNextVarContents();
@ -1792,6 +1812,13 @@ void AGOSEngine::oww_ifDoorOpen() {
setScriptCondition(getDoorState(item, d) != 0);
}
void AGOSEngine::oww_opcode184() {
printf("%s\n", getStringPtrByID(getNextStringID()));
}
void AGOSEngine::oww_opcode187() {
}
// -----------------------------------------------------------------------
// Simon 1 Opcodes
// -----------------------------------------------------------------------