popn: hook DisplayConfigGetDeviceInfo to allow for any GPU port to be used for monitor, get past I/O check (#622)

## Link to GitHub Issue or related Pull Request, if one exists
#618 

## Description of change
The game expects the main display to be *not* HDMI, and at port 2.

Hooking DisplayConfigGetDeviceInfo allows us to boot the game on any
monitor.

Add basic I/O hook. It gets stuck in `USB I/O Checking...` for a couple
minutes but it'll eventually skip and boot to title screen.

## Testing
ugh.
This commit is contained in:
bicarus
2026-04-10 02:56:32 -07:00
committed by GitHub
parent 54ec9f272e
commit b281517429
6 changed files with 129 additions and 7 deletions
+20 -1
View File
@@ -409,7 +409,26 @@ namespace sysutils {
std::vector<MonitorEntry> result;
for (const auto& path : paths) {
MonitorEntry entry;
MonitorEntry entry = {};
entry.adapter_id_LowPart = path.targetInfo.adapterId.LowPart;
entry.adapter_id_HighPart = path.targetInfo.adapterId.HighPart;
entry.id = path.targetInfo.id;
// primary monitor?
for (const auto& mode : modes) {
if (mode.infoType != DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE) {
continue;
}
if (mode.adapterId.HighPart == path.sourceInfo.adapterId.HighPart &&
mode.adapterId.LowPart == path.sourceInfo.adapterId.LowPart &&
mode.id == path.sourceInfo.id) {
if (mode.sourceMode.position.x == 0 && mode.sourceMode.position.y == 0) {
entry.is_primary = true;
}
break;
}
}
// device ID (\\.\DISPLAYn)
DISPLAYCONFIG_SOURCE_DEVICE_NAME source_name = {};
+4
View File
@@ -12,6 +12,10 @@ namespace sysutils {
struct MonitorEntry {
std::string display_name; // \\.\DISPLAY1
std::wstring friendly_name; // Dell S2204T; wstring so that it can be converted to utf8 or string
bool is_primary;
uint32_t adapter_id_LowPart;
int32_t adapter_id_HighPart;
uint32_t id;
};
const std::vector<MonitorEntry> &enumerate_monitors();