Fixed BRA parser table for scripts.
svn-id: r28905
This commit is contained in:
parent
5fa2b1a3c5
commit
c22784449f
6 changed files with 22 additions and 11 deletions
|
@ -29,12 +29,13 @@ namespace Parallaction {
|
||||||
#define INST_TEXT 23
|
#define INST_TEXT 23
|
||||||
#define INST_MUL 24
|
#define INST_MUL 24
|
||||||
#define INST_DIV 25
|
#define INST_DIV 25
|
||||||
#define INST_IF 26
|
#define INST_IFEQ 26
|
||||||
#define INST_IFEQ 27
|
#define INST_IFLT 27
|
||||||
#define INST_IFLT 28
|
#define INST_IFGT 28
|
||||||
#define INST_IFGT 29
|
#define INST_ENDIF 29
|
||||||
#define INST_ENDIF 30
|
#define INST_STOP 30
|
||||||
#define INST_STOP 31
|
#define INST_ENDSCRIPT 31
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef OpcodeImpl<Parallaction_br> OpcodeV2;
|
typedef OpcodeImpl<Parallaction_br> OpcodeV2;
|
||||||
|
@ -411,12 +412,18 @@ void Parallaction_br::jobEraseSubtitle(void *parm, Job *job) {
|
||||||
|
|
||||||
if (_subtitle0._old.x != -1000) {
|
if (_subtitle0._old.x != -1000) {
|
||||||
_subtitle0.getRect(r);
|
_subtitle0.getRect(r);
|
||||||
|
|
||||||
|
// printf("sub0: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom);
|
||||||
|
|
||||||
_gfx->restoreBackground(r);
|
_gfx->restoreBackground(r);
|
||||||
}
|
}
|
||||||
_subtitle0._old = _subtitle0._pos;
|
_subtitle0._old = _subtitle0._pos;
|
||||||
|
|
||||||
if (_subtitle1._old.x != -1000) {
|
if (_subtitle1._old.x != -1000) {
|
||||||
_subtitle0.getRect(r);
|
_subtitle0.getRect(r);
|
||||||
|
|
||||||
|
// printf("sub1: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom);
|
||||||
|
|
||||||
_gfx->restoreBackground(r);
|
_gfx->restoreBackground(r);
|
||||||
}
|
}
|
||||||
_subtitle1._old = _subtitle1._pos;
|
_subtitle1._old = _subtitle1._pos;
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace Parallaction {
|
||||||
#define INST_START 16
|
#define INST_START 16
|
||||||
#define INST_SOUND 17
|
#define INST_SOUND 17
|
||||||
#define INST_MOVE 18
|
#define INST_MOVE 18
|
||||||
#define INST_END 19
|
#define INST_ENDSCRIPT 19
|
||||||
|
|
||||||
|
|
||||||
typedef OpcodeImpl<Parallaction_ns> OpcodeV1;
|
typedef OpcodeImpl<Parallaction_ns> OpcodeV1;
|
||||||
|
@ -185,7 +185,7 @@ DECLARE_INSTRUCTION_OPCODE(move) {
|
||||||
_engineFlags |= kEngineWalking;
|
_engineFlags |= kEngineWalking;
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_INSTRUCTION_OPCODE(end) {
|
DECLARE_INSTRUCTION_OPCODE(endscript) {
|
||||||
if ((_instRunCtxt.a->_flags & kFlagsLooping) == 0) {
|
if ((_instRunCtxt.a->_flags & kFlagsLooping) == 0) {
|
||||||
_instRunCtxt.a->_flags &= ~kFlagsActing;
|
_instRunCtxt.a->_flags &= ~kFlagsActing;
|
||||||
runCommands(_instRunCtxt.a->_commands, _instRunCtxt.a);
|
runCommands(_instRunCtxt.a->_commands, _instRunCtxt.a);
|
||||||
|
@ -819,7 +819,7 @@ void Parallaction_ns::initOpcodes() {
|
||||||
INSTRUCTION_OPCODE(start),
|
INSTRUCTION_OPCODE(start),
|
||||||
INSTRUCTION_OPCODE(sound),
|
INSTRUCTION_OPCODE(sound),
|
||||||
INSTRUCTION_OPCODE(move),
|
INSTRUCTION_OPCODE(move),
|
||||||
INSTRUCTION_OPCODE(end)
|
INSTRUCTION_OPCODE(endscript)
|
||||||
};
|
};
|
||||||
|
|
||||||
uint i;
|
uint i;
|
||||||
|
|
|
@ -884,7 +884,7 @@ protected:
|
||||||
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(start);
|
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(start);
|
||||||
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(sound);
|
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(sound);
|
||||||
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(move);
|
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(move);
|
||||||
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(end);
|
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(endscript);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -704,6 +704,8 @@ void Parallaction_br::initParsers() {
|
||||||
INSTRUCTION_PARSER(inc), // mul
|
INSTRUCTION_PARSER(inc), // mul
|
||||||
INSTRUCTION_PARSER(inc), // div
|
INSTRUCTION_PARSER(inc), // div
|
||||||
INSTRUCTION_PARSER(if_op),
|
INSTRUCTION_PARSER(if_op),
|
||||||
|
INSTRUCTION_PARSER(null),
|
||||||
|
INSTRUCTION_PARSER(null),
|
||||||
INSTRUCTION_PARSER(endif),
|
INSTRUCTION_PARSER(endif),
|
||||||
INSTRUCTION_PARSER(zone), // stop
|
INSTRUCTION_PARSER(zone), // stop
|
||||||
INSTRUCTION_PARSER(endscript)
|
INSTRUCTION_PARSER(endscript)
|
||||||
|
|
|
@ -871,7 +871,7 @@ void Parallaction_ns::parseLocation(const char *filename) {
|
||||||
debugC(5, kDebugLocation, "parseLocation('%s')", filename);
|
debugC(5, kDebugLocation, "parseLocation('%s')", filename);
|
||||||
|
|
||||||
allocateLocationSlot(filename);
|
allocateLocationSlot(filename);
|
||||||
printf("got location slot #%i for %s\n", _currentLocationIndex, filename);
|
// printf("got location slot #%i for %s\n", _currentLocationIndex, filename);
|
||||||
|
|
||||||
Script *script = _disk->loadLocation(filename);
|
Script *script = _disk->loadLocation(filename);
|
||||||
|
|
||||||
|
|
|
@ -421,6 +421,8 @@ const char *_instructionNamesRes_br[] = {
|
||||||
"mul",
|
"mul",
|
||||||
"div",
|
"div",
|
||||||
"if",
|
"if",
|
||||||
|
"dummy",
|
||||||
|
"dummy",
|
||||||
"endif",
|
"endif",
|
||||||
"stop",
|
"stop",
|
||||||
"endscript"
|
"endscript"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue