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); }