mirror of https://github.com/stella-emu/stella.git
Reverted part of previous commit; rewind states now use 64-bit where appropriate.
Fixed some more minor errors found by clang.
This commit is contained in:
parent
a1d0319042
commit
e9a5198863
|
@ -199,6 +199,8 @@ class LinkedObjectPool
|
|||
const_iter begin() const { return myList.cbegin(); }
|
||||
const_iter end() const { return myList.cend(); }
|
||||
|
||||
uInt32 capacity() const { return CAPACITY; }
|
||||
|
||||
uInt32 size() const { return myList.size(); }
|
||||
bool empty() const { return myList.size() == 0; }
|
||||
bool full() const { return myList.size() >= CAPACITY; }
|
||||
|
|
|
@ -171,7 +171,7 @@ void RewindManager::compressStates()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string RewindManager::getMessage(RewindState& state)
|
||||
{
|
||||
Int32 diff = Int32(myOSystem.console().tia().cycles() - state.cycle);
|
||||
Int64 diff = myOSystem.console().tia().cycles() - state.cycle;
|
||||
stringstream message;
|
||||
|
||||
message << (diff >= 0 ? "Rewind" : "Unwind") << " " << getUnitString(diff);
|
||||
|
@ -183,7 +183,7 @@ string RewindManager::getMessage(RewindState& state)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string RewindManager::getUnitString(Int32 cycles)
|
||||
string RewindManager::getUnitString(Int64 cycles)
|
||||
{
|
||||
const Int32 scanlines = std::max(myOSystem.console().tia().scanlinesLastFrame(), 240u);
|
||||
const bool isNTSC = scanlines <= 285; // TODO: replace magic number
|
||||
|
@ -194,8 +194,8 @@ string RewindManager::getUnitString(Int32 cycles)
|
|||
// TODO: do we need hours here? don't think so
|
||||
const Int32 NUM_UNITS = 5;
|
||||
const string UNIT_NAMES[NUM_UNITS] = { "cycle", "scanline", "frame", "second", "minute" };
|
||||
const Int32 UNIT_CYCLES[NUM_UNITS + 1] = { 1, 76, 76 * scanlines, freq,
|
||||
freq * 60, 1 << 31 };
|
||||
const Int64 UNIT_CYCLES[NUM_UNITS + 1] = { 1, 76, 76 * scanlines, freq,
|
||||
freq * 60, Int64(1) << 62 };
|
||||
|
||||
stringstream result;
|
||||
Int32 i;
|
||||
|
|
|
@ -73,7 +73,7 @@ class RewindManager
|
|||
/**
|
||||
Convert the cycles into a unit string.
|
||||
*/
|
||||
string getUnitString(Int32 cycles);
|
||||
string getUnitString(Int64 cycles);
|
||||
|
||||
private:
|
||||
// Maximum number of states to save
|
||||
|
|
|
@ -69,7 +69,7 @@ class StateManager
|
|||
Sets state rewind recording mode; this uses the RewindManager
|
||||
for its functionality.
|
||||
*/
|
||||
void setRewindMode(Mode mode) { myActiveMode = mode; };
|
||||
void setRewindMode(Mode mode) { myActiveMode = mode; }
|
||||
|
||||
/**
|
||||
Rewinds one state; this uses the RewindManager for its functionality.
|
||||
|
|
|
@ -544,7 +544,7 @@ uInt16 Debugger::windStates(uInt16 states, bool unwind, string& message)
|
|||
winds++;
|
||||
else
|
||||
break;
|
||||
message = r.getUnitString(Int32(myOSystem.console().tia().cycles() - startCycles));
|
||||
message = r.getUnitString(myOSystem.console().tia().cycles() - startCycles);
|
||||
|
||||
lockBankswitchState();
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
|
||||
for(int col = 0; col < 2; ++col)
|
||||
{
|
||||
new StaticTextWidget(boss, lfont, xpos + col * myAudF->colWidth() + (int)(myAudF->colWidth() / 2.75),
|
||||
new StaticTextWidget(boss, lfont, xpos + col * myAudF->colWidth() + int(myAudF->colWidth() / 2.75),
|
||||
ypos - lineHeight, fontWidth, fontHeight,
|
||||
Common::Base::toString(col, Common::Base::F_16_1),
|
||||
kTextAlignLeft);
|
||||
|
@ -63,7 +63,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight,
|
||||
"AUDC", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myAudC = new DataGridWidget(boss, nfont, xpos + (int)(myAudF->colWidth() / 2.75), ypos,
|
||||
myAudC = new DataGridWidget(boss, nfont, xpos + int(myAudF->colWidth() / 2.75), ypos,
|
||||
2, 1, 1, 4, Common::Base::F_16_1);
|
||||
myAudC->setTarget(this);
|
||||
myAudC->setID(kAUDCID);
|
||||
|
@ -74,7 +74,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight,
|
||||
"AUDV", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myAudV = new DataGridWidget(boss, nfont, xpos + (int)(myAudF->colWidth() / 2.75), ypos,
|
||||
myAudV = new DataGridWidget(boss, nfont, xpos + int(myAudF->colWidth() / 2.75), ypos,
|
||||
2, 1, 1, 4, Common::Base::F_16_1);
|
||||
myAudV->setTarget(this);
|
||||
myAudV->setID(kAUDVID);
|
||||
|
|
|
@ -608,7 +608,7 @@ void DeveloperDialog::loadConfig()
|
|||
loadSettings(SettingsSet::player);
|
||||
loadSettings(SettingsSet::developer);
|
||||
// ...and select the current one
|
||||
setWidgetStates((SettingsSet)mySettingsGroup0->getSelected());
|
||||
setWidgetStates(SettingsSet(mySettingsGroup0->getSelected()));
|
||||
|
||||
// Debug colours
|
||||
handleDebugColours(instance().settings().getString("tia.dbgcolors"));
|
||||
|
@ -644,7 +644,7 @@ void DeveloperDialog::saveConfig()
|
|||
{
|
||||
instance().settings().setValue("dev.settings", mySettingsGroup0->getSelected() == SettingsSet::developer);
|
||||
// copy current widget status into set...
|
||||
getWidgetStates((SettingsSet)mySettingsGroup0->getSelected());
|
||||
getWidgetStates(SettingsSet(mySettingsGroup0->getSelected()));
|
||||
// ...and save both sets
|
||||
saveSettings(SettingsSet::player);
|
||||
saveSettings(SettingsSet::developer);
|
||||
|
@ -728,7 +728,7 @@ void DeveloperDialog::saveConfig()
|
|||
void DeveloperDialog::setDefaults()
|
||||
{
|
||||
bool devSettings = mySettingsGroup0->getSelected() == 1;
|
||||
SettingsSet set = (SettingsSet)mySettingsGroup0->getSelected();
|
||||
SettingsSet set = SettingsSet(mySettingsGroup0->getSelected());
|
||||
|
||||
switch(myTab->getActiveTab())
|
||||
{
|
||||
|
@ -1195,14 +1195,14 @@ void DeveloperDialog::handleFontSize()
|
|||
minH = std::min(instance().frameBuffer().desktopSize().h, minH);
|
||||
|
||||
myDebuggerWidthSlider->setMinValue(minW);
|
||||
if(minW > myDebuggerWidthSlider->getValue())
|
||||
if(minW > uInt32(myDebuggerWidthSlider->getValue()))
|
||||
{
|
||||
myDebuggerWidthSlider->setValue(minW);
|
||||
myDebuggerWidthLabel->setValue(minW);
|
||||
}
|
||||
|
||||
myDebuggerHeightSlider->setMinValue(minH);
|
||||
if(minH > myDebuggerHeightSlider->getValue())
|
||||
if(minH > uInt32(myDebuggerHeightSlider->getValue()))
|
||||
{
|
||||
myDebuggerHeightSlider->setValue(minH);
|
||||
myDebuggerHeightLabel->setValue(minH);
|
||||
|
|
|
@ -96,7 +96,7 @@ class DeveloperDialog : public Dialog
|
|||
const string HORIZONS[NUM_HORIZONS] = { "~1 frame", "~10 frames", "~1 second", "~10 seconds",
|
||||
"~1 minute", "~10 minutes", "~60 minutes" };
|
||||
const uInt64 HORIZON_CYCLES[NUM_HORIZONS] = { 76 * 262, 76 * 262 * 10, 76 * 262 * 60, 76 * 262 * 60 * 10,
|
||||
76 * 262 * 60 * 60, 76 * 262 * 60 * 60 * 10, (uInt64)76 * 262 * 60 * 60 * 60 };
|
||||
76 * 262 * 60 * 60, 76 * 262 * 60 * 60 * 10, uInt64(76) * 262 * 60 * 60 * 60 };
|
||||
|
||||
static const int DEBUG_COLORS = 6;
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ void RadioButtonGroup::setSelected(uInt32 selected)
|
|||
mySelected = selected;
|
||||
for(const auto& w : myWidgets)
|
||||
{
|
||||
((RadioButtonWidget*)w)->setState(i == mySelected);
|
||||
(static_cast<RadioButtonWidget*>(w))->setState(i == mySelected);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,14 +56,14 @@ class RadioButtonWidget : public CheckboxWidget
|
|||
class RadioButtonGroup
|
||||
{
|
||||
public:
|
||||
RadioButtonGroup() {};
|
||||
RadioButtonGroup() = default;
|
||||
|
||||
// add widget to group
|
||||
void addWidget(RadioButtonWidget* widget);
|
||||
// tell the group which widget was selected
|
||||
void select(RadioButtonWidget* widget);
|
||||
void setSelected(uInt32 selected);
|
||||
uInt32 getSelected() { return mySelected; };
|
||||
uInt32 getSelected() { return mySelected; }
|
||||
|
||||
private:
|
||||
WidgetArray myWidgets;
|
||||
|
|
Loading…
Reference in New Issue