libretro/beetle-psx-libretro

[Vulkan/Beetle + Beetle HW] - R4 - Ridge Racer Type 4 (USA) fails to load

cheds89 opened this issue · 4 comments

Description

Hi Beetle Team,

The following NTSC-U dump of R4 - Ridge Racer 4 fails to load: http://redump.org/disc/11608/
BIOS startup finishes, followed by an unexpected shutdown.

In my testing, this failure is specific to the Software renderers on both Beetle PSX and Beetle PSX HW cores.

log-file from Beetle PSX (Software) - https://gist.github.com/cheds89/706219636445e3ba8a2cee6815d36ea4

Expected behavior

Example 1: Using Beetle PSX HW (Hardware Vulkan Renderer), R4 - Ridge Racer Type 4 (USA) loads successfully.
Beetle PSX HW (Hardware Vulkan Renderer)

Example 2: Using Beetle PSX (Software), Ridge Racer Type 4 (Europe) loads successfully.
Beetle PSX (Software) - Ridge Racer Type 4 (Europe)

Example 3: Using Duckstation (Software Renderer), R4- Ridge Racer Type 4 (USA) loads successfully.
Duckstation (Software Renderer)

Actual behavior

Using Beetle PSX (Software), R4 - Ridge Racer Type 4 (USA) fails to load.
Beetle PSX (Software), R4 - Ridge Racer Type 4 (USA) fails to load

Using Beetle PSX HW (Software Renderer), R4 - Ridge Racer Type 4 (USA) fails to load
Beetle PSX HW (Software Renderer), R4 - Ridge Racer Type 4 (USA) fails to load

Steps to reproduce the bug

  1. Load NTSC-U dump of R4 - Ridge Racer 4 (MD5 - bf1d92037b1b2be83b459c11f0b89eb6)
  2. Load fails.

Bisect results

I last booted this game maybe 2 months ago, and I did not encounter this behavior,

Version/Commit

Retroarch: 1.9.14
Beetle PSX HW: 0.9.44.1 8b853cd
Beetle PSX: 0.9.44.1 8b853cd

Core options

All defaults
Fresh RetroArch and core installation
Vulkan front-end driver

The same issues occur with gl front-end drivers

Environment information

  • Frontend: RetroArch 1.9.14
  • OS: Windows 10 Home, Version 20H2, Build 19042.1466
  • Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz 3.20 GHz
  • GPU: Radeon Rx480 Driver 22.1.1

Seemed similar to https://www.reddit.com/r/RetroArch/comments/saixj4/racing_lagoon_crashes_after_the_first_cutscene_on/ so I started to bisect, the issue started with cde89c9 , both R4 and Racing Lagoon boot fine before that commit.

So yeah, looks like it's because of the "Dynamic" crop option, if changed to "Static" it doesn't crash anymore.

@ds22x maybe you'll have an idea of what's happening here. Ran with gdb:

(gdb) bt full
#0  0x00007ffda0dcc565 in GPU_Update (sys_timestamp=15063)
    at mednafen/psx/gpu.cpp:1561
        i = 482
        FirstVisibleLine = 16
        displayfb_yoffset = 0
        dmw_width = 0
        pix_clock_offset = 269068796
        dest = 0xabe8410000000
        VisibleLineCount = 242
        pix_clock = 32765
        pix_clock_div = 2698631416
        chunk_clocks = 194
        dot_clocks = 24
        gpu_clocks = 0
        DotClockRatios = {10, 8, 5, 4, 7}
        dmc = 1
        dmw = 350
        sys_clocks = 122
        next_dt = -1591942464
#1  0x00007ffda11cce6d in PSX_EventHandler (timestamp=15063)
    at libretro.cpp:689
        nt = 15069
        prev = 0x7ffda17890e0 <events>
        e = 0x7ffda17890f8 <events+24>
#2  0x00007ffda12ec058 in PS_CPU::RunReal<false, false, false> (
    this=0x1ce6b9cdb10, timestamp_in=0) at mednafen/psx/cpu.cpp:2647
        timestamp = 15063
        PC = 2148116988
        new_PC = 2148116992
        LDWhich = 3
        LDValue = 29002
#3  0x00007ffda0d9bb09 in PS_CPU::Run (this=0x1ce6b9cdb10, timestamp_in=0,
    BIOSPrintMode=false, ILHMode=false) at mednafen/psx/cpu.cpp:2691
No locals.
#4  0x00007ffda11da71d in retro_run () at libretro.cpp:4601
        updated = false
        rects = {2 <repeats 482 times>, 0 <repeats 94 times>}
        spec = {surface = 0x1ce6ba60200, VideoFormatChanged = false,
          DisplayRect = {x = 0, y = 0, w = 0, h = 484},
          LineWidths = 0x7ffda1789200 <retro_run::rects>, IsFMV = 0x0,
          InterlaceOn = true, InterlaceField = true, skip = 0,
          SoundFormatChanged = false, SoundRate = 44100, SoundBuf = 0x0,
          SoundBufMaxSize = 0, SoundBufSize = 0, SoundBufSizeALMS = 0,
          MasterCycles = 0, MasterCyclesALMS = 0, SoundVolume = 1,
          soundmultiplier = 1}
        espec = 0x3ad1ff480
        timestamp = 0
        players = 2
        fb = 0x7ff6c35be240 <ui_application_win32>
        width = 32758
        height = 3274982515
        upscale_shift = 0 '\000'
        interbuf = 0xa1000000
#5  0x00007ff6c2c6ea46 in core_run () at runloop.c:8198
        runloop_st = 0x7ff6c3c60600 <runloop_state>
        current_core = 0x7ff6c3c60648 <runloop_state+72>
        core_poll_type_override = POLL_TYPE_OVERRIDE_DONTCARE
        new_poll_type = 2
        early_polling = false
        late_polling = true
        netplay_preframe = true
#6  0x00007ff6c2c6d7eb in runloop_iterate () at runloop.c:7595
        run_ahead_enabled = false
        run_ahead_secondary_instance = true
        want_runahead = false
        run_ahead_num_frames = 1
        run_ahead_hide_warnings = false
        i = 5
        dpad_mode = {ANALOG_DPAD_NONE, ANALOG_DPAD_NONE, ANALOG_DPAD_NONE,
          ANALOG_DPAD_NONE, ANALOG_DPAD_NONE, 16777216, 1546059776, 462,
          ANALOG_DPAD_NONE, ANALOG_DPAD_NONE, ANALOG_DPAD_NONE,
          ANALOG_DPAD_NONE, 1545099152, 462, 1543442480, 462}
        uico_st = 0x7ff6c3c7e920 <uico_driver_st>
        input_st = 0x7ff6c3cb3560 <input_driver_st>
        audio_st = 0x7ff6c3c8cce0 <audio_driver_st>
        video_st = 0x7ff6c3cd9a40 <video_driver_st>
        recording_st = 0x7ff6c3c7e9a0 <recording_state>
        camera_st = 0x7ff6c3c7e940 <camera_driver_st>
        settings = 0x1ce5c1c9fd0
        runloop_st = 0x7ff6c3c60600 <runloop_state>
        video_frame_delay = 0
        video_frame_delay_effective = 0
        vrr_runloop_enable = false
        max_users = 5
        current_time = 11428141115
        menu_pause_libretro = true
        core_paused = false
        slowmotion_ratio = 3
        cheevos_enable = false
        audio_sync = true
        discord_st = 0x7ff6c3d82f40 <discord_state_st>
#7  0x00007ff6c2c586f1 in rarch_main (argc=1, argv=0x1ce5c185790, data=0x0)
    at retroarch.c:3824
        ret = 0
        app_exit = false
        p_rarch = 0x7ff6c3c57060 <rarch_st>
        runloop_st = 0x7ff6c3c60600 <runloop_state>
        video_st = 0x7ff6c3cd9a40 <video_driver_st>
#8  0x00007ff6c2e4fa5d in SDL_main (argc=1, argv=0x1ce5c185790)
    at ui/drivers/ui_qt.cpp:4315
No locals.
#9  0x00007ff6c33a0eda in main_getcmdline ()
No symbol table info available.
#10 0x00007ff6c2c513c1 in __tmainCRTStartup ()
    at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:321
        lock_free = <optimized out>
        fiberid = <optimized out>
        nested = <optimized out>
        lpszCommandLine = <optimized out>
        StartupInfo = {cb = 104, lpReserved = 0x1ce5bfc1c90 "",
          lpDesktop = 0x1ce5bfc2fd0 "Winsta0\\Default",
          lpTitle = 0x1ce5bfc3e60 "G:\\msys64\\home\\B-S\\build\\retroarch_debug.exe", dwX = 0, dwY = 0, dwXSize = 0, dwYSize = 0, dwXCountChars = 0,
          dwYCountChars = 0, dwFillAttribute = 0, dwFlags = 0,
          wShowWindow = 0, cbReserved2 = 0, lpReserved2 = 0x0,
          hStdInput = 0xffffffffffffffff, hStdOutput = 0xffffffffffffffff,
          hStdError = 0xffffffffffffffff}
        inDoubleQuote = <optimized out>
#11 0x00007ff6c2c514d6 in WinMainCRTStartup ()
    at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:176
        ret = 255
ds22x commented

Seems the software renderer really doesn't like having too many lines displayed on the screen.

Thanks for the quick fix! 👍

Thank you!