aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-08-11 23:43:27 +0200
committerStrangerke2014-08-11 23:43:27 +0200
commit5c7699799d4d35ac863470b0ad52817de170f4f9 (patch)
tree33655c0d9e3efe36aab06864c6105c0fded9dcae
parent69c7f989b12de26ada8d399233e95777421ee65b (diff)
downloadscummvm-rg350-5c7699799d4d35ac863470b0ad52817de170f4f9.tar.gz
scummvm-rg350-5c7699799d4d35ac863470b0ad52817de170f4f9.tar.bz2
scummvm-rg350-5c7699799d4d35ac863470b0ad52817de170f4f9.zip
ACCESS: Implement 3 more opcodes, fix a typo
-rw-r--r--engines/access/scripts.cpp35
-rw-r--r--engines/access/scripts.h10
2 files changed, 32 insertions, 13 deletions
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index e7827fba01..bb45cd44d2 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -34,6 +34,8 @@ Scripts::Scripts(AccessEngine *vm) : _vm(vm) {
_sequence = 0;
_endFlag = false;
_returnCode = 0;
+ _choice = 0;
+ _choiceStart = 0;
}
Scripts::~Scripts() {
@@ -94,14 +96,14 @@ void Scripts::executeCommand(int commandIndex) {
&Scripts::cmdSetAnim, &Scripts::CMDDISPINV, &Scripts::CMDSETTIMER,
&Scripts::CMDSETTIMER, &Scripts::CMDCHECKTIMER, &Scripts::cmdSetTravel,
&Scripts::cmdSetTravel, &Scripts::CMDSETVID, &Scripts::CMDPLAYVID,
- &Scripts::cmdPlotImage, &Scripts::cmdSetDisplay, &Scripts::CMDSETBUFFER,
+ &Scripts::cmdPlotImage, &Scripts::cmdSetDisplay, &Scripts::cmdSetBuffer,
&Scripts::cmdSetScroll, &Scripts::CMDSAVERECT, &Scripts::CMDSAVERECT,
- &Scripts::CMDSETBUFVID, &Scripts::CMDPLAYBUFVID, &Scripts::cmeRemoveLast,
+ &Scripts::CMDSETBUFVID, &Scripts::CMDPLAYBUFVID, &Scripts::cmdRemoveLast,
&Scripts::CMDSPECIAL, &Scripts::CMDSPECIAL, &Scripts::CMDSPECIAL,
&Scripts::CMDSETCYCLE, &Scripts::CMDCYCLE, &Scripts::CMDCHARSPEAK,
&Scripts::CMDTEXSPEAK, &Scripts::CMDTEXCHOICE, &Scripts::CMDWAIT,
- &Scripts::CMDSETCONPOS, &Scripts::CMDCHECKVFRAME, &Scripts::CMDJUMPCHOICE,
- &Scripts::CMDRETURNCHOICE, &Scripts::CMDCLEARBLOCK, &Scripts::CMDLOADSOUND,
+ &Scripts::CMDSETCONPOS, &Scripts::CMDCHECKVFRAME, &Scripts::cmdJumpChoice,
+ &Scripts::cmdReturnChoice, &Scripts::CMDCLEARBLOCK, &Scripts::CMDLOADSOUND,
&Scripts::CMDFREESOUND, &Scripts::CMDSETVIDSND, &Scripts::CMDPLAYVIDSND,
&Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION,
&Scripts::CMDPUSHLOCATION, &Scripts::CMDPUSHLOCATION, &Scripts::cmdPlayerOff,
@@ -302,7 +304,9 @@ void Scripts::cmdSetDisplay() {
_vm->_current = _vm->_screen;
}
-void Scripts::CMDSETBUFFER() { error("TODO"); }
+void Scripts::cmdSetBuffer() {
+ _vm->_current = &_vm->_buffer2;
+}
void Scripts::cmdSetScroll() {
_vm->_screen->_scrollCol = _data->readUint16LE();
@@ -315,7 +319,7 @@ void Scripts::CMDSAVERECT() { error("TODO"); }
void Scripts::CMDSETBUFVID() { error("TODO"); }
void Scripts::CMDPLAYBUFVID() { error("TODO"); }
-void Scripts::cmeRemoveLast() {
+void Scripts::cmdRemoveLast() {
--_vm->_numAnimTimers;
}
@@ -324,12 +328,25 @@ void Scripts::CMDSETCYCLE() { error("TODO"); }
void Scripts::CMDCYCLE() { error("TODO"); }
void Scripts::CMDCHARSPEAK() { error("TODO"); }
void Scripts::CMDTEXSPEAK() { error("TODO"); }
-void Scripts::CMDTEXCHOICE() { error("TODO"); }
+void Scripts::CMDTEXCHOICE() { error("TODO"); } // _choiceStart = _data->pos() - 1;
void Scripts::CMDWAIT() { error("TODO"); }
void Scripts::CMDSETCONPOS() { error("TODO"); }
void Scripts::CMDCHECKVFRAME() { error("TODO"); }
-void Scripts::CMDJUMPCHOICE() { error("TODO"); }
-void Scripts::CMDRETURNCHOICE() { error("TODO"); }
+
+void Scripts::cmdJumpChoice() {
+ int val = (_data->readUint16LE() && 0xFF);
+
+ if (val == _choice) {
+ _sequence = _data->readUint16LE();
+ searchForSequence();
+ } else
+ _data->skip(2);
+}
+
+void Scripts::cmdReturnChoice() {
+ _data->seek(_choiceStart);
+}
+
void Scripts::CMDCLEARBLOCK() { error("TODO"); }
void Scripts::CMDLOADSOUND() { error("TODO"); }
void Scripts::CMDFREESOUND() { error("TODO"); }
diff --git a/engines/access/scripts.h b/engines/access/scripts.h
index 3832f0d0e1..25f4dc192d 100644
--- a/engines/access/scripts.h
+++ b/engines/access/scripts.h
@@ -80,12 +80,12 @@ protected:
void CMDPLAYVID();
void cmdPlotImage();
void cmdSetDisplay();
- void CMDSETBUFFER();
+ void cmdSetBuffer();
void cmdSetScroll();
void CMDSAVERECT();
void CMDSETBUFVID();
void CMDPLAYBUFVID();
- void cmeRemoveLast();
+ void cmdRemoveLast();
void CMDSPECIAL();
void CMDSETCYCLE();
void CMDCYCLE();
@@ -95,8 +95,8 @@ protected:
void CMDWAIT();
void CMDSETCONPOS();
void CMDCHECKVFRAME();
- void CMDJUMPCHOICE();
- void CMDRETURNCHOICE();
+ void cmdJumpChoice();
+ void cmdReturnChoice();
void CMDCLEARBLOCK();
void CMDLOADSOUND();
void CMDFREESOUND();
@@ -120,6 +120,8 @@ public:
bool _endFlag;
int _returnCode;
int _scriptCommand;
+ int _choice;
+ int32 _choiceStart;
public:
Scripts(AccessEngine *vm);