more work on the command stream debugger
This commit is contained in:
parent
53ff3c2f70
commit
5dd62d45fa
|
@ -89,6 +89,7 @@ bool DivCSPlayer::tick() {
|
||||||
command=fastCmds[next&15];
|
command=fastCmds[next&15];
|
||||||
} else if (next>=0xe0 && next<=0xef) { // preset delay
|
} else if (next>=0xe0 && next<=0xef) { // preset delay
|
||||||
chan[i].waitTicks=fastDelays[next&15];
|
chan[i].waitTicks=fastDelays[next&15];
|
||||||
|
chan[i].lastWaitLen=chan[i].waitTicks;
|
||||||
} else switch (next) {
|
} else switch (next) {
|
||||||
case 0xb4: // note on null
|
case 0xb4: // note on null
|
||||||
e->dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
|
e->dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
|
||||||
|
@ -156,12 +157,15 @@ bool DivCSPlayer::tick() {
|
||||||
break;
|
break;
|
||||||
case 0xfc:
|
case 0xfc:
|
||||||
chan[i].waitTicks=(unsigned short)stream.readS();
|
chan[i].waitTicks=(unsigned short)stream.readS();
|
||||||
|
chan[i].lastWaitLen=chan[i].waitTicks;
|
||||||
break;
|
break;
|
||||||
case 0xfd:
|
case 0xfd:
|
||||||
chan[i].waitTicks=(unsigned char)stream.readC();
|
chan[i].waitTicks=(unsigned char)stream.readC();
|
||||||
|
chan[i].lastWaitLen=chan[i].waitTicks;
|
||||||
break;
|
break;
|
||||||
case 0xfe:
|
case 0xfe:
|
||||||
chan[i].waitTicks=1;
|
chan[i].waitTicks=1;
|
||||||
|
chan[i].lastWaitLen=chan[i].waitTicks;
|
||||||
break;
|
break;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
chan[i].readPos=chan[i].startPos;
|
chan[i].readPos=chan[i].startPos;
|
||||||
|
|
|
@ -23,12 +23,15 @@
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "safeReader.h"
|
#include "safeReader.h"
|
||||||
|
|
||||||
|
#define DIV_MAX_CSTRACE 64
|
||||||
|
|
||||||
class DivEngine;
|
class DivEngine;
|
||||||
|
|
||||||
struct DivCSChannelState {
|
struct DivCSChannelState {
|
||||||
unsigned int startPos;
|
unsigned int startPos;
|
||||||
unsigned int readPos;
|
unsigned int readPos;
|
||||||
int waitTicks;
|
int waitTicks;
|
||||||
|
int lastWaitLen;
|
||||||
|
|
||||||
int note, pitch;
|
int note, pitch;
|
||||||
int volume, volMax, volSpeed;
|
int volume, volMax, volSpeed;
|
||||||
|
@ -39,11 +42,7 @@ struct DivCSChannelState {
|
||||||
unsigned int callStack[8];
|
unsigned int callStack[8];
|
||||||
unsigned char callStackPos;
|
unsigned char callStackPos;
|
||||||
|
|
||||||
struct TraceEntry {
|
unsigned int trace[DIV_MAX_CSTRACE];
|
||||||
unsigned int addr;
|
|
||||||
unsigned char length;
|
|
||||||
unsigned char data[11];
|
|
||||||
} trace[32];
|
|
||||||
unsigned char tracePos;
|
unsigned char tracePos;
|
||||||
|
|
||||||
bool doCall(unsigned int addr);
|
bool doCall(unsigned int addr);
|
||||||
|
@ -51,6 +50,7 @@ struct DivCSChannelState {
|
||||||
DivCSChannelState():
|
DivCSChannelState():
|
||||||
readPos(0),
|
readPos(0),
|
||||||
waitTicks(0),
|
waitTicks(0),
|
||||||
|
lastWaitLen(0),
|
||||||
note(-1),
|
note(-1),
|
||||||
pitch(0),
|
pitch(0),
|
||||||
volume(0x7f00),
|
volume(0x7f00),
|
||||||
|
@ -64,7 +64,12 @@ struct DivCSChannelState {
|
||||||
arp(0),
|
arp(0),
|
||||||
arpStage(0),
|
arpStage(0),
|
||||||
arpTicks(0),
|
arpTicks(0),
|
||||||
callStackPos(0) {}
|
callStackPos(0),
|
||||||
|
tracePos(0) {
|
||||||
|
for (int i=0; i<DIV_MAX_CSTRACE; i++) {
|
||||||
|
trace[i]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class DivCSPlayer {
|
class DivCSPlayer {
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
#include <fmt/printf.h>
|
#include <fmt/printf.h>
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
|
||||||
|
String disasmCmd(unsigned char* buf, size_t bufLen, unsigned int addr) {
|
||||||
|
return "TODO";
|
||||||
|
}
|
||||||
|
|
||||||
void FurnaceGUI::drawCSPlayer() {
|
void FurnaceGUI::drawCSPlayer() {
|
||||||
if (nextWindow==GUI_WINDOW_CS_PLAYER) {
|
if (nextWindow==GUI_WINDOW_CS_PLAYER) {
|
||||||
csPlayerOpen=true;
|
csPlayerOpen=true;
|
||||||
|
@ -58,6 +62,71 @@ void FurnaceGUI::drawCSPlayer() {
|
||||||
if (ImGui::BeginTabBar("CSOptions")) {
|
if (ImGui::BeginTabBar("CSOptions")) {
|
||||||
int chans=e->getTotalChannelCount();
|
int chans=e->getTotalChannelCount();
|
||||||
if (ImGui::BeginTabItem("Status")) {
|
if (ImGui::BeginTabItem("Status")) {
|
||||||
|
if (ImGui::BeginTable("CSStat",11,ImGuiTableFlags_SizingFixedSame|ImGuiTableFlags_ScrollX|ImGuiTableFlags_Borders)) {
|
||||||
|
ImGui::TableSetupScrollFreeze(1,1);
|
||||||
|
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("channel");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("start");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("PC");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("wait");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("SP");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("note");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("pitch");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("vol");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("vols");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("vib");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("porta");
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("arp");
|
||||||
|
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
DivCSChannelState* state=cs->getChanState(i);
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d",i);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("$%.4x",state->startPos);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("$%.4x",state->readPos);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d/%d",state->waitTicks,state->lastWaitLen);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d",state->callStackPos);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d",state->note);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d",state->pitch);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("$%.4X",state->volume);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%+d",state->volSpeed);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("%d/%d (%d)",state->vibratoDepth,state->vibratoRate,state->vibratoPos);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("-> %d (%d)",state->portaTarget,state->portaSpeed);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("$%.2X",state->arp);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
if (ImGui::BeginTabItem("Trace")) {
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
if (ImGui::BeginTabItem("Disassemble")) {
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginTabItem("Hex")) {
|
if (ImGui::BeginTabItem("Hex")) {
|
||||||
|
|
Loading…
Reference in a new issue