Skip to content

Commit

Permalink
Fixed dyntable end handling cases and another ABI typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sauraen committed Oct 29, 2021
1 parent c2c7795 commit d671a16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions Source/SeqFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4949,6 +4949,12 @@ int SeqFile::createSection(String src_action, int tgt_addr, int tgt_stype, Value
if(channel < 0 || channel >= 16){
dbgmsg("Error determining channel for new section from " + src_action
+ " @" + hex((int)parse_cmd.getProperty(idAddress),16) + "!");
dbgmsg("src_action " + src_action + " has Channel param " +
String((int)parse_cmd.getChildWithProperty(idMeaning, "Channel").isValid()));
ValueTree param = parse_cmd.getChildWithProperty(idMeaning, "Channel");
if(param.isValid()){
dbgmsg("value " + param.getProperty(idValue, -1234).toString());
}
return -1;
}
newsec.setProperty(idChannel, channel, nullptr);
Expand Down Expand Up @@ -5343,6 +5349,10 @@ int SeqFile::parseComSection(int s, const Array<uint8_t> &data, Array<uint8_t> &
dbgmsg("Ran into another section while parsing child of unused section, ending section");
break;
}
if(stype == 3){
dbgmsg("Considering that the end of the dyntable (not an error)");
break;
}
//Otherwise this is an error
dbgmsg("Error due to running into another section");
return 2;
Expand Down Expand Up @@ -5393,13 +5403,19 @@ int SeqFile::parseComSection(int s, const Array<uint8_t> &data, Array<uint8_t> &
dbgmsg("Considering Maybe Ptr to not be a pointer");
continue; //Guess it's not a pointer
}
if(forceContinue && a - cmdlen == forceContinueA){
dbgmsg("Aborting force continue due to error on first new command");
if((forceContinue && a - cmdlen == forceContinueA) || stype == 3){
if(stype == 3){
dbgmsg("Stopping dynable due to bad address");
}else{
dbgmsg("Aborting force continue due to error on first new command");
}
//Undo all of our changes and get out of here
section.removeChild(command, nullptr);
a -= cmdlen;
for(int i=a; i<a+cmdlen; ++i) datause.set(i, 0);
ret = -1;
if(forceContinue){
ret = -1;
}
break;
}
dbgmsg("findTargetCommand failed");
Expand Down
2 changes: 1 addition & 1 deletion abi/4 - Zelda.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</command>
<command cmd="32" name="startchan" action="Ptr Channel Header" comments="Start channel N for the parent sequence, with channel script starting at address X."
cname="sopensub" cmdend="47" validinchn="1">
<parameter name="Channel" meaning="None" datasrc="offset"/>
<parameter name="Channel" meaning="Channel" datasrc="offset"/>
<parameter name="Address" meaning="Absolute Address" datasrc="fixed" datalen="2"/>
</command>
<command cmd="48" name="stcio" action="No Action" cmdend="63" comments="Chan[C].IO[N] = Q, where IO[N] is the IO array for channel C."
Expand Down

0 comments on commit d671a16

Please sign in to comment.