gitadora: allow a landscape monitor to display subscreen (#899)

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

## Description of change
Arena Model's SMALL touch subscreen is a portrait (800x1280) panel -
however, it's common for people to set up a touch screen in landscape
orientation since IIDX/SDVX/popn all use landscape.

Add a new option, `-gdsublandscape`, which forces the subscreen to
launch at 1080p landscape. The image is rendered with black bars on the
sides. Touches will be unaligned initially; user needs to go into test
mode and recalibrate. In reality this option is just a short hand for
`-forceressub 1920,1080`.

Wire up `-forceressub` which previously didn't work for gitadora, so
that a resolution other than 1080p can be used in either orientation. In
other games `-forceressub` just forces the rendering resolution and
IIDX/SDVX/popn's game engine automatically stretches to fill... however
for gitadora it works differently since we want to keep the aspect ratio
of the original screen; it instead hijacks the back buffer and makes the
game draw to an intermediate buffer.

## Testing
This commit is contained in:
bicarus
2026-08-29 19:09:56 -07:00
committed by GitHub
parent 67963389ef
commit 357e6c86f1
11 changed files with 344 additions and 32 deletions
@@ -157,6 +157,9 @@ ULONG STDMETHODCALLTYPE WrappedIDirect3DDevice9::Release() {
}
}
// holds a reference on the device, so it has to go before the counts are compared
this->gfdm_small_head.release();
d3d9_readback::release_device_resources(this->pReal);
if (overlay::ENABLED) {
@@ -634,6 +637,8 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::Reset(
overlay::OVERLAY->reset_invalidate();
}
gfdm_small_head.release();
// Reset refuses to run while any default pool resource is outstanding
d3d9_readback::discard_snapshot_targets(pReal);
@@ -662,6 +667,12 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::Present(
graphics_d3d9_on_present(hFocusWindow, pReal, this);
// an adapter group device presents every head at once, so the SMALL head has to be
// composed here as well as in its own swap chain
if (gfdm_small_head.scaled()) {
gfdm_small_head.compose(pReal);
}
CHECK_RESULT(pReal->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion));
}
@@ -683,6 +694,12 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::GetBackBuffer(
if (is_gfdm_two_head_exclusive()
&& is_gfdm_logical_small_swapchain(iSwapChain))
{
if (gfdm_small_head.scaled()
&& iBackBuffer == 0
&& Type == D3DBACKBUFFER_TYPE_MONO)
{
CHECK_RESULT(gfdm_small_head.backbuffer(pReal, ppBackBuffer));
}
CHECK_RESULT(pReal->GetBackBuffer(
GFDM_NATIVE_SMALL_SWAPCHAIN,
iBackBuffer,
@@ -2324,6 +2341,8 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::ResetEx(
overlay::OVERLAY->reset_invalidate();
}
gfdm_small_head.release();
// ResetEx refuses to run while any default pool resource is outstanding
d3d9_readback::discard_snapshot_targets(pReal);
@@ -2341,14 +2360,10 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3DDevice9::ResetEx(
}
if (is_gfdm_two_head_exclusive() && SUCCEEDED(res)) {
gfdm_logical_small_swapchain = gfdm_parameters.logical_small_swapchain;
pPresentationParameters[0] = gfdm_parameters.presentation_parameters[0];
pPresentationParameters[gfdm_parameters.logical_small_swapchain] =
gfdm_parameters.presentation_parameters[1];
if (pFullscreenDisplayMode != nullptr) {
pFullscreenDisplayMode[0] = gfdm_parameters.fullscreen_display_modes[0];
pFullscreenDisplayMode[gfdm_parameters.logical_small_swapchain] =
gfdm_parameters.fullscreen_display_modes[1];
}
gfdm_publish_two_head_parameters(
pPresentationParameters,
pFullscreenDisplayMode,
gfdm_parameters);
}
// recreate overlay