TASEmulators / freej2me-plus

A free J2ME emulator with libretro, awt and sdl2 frontends.
https://tasemulators.github.io/freej2me-plus/
Other
8 stars 2 forks source link

Commit 9bd3628ca broke libretro core on Windows #25

Closed raidenii closed 1 week ago

raidenii commented 2 weeks ago

Hi,

It appears that commit 9bd3628ca broke the libretro core on Windows - loading any game through RA gives the error in log:

[INFO] [Video]: Set video size to: 1920x1920.
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[INFO] [Vulkan]: Found vulkan context: "vk_w".
[INFO] [Vulkan]: Detecting screen resolution: 3840x2160.
[INFO] [Vulkan]: Found GPU at index 0: "NVIDIA GeForce RTX 3070".
[INFO] [Vulkan]: Using GPU index 0.
[INFO] [Vulkan]: Using fences for WSI acquire.
[INFO] [Vulkan]: Using GPU: "NVIDIA GeForce RTX 3070".
[INFO] [Vulkan]: Queue family 0 supports 16 sub-queues.
[INFO] [Vulkan]: Got 3 swapchain images.
[INFO] [Vulkan]: Using resolution 1920x1920.
[INFO] [Vulkan]: Using BGRA8888 format.
[INFO] [Vulkan]: Loading stock shader.
[INFO] [Joypad]: Found joypad driver: "dinput".
[INFO] [Video]: Found display server: "win32".
[INFO] [XAudio2]: Requesting 64 ms latency, using 64 ms latency.
[INFO] [Audio]: Started synchronous audio driver.
[INFO] [Microphone]: Initialized microphone driver.
[INFO] [Display]: Found display driver: "vulkan".
[INFO] [Playlist]: Loading favorites file: "D:\RetroArch\content_favorites.lpl".
Java app is not running anymore! Last known PID=

after and then RA crashed.

raidenii commented 2 weeks ago

It appears the breaking line is this:

https://github.com/TASEmulators/freej2me-plus/commit/9bd3628ca9faaebcc054c7e55fb9a80befd30bdb#diff-b06a407aeb725fad325d297dd21d4f725dbbb5b25c8825b53a5e3bb0535af5a6L1124

Reverting it back to NULL allows the core to load properly. With that being said, the freej2me_system folder gets created in the root folder of Retroarch config, which is not quite what we want.

raidenii commented 2 weeks ago

It turns out that I am using relative path in Windows RA's playlist and the issue happens. On Linux side the playlist is absolute path, so the issue is not happening there.

I implemented a naive way to detect the path and either use it as is, or get the current workdir and attach that to the relative path, which works on Windows but not quite well on Linux (Linux RA seems have to use absolute path anyway).

Submitting a PR for this. This PR also contains a patch to create a subdir for saves - currently, on Linux, the saves were created in a subfolder called saves. in RA root config folder, which is less than ideal. This will create a subdir freej2me in RA's saves folder so the behaviors are the same on both Windows and Linux.

https://github.com/TASEmulators/freej2me-plus/pull/27

Tested the new core with those changes works as expected on both Windows and Linux.