Merge pull request #936 from laoo/Mikey_VGM

Mikey vgm export
This commit is contained in:
tildearrow 2023-01-21 05:33:35 -05:00 committed by GitHub
commit f3af1d78ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 10 deletions

View file

@ -1400,7 +1400,7 @@ void DivEngine::registerSystems() {
}
sysDefs[DIV_SYSTEM_LYNX]=new DivSysDef(
"Atari Lynx", NULL, 0xa8, 0, 4, false, true, 0, false, 1U<<DIV_SAMPLE_DEPTH_8BIT,
"Atari Lynx", NULL, 0xa8, 0, 4, false, true, 0x172, false, 1U<<DIV_SAMPLE_DEPTH_8BIT,
"a portable console made by Atari. it has all of Atari's trademark waveforms.",
{"Channel 1", "Channel 2", "Channel 3", "Channel 4"},
{"CH1", "CH2", "CH3", "CH4"},

View file

@ -341,14 +341,14 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
}
break;
case DIV_SYSTEM_LYNX:
w->writeC(0x4e);
w->writeC(0x40);
w->writeC(0x44);
w->writeC(0xff); //stereo attenuation select
w->writeC(0x4e);
w->writeC(0x40);
w->writeC(0x50);
w->writeC(0x00); //stereo channel disable
for (int i=0; i<4; i++) { //stereo attenuation value
w->writeC(0x4e);
w->writeC(0x40);
w->writeC(0x40+i);
w->writeC(0xff);
}
@ -731,7 +731,7 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(write.val&0xff);
break;
case DIV_SYSTEM_LYNX:
w->writeC(0x4e);
w->writeC(0x40);
w->writeC(write.addr&0xff);
w->writeC(write.val&0xff);
break;
@ -1685,7 +1685,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
w->writeI(hasX1);
w->writeI(hasC352);
w->writeI(hasGA20);
w->writeI(hasLynx);
w->writeI(version>=0x172?hasLynx:0); //Mikey introduced in 1.72
} else {
w->writeI(0);
w->writeI(0);

View file

@ -3507,7 +3507,7 @@ bool FurnaceGUI::loop() {
if (ImGui::BeginMenu("export VGM...")) {
ImGui::Text("settings:");
if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) {
for (int i=0; i<6; i++) {
for (int i=0; i<7; i++) {
if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) {
vgmExportVersion=vgmVersions[i];
}

View file

@ -70,13 +70,14 @@ const int altValues[24]={
0, 10, 1, 11, 2, 3, 12, 4, 13, 5, 14, 6, 7, 15, 8, -1, 9, -1, -1, -1, -1, -1, -1, -1
};
const int vgmVersions[6]={
const int vgmVersions[7]={
0x150,
0x151,
0x160,
0x161,
0x170,
0x171
0x171,
0x172
};
const char* insTypes[DIV_INS_MAX+1]={

View file

@ -54,5 +54,5 @@ extern const int* chipCategories[];
extern const FurnaceGUIActionDef guiActions[];
extern const FurnaceGUIColorDef guiColors[];
extern const int altValues[24];
extern const int vgmVersions[6];
extern const int vgmVersions[7];
extern const FurnaceGUIColors fxColors[256];