Skip to content

Commit

Permalink
Improved highscore parser
Browse files Browse the repository at this point in the history
  • Loading branch information
syd711 committed Dec 23, 2024
1 parent ea5b80e commit e2dbe80
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Release Notes 3.11.2

## Bugfixes

- **Tables / Highscore Parsing**: Improved detection of VPReg.stg based highscore entries. The lookup is now completely case-insensitive. Also, an additional lookup is made using the ROM name plus the **_VPX** suffix which some tables use to store the highscore.

---

## Release Notes 3.11.1

## Bugfixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ private String readVPRegHighscore(Game game, HighscoreMetadata metadata) throws

File vpRegFile = game.getEmulator().getVPRegFile();
VPReg reg = new VPReg(vpRegFile, game.getRom(), tableName);

if (!reg.containsGame()) {
reg = new VPReg(vpRegFile, game.getRom() + "_VPX", tableName);
}

if (reg.containsGame()) {
metadata.setType(HighscoreType.VPReg);
metadata.setFilename(vpRegFile.getCanonicalPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,19 @@ public ScoreParsingSummary readHighscores() {
* @throws FileNotFoundException
*/
private DirectoryEntry getGameDirectory(DirectoryEntry root) throws FileNotFoundException {
if (root.hasEntry(rom)) {
return (DirectoryEntry) root.getEntry(rom);
}

if (root.hasEntry(rom.toLowerCase())) {
return (DirectoryEntry) root.getEntry(rom.toLowerCase());
}

if (tablename != null && root.hasEntry(tablename)) {
return (DirectoryEntry) root.getEntry(tablename);
Set<String> entryNames = root.getEntryNames();
for (String entryName : entryNames) {
if (entryName.equalsIgnoreCase(rom)) {
return (DirectoryEntry) root.getEntry(entryName);
}
}

if (tablename != null && root.hasEntry(tablename.toLowerCase())) {
return (DirectoryEntry) root.getEntry(tablename.toLowerCase());
if (tablename != null) {
for (String entryName : entryNames) {
if (entryName.equalsIgnoreCase(tablename)) {
return (DirectoryEntry) root.getEntry(entryName);
}
}
}

return null;
Expand Down

0 comments on commit e2dbe80

Please sign in to comment.