command stream player now loops
This commit is contained in:
parent
2290f3d873
commit
8ff8ee89e9
|
@ -79,6 +79,7 @@ bool DivCSPlayer::tick() {
|
||||||
}
|
}
|
||||||
unsigned char next=stream.readC();
|
unsigned char next=stream.readC();
|
||||||
unsigned char command=0;
|
unsigned char command=0;
|
||||||
|
bool mustTell=true;
|
||||||
|
|
||||||
if (next<0xb3) { // note
|
if (next<0xb3) { // note
|
||||||
e->dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,(int)next-60));
|
e->dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,(int)next-60));
|
||||||
|
@ -143,9 +144,11 @@ bool DivCSPlayer::tick() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chan[i].readPos=chan[i].callStack[--chan[i].callStackPos];
|
chan[i].readPos=chan[i].callStack[--chan[i].callStackPos];
|
||||||
|
mustTell=false;
|
||||||
break;
|
break;
|
||||||
case 0xfa:
|
case 0xfa:
|
||||||
chan[i].readPos=stream.readI();
|
chan[i].readPos=stream.readI();
|
||||||
|
mustTell=false;
|
||||||
break;
|
break;
|
||||||
case 0xfb:
|
case 0xfb:
|
||||||
logE("TODO: RATE");
|
logE("TODO: RATE");
|
||||||
|
@ -161,8 +164,9 @@ bool DivCSPlayer::tick() {
|
||||||
chan[i].waitTicks=1;
|
chan[i].waitTicks=1;
|
||||||
break;
|
break;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
chan[i].readPos=0;
|
chan[i].readPos=chan[i].startPos;
|
||||||
logI("%d: stop",i);
|
mustTell=false;
|
||||||
|
logI("%d: stop go back to %x",i,chan[i].readPos);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logE("%d: illegal instruction $%.2x! $%.x",i,next,chan[i].readPos);
|
logE("%d: illegal instruction $%.2x! $%.x",i,next,chan[i].readPos);
|
||||||
|
@ -337,7 +341,7 @@ bool DivCSPlayer::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chan[i].readPos=stream.tell();
|
if (mustTell) chan[i].readPos=stream.tell();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendVolume || chan[i].volSpeed!=0) {
|
if (sendVolume || chan[i].volSpeed!=0) {
|
||||||
|
|
|
@ -141,7 +141,7 @@ void FurnaceGUI::drawCSPlayer() {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (pos>=(int)bufSize) continue;
|
if (pos>=(int)bufSize) continue;
|
||||||
if (pos==nextHighlight) {
|
if (pos==nextHighlight) {
|
||||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(ImGuiCol_Header));
|
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(ImGuiCol_HeaderActive));
|
||||||
highlightPos++;
|
highlightPos++;
|
||||||
if (highlightPos>=(int)highlights.size()) {
|
if (highlightPos>=(int)highlights.size()) {
|
||||||
nextHighlight=-1;
|
nextHighlight=-1;
|
||||||
|
|
Loading…
Reference in a new issue