defined various TIA types in developer options

This commit is contained in:
thrust26 2019-01-12 15:51:38 +01:00
parent da78065996
commit 0449e24146
4 changed files with 163 additions and 48 deletions

View File

@ -181,11 +181,12 @@ Settings::Settings(OSystem& osystem)
setInternal("dev.debugcolors", "false");
setInternal("dev.tiadriven", "true");
setInternal("dev.console", "2600"); // 7800
setInternal("dev.tia.delaypfbits", "false");
setInternal("dev.tia.delaypfcolor", "false");
setInternal("dev.tia.delayp0swap", "false");
setInternal("dev.tia.delayp1swap", "false");
setInternal("dev.tia.stuffplayerhm", "false");
setInternal("dev.tia.type", "standard");
setInternal("dev.tia.stuffplayerhm", "true");
setInternal("dev.tia.delaypfbits", "true");
setInternal("dev.tia.delaypfcolor", "true");
setInternal("dev.tia.delayp0swap", "true");
setInternal("dev.tia.delayp1swap", "true");
setInternal("dev.timemachine", true);
setInternal("dev.tm.size", 1000);
setInternal("dev.tm.uncompressed", 600);
@ -645,11 +646,15 @@ void Settings::usage() const
<< " throw an exception\n"
<< " -dev.eepromaccess <1|0> Enable messages for AtariVox/SaveKey access\n"
<< " messages\n"
<< " -dev.tia.type <standard|custom| Selects a TIA type\n"
<< " koolaidman|pesco|\n"
<< " videocube|\n"
<< " hemanv1|hemanv2>\n"
<< " -dev.tia.stuffplayerhm <1|0> Enable stuffed player moves\n"
<< " -dev.tia.delaypfbits <1|0> Enable extra delay cycle for PF bits access\n"
<< " -dev.tia.delaypfcolor <1|0> Enable extra delay cycle for PF color\n"
<< " -dev.tia.delayp0swap <1|0> Enable extra delay cycle for PF color\n"
<< " -dev.tia.delayp1swap <1|0> Enable extra delay cycle for PF color\n"
<< " -dev.tia.stuffplayerhm <1|0> Enable extra delay cycle for PF color\n"
<< " -dev.tia.delayp0swap <1|0> Enable extra delay cycle for player 0 swap\n"
<< " -dev.tia.delayp1swap <1|0> Enable extra delay cycle for player 1 swap\n"
<< endl << std::flush;
}

View File

@ -172,11 +172,35 @@ void TIA::reset()
paddleReader.reset(myTimestamp);
bool devSettings = mySettings.getBool("dev.settings");
setPFBitsDelay(devSettings ? mySettings.getBool("dev.tia.delaypfbits") : false);
setPFColorDelay(devSettings ? mySettings.getBool("dev.tia.delaypfcolor") : false);
setP0SwapDelay(devSettings ? mySettings.getBool("dev.tia.delayp0swap") : false);
setP1SwapDelay(devSettings ? mySettings.getBool("dev.tia.delayp1swap") : false);
setStuffPlayerMove(devSettings ? mySettings.getBool("dev.tia.stuffplayerhm") : false);
if(devSettings)
{
bool custom = BSPF::equalsIgnoreCase("custom", mySettings.getString("dev.tia.type"));
setStuffPlayerMove(custom
? mySettings.getBool("dev.tia.stuffplayerhm")
: BSPF::equalsIgnoreCase("koolaidman", mySettings.getString("dev.tia.type")));
setPFBitsDelay(custom
? mySettings.getBool("dev.tia.delaypfbits")
: BSPF::equalsIgnoreCase("pesco", mySettings.getString("dev.tia.type")));
setPFColorDelay(custom
? mySettings.getBool("dev.tia.delaypfcolor")
: BSPF::equalsIgnoreCase("videocube", mySettings.getString("dev.tia.type")));
setP0SwapDelay(custom
? mySettings.getBool("dev.tia.delayp0swap")
: BSPF::equalsIgnoreCase("hemanv2", mySettings.getString("dev.tia.type")));
setP1SwapDelay(custom
? mySettings.getBool("dev.tia.delayp1swap")
: BSPF::equalsIgnoreCase("hemanv1", mySettings.getString("dev.tia.type"))
|| BSPF::equalsIgnoreCase("hemanv2", mySettings.getString("dev.tia.type")));
}
else
{
setPFBitsDelay(false);
setPFColorDelay(false);
setP0SwapDelay(false);
setP1SwapDelay(false);
setStuffPlayerMove(false);
}
myDelayQueue.reset();
myCyclesAtFrameStart = 0;

View File

@ -185,7 +185,9 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
const int VGAP = 4;
int ypos = VBORDER;
int lineHeight = font.getLineHeight();
int pwidth = font.getStringWidth("Glitched Atari Video Cube");
WidgetArray wid;
VariantList items;
int tabID = myTab->addTab("TIA");
wid.clear();
@ -201,30 +203,44 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
wid.push_back(r);
ypos += lineHeight + VGAP * 1;
myPFBitsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1,
items.clear();
VarList::push_back(items, "Standard", "standard");
VarList::push_back(items, "Faulty Kool-Aid Man", "koolaidman");
VarList::push_back(items, "Glitched Pesco", "pesco");
VarList::push_back(items, "Glitched Atari Video Cube", "videocube");
VarList::push_back(items, "Glitched He-Man title V1", "hemanv1");
VarList::push_back(items, "Glitched He-Man title V2", "hemanv2");
VarList::push_back(items, "Custom", "custom");
myTIATypeWidget = new PopUpWidget(myTab, font, HBORDER + INDENT, ypos - 1,
pwidth, lineHeight, items, "Chip type ", 0, kTIAType);
wid.push_back(myTIATypeWidget);
ypos += lineHeight + VGAP * 1;
myGRPxStuffedWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Stuffed player move (Kool Aid Man/Thundergr.)");
wid.push_back(myGRPxStuffedWidget);
ypos += lineHeight + VGAP * 1;
myPFBitsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Delayed playfield bits (Thrust, Pesco)");
wid.push_back(myPFBitsWidget);
ypos += lineHeight + VGAP * 1;
myPFColorWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1,
myPFColorWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Delayed playfield color (Quick Step/Ixion)");
wid.push_back(myPFColorWidget);
ypos += lineHeight + VGAP * 1;
myGRP0SwapWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1,
"Delayed player 0 swap (He-Man V1/Obelix/Octopus)");
myGRP0SwapWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Delayed player 0 swap (HeMan V2/Obelix/Octop.)");
wid.push_back(myGRP0SwapWidget);
ypos += lineHeight + VGAP * 1;
myGRP1SwapWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1,
"Delayed player 1 swap (He-Man V2)");
myGRP1SwapWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Delayed player 1 swap (HeMan V1+2)");
wid.push_back(myGRP1SwapWidget);
ypos += lineHeight + VGAP * 1;
myGRPxStuffedWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1,
"Stuffed player move (Kool Aid Man/Thunderground)");
wid.push_back(myGRPxStuffedWidget);
ypos += lineHeight + VGAP * 1;
// Add items for tab 2
addToFocusList(wid, myTab, tabID);
@ -562,11 +578,13 @@ void DeveloperDialog::loadSettings(SettingsSet set)
myEEPROMAccess[set] = instance().settings().getBool(prefix + "eepromaccess");
// TIA tab
myTIAType[set] = devSettings ? instance().settings().getString("dev.tia.type") : "standard";
//bool custom = BSPF::equalsIgnoreCase("custom", myTIAType[set]);
myGRPxStuffed[set] = devSettings ? instance().settings().getBool("dev.tia.stuffplayerhm") : false;
myPFBits[set] = devSettings ? instance().settings().getBool("dev.tia.delaypfbits") : false;
myPFColor[set] = devSettings ? instance().settings().getBool("dev.tia.delaypfcolor") : false;
myGRP0Swap[set] = devSettings ? instance().settings().getBool("dev.tia.delayp0swap") : false;
myGRP1Swap[set] = devSettings ? instance().settings().getBool("dev.tia.delayp1swap") : false;
myGRPxStuffed[set] = devSettings ? instance().settings().getBool("dev.tia.stuffplayerhm") : false;
// Debug colors
myDebugColors[set] = instance().settings().getBool(prefix + "debugcolors");
@ -616,11 +634,15 @@ void DeveloperDialog::saveSettings(SettingsSet set)
// TIA tab
if (devSettings)
{
instance().settings().setValue("dev.tia.type", myTIAType[set]);
if (BSPF::equalsIgnoreCase("custom", myTIAType[set]))
{
instance().settings().setValue("dev.tia.stuffplayerhm", myGRPxStuffed[set]);
instance().settings().setValue("dev.tia.delaypfbits", myPFBits[set]);
instance().settings().setValue("dev.tia.delaypfcolor", myPFColor[set]);
instance().settings().setValue("dev.tia.delayp0swap", myGRP0Swap[set]);
instance().settings().setValue("dev.tia.delayp1swap", myGRP1Swap[set]);
instance().settings().setValue("dev.tia.stuffplayerhm", myGRPxStuffed[set]);
}
}
// Debug colors
@ -665,11 +687,12 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
myEEPROMAccess[set] = myEEPROMAccessWidget->getState();
// TIA tab
myTIAType[set] = myTIATypeWidget->getSelectedTag().toString();
myGRPxStuffed[set] = myGRPxStuffedWidget->getState();
myPFBits[set] = myPFBitsWidget->getState();
myPFColor[set] = myPFColorWidget->getState();
myGRP0Swap[set] = myGRP0SwapWidget->getState();
myGRP1Swap[set] = myGRP1SwapWidget->getState();
myGRPxStuffed[set] = myGRPxStuffedWidget->getState();
// Debug colors
myDebugColors[set] = myDebugColorsWidget->getState();
@ -714,11 +737,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
handleConsole();
// TIA tab
myPFBitsWidget->setState(myPFBits[set]);
myPFColorWidget->setState(myPFColor[set]);
myGRP0SwapWidget->setState(myGRP0Swap[set]);
myGRP1SwapWidget->setState(myGRP1Swap[set]);
myGRPxStuffedWidget->setState(myGRPxStuffed[set]);
myTIATypeWidget->setSelected(myTIAType[set], "standard");
handleTia();
// Debug colors
@ -813,12 +832,11 @@ void DeveloperDialog::saveConfig()
// TIA tab
if(instance().hasConsole())
{
// playfield delay
instance().console().tia().setStuffPlayerMove(myGRPxStuffedWidget->getState());
instance().console().tia().setPFBitsDelay(myPFBitsWidget->getState());
instance().console().tia().setPFColorDelay(myPFColorWidget->getState());
instance().console().tia().setP0SwapDelay(myGRP0SwapWidget->getState());
instance().console().tia().setP1SwapDelay(myGRP1SwapWidget->getState());
instance().console().tia().setStuffPlayerMove(myGRPxStuffedWidget->getState());
}
handleEnableDebugColors();
@ -891,11 +909,12 @@ void DeveloperDialog::setDefaults()
break;
case 1: // TIA
myPFBits[set] = false;
myPFColor[set] = false;
myGRP0Swap[set] = false;
myGRP1Swap[set] = false;
myGRPxStuffed[set] = false;
myTIAType[set] = "standard";
myGRPxStuffed[set] = devSettings ? true : false;
myPFBits[set] = devSettings ? true : false;
myPFColor[set] = devSettings ? true : false;
myGRP0Swap[set] = devSettings ? true : false;
myGRP1Swap[set] = devSettings ? true : false;
setWidgetStates(set);
break;
@ -958,6 +977,10 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
handleSettings(true);
break;
case kTIAType:
handleTia();
break;
case kConsole:
handleConsole();
break;
@ -1093,12 +1116,72 @@ void DeveloperDialog::handleConsole()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::handleTia()
{
bool enable = mySettingsGroupEmulation->getSelected() == SettingsSet::developer;
bool devSettings = mySettings;
bool enable = BSPF::equalsIgnoreCase("custom", myTIATypeWidget->getSelectedTag().toString());
myTIATypeWidget->setEnabled(devSettings);
myGRPxStuffedWidget->setEnabled(enable);
myPFBitsWidget->setEnabled(enable);
myPFColorWidget->setEnabled(enable);
myGRP0SwapWidget->setEnabled(enable);
myGRP1SwapWidget->setEnabled(enable);
myGRPxStuffedWidget->setEnabled(enable);
if(BSPF::equalsIgnoreCase("standard", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(false);
}
if(BSPF::equalsIgnoreCase("koolaidman", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(true);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(false);
}
if(BSPF::equalsIgnoreCase("pesco", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPFBitsWidget->setState(true);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(false);
}
if(BSPF::equalsIgnoreCase("videocube", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(true);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(false);
}
if(BSPF::equalsIgnoreCase("hemanv1", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(true);
}
if(BSPF::equalsIgnoreCase("hemanv2", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(true);
myGRP1SwapWidget->setState(true);
}
if(BSPF::equalsIgnoreCase("custom", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(myGRPxStuffed[SettingsSet::developer]);
myPFBitsWidget->setState(myPFBits[SettingsSet::developer]);
myPFColorWidget->setState(myPFColor[SettingsSet::developer]);
myGRP0SwapWidget->setState(myGRP0Swap[SettingsSet::developer]);
myGRP1SwapWidget->setState(myGRP1Swap[SettingsSet::developer]);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -59,6 +59,7 @@ class DeveloperDialog : public Dialog
kConsole = 'DVco',
kRandRAMID = 'DVrm',
kRandCPUID = 'DVcp',
kTIAType = 'DVtt',
kTVJitter = 'DVjt',
kTVJitterChanged = 'DVjr',
kPPinCmd = 'DVpn',
@ -108,11 +109,12 @@ class DeveloperDialog : public Dialog
// TIA widgets
RadioButtonGroup* mySettingsGroupTia;
PopUpWidget* myTIATypeWidget;
CheckboxWidget* myGRPxStuffedWidget;
CheckboxWidget* myPFBitsWidget;
CheckboxWidget* myPFColorWidget;
CheckboxWidget* myGRP0SwapWidget;
CheckboxWidget* myGRP1SwapWidget;
CheckboxWidget* myGRPxStuffedWidget;
// Video widgets
RadioButtonGroup* mySettingsGroupVideo;
@ -159,11 +161,12 @@ class DeveloperDialog : public Dialog
bool myThumbException[2];
bool myEEPROMAccess[2];
// TIA sets
string myTIAType[2];
bool myGRPxStuffed[2];
bool myPFBits[2];
bool myPFColor[2];
bool myGRP0Swap[2];
bool myGRP1Swap[2];
bool myGRPxStuffed[2];
// States sets
bool myTimeMachine[2];
int myStateSize[2];