renamed player inverted HMOVE phase clock option, methods and keys

added missile inverted HMOVE phase clock option
This commit is contained in:
thrust26 2019-01-14 22:52:30 +01:00
parent fad141b5de
commit bd0984fc98
9 changed files with 120 additions and 45 deletions

View File

@ -182,7 +182,8 @@ Settings::Settings(OSystem& osystem)
setInternal("dev.tiadriven", "true");
setInternal("dev.console", "2600"); // 7800
setInternal("dev.tia.type", "standard");
setInternal("dev.tia.stuffplayerhm", "true");
setInternal("dev.tia.playerinvphase", "true");
setInternal("dev.tia.missileinvphase", "true");
setInternal("dev.tia.delaypfbits", "true");
setInternal("dev.tia.delaypfcolor", "true");
setInternal("dev.tia.delayp0swap", "true");
@ -647,10 +648,11 @@ void Settings::usage() const
<< " -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"
<< " quickstep|\n"
<< " koolaidman|cosmicark|\n"
<< " pesco|quickstep|\n"
<< " hemanv1|hemanv2>\n"
<< " -dev.tia.stuffplayerhm <1|0> Enable stuffed player moves\n"
<< " -dev.tia.playerinvphase <1|0> Enable inverted HMOVE clock phase for players\n"
<< " -dev.tia.missileinvphase <1|0> Enable inverted HMOVE clock phase for missiles\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 player 0 swap\n"

View File

@ -54,6 +54,8 @@ void Missile::reset()
myDebugEnabled = false;
collision = myCollisionMaskDisabled;
myIsEnabled = false;
myInvertedPhaseClock = false;
myUseInvertedPhaseClock = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -169,8 +171,11 @@ bool Missile::movementTick(uInt8 clock, uInt8 hclock, bool apply)
if(clock == myHmmClocks)
myIsMoving = false;
else if(myIsMoving && apply)
tick(hclock, false);
else if(myIsMoving)
{
if(apply) tick(hclock, false);
else myInvertedPhaseClock = true;
}
return myIsMoving;
}
@ -178,6 +183,12 @@ bool Missile::movementTick(uInt8 clock, uInt8 hclock, bool apply)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Missile::tick(uInt8 hclock, bool isReceivingMclock)
{
if(myUseInvertedPhaseClock && myInvertedPhaseClock)
{
myInvertedPhaseClock = false;
return;
}
myIsVisible =
myIsRendering &&
(myRenderCounter >= 0 || (myIsMoving && isReceivingMclock && myRenderCounter == -1 && myWidth < 4 && ((hclock + 1) % 4 == 3)));
@ -255,6 +266,12 @@ void Missile::applyColorLoss()
applyColors();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Missile::setInvertedPhaseClock(bool enable)
{
myUseInvertedPhaseClock = enable;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Missile::updateEnabled()
{
@ -331,6 +348,7 @@ bool Missile::save(Serializer& out) const
out.putByte(myColor);
out.putByte(myObjectColor); out.putByte(myDebugColor);
out.putBool(myDebugEnabled);
out.putBool(myInvertedPhaseClock);
}
catch(...)
{
@ -372,6 +390,7 @@ bool Missile::load(Serializer& in)
myColor = in.getByte();
myObjectColor = in.getByte(); myDebugColor = in.getByte();
myDebugEnabled = in.getBool();
myInvertedPhaseClock = in.getBool();
applyColors();
}

View File

@ -61,6 +61,8 @@ class Missile : public Serializable
void applyColorLoss();
void setInvertedPhaseClock(bool enable);
void toggleCollisions(bool enabled);
void toggleEnabled(bool enabled);
@ -114,6 +116,9 @@ class Missile : public Serializable
uInt8 myObjectColor, myDebugColor;
bool myDebugEnabled;
bool myInvertedPhaseClock;
bool myUseInvertedPhaseClock;
TIA *myTIA;
private:

View File

@ -53,8 +53,8 @@ void Player::reset()
mySampleCounter = 0;
myDividerPending = 0;
myDividerChangeCounter = -1;
myStuffedClock = false;
myUseStuffedClock = false;
myInvertedPhaseClock = false;
myUseInvertedPhaseClock = false;
myPattern = 0;
setDivider(1);
@ -254,9 +254,9 @@ void Player::applyColorLoss()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Player::setStuffedClock(bool enable)
void Player::setInvertedPhaseClock(bool enable)
{
myUseStuffedClock = enable;
myUseInvertedPhaseClock = enable;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -273,7 +273,7 @@ bool Player::movementTick(uInt32 clock, bool apply)
else if(myIsMoving)
{
if(apply) tick();
else myStuffedClock = true;
else myInvertedPhaseClock = true;
}
return myIsMoving;
@ -282,9 +282,9 @@ bool Player::movementTick(uInt32 clock, bool apply)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Player::tick()
{
if(myUseStuffedClock && myStuffedClock)
if(myUseInvertedPhaseClock && myInvertedPhaseClock)
{
myStuffedClock = false;
myInvertedPhaseClock = false;
return;
}
@ -490,7 +490,7 @@ bool Player::save(Serializer& out) const
out.putBool(myIsReflected);
out.putBool(myIsDelaying);
out.putBool(myStuffedClock);
out.putBool(myInvertedPhaseClock);
}
catch(...)
{
@ -537,7 +537,7 @@ bool Player::load(Serializer& in)
myIsReflected = in.getBool();
myIsDelaying = in.getBool();
myStuffedClock = in.getBool();
myInvertedPhaseClock = in.getBool();
applyColors();
}

View File

@ -57,7 +57,7 @@ class Player : public Serializable
void applyColorLoss();
void setStuffedClock(bool enable);
void setInvertedPhaseClock(bool enable);
void startMovement();
@ -132,8 +132,8 @@ class Player : public Serializable
bool myIsReflected;
bool myIsDelaying;
bool myStuffedClock;
bool myUseStuffedClock;
bool myInvertedPhaseClock;
bool myUseInvertedPhaseClock;
TIA* myTIA;

View File

@ -176,9 +176,12 @@ void TIA::reset()
{
bool custom = BSPF::equalsIgnoreCase("custom", mySettings.getString("dev.tia.type"));
setStuffPlayerMove(custom
? mySettings.getBool("dev.tia.stuffplayerhm")
setPlayerInvertedPhaseClock(custom
? mySettings.getBool("dev.tia.playerinvphase")
: BSPF::equalsIgnoreCase("koolaidman", mySettings.getString("dev.tia.type")));
setMissileInvertedPhaseClock(custom
? mySettings.getBool("dev.tia.missileinvphase")
: BSPF::equalsIgnoreCase("cosmicark", mySettings.getString("dev.tia.type")));
setPFBitsDelay(custom
? mySettings.getBool("dev.tia.delaypfbits")
: BSPF::equalsIgnoreCase("pesco", mySettings.getString("dev.tia.type")));
@ -195,11 +198,12 @@ void TIA::reset()
}
else
{
setPlayerInvertedPhaseClock(false);
setMissileInvertedPhaseClock(false);
setPFBitsDelay(false);
setPFColorDelay(false);
setP0SwapDelay(false);
setP1SwapDelay(false);
setStuffPlayerMove(false);
}
myDelayQueue.reset();
@ -1525,10 +1529,17 @@ void TIA::setP1SwapDelay(bool delayed)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::setStuffPlayerMove(bool enable)
void TIA::setPlayerInvertedPhaseClock(bool enable)
{
myPlayer0.setStuffedClock(enable);
myPlayer1.setStuffedClock(enable);
myPlayer0.setInvertedPhaseClock(enable);
myPlayer1.setInvertedPhaseClock(enable);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIA::setMissileInvertedPhaseClock(bool enable)
{
myMissile0.setInvertedPhaseClock(enable);
myMissile1.setInvertedPhaseClock(enable);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -446,11 +446,18 @@ class TIA : public Device
void setP1SwapDelay(bool delayed);
/**
Enables/disables stuffed player moving.
Enables/disables inverted HMOVE phase clock for players.
@param enable Wether to enable stuffed player moving
@param enable Wether to enable inverted HMOVE phase clock for players
*/
void setStuffPlayerMove(bool enable);
void setPlayerInvertedPhaseClock(bool enable);
/**
Enables/disables inverted HMOVE phase clock for missiles.
@param enable Wether to enable inverted HMOVE phase clock for missiles
*/
void setMissileInvertedPhaseClock(bool enable);
/**
This method should be called to update the TIA with a new scanline.

View File

@ -206,6 +206,7 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
items.clear();
VarList::push_back(items, "Standard", "standard");
VarList::push_back(items, "Faulty Kool-Aid Man", "koolaidman");
VarList::push_back(items, "Faulty Cosmic Ark stars", "cosmicark");
VarList::push_back(items, "Glitched Pesco", "pesco");
VarList::push_back(items, "Glitched Quick Step!", "quickstep");
VarList::push_back(items, "Glitched He-Man title V1", "hemanv1");
@ -216,11 +217,17 @@ void DeveloperDialog::addTiaTab(const GUI::Font& font)
wid.push_back(myTIATypeWidget);
ypos += lineHeight + VGAP * 1;
myGRPxStuffedWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Stuffed player move");
wid.push_back(myGRPxStuffedWidget);
myPlayerInvPhaseWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Inverted HMOVE clock phase for players");
wid.push_back(myPlayerInvPhaseWidget);
ypos += lineHeight + VGAP * 1;
myMissileInvPhaseWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Inverted HMOVE clock phase for missiles");
wid.push_back(myMissileInvPhaseWidget);
ypos += lineHeight + VGAP * 1;
myPFBitsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
"Delayed playfield bits");
wid.push_back(myPFBitsWidget);
@ -578,7 +585,8 @@ void DeveloperDialog::loadSettings(SettingsSet set)
// TIA tab
myTIAType[set] = devSettings ? instance().settings().getString("dev.tia.type") : "standard";
myGRPxStuffed[set] = devSettings ? instance().settings().getBool("dev.tia.stuffplayerhm") : false;
myPlayerInvPhase[set] = devSettings ? instance().settings().getBool("dev.tia.playerinvphase") : false;
myMissileInvPhase[set] = devSettings ? instance().settings().getBool("dev.tia.missileinvphase") : 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;
@ -635,7 +643,8 @@ void DeveloperDialog::saveSettings(SettingsSet set)
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.playerinvphase", myPlayerInvPhase[set]);
instance().settings().setValue("dev.tia.missileinvphase", myMissileInvPhase[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]);
@ -686,7 +695,8 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
// TIA tab
myTIAType[set] = myTIATypeWidget->getSelectedTag().toString();
myGRPxStuffed[set] = myGRPxStuffedWidget->getState();
myPlayerInvPhase[set] = myPlayerInvPhaseWidget->getState();
myMissileInvPhase[set] = myMissileInvPhaseWidget->getState();
myPFBits[set] = myPFBitsWidget->getState();
myPFColor[set] = myPFColorWidget->getState();
myGRP0Swap[set] = myGRP0SwapWidget->getState();
@ -830,7 +840,8 @@ void DeveloperDialog::saveConfig()
// TIA tab
if(instance().hasConsole())
{
instance().console().tia().setStuffPlayerMove(myGRPxStuffedWidget->getState());
instance().console().tia().setPlayerInvertedPhaseClock(myPlayerInvPhaseWidget->getState());
instance().console().tia().setMissileInvertedPhaseClock(myMissileInvPhaseWidget->getState());
instance().console().tia().setPFBitsDelay(myPFBitsWidget->getState());
instance().console().tia().setPFColorDelay(myPFColorWidget->getState());
instance().console().tia().setP0SwapDelay(myGRP0SwapWidget->getState());
@ -909,7 +920,8 @@ void DeveloperDialog::setDefaults()
case 1: // TIA
myTIAType[set] = "standard";
// reset "custom" mode
myGRPxStuffed[set] = devSettings ? true : false;
myPlayerInvPhase[set] = devSettings ? true : false;
myMissileInvPhase[set] = devSettings ? true : false;
myPFBits[set] = devSettings ? true : false;
myPFColor[set] = devSettings ? true : false;
myGRP0Swap[set] = devSettings ? true : false;
@ -1119,7 +1131,8 @@ void DeveloperDialog::handleTia()
bool enable = BSPF::equalsIgnoreCase("custom", myTIATypeWidget->getSelectedTag().toString());
myTIATypeWidget->setEnabled(mySettings);
myGRPxStuffedWidget->setEnabled(enable);
myPlayerInvPhaseWidget->setEnabled(enable);
myMissileInvPhaseWidget->setEnabled(enable);
myPFBitsWidget->setEnabled(enable);
myPFColorWidget->setEnabled(enable);
myGRP0SwapWidget->setEnabled(enable);
@ -1127,7 +1140,8 @@ void DeveloperDialog::handleTia()
if(BSPF::equalsIgnoreCase("standard", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
@ -1135,7 +1149,17 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("koolaidman", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(true);
myPlayerInvPhaseWidget->setState(true);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
myGRP1SwapWidget->setState(false);
}
if(BSPF::equalsIgnoreCase("cosmicark", myTIATypeWidget->getSelectedTag().toString()))
{
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(true);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
@ -1143,7 +1167,8 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("pesco", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(true);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
@ -1151,7 +1176,8 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("quickstep", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(true);
myGRP0SwapWidget->setState(false);
@ -1159,7 +1185,8 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("hemanv1", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(false);
@ -1167,7 +1194,8 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("hemanv2", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(false);
myPlayerInvPhaseWidget->setState(false);
myMissileInvPhaseWidget->setState(false);
myPFBitsWidget->setState(false);
myPFColorWidget->setState(false);
myGRP0SwapWidget->setState(true);
@ -1175,7 +1203,8 @@ void DeveloperDialog::handleTia()
}
if(BSPF::equalsIgnoreCase("custom", myTIATypeWidget->getSelectedTag().toString()))
{
myGRPxStuffedWidget->setState(myGRPxStuffed[SettingsSet::developer]);
myPlayerInvPhaseWidget->setState(myPlayerInvPhase[SettingsSet::developer]);
myMissileInvPhaseWidget->setState(myMissileInvPhase[SettingsSet::developer]);
myPFBitsWidget->setState(myPFBits[SettingsSet::developer]);
myPFColorWidget->setState(myPFColor[SettingsSet::developer]);
myGRP0SwapWidget->setState(myGRP0Swap[SettingsSet::developer]);

View File

@ -110,7 +110,8 @@ class DeveloperDialog : public Dialog
// TIA widgets
RadioButtonGroup* mySettingsGroupTia;
PopUpWidget* myTIATypeWidget;
CheckboxWidget* myGRPxStuffedWidget;
CheckboxWidget* myPlayerInvPhaseWidget;
CheckboxWidget* myMissileInvPhaseWidget;
CheckboxWidget* myPFBitsWidget;
CheckboxWidget* myPFColorWidget;
CheckboxWidget* myGRP0SwapWidget;
@ -162,7 +163,8 @@ class DeveloperDialog : public Dialog
bool myEEPROMAccess[2];
// TIA sets
string myTIAType[2];
bool myGRPxStuffed[2];
bool myPlayerInvPhase[2];
bool myMissileInvPhase[2];
bool myPFBits[2];
bool myPFColor[2];
bool myGRP0Swap[2];