add more high score data

add hexadecimal score formatting (SCSIcide)
This commit is contained in:
thrust26 2020-02-23 09:52:03 +01:00
parent 7d0896f0a3
commit 9a40428db3
5 changed files with 56 additions and 15 deletions

View File

@ -396,7 +396,6 @@ Int32 HighScoresManager::score(uInt32 numAddrBytes, uInt32 trailingZeroes,
return totalScore;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Int32 HighScoresManager::score() const
{
@ -416,6 +415,31 @@ Int32 HighScoresManager::score() const
return score(numBytes, trailingZeroes(props), scoreBCD(props), scoreAddr);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string HighScoresManager::formattedScore(Int32 score, Int32 width) const
{
if(score <= 0)
return "";
ostringstream buf;
Properties props;
Int32 digits = numDigits(properties(props));
if(scoreBCD(props))
{
if(width > digits)
digits = width;
buf << std::setw(digits) << std::setfill(' ') << score;
}
else {
if(width > digits)
buf << std::setw(width - digits) << std::setfill(' ') << "";
buf << std::hex << std::setw(digits) << std::setfill('0') << score;
}
return buf.str();
}
bool HighScoresManager::scoreInvert() const
{
Properties props;

View File

@ -118,6 +118,7 @@ class HighScoresManager
string specialLabel() const;
Int32 variation() const;
Int32 score() const;
string formattedScore(Int32 score, Int32 width = -1) const;
bool scoreInvert() const;
Int32 special() const;

View File

@ -25,6 +25,14 @@
"Cart.Addresses" "DD,DE,DF,80"
""
"Cart.MD5" "137373599e9b7bf2cf162a102eb5927f"
"Cart.Manufacturer" "AtariAge, Joe Grand"
"Cart.Name" "Ultra SCSIcide (SCSIcide 2.0)"
"Controller.Left" "PADDLES"
"Cart.Formats" "6,0,H"
"Cart.Addresses" "DC,DD,DE"
""
"Cart.MD5" "211774f4c5739042618be8ff67351177"
"Cart.Manufacturer" "Atari - GCC, Mark Ackerman, Tom Calderwood, Glenn Parker"
"Cart.ModelNo" "CX2684"
@ -58,8 +66,8 @@
"Cart.ModelNo" "AG-019"
"Cart.Name" "Sky Jinks (1982) (Activision)"
"Cart.Variations" "4"
"Cart.Formats" "4,0,B,1,B,1"
"Cart.Addresses" "A6,A2,99"
"Cart.Formats" "6,0,B,1,B,1"
"Cart.Addresses" "9E,A6,A2,99"
""
"Cart.MD5" "2bb9f4686f7e08c5fcc69ec1a1c66fe7"
@ -107,6 +115,15 @@
"Cart.Addresses" "D5,D6,D7"
""
"Cart.MD5" "515046e3061b7b18aa3a551c3ae12673"
"Cart.Manufacturer" "Atari - GCC, Mark Ackerman, Noellie Alito"
"Cart.ModelNo" "CX2692"
"Cart.Name" "Moon Patrol (1983) (Atari)"
"Cart.Variations" "6"
"Cart.Formats" "6,0,B,0,B,1"
"Cart.Addresses" "EA,EB,EC,F9"
""
"Cart.MD5" "541cac55ebcf7891d9d51c415922303f"
"Cart.Name" "SF2_20131217_RC8_NTSC"
"Display.Phosphor" "YES"
@ -220,6 +237,14 @@
"Cart.Addresses" "E0,E1,E2,80"
""
"Cart.MD5" "c6556e082aac04260596b4045bc122de"
"Cart.Manufacturer" "Atari - GCC, Dave Payne"
"Cart.ModelNo" "CX2669"
"Cart.Name" "Vanguard (1983) (Atari)"
"Cart.Formats" "6"
"Cart.Addresses" "99,98,97"
""
"Cart.MD5" "ccbd36746ed4525821a8083b0d6d2c2c"
"Cart.Manufacturer" "Atari, Brad Stewart - Sears"
"Cart.ModelNo" "CX2649, 49-75163"

View File

@ -1152,16 +1152,8 @@ void GameInfoDialog::updateHighScoresWidgets()
Int32 score = instance().highScores().score(numAddr, myTrailingZeroes->getSelected(),
myScoreBCD->getState(), scoreAddr);
if(score >= 0)
{
ostringstream ss;
ss.str("");
ss << right << setw(myScoreDigits->getSelected() + 1) << setfill(' ') << score;
myCurrentScore->setLabel(ss.str());
}
else
myCurrentScore->setLabel("");
myCurrentScore->setLabel(instance().highScores().formattedScore(score));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -314,7 +314,6 @@ void HighScoresDialog::updateWidgets(bool init)
if (myHighScores[r] > 0)
{
buf << std::setw(HSM::MAX_SCORE_DIGITS) << std::setfill(' ') << myHighScores[r];
myRankWidgets[r]->clearFlags(Widget::FLAG_INVISIBLE);
myDeleteButtons[r]->clearFlags(Widget::FLAG_INVISIBLE);
myDeleteButtons[r]->setEnabled(true);
@ -325,9 +324,9 @@ void HighScoresDialog::updateWidgets(bool init)
myDeleteButtons[r]->setFlags(Widget::FLAG_INVISIBLE);
myDeleteButtons[r]->setEnabled(false);
}
myScoreWidgets[r]->setLabel(buf.str());
myScoreWidgets[r]->setLabel(instance().highScores().formattedScore(myHighScores[r],
HSM::MAX_SCORE_DIGITS));
buf.str("");
if (mySpecials[r] > 0)
buf << std::setw(HSM::MAX_SPECIAL_DIGITS) << std::setfill(' ') << mySpecials[r];
mySpecialWidgets[r]->setLabel(buf.str());