libretro / desmume2015

Port of Desmume to libretro based on Desmume SVN circa 2015.
29 stars 44 forks source link

Desmume problem with starting some roms from the cmd line. #122

Open i30817 opened 6 years ago

i30817 commented 6 years ago

This is a weird one. I'm sure i've seen this before on another game (don't remember if patched or not) but here it is again:

Recently this patch came out http://www.romhacking.net/translations/3376/ It requires the scene 'dump' (second here http://datomatic.no-intro.org/?page=show_record&s=28&n=4089 ) But you can turn one into the other with the right patch here: http://nds.hordeofninjas.com/Nintendo_DS/ (search for 4089)

Now the bug: if the completely patched rom (which ends up with a crc32 of '647e487b' FYI ) is used on the command line, eg:

retroarch -L /usr/lib/x86_64-linux-gnu/libretro/desmume_libretro.so Irozuki\ Tingle\ no\ Koi\ no\ Balloon\ Trip\ \(Japan\).nds

something like this happens (on both RA and upstream): terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 5) Aborted

If the patched game is loaded from the actual interface instead of the cmd line, it loads fine (RA or upstream desmume). Loading the game from the cmdline - the correctly dumped or underdumped header version - when it's not patched also works fine (again, RA or upstream desmume).

I'm left unsure if this is a patch problem or emulator problem.

Enverex commented 6 years ago

Looks like I have a 1.0 translation of the game (as I patched the game before 1.1 was out) and it doesn't crash for me...

=== Running retroarch -f  -L "/usr/lib/libretro/desmume_libretro.so" "/mnt/store/Emulation/Games/Nintendo - DS/Ripened Tingle's Balloon Trip of Love (Translated 1.0) (Independent).nds"
DeSmuME 0.9.11 svn0 x64 NOSSE
Attempting change to 3d core to: SoftRasterizer
SoftRast Initialized with cores=4

Slot1 auto-selected device type: Retail MC+ROM
Slot2 auto-selected device type: None (0xFF)
DeSmuME .dsv save file not found. Trying to load an old raw .sav file.
CPU mode: JIT
JIT: max block size 12 instruction(s)
Already decrypted.
Autodetecting with autodetect_size=4
i30817 commented 6 years ago

Nope.


$ XDG_CONFIG_HOME=/media/i30817/Huggin/Documents/  re
troarch -L /usr/lib/x86_64-linux-gnu/libretro/desmume_libretro.so b.nds 
[INFO] Loading dynamic libretro core from: "/usr/lib/x86_64-linux-gnu/libretro/desmume_libretro.so"
[INFO] [overrides] no core-specific overrides found at /media/i30817/Huggin/Documents/retroarch/config/DeSmuME/DeSmuME.cfg.
[INFO] [overrides] no game-specific overrides found at /media/i30817/Huggin/Documents/retroarch/config/DeSmuME/b.cfg.
[INFO] Shaders: preset directory: /media/i30817/Huggin/Documents/retroarch/shaders/presets
[INFO] Shaders: no game-specific preset found at /media/i30817/Huggin/Documents/retroarch/shaders/presets/DeSmuME/b.cgp.
[INFO] Shaders: no game-specific preset found at /media/i30817/Huggin/Documents/retroarch/shaders/presets/DeSmuME/b.glslp.
[INFO] Shaders: no core-specific preset found at /media/i30817/Huggin/Documents/retroarch/shaders/presets/DeSmuME/DeSmuME.cgp.
[INFO] Shaders: no core-specific preset found at /media/i30817/Huggin/Documents/retroarch/shaders/presets/DeSmuME/DeSmuME.glslp.
[INFO] Environ SET_VARIABLES.
[INFO] Remaps: remap directory: /media/i30817/Huggin/Documents/retroarch/config/remaps
[INFO] Remaps: no game-specific remap found at /media/i30817/Huggin/Documents/retroarch/config/remaps/DeSmuME/b.rmp.
[INFO] Remaps: no core-specific remap found at /media/i30817/Huggin/Documents/retroarch/config/remaps/DeSmuME/DeSmuME.rmp.
[INFO] Redirecting save file to "/media/i30817/Huggin/Documents/retroarch/saves/b.srm".
[INFO] Redirecting savestate to "/media/i30817/Huggin/Documents/retroarch/savestates/b.state".
[INFO] Environ GET_LOG_INTERFACE.
[INFO] Environ SET_PIXEL_FORMAT: RGB565.
[INFO] Environ GET_VARIABLE desmume_internal_resolution:
[INFO]  256x192
[INFO] Environ GET_VARIABLE desmume_hybrid_layout_scale:
[INFO]  1
[INFO] Environ GET_VARIABLE desmume_num_cores:
[INFO]  1
[INFO] Environ GET_VARIABLE desmume_cpu_mode:
[INFO]  jit
[INFO] Environ GET_VARIABLE desmume_jit_block_size:
[INFO]  12
[INFO] Environ GET_VARIABLE desmume_screens_layout:
[INFO]  top/bottom
[INFO] Environ GET_VARIABLE desmume_pointer_mouse:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_pointer_device_l:
[INFO]  none
[INFO] Environ GET_VARIABLE desmume_pointer_device_r:
[INFO]  none
[INFO] Environ GET_VARIABLE desmume_pointer_device_deadzone:
[INFO]  15
[INFO] Environ GET_VARIABLE desmume_pointer_type:
[INFO]  mouse
[INFO] Environ GET_VARIABLE desmume_frameskip:
[INFO]  0
[INFO] Environ GET_VARIABLE desmume_firmware_language:
[INFO]  Auto
[INFO] Environ GET_LANGUAGE: "0".
[INFO] Environ GET_VARIABLE desmume_gfx_edgemark:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_gfx_linehack:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_gfx_txthack:
[INFO]  disabled
[INFO] Environ GET_VARIABLE desmume_mic_force_enable:
[INFO]  disabled
[INFO] Environ GET_VARIABLE desmume_mic_mode:
[INFO]  internal
[INFO] Environ GET_VARIABLE desmume_pointer_device_acceleration_mod:
[INFO]  0
[INFO] Environ GET_VARIABLE desmume_pointer_stylus_pressure:
[INFO]  50
[INFO] Environ GET_VARIABLE desmume_pointer_stylus_jitter:
[INFO]  disabled
[INFO] Environ GET_VARIABLE desmume_load_to_memory:
[INFO]  disabled
[INFO] Environ GET_VARIABLE desmume_advanced_timing:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_screens_gap:
[INFO]  0
[INFO] Environ GET_VARIABLE desmume_hybrid_showboth_screens:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_hybrid_cursor_always_smallscreen:
[INFO]  enabled
[INFO] Environ GET_VARIABLE desmume_pointer_colour:
[INFO]  white
DeSmuME 0.9.11 svn0 x64 NOSSE
Attempting change to 3d core to: SoftRasterizer
SoftRast Initialized with cores=1
[INFO] Environ PERFORMANCE_LEVEL: 15.
[INFO] Content loading skipped. Implementation will load it on its own.
[INFO] Environ SET_INPUT_DESCRIPTORS:
[INFO]  RetroPad, User 1, Button "B (bottom)" => "B"
[INFO]  RetroPad, User 1, Button "Y (left)" => "Y"
[INFO]  RetroPad, User 1, Button "Select" => "Select"
[INFO]  RetroPad, User 1, Button "Start" => "Start"
[INFO]  RetroPad, User 1, Button "D-Pad Up" => "Up"
[INFO]  RetroPad, User 1, Button "D-Pad Down" => "Down"
[INFO]  RetroPad, User 1, Button "D-Pad Left" => "Left"
[INFO]  RetroPad, User 1, Button "D-Pad Right" => "Right"
[INFO]  RetroPad, User 1, Button "A (right)" => "A"
[INFO]  RetroPad, User 1, Button "X (up)" => "X"
[INFO]  RetroPad, User 1, Button "L" => "L"
[INFO]  RetroPad, User 1, Button "R" => "R"
[INFO]  RetroPad, User 1, Button "L2" => "Lid Close/Open"
[INFO]  RetroPad, User 1, Button "R2" => "Tap Stylus"
[INFO]  RetroPad, User 1, Button "L3" => "Toggle Microphone"
[INFO]  RetroPad, User 1, Button "R3" => "Quick Screen Switch"
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 5)
Aborted

or for standalone:

desmume b.nds 
Failed to set format: Invalid argument
Microphone init failed.
DeSmuME 0.9.11 svn0 dev+ x64-JIT
Using 2 threads for video filter.
SoftRast Initialized with cores=2
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 5)
Aborted

I meanwhile converted my particular patch to work with no-intro (it's actually easy, apply to what you need and make a patch from the no-intro rom to that), but nothing changed here.

i30817 commented 6 years ago

The 'working' case here is if i start the rom from the GUI after loading in which case standalone says this on the console:


$ desmume 
Failed to set format: Invalid argument
Microphone init failed.
DeSmuME 0.9.11 svn0 dev+ x64-JIT
Using 2 threads for video filter.
SoftRast Initialized with cores=2

ROM game code: BCNJ
ROM serial: NTR-BCNJ-JPN
ROM chipID: 00007FC2
ROM internal name: TINGLE ADV
ROM developer: Nintendo

Slot1 auto-selected device type: Retail MC+ROM
Slot2 auto-selected device type: None (0xFF)
BackupDevice: size = 4 Kbit
CPU mode: Interpreter
Already decrypted.
MMU9 write32 to undefined register 04000058h = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 0400005Ch = 00000000h (PC:01FFD120)
Changing master brightness outside of vblank
MMU9 write32 to undefined register 04001004h = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 04001058h = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 0400105Ch = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 04001060h = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 04001064h = 00000000h (PC:01FFD120)
MMU9 write32 to undefined register 04001068h = 00000000h (PC:01FFD120)
Changing master brightness outside of vblank
Changing master brightness outside of vblank
Changing master brightness outside of vblank