DIRECTOR: Lingo: Fixed c_whencode and added debug output

This commit is contained in:
Eugene Sandulenko 2016-09-02 09:35:53 +02:00
parent 18af5ea5da
commit bb2168fe9c

View File

@ -758,12 +758,20 @@ void Lingo::c_whencode() {
int end = READ_UINT32(&(*g_lingo->_currentScript)[start]);
Common::String eventname((char *)&(*g_lingo->_currentScript)[start + 1]);
start += g_lingo->calcStringAlignment(eventname.c_str());
start += g_lingo->calcStringAlignment(eventname.c_str()) + 1;
debugC(3, kDebugLingoExec, "c_whencode([%5d][%5d], %s)", start, end, eventname.c_str());
g_lingo->define(eventname, start, 0, NULL, end);
if (debugChannelSet(3, kDebugLingoExec)) {
int pc = start;
while (pc <= end) {
Common::String instr = g_lingo->decodeInstruction(pc, &pc);
debugC(3, kDebugLingoExec, "[%5d] %s", pc, instr.c_str());
}
}
g_lingo->_pc = end;
}