libretro / libretro-atari800

atari800 3.1.0 for libretro/libco WIP
17 stars 45 forks source link

core stopped working on xbox one #85

Closed greenchili2 closed 1 year ago

greenchili2 commented 1 year ago

This core stopped working on the xbox one. What is really odd is that older versions of this core stopped working as well. Which cause me to suspect Microsoft changed something with a system update.

I had someone I know with an xbox one Dev account to manually edit the .atari800.cfg file to point to where he had his Atari BIOS files located. He then copied the ".atari800.cfg" file over to the retroarch "root" folder . When doing that the core works fine.

Which makes me conclude that Microsoft changed the rights in such a way that the Atari800 core cannot create the .atari800.cfg file in the retroarch "root" folder. I suspect this issue affects the Android builds? Which some people reported as non-working?

The solution is real simple. Modify the code so that the ".atari800.cfg" file is store somewhere more reasonable. Like the retroarch "System\a800" folder or even the retroarch "config\a800 folder" which the user actually has read/write access to.

greenchili2 commented 1 year ago

I was able to set-up a compile environment for Retroarch Atari800 on the Xbox one / Series S & X. And after some experimentation I was able to determine that the actual cause of Atari800 crashing on start was happening in the subroutine SYSROM_FindInDir. This subroutine uses the "fopen" command to determine if a directory entry is a file or a directory.

Well apparently UWP (Xbox One) does not like this and it was causing retroarch to crash. I modified the code to use the STAT ommand based on HAVE_STAT being defined. If HAVE_STAT is not defined it just used the "fopen" command. I also had to put in checks for current directory '.' and previous directory '..' entries. This seems to have fixed the issue and atari800 is able to scan for the ROM files in the retroarch SYSTEM folder properly and not crash.

I could submit a pull request if needed. Let me know.