From 4d66cc73dbbe9d4eda1abd22a9ba57244b7b4bb3 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Wed, 16 Sep 2026 00:17:58 -0400 Subject: [PATCH] Fix menu renderer to use the 854x480 framebuffer space RCO menu objects are authored in the PSP movie player's 854x480 FWVGA framebuffer, not the 480x272 LCD. The renderer was laying everything out in the wrong coordinate space, which is why no menu items were visible. --- cli/src/main/java/dev/quoije/umd/cli/Main.java | 2 +- .../java/dev/quoije/umd/ui/RcoRenderer.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/src/main/java/dev/quoije/umd/cli/Main.java b/cli/src/main/java/dev/quoije/umd/cli/Main.java index 969aa32..868c6e8 100644 --- a/cli/src/main/java/dev/quoije/umd/cli/Main.java +++ b/cli/src/main/java/dev/quoije/umd/cli/Main.java @@ -475,7 +475,7 @@ public final class Main { }; String resourceName = rcoPath.substring(rcoPath.lastIndexOf('/') + 1).replace(".RCO", ""); - VsmxNativeObject globals = GlobalVariables.create(interpreter, 854, 480); + VsmxNativeObject globals = GlobalVariables.create(interpreter, 480, 272); VsmxNativeObject controller = Controller.create(interpreter, menuHost, resourceName); VsmxNativeObject movieplayer = MoviePlayer.create(interpreter, menuHost, controller); VsmxNativeObject resource = Resource.create(interpreter, null, controller, rco); diff --git a/ui/src/main/java/dev/quoije/umd/ui/RcoRenderer.java b/ui/src/main/java/dev/quoije/umd/ui/RcoRenderer.java index d8d422d..2ef5a7e 100644 --- a/ui/src/main/java/dev/quoije/umd/ui/RcoRenderer.java +++ b/ui/src/main/java/dev/quoije/umd/ui/RcoRenderer.java @@ -96,12 +96,12 @@ public final class RcoRenderer implements Display { double h = canvas.getHeight(); g.clearRect(0, 0, w, h); - // RCO content is authored for the PSP 480x272 screen; scale it to - // fill the window while keeping that aspect ratio. + // RCO content is authored for the PSP movie player framebuffer, which + // is 854x480 (FWVGA) and 16:9. Scale that to fill the canvas. if (w > 0 && h > 0) { - double scale = Math.min(w / 480.0, h / 272.0); - double drawW = 480.0 * scale; - double drawH = 272.0 * scale; + double scale = Math.min(w / 854.0, h / 480.0); + double drawW = 854.0 * scale; + double drawH = 480.0 * scale; g.translate((w - drawW) / 2.0, (h - drawH) / 2.0); g.scale(scale, scale); } @@ -130,12 +130,12 @@ public final class RcoRenderer implements Display { double w = drawWidth > 0 ? drawWidth : image.getWidth(); double h = drawHeight > 0 ? drawHeight : image.getHeight(); - // RCO positions are screen-center coordinates with +Y up (OpenGL-like). - // Convert to top-left within the 480x272 design space. + // RCO positions are screen-center coordinates with +Y up (OpenGL-like), + // within the 854x480 framebuffer. Convert to top-left in that space. double cx = display.getX(); double cy = display.getY(); - double x = 240.0 + (cx - w / 2.0); - double y = 136.0 - (cy + h / 2.0); + double x = 427.0 + (cx - w / 2.0); + double y = 240.0 - (cy + h / 2.0); g.drawImage(image, x, y, w, h); g.setGlobalAlpha(1.0); }