Skip to content

P0295

Latest
Compare
Choose a tag to compare
@nmlgc nmlgc released this 22 Oct 05:45

The graphics subsystem has been ported to SDL 2's cross-platform 2D rendering API! Now, the game runs fully hardware-accelerated on any GPU supporting at least Direct3D 9 or OpenGL 2.
SDL also facilitated the addition of new windowed and borderless fullscreen modes, providing all the scaling options you'd expect for retro pixel graphics on modern displays.
Screenshot of the new Graphic option menu in the Shuusou Gyoku P0295 build, showcasing the defaults after updating: Windowed mode, fullscreen as borderless, window as large as possible on current display, and framebuffer scaling.
The defaults after updating.

The SDL build now exclusively renders the game as it appeared in the original 16-bit mode, and currently does not offer the original 8-bit mode or an emulation of it. Therefore, this release also comes with a separate binary that retains the original Direct3D and DirectDraw renderers, built from the same current codebase. This binary still only supports the original game's 640×480 fullscreen mode.

The detailed changelog:

Graphics options

  • (SDL-exclusive) When updating to this build, the game starts up in windowed mode, scaled by the largest multiple of 0.25× possible on the primary display.

  • (SDL-exclusive) The Config → Graphic menu now hosts a variety of options to control rendering and scaling:

    • Display: Changes between windowed and fullscreen modes. When changing to fullscreen, the game will pick the display the window is on; if the window is placed between two displays, it will first be snapped to the closer one.

    • FullScr: Specifies the fullscreen mode to use:

      • [Exclusive]: The classic, display mode-changing type of fullscreen from the original version of the game. Uses the game's native 640×480 resolution and leaves the specific scaling behavior to your display.

      • [Borderless]: Displays the game in a borderless window stretched to the current desktop resolution.

    • ScaleFact: Allows the scaling factor in windowed mode to be adjusted at multiples of 0.25. Capped to the maximum possible resolution of the display the game window is currently placed on. Any explicit factor is preserved across restarts; [ Screen ] will always pick the largest possible size on the current monitor.

    • FullScrFit: Specifies scaling in borderless fullscreen mode:

      • [Integer]: Largest integer resolution possible on the current display. Can lead to windowboxing.

      • [ 4:3 ]: Largest resolution that maintains the game's 4:3 aspect ratio. Will pillarbox on wider screens, and letterbox on taller ones.

      • [Stretch]: Stretches the game to fill the display, disregarding its intended 4:3 aspect ratio.

    • ScaleMode: Selects between two scaling behaviors:

      • [FrameBuf]: Renders each frame to a 640×480 texture that is then scaled to the output size.
        Fully preserves the game's original pixel grid. When using any of the Direct3D rendering APIs, the rendered pixels perfectly match the 32-bit mode of pbg's original DirectDraw/Direct3D backend. Only line rendering slightly differs on other APIs; see the blog for details.

      • [Geometry]: Directly renders the game at its scaled resolution by scaling the vertices of each draw call. This has the following effects:

        1. All polygonal shapes (i.e., boxes, lasers, gradients, and the boss explosion rings) appear sharper due to being rasterized directly at the output resolution.
        2. However, sprites can suffer dramatically at non-integer resolutions, exhibiting weird color blending and texture coordinate glitches at their edges.
        3. Screenshots taken with the P key use the output resolution rather than 640×480. (In this mode, there is no 640×480 render output to be saved.)
    • API: Specifies which render driver SDL is using.
      This is only meant to provide alternatives in case of rendering or performance issues on certain GPUs. The game is not guaranteed to run flawlessly and at full speed with all of the drivers on every GPU. See #65 for a list of known bugs with specific GPU × API permutations.

  • (SDL-exclusive) Regardless of how the game is scaled, the SDL renderer always uses nearest-neighbor filtering if the output resolution is an integer multiple of 640×480, and bilinear filtering for every resolution in between.

  • The DrawMode option has been renamed to a less ambiguous and visually symmetric FrameRate.

  • The more layout-related MsgWindow option is now separated from the more technical graphics options with a horizontal line.

Input

  • (SDL-exclusive) The most important rendering options are also mapped to hotkeys:

    • Alt + ⏎ Return: Switches between windowed mode and the either borderless or exclusive fullscreen mode, as selected in the Graphic menu.
    • F11/F10: Cycles forward/backward through the window scale options. In windowed mode, this adds/subtracts 0.25× to the window's scaling factor; in borderless fullscreen mode, it cycles through the integer, 4:3, and stretch options.
    • F9: Switches between framebuffer and geometry scaling.
  • The F8 key now toggles the framerate limiter.

Graphics

  • All true-color shapes rendered in-game are now correctly clipped to the bottom-right edge of the playfield at (512, 480). The Direct3D backend used in the original game's 16-bit mode had an off-by-one error in its viewport calculation that caused these shapes to be clipped at (511, 479) instead.

    • (DirectDraw-exclusive) The palettized 8-bit renderer had similar off-by-one bugs in the clipping conditions of circle outlines and the filled circle parts of homing lasers, which are now fixed as well.
  • (DirectDraw-exclusive) The red boxes drawn when entering a new name into the High Score list are now equally wide in both 8-bit and 16-bit modes. An off-by-one error in the original game's 8-bit box drawing code added one more column of pixels to their right edge.

Sound and music

  • The MIDI options have been moved to a dedicated submenu within Sound / Music.

  • Invalid GS Reverb Macro SysEx messages are now clamped to the SC-88Pro's specified range of [0, 7] by default, matching the behavior of real hardware. This ensures that the majority of Shuusou Gyoku's soundtrack plays back with ZUN's intended panning delay reverb on non-SC-88Pro Roland synthesizers that don't clamp these messages, such as the SC-8850 and Sound Canvas VA.
    See the 2024-03-09 blog post for more info about the bugs in ZUN's MIDI files.
    Thanks to Romantique Tp for clarifying the behavior of real hardware.

    • This fix can be toggled with the SC88ProFXCompat option in the Config → Sound / Music → MIDI menu.

BGM modding

  • The previous empty files in the bgm/ directory that tried to explain the BGM pack folder structure with localized filenames have been replaced with a single, clearer image.

Menus

  • The title and options of the Joy Pad option menu are now consistently aligned to the same horizontal position.

Miscellaneous

  • Playing the Extra Stage or watching an Extra Stage replay no longer affects the configured difficulty setting. The original game had three bugs here:

    • When returning to the main menu from an Extra Stage replay, the configured difficulty would be overridden with either
      1. the difficulty selected before the last time the Extra Stage's Weapon Select screen was entered, or
      2. Easy, when watching the replay before having been to the Extra Stage's Weapon Select screen during one run of the program.
    1. Closing the game window during the Extra Stage (both self-played and replayed) would override the configured difficulty with Hard (the internal difficulty level of the Extra Stage).
  • During the game, the number of frames rendered in the previous second is now displayed in the top-left corner.

  • Scores above 2,147,483,647 points are now displayed correctly in-game instead of rendering as negative numbers.

Regressions

  • High score saving now works again. It was accidentally commented out in the P0256 and P0275 builds.

  • The P0251 build introduced a potential use-after-free bug when re-opening the in-game dialog / main menu help window, which has also been fixed.

Troubleshooting

As of the P0256 build, D3DWindower can no longer be used with the vintage DirectDraw/Direct3D binary, but DxWnd still works. Import this configuration via File → Import, then adjust the path to your GIAN07.exe.

If the vintage binary still runs slow on your system, or doesn't render anything at all:

  • Delete any reference to GIAN07.exe from the following registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  • Make sure that the 32-bit mode is activated in the Config → Graphic menu.

Additional credits

  • Elfin: English→Japanese localizations

Summary blog post: https://rec98.nmlgc.net/blog/2024-10-22
Full changelog compared to the previous release: P0275...P0295
Previous release: https://github.com/nmlgc/ssg/releases/tag/P0275