Merge branch 'progsig-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison 2015-08-16 16:58:23 +01:00
commit 880d455ea9
2 changed files with 60 additions and 54 deletions

View File

@ -355,6 +355,7 @@ public:
{ {
uint64 p1 = 0; uint64 p1 = 0;
while(true) { while(true) {
if(si == NULL) break;
switch(si->Opcode()) { switch(si->Opcode()) {
case PSO_SET_SIGNAL: { case PSO_SET_SIGNAL: {
SB(p1, 0, 3, this->track); SB(p1, 0, 3, this->track);
@ -365,6 +366,7 @@ public:
this->RebuildInstructionList(); this->RebuildInstructionList();
si = ((SignalSet*)si)->next; si = ((SignalSet*)si)->next;
} break; } break;
case PSO_IF: { case PSO_IF: {
SB(p1, 0, 3, this->track); SB(p1, 0, 3, this->track);
SB(p1, 3, 16, next); SB(p1, 3, 16, next);
@ -393,11 +395,15 @@ public:
si = ((SignalIf*)si)->after; si = ((SignalIf*)si)->after;
} break; } break;
case PSO_LAST:
case PSO_IF_ELSE:
case PSO_IF_ENDIF:
return;
default:
NOT_REACHED();
} }
if(si == NULL) break;
if(si->Opcode() == PSO_LAST) break;
if(si->Opcode() == PSO_IF_ELSE) break;
if(si->Opcode() == PSO_IF_ENDIF) break;
} }
} }

View File

@ -117,7 +117,6 @@ static void Save_SPRG()
WriteVLI(b, _signal_programs.size()); WriteVLI(b, _signal_programs.size());
for(ProgramList::iterator i = _signal_programs.begin(), e = _signal_programs.end(); for(ProgramList::iterator i = _signal_programs.begin(), e = _signal_programs.end();
i != e; ++i) { i != e; ++i) {
SignalReference ref = i->first;
SignalProgram *prog = i->second; SignalProgram *prog = i->second;
prog->DebugPrintProgram(); prog->DebugPrintProgram();
@ -170,9 +169,10 @@ static void Save_SPRG()
uint size = b.size(); uint size = b.size();
SlSetLength(size); SlSetLength(size);
for(uint i = 0; i < size; i++) for(uint i = 0; i < size; i++) {
SlWriteByte(b[i]); // TODO Gotta be a better way SlWriteByte(b[i]); // TODO Gotta be a better way
} }
}
// We don't know the pointer values that need to be stored in various // We don't know the pointer values that need to be stored in various
// instruction fields at load time, so we need to instead store the IDs and // instruction fields at load time, so we need to instead store the IDs and