libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.33k stars 1.84k forks source link

[Linux armhf] --enable-cheats breaks fif_libretro (Fix-It Felix Jr.) after commit [b2634ea] #15821

Open Technoturnovers opened 1 year ago

Technoturnovers commented 1 year ago

(Note: at the advice of hizzlekizzle, I am closing the prior issue #15802 in favor of this one)

Description

fif_libretro.so is a proprietary libretro core for the game Fix-It Felix Jr., originally developed by Code Mystics under license from Disney as a standalone game for promotional Windows-based arcade cabinets, and later licensed with Disney's approval for porting to libretro and inclusion on AtGames's various Linux-based home arcade cabinets in 2019. The shared library is compiled as a 32-bit ARMv8 ELF binary, and only depends on libc and libm (and can run on armhf, aka ARMv7, platforms). Full details on the core's unusual operation will detailed later.

After commit b2634ea5885b6f09697c4b0d13e8d9c93ca381ea by @LibretroAdmin, attempting to launch the core results in a segmentation fault, with the following backtrace on a debug-enabled build linking the crash to the cheat manager:

GDB backtrace ``` technoturnovers@debian-armhf:~/retroarch-broken/RetroArch$ gdb --args ./retroarch --verbose -L /home/technoturnovers/fif_libretro.so /home/technoturnovers/res_fif/fif.rom GNU gdb (Debian 13.2-1) 13.2 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./retroarch... (gdb) run Starting program: /home/technoturnovers/retroarch-broken/RetroArch/retroarch --verbose -L /home/technoturnovers/fif_libretro.so /home/technoturnovers/res_fif/fif.rom [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [INFO] [Config]: Loading default config. [INFO] [Config]: Looking for config in: "/home/technoturnovers/.config/retroarch/retroarch.cfg". [New Thread 0xad0ed9a0 (LWP 7346)] Thread 1 "retroarch" received signal SIGSEGV, Segmentation fault. 0x0050abb8 in string_is_empty (data=0x3e8 ) at ./libretro-common/include/string/stdstring.h:67 67 return !data || (*data == '\0'); (gdb) bt full #0 0x0050abb8 in string_is_empty (data=0x3e8 ) at ./libretro-common/include/string/stdstring.h:67 #1 0x0050c86a in cheat_manager_get_game_specific_filename (s=0xbeffdc28 "\250\276\217\266", len=4096, path_cheat_database=0xad1000b6 "/home/technoturnovers/.config/retroarch/cheats", saving=false) at cheat_manager.c:722 s1 = "m\312\333\"m\312\333\"\350A", '\000' , "\377\027\000\000\000\020\000\000\000\000\000\000\000\000\000\000\002\000\000\000\350\003\000\000\350\003\000\000\350A\000\000\232:\t\000\000\000\000\000\000\020\000\000\000\000\000\000\b\000\000\000\000\000\000\000t80\000\000\000\000\000\200\2150e\000\000\000\000QK`\"", '\000' ... system_info = {library_name = 0x3e8 , library_version = 0x3e8 , valid_extensions = 0x1000 , need_fullpath = 81, block_extract = 75} runloop_st = 0x11fbad0 core_name = 0x3e8 game_name = 0x120e026 "fif.cht" #2 0x0050c938 in cheat_manager_load_game_specific_cheats (path_cheat_database=0xad1000b6 "/home/technoturnovers/.config/retroarch/cheats") at cheat_manager.c:746 cheat_file = "\250\276\217\266\000`\246\265\030]\272\2658Z\272\265\230N\272\265\240K\272\265\250H\272\265\300E\272\265\340B\272\265\000@\272\265(z\272\265@t\272\265Xq\272\265xn\272\265\210k\272\265\240h\272\265\300e\272\265\340b\272\265@(\302\265`%\302\265\230\037\302\265XW\272\265\260\034\302\265x\312\217\266\230\304\217\266\260r\246\265\bg\246\265\340$\214\266\210x\246\265\360\343\375\266\360\030\214\266x{\246\265h\373\375\266\000@\246\265\230u\246\265\370B\246\265\350E\246\265\260o\206\266\000\000\000\000#1(\264\370\330\217\266\000\020\302\265\210\347\217\266\360b\246\265(O\246\265\bR\246\265xU\246\265\320Y\246\265\224\374\036\264\263\221\226\006"... #3 0x00490a0e in command_event_init_cheats (apply_cheats_after_load=false, path_cheat_db=0xad1000b6 "/home/technoturnovers/.config/retroarch/cheats", bsv_movie_data=0x0) at command.c:1187 allow_cheats = true bsv_movie_state_handle = 0x0 #4 0x0047a8fe in retroarch_main_init (argc=5, argv=0xbefff2d4) at retroarch.c:5450 verbosity_enabled = true init_failed = false p_rarch = 0x11f25f0 --Type for more, q to quit, c to continue without paging-- runloop_st = 0x11fbad0 input_st = 0x1248360 video_st = 0x125f6c8 settings = 0xad0ef008 recording_st = 0x12181a8 global = 0x11fb818 access_st = 0x11fb80c accessibility_enable = false accessibility_narrator_speech_speed = 5 menu_st = 0x12b9290 #5 0x004b7c2a in content_load (info=0xbefff118, p_content=0x11fbf14 ) at tasks/task_content.c:1451 i = 0 success = false rarch_argc = 0 rarch_argv = {0x0 } argv_copy = {0x0 } rarch_argv_ptr = 0xbefff2d4 rarch_argc_ptr = 0xbefff124 wrap_args = 0x133ba78 #6 0x004b9320 in task_load_content_internal (content_info=0xbefff118, loading_from_menu=true, loading_from_cli=true, loading_from_companion_ui=false) at tasks/task_content.c:2526 content_ctx = {name_ips = 0x0, name_bps = 0x0, name_ups = 0x0, valid_extensions = 0x0, directory_cache = 0x0, directory_system = 0x0, subsystem = {data = 0x0, size = 0}, block_extract = false, need_fullpath = false, set_supports_no_game_enable = false, is_ips_pref = false, is_bps_pref = false, is_ups_pref = false, patch_is_blocked = false, bios_is_missing = false, check_firmware_before_loading = false} p_content = 0x11fbf14 ret = false runloop_st = 0x11fbad0 sys_info = 0x11ff028 settings = 0xad0ef008 check_firmware_before_loading = false --Type for more, q to quit, c to continue without paging-- set_supports_no_game_enable = false path_dir_system = 0xad11e0b6 "/home/technoturnovers/.config/retroarch/system" path_dir_cache = 0xad11f0b6 "" #7 0x004b94b8 in task_push_load_content_from_cli (core_path=0x0, fullpath=0x0, content_info=0xbefff118, type=CORE_TYPE_PLAIN, cb=0x0, user_data=0x0) at tasks/task_content.c:2606 #8 0x00476a4e in rarch_main (argc=5, argv=0xbefff2d4, data=0x0) at retroarch.c:3847 info = {argv = 0xbefff2d4, args = 0x0, environ_get = 0x46d555 , argc = 5} p_rarch = 0x11f25f0 runloop_st = 0x11fbad0 video_st = 0x125f6c8 #9 0x007b1d84 in main(int, char**) (argc=5, argv=0xbefff2d4) at ui/drivers/ui_qt.cpp:4318 ```

This core also has a variety of other non-crashing issues not tied to this specific commit, which I will list later (and potentially make future separate issues about).

Expected behavior

Pictured is the core running on the latest release version of RetroArch with only --disable-cheats and debug flags set on compile: image

Further fif_libretro details and issues:

As stated previously, fif_libretro.so is a libretro core compiled as a 32-bit ARM binary, with libc and libm as the only dependencies. It requires being pointed at a "ROM" in the form of the file 'fif.rom'; however, this file is actually just a plain text file with the text "FIF" in it, and only serves as a dummy file that allows the core to receive the assets folder with all of the unpacked assets contained inside. Here is a list of the files required to run the core, with SHA-1 sums for each:

SHA-1 ``` SHA-1: 709f2f1a9147d9987a00c2c86ad1beced4ed4b75 ./fif_libretro.so 7a40f13a4f3cab9348f71cef4f3cbe155eadcb4f ./res_fif/controls.log 2314358705f32d68c8709a990e724ecef3ed7b4c ./res_fif/fif.rom 74f346a151e16e479de68e7ede99f6077749971a ./res_fif/fif.rom.l.png 1f764f5f5b4387dd7853719b707aa5e852672108 ./res_fif/fif.rom.png 3fac5a8704d8f97e378152132e7e6ceb3288940f ./res_fif/fif.rom.s.png 34a5dca2810f31ea7336b167b2e89dfba953db94 ./res_fif/sound0.wav c9e41e0a3ef7b8b99bc04922135d4d9e772e0b8c ./res_fif/sound1.wav fb0fcd30c2736faec27cb2e6ae392c0ba997204f ./res_fif/sound10.wav f4fe6d07446e633d327fa0b5e8f77b51812236d9 ./res_fif/sound11.wav c30eab4db02adf7be7fe4f1fc8bffd5b949e292c ./res_fif/sound12.wav c60445a5afc41fa1c7306e494de3d977c1860054 ./res_fif/sound13.wav 43619830a69d1541c432afcb27937ee928668e79 ./res_fif/sound14.wav 393f02665bccc12c71d78c8b406a81b623ff660d ./res_fif/sound15.wav 9f3146264532fe42083fdfc5beef902046a91d20 ./res_fif/sound16.wav 56aa52bb0032aaa9edcdfe476b7af853b0a873d7 ./res_fif/sound17.wav dba72e4253047894170d7b1b4fa48ea7f9b74f32 ./res_fif/sound18.wav 3517443234d3d75e485e23607fc34b699d5700d1 ./res_fif/sound19.wav d296e8eef2059c6d2b00a49f78ada9828e6fb395 ./res_fif/sound2.wav 3bbd8ca70019b2123143d6397732b5877c5fc304 ./res_fif/sound20.wav 022138961a374d4eda7a133796b476edf87cb3b7 ./res_fif/sound21.wav a89280408c43b5624b2ff4c84cbe66f1d83ddd18 ./res_fif/sound22.wav 8401b37e7bcaa4eef7caac2c3ef05a47c0f29847 ./res_fif/sound23.wav 2798b239ce23a22847cda2936cdfbb00e280b395 ./res_fif/sound24.wav 2bed76ffe0e3aa7137b4611b10dac1296dc6ffee ./res_fif/sound25.wav a93a3593b729444591f616afb981f454e2177a0c ./res_fif/sound26.wav 5effb7b0fd79033973d7a66601cfe589a65893c2 ./res_fif/sound27.wav 0f0043be3fb2b97e207ee15684d8fb1f12fa9f3d ./res_fif/sound28.wav 63a43994cc3a8fd92011e5a3b5d1ba8d501d07a5 ./res_fif/sound29.wav 404de5cb7d6a56ab9a17405e9241494693f79021 ./res_fif/sound3.wav 8f75836a9ba115b77c1e1002560b2896c62b61af ./res_fif/sound30.wav 672ba3d47cdd654f82b8ee6c84572ee20ae7117c ./res_fif/sound31.wav a44af75d16a9e2f79d1dcead24dba35001913b09 ./res_fif/sound4.wav 6ecb91ac9534eaaa4069a043661c9c16e21942d2 ./res_fif/sound5.wav 66365bd6dc650d714547cfd46278da692b40fe22 ./res_fif/sound6.wav ed09b930615429362628cde3713ec31cd2ce1a31 ./res_fif/sound7.wav e21920b85c2edae9e7614251e0cf90b808de0072 ./res_fif/sound8.wav 1bd8cb6c168db29ecfa73e6e776277af21166579 ./res_fif/sound9.wav 3bd2ad5d0d481b813b00024cb0e290133238c5ba ./res_fif/texture2.bmp ```

I cannot link to any of these files due to copyright, but they are out there (if a bit difficult to find), and they can also be pulled from any AtGames console that includes the game.

The core does not come with a core info file, and I have yet to pin down exactly what capabilities it exposes due to it apparently relying on the defaults of AtGames's proprietary libretro frontend/implementation, retroplayer. However, I have managed to get it to launch from the menu, accept the .rom file, and even enable save states with this core info file I made up, named fif_libretro.info:

# Software Information
display_name = "Fix-It Felix Jr."
authors = "Code Mystics, Disney"
supported_extensions = "rom"
corename = "fif_libretro"
categories = "Game"
license = "Proprietary (All rights reserved)"
permissions = ""
categories = "Game"

# Hardware Information
manufacturer = "AtGames"
systemname = "FOCAL Engine"

# Libretro features
supports_no_game = "false"
savestate = "true"
cheats = "false"
needs_fullpath = "true"
hw_render = "false"

Even with this core info file however, there are still issues, seemingly tied to the core itself reporting absolutely zero details about itself. So far, I've had the following issues crop up (although there's probably more):

Environment Information

OS: Linux debian-armhf 6.5.0-1-armmp-lpae #1 SMP Debian 6.5.3-1 (2023-09-13) armv7l GNU/Linux QEMU launch command: qemu-system-arm -machine virt,gic-version=max -m 1G -cpu cortex-a7 -smp 4 -netdev user,id=vnet,hostfwd=:127.0.0.1:2222-:22 -device virtio-net-pci,netdev=vnet -drive file=harddisk.qcow2,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -device virtio-gpu-pci -device qemu-xhci -device usb-kbd -device usb-tablet -display sdl,show-cursor=on -accel tcg,thread=multi -device usb-audio

Technoturnovers commented 1 year ago

Using the project lrproxy, I was able to get what info the core reported about itself, and there's a whole lotta null, here. That would explain pretty much all of the issues, probably including the borked aspect ratio. Ideally there would be ways to override all of this in configs, but there's probably also a way to modify this proxy library to intercept these null values and change them to ones that actually, well, work.

technoturnovers@debian-armhf:~$ ./retroarch-latest-nocheats/retroarch --verbose -L /home/technoturnovers/lrproxy/src/proxy_core.so /home/technoturnovers/res_fif/fif.rom
[INFO] [Config]: Looking for config in: "/home/technoturnovers/.config/retroarch/retroarch.cfg".
[INFO] RetroArch 1.16.0 (Git 6c2cc45628)
[INFO] === Build =======================================
[INFO] CPU Model Name: ARMv7 Processor rev 5 (v7l)

[INFO] Capabilities: NEON VFPV3 VFPV4 
[INFO] Version: 1.16.0
[INFO] Git: 6c2cc45628
[INFO] Built: Oct 19 2023
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Core]: Loading dynamic libretro core from: "/home/technoturnovers/lrproxy/src/proxy_core.so"
[LRPROXY] Loading core "./fif_libretro.so"
[LRPROXY] Getting pointer to retro_init
[LRPROXY] Getting pointer to retro_deinit
[LRPROXY] Getting pointer to retro_api_version
[LRPROXY] Getting pointer to retro_get_system_info
[LRPROXY] Getting pointer to retro_get_system_av_info
[LRPROXY] Getting pointer to retro_set_environment
[LRPROXY] Getting pointer to retro_set_video_refresh
[LRPROXY] Getting pointer to retro_set_audio_sample
[LRPROXY] Getting pointer to retro_set_audio_sample_batch
[LRPROXY] Getting pointer to retro_set_input_poll
[LRPROXY] Getting pointer to retro_set_input_state
[LRPROXY] Getting pointer to retro_set_controller_port_device
[LRPROXY] Getting pointer to retro_reset
[LRPROXY] Getting pointer to retro_run
[LRPROXY] Getting pointer to retro_serialize_size
[LRPROXY] Getting pointer to retro_serialize
[LRPROXY] Getting pointer to retro_unserialize
[LRPROXY] Getting pointer to retro_cheat_reset
[LRPROXY] Getting pointer to retro_cheat_set
[LRPROXY] Getting pointer to retro_load_game
[LRPROXY] Getting pointer to retro_load_game_special
[LRPROXY] Getting pointer to retro_unload_game
[LRPROXY] Getting pointer to retro_get_region
[LRPROXY] Getting pointer to retro_get_memory_data
[LRPROXY] Getting pointer to retro_get_memory_size
[LRPROXY] retro_get_system_info(0x120c6e4)
[LRPROXY]     ->library_name     = "(null)"
[LRPROXY]     ->library_version  = "(null)"
[LRPROXY]     ->valid_extensions = "(null)"
[LRPROXY]     ->need_fullpath    = 0
[LRPROXY]     ->block_extract    = 0
[LRPROXY] retro_set_environment(0x48c5c9)
[INFO] [Overrides]: Redirecting save file to "/home/technoturnovers/.config/retroarch/saves/Unknown/fif.srm".
[INFO] [Overrides]: Redirecting save state to "/home/technoturnovers/.config/retroarch/states/Unknown/fif.state".
[LRPROXY] retro_init()
[INFO] [Content]: Loading content file: "/home/technoturnovers/res_fif/fif.rom".
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[LRPROXY] RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS(0xbe8e91bc) = 1
[LRPROXY]     [0].port        = 0
[LRPROXY]     [0].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [0].index       = 0
[LRPROXY]     [0].id          = RETRO_DEVICE_ID_JOYPAD_LEFT
[LRPROXY]     [0].description = "D-Pad Left"
[LRPROXY]     [1].port        = 0
[LRPROXY]     [1].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [1].index       = 0
[LRPROXY]     [1].id          = RETRO_DEVICE_ID_JOYPAD_UP
[LRPROXY]     [1].description = "D-Pad Up"
[LRPROXY]     [2].port        = 0
[LRPROXY]     [2].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [2].index       = 0
[LRPROXY]     [2].id          = RETRO_DEVICE_ID_JOYPAD_DOWN
[LRPROXY]     [2].description = "D-Pad Down"
[LRPROXY]     [3].port        = 0
[LRPROXY]     [3].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [3].index       = 0
[LRPROXY]     [3].id          = RETRO_DEVICE_ID_JOYPAD_RIGHT
[LRPROXY]     [3].description = "D-Pad Right"
[LRPROXY]     [4].port        = 0
[LRPROXY]     [4].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [4].index       = 0
[LRPROXY]     [4].id          = RETRO_DEVICE_ID_JOYPAD_B
[LRPROXY]     [4].description = "B"
[LRPROXY]     [5].port        = 0
[LRPROXY]     [5].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [5].index       = 0
[LRPROXY]     [5].id          = RETRO_DEVICE_ID_JOYPAD_A
[LRPROXY]     [5].description = "A"
[LRPROXY]     [6].port        = 0
[LRPROXY]     [6].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [6].index       = 0
[LRPROXY]     [6].id          = RETRO_DEVICE_ID_JOYPAD_Y
[LRPROXY]     [6].description = "Insert Coin"
[LRPROXY]     [7].port        = 0
[LRPROXY]     [7].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [7].index       = 0
[LRPROXY]     [7].id          = RETRO_DEVICE_ID_JOYPAD_START
[LRPROXY]     [7].description = "Start"
[LRPROXY]     [8].port        = 1
[LRPROXY]     [8].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [8].index       = 0
[LRPROXY]     [8].id          = RETRO_DEVICE_ID_JOYPAD_LEFT
[LRPROXY]     [8].description = "D-Pad Left"
[LRPROXY]     [9].port        = 1
[LRPROXY]     [9].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [9].index       = 0
[LRPROXY]     [9].id          = RETRO_DEVICE_ID_JOYPAD_UP
[LRPROXY]     [9].description = "D-Pad Up"
[LRPROXY]     [10].port        = 1
[LRPROXY]     [10].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [10].index       = 0
[LRPROXY]     [10].id          = RETRO_DEVICE_ID_JOYPAD_DOWN
[LRPROXY]     [10].description = "D-Pad Down"
[LRPROXY]     [11].port        = 1
[LRPROXY]     [11].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [11].index       = 0
[LRPROXY]     [11].id          = RETRO_DEVICE_ID_JOYPAD_RIGHT
[LRPROXY]     [11].description = "D-Pad Right"
[LRPROXY]     [12].port        = 1
[LRPROXY]     [12].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [12].index       = 0
[LRPROXY]     [12].id          = RETRO_DEVICE_ID_JOYPAD_B
[LRPROXY]     [12].description = "B"
[LRPROXY]     [13].port        = 1
[LRPROXY]     [13].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [13].index       = 0
[LRPROXY]     [13].id          = RETRO_DEVICE_ID_JOYPAD_A
[LRPROXY]     [13].description = "A"
[LRPROXY]     [14].port        = 1
[LRPROXY]     [14].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [14].index       = 0
[LRPROXY]     [14].id          = RETRO_DEVICE_ID_JOYPAD_Y
[LRPROXY]     [14].description = "Insert Coin"
[LRPROXY]     [15].port        = 1
[LRPROXY]     [15].device      = 0 << RETRO_DEVICE_TYPE_SHIFT | RETRO_DEVICE_JOYPAD
[LRPROXY]     [15].index       = 0
[LRPROXY]     [15].id          = RETRO_DEVICE_ID_JOYPAD_START
[LRPROXY]     [15].description = "Start"
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[LRPROXY] RETRO_ENVIRONMENT_SET_PIXEL_FORMAT(RETRO_PIXEL_FORMAT_RGB565) = 1
[LRPROXY] retro_load_game(0x22d83a8) = 1
[LRPROXY]     ->path = "/home/technoturnovers/res_fif/fif.rom"
[LRPROXY]     ->data = 0x22ee170
[LRPROXY]     ->size = 4
[LRPROXY]     ->meta = "(null)"
[INFO] [Replay]: Found last replay slot: #0
[LRPROXY] retro_get_memory_size(0) = 0
[LRPROXY] retro_get_memory_data(0) = (nil)
[LRPROXY] retro_get_memory_size(1) = 0
[LRPROXY] retro_get_memory_data(1) = (nil)
[INFO] [SRAM]: Skipping SRAM load.
[LRPROXY] retro_set_video_refresh(0x6813b5)
[LRPROXY] retro_set_audio_sample(0x66dff5)
[LRPROXY] retro_set_audio_sample_batch(0x66e155)
[LRPROXY] retro_set_input_state(0x67a549)
[LRPROXY] retro_set_video_refresh(0x6813b5)
[LRPROXY] retro_set_audio_sample(0x66dff5)
[LRPROXY] retro_set_audio_sample_batch(0x66e155)
[LRPROXY] retro_set_input_state(0x67a549)
[LRPROXY] retro_api_version() = 1
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[LRPROXY] retro_set_video_refresh(0x6813b5)
[LRPROXY] retro_set_audio_sample(0x66dff5)
[LRPROXY] retro_set_audio_sample_batch(0x66e155)
[LRPROXY] retro_set_input_state(0x493b65)
[LRPROXY] retro_set_input_poll(0x493bb9)
[LRPROXY] retro_get_system_av_info(0x125d790)
[LRPROXY]     ->geometry.base_width   = 240
[LRPROXY]     ->geometry.base_height  = 320
[LRPROXY]     ->geometry.max_width    = 240
[LRPROXY]     ->geometry.max_height   = 320
[LRPROXY]     ->geometry.aspect_ratio = 0.000000
[LRPROXY]     ->timing.fps            = 60.000000
[LRPROXY]     ->timing.sample_rate    = 44100.000000
[INFO] [Core]: Geometry: 240x320, Aspect: 0.000, FPS: 60.00, Sample rate: 44100.00 Hz.
[INFO] [Audio]: Set audio input rate to: 44100.00 Hz.
[INFO] [Video]: Set video size to: 720x960.
[ERROR] [Wayland]: Failed to connect to Wayland server.
Technoturnovers commented 1 year ago

image IT WORKS I don't even know C, by the way- didn't manage to fix the aspect ratio issue quite yet it seems, but it launches on default compile and can save remaps now I'll make a github repo for the changes I made to lrproxy tomorrow, it's really late right now

Technoturnovers commented 1 year ago

image I haven't been able to figure out what is causing the incorrect aspect ratio, core-wise, but an ugly hack that seems to work in the meantime is just using aspect ratio settings to manually stretch the game to two times its width, and possibly set overscan cropping to get rid of the black bars for use in a portrait monitor configuration. I'm not really sure what could be causing this type of viewport/scaling related issue, since it doesn't seem like there are that many parameters that are relevant; if anyone has any insight, I would be glad to hear it, since this isn't exactly elegant (then again, this wrapper core isn't terribly elegant just in principle).

hizzlekizzle commented 1 year ago

Have you tried changing this: [LRPROXY] ->geometry.aspect_ratio = 0.000000 to 0.75 (that is, 3:4)?

Great work so far, by the way. That's a clever idea to use the wrapper core to solve the shortcomings of the closed-source core.

Technoturnovers commented 1 year ago

Have you tried changing this: [LRPROXY] ->geometry.aspect_ratio = 0.000000 to 0.75 (that is, 3:4)?

Great work so far, by the way. That's a clever idea to use the wrapper core to solve the shortcomings of the closed-source core.

Tried that, it didn't do anything. Gonna make a repo for what I have so far

Technoturnovers commented 1 year ago

https://github.com/Technoturnovers/lrproxy_fif Here it is, all it does is override the unspecified sys_info stuff with actual values.

Technoturnovers commented 1 year ago

Note: in order to get the core info file to work, I had to rename the proxy core to proxy-core.so and the info file to proxy-core.info

Technoturnovers commented 1 year ago

Alright, I still haven't been able to figure out the video issue, mainly because I am a tiny-brained compsci novice who only knows Python, JavaScript, and some Java, and looking at the core info functions for AV in the reference libretro.h and a variety of other existing cores hasn't really told me much about what could be causing the frame to be squeezed within the viewport. Does anyone have any advice for what structs may be in play with this?

Technoturnovers commented 1 year ago

Alright, I have come to the conclusion that there is probably letterboxing baked into this particular core, with it being targeted at a 4:3 aspect ratio; I found an AtGames promotional video on Facebook that is a direct capture of the game in question, and that video is at 4:3 when that would make no sense as an intentional decision rather than just them leaving the capture as is. I still need to find a configuration that won't end up with uneven pixels, so I'll report back when I figure that out.

Also, I'm leaving this issue open because even though I found a workaround for the last remaining issue, there's still a crash here where there wasn't before, and that's bad obviously and should still be fixed.

EDIT: Just took a look at the Facebook video, and that has uneven pixels too, so it looks like this core just has uneven scaling as a matter course. Lame.

hizzlekizzle commented 1 year ago

oh nice. Mystery solved, then. If you're able to get it to render at wider-than-desired without wonky pixels (i.e., an even integer multiple), you could shrink it down with a shader to keep the quality up.

Technoturnovers commented 1 year ago

oh nice. Mystery solved, then. If you're able to get it to render at wider-than-desired without wonky pixels (i.e., an even integer multiple), you could shrink it down with a shader to keep the quality up.

Actually, I'm going to try one more thing- how do I set a rotation value? EDIT: Figured it out, didn't do what I was hoping.

Technoturnovers commented 1 year ago

I wasn't able to find a simple integer factor in order to get the pixels to even out, but I was able to get a base resolution target, that being 428x320; that leaves the actual game area at a base size of 240x320 as intended, should work fine with integer scaling, and should probably also work fine with non-integer scaling since that should change the pixel size rather than duplicating actual pixels, at larger resolutions. Now I need to figure out a way to either automatically crop out a given portion of the base image using a config or core parameter, or have a shader to do it for me (although the latter is not preferred for performance reasons).

hizzlekizzle commented 1 year ago

Can you use integer overscale? Will that cut enough off for your purposes?

Technoturnovers commented 1 year ago

Can you use integer overscale? Will that cut enough off for your purposes?

All integer overscale does is always round up when scaling- there are two black bars to either side of the frame horizontally, and there just isn't any way for me to crop that out without manually setting aspect ratio to custom and figuring out the viewport x setting that works, plus manually changing the window size.

Technoturnovers commented 1 year ago

I tried testing it on my one spare RPi, but there was a complication: this thing is only ARM6, which means the arch is armeb as opposed to armhf. I would need to either buy a new Pi, or pull my Pi 4 from KVM duty (which isn't feasible right now). Gonna consider my options, since I really want to see what this looks like at full native performance

EDIT: Turns out that I have an SNES Classic (somehow), so I'm gonna test using that EDIT EDIT: didn't work, it segfaulted and I can't tell why unless I get a compile environment functional, which is difficult because the SNES Classic uses an ancient libc

LibretroAdmin commented 1 year ago

After commit https://github.com/libretro/RetroArch/commit/b2634ea5885b6f09697c4b0d13e8d9c93ca381ea by @LibretroAdmin, attempting to launch the core results in a segmentation fault, with the following backtrace on a debug-enabled build linking the crash to the cheat manager:

Does this crash still happen?