Skip to content

Commit

Permalink
3.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
syd711 committed Dec 28, 2024
1 parent e2dbe80 commit 5e607e3
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 9 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
## 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.
- **Emulator Detection**: The way the **nvram** and **rom** folders are read has been changed. For VPX emulators...
- the **nvram** folder is read from the Windows registry first, instead of simply assuming the default folder of PinMAME which is used as fallback now.
- the **roms** folder is read from the frontend/Popper first. If the value is empty there or invalid, the Windows registry value for PinMAME roms is used instead.
- **Preferences / VPX Monitor**: The VPX monitor has been disabled for now. The task of this monitor was to detect the table that is currently running to provide services like the pause menu also to non-Popper users. We used the VPX window title for this, but since the title does not include the active game anymore. I see currently no way to continue the support here.

---

Expand Down
2 changes: 1 addition & 1 deletion resources/pinemhi/pinemhi.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[paths]
VP=C:/vPinball/visualpinball/VPinMAME/nvram/
VP=C:/vPinball/VisualPinball/VPinMame/nvram/
FP=D:\Future Pinball\fpRAM\
USER=D:\Visual Pinball\user\

Expand Down
2 changes: 1 addition & 1 deletion resources/vpsdb.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class Features {
public static boolean MANIA_ENABLED = true;
public static boolean ISCORED_ENABLED = true;
public static boolean NOTIFICATIONS_ENABLED = true;
public static boolean VPX_MONITORING = true;
public static boolean VPX_MONITORING = false;

public static boolean VP_UNIVERSE = false;
public static boolean VP_FORUMS = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

public class MameOptions {
public final static String DEFAULT_KEY = "default";
public final static String GLOBALS_KEY = "globals";

private String rom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,6 @@ public boolean isValidVPXEmulator(Emulator emulator) {
return false;
}

// should not ignore as GameEmulator will set a folder by default
//if (StringUtils.isEmpty(emulator.getDirRoms())) {
// LOG.warn("Ignoring " + emulator + ", because \"Roms Folder\" is not set.");
// return false;
//}

if (getFrontendConnector().getMediaAccessStrategy() != null && StringUtils.isEmpty(emulator.getDirMedia())) {
LOG.warn("Ignoring " + emulator + ", because \"Media Dir\" is not set.");
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import de.mephisto.vpin.restclient.frontend.Emulator;
import de.mephisto.vpin.restclient.frontend.EmulatorType;
import de.mephisto.vpin.server.mame.MameUtil;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -92,6 +93,14 @@ public GameEmulator(@NonNull Emulator emulator) {
if (!StringUtils.isEmpty(emulator.getDirRoms())) {
this.romFolder = new File(emulator.getDirRoms());
}

if (isVpxEmulator() && StringUtils.isEmpty(emulator.getDirRoms())) {
File romDir = new File(MameUtil.getRomsFolder());
if (romDir.exists()) {
this.romFolder = romDir;
}
}

this.romDirectory = this.romFolder.getAbsolutePath();
}

Expand Down Expand Up @@ -210,6 +219,12 @@ public List<String> getAltExeNames() {
@NonNull
@JsonIgnore
public File getNvramFolder() {
if (isVpxEmulator()) {
File registryFolder = new File(MameUtil.getNvRamFolder());
if (registryFolder.exists()) {
return registryFolder;
}
}
return nvramFolder;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package de.mephisto.vpin.server.mame;

import de.mephisto.vpin.commons.utils.WinRegistry;
import de.mephisto.vpin.restclient.mame.MameOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class MameUtil {
private final static Logger LOG = LoggerFactory.getLogger(MameUtil.class);

public static final String NVRAM_DIRECTORY = "nvram_directory";
public static final String ROMS_DIRECTORY = "rompath";

private static String nvRamFolder = null;
private static String romsFolder = null;

public static String getNvRamFolder() {
if (nvRamFolder == null) {
Map<String, Object> values = WinRegistry.getCurrentUserValues(MameService.MAME_REG_FOLDER_KEY + MameOptions.GLOBALS_KEY);
if (values.containsKey(NVRAM_DIRECTORY)) {
nvRamFolder = (String) values.get(NVRAM_DIRECTORY);
LOG.info("Resolved registry PinMAME nvram folder: {}", nvRamFolder);
}
else {
nvRamFolder = "-invalid-";
}
}
return nvRamFolder;
}

public static String getRomsFolder() {
if (romsFolder == null) {
Map<String, Object> values = WinRegistry.getCurrentUserValues(MameService.MAME_REG_FOLDER_KEY + MameOptions.GLOBALS_KEY);
if (values.containsKey(ROMS_DIRECTORY)) {
romsFolder = (String) values.get(ROMS_DIRECTORY);
LOG.info("Resolved registry PinMAME roms folder: {}", romsFolder);
}
else {
romsFolder = "-invalid-";
}
}
return romsFolder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ public void installPupPack(@NonNull UploadDescriptor uploadDescriptor, @NonNull
return;
}

File pupPackFolder = new File(pupVideosFolder, rom);
if (pupPackFolder.exists() && pupPackFolder.isDirectory()) {
LOG.info("Existing PUP pack folder \"{}\" found, deleting it first.", rom);
de.mephisto.vpin.restclient.util.FileUtils.deleteFolder(pupPackFolder);
pupPackFolder.mkdirs();
}

LOG.info("Starting PUP pack extraction for ROM '" + rom + "'");
PupPackInstallerJob job = new PupPackInstallerJob(this, tempFile, pupVideosFolder, analysis.getPupPackRootDirectory(), rom);
if (!async) {
Expand Down

0 comments on commit 5e607e3

Please sign in to comment.