Craig
819c2f7fb2
Merge pull request #146 from sunlollyking/libretro-fpu-before-first-frame
...
libretro: set up the FPU before the first frame
2026-11-06 15:32:42 +00:00
Craig
8f9c539c54
Merge pull request #145 from sunlollyking/libretro-file-open-std-streams
...
libretro: open stdout and stderr as the streams
2026-11-06 15:32:29 +00:00
Chris
13b89304b2
libretro: set up the FPU before the first frame
...
save_fpu() and restore_fpu() call the FPU emulation through function
pointers that fpu_reset() only sets up when the first m68k_go() resets
the CPU. A frontend may ask for the state size, or save or load a state,
before the first retro_run() - Kodi does when a game starts - and the
core crashed calling a null pointer.
2026-11-05 08:24:25 +00:00
Chris
56c83f9d22
libretro: open stdout and stderr as the streams
...
File_Open() opened "stdout" and "stderr" as files in the current
directory. Log_Init() opens both by default, so where that directory
isn't writable (Kodi on LibreELEC runs in /) logging failed to start,
Main_ErrorExit() set bQuitProgram and the core never ran a frame.
Return the standard streams for the special names as src/file.c does,
and don't close them in File_Close().
2026-11-05 08:24:25 +00:00
WizzardSK
25f488b166
libretro: poll the frontend's input once per frame
2026-11-04 18:22:06 +00:00
WizzardSK
6edf374011
libretro: option to disable the virtual keyboard
...
A core option Virtual Keyboard (enabled by default) turns the on-screen
keyboard off altogether, for when a real keyboard is used; it replaces
the Disabled choice of Virtual Keyboard Button.
2026-11-04 18:22:06 +00:00
WizzardSK
3dcfee6fd7
libretro: virtual keyboard, from the hatari2014 core
2026-11-04 18:22:03 +00:00
WizzardSK
fac13aeeb8
libretro: drive LEDs and floppy drive sound, from the hatari2014 core
2026-11-04 18:15:06 +00:00
WizzardSK
a7413b2b32
libretro: carry out RetroArch's reset on the CPU too
...
retro_reset() reset the devices and asked the CPU to reset, but the next
retro_run() set quit_program to 0 before m68k_run(), dropping the
request: only m68k_go() carries a reset out. The CPU went on with the
code from before on devices reset under it - the machine did not
restart, and the mouse no longer moved (the reset had also cleared the
interrupt that sends the IKBD's mouse packets).
retro_run() now enters m68k_go() when a reset is pending, as it already
does after a CPU setting changed. m68k_go() always clears the memory on
entry, so retro_reset() asks for a cold reset, which is what it gets.
2026-11-04 16:55:52 +00:00
Craig Carnell
26d481f721
Prevent locale changes in retro core as may lead to erroneous cfg values
2026-11-04 16:55:33 +00:00
Craig Carnell
2d5d9c7259
Keep inside bounds for retro core
2026-11-04 16:55:06 +00:00
Craig Carnell
d1379dde93
Fix device-prefixed paths on retro core for PS Vita
2026-11-04 16:51:59 +00:00
Craig Carnell
64446b8ed7
Set sHatariHomeDir to retroarch\saves directory for retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
37838000ea
Delay av info updates until game loaded on retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
c49d39db33
Add working libretro CI
2026-11-04 16:39:10 +00:00
Craig Carnell
b6b80da91e
Set custom hatari_libretro build and linking for optional deps for retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
99469b4b96
Disable unused dependencies on retro builds
2026-11-04 16:39:10 +00:00
Craig Carnell
de67d3e656
Fix retro build on PS Vita
2026-11-04 16:39:10 +00:00
Craig Carnell
d89eeb1dc6
Fix retro build on mingw
2026-11-04 16:39:10 +00:00
Craig Carnell
7c3aa11236
Fix retro build on 32-bit android
2026-11-04 16:39:10 +00:00
Craig Carnell
bf57f2f1f7
Fix build on OSX/iOS for retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
2ff59f9113
Add optional build depencies to retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
179c5df8ec
Add static builds to retro core
2026-11-04 16:39:10 +00:00
Craig Carnell
971f99d99c
Link in libretro.h from libretro-common includes
2026-11-04 16:25:25 +00:00
Craig Carnell
7f5e17a27c
Add libretro github workflows
2026-11-04 14:49:42 +00:00
Craig Carnell
2e3857767a
Add github issue template
2026-11-04 14:49:30 +00:00
Craig Carnell
202c99963f
Add libretro.h from libretro-common
2026-11-04 14:49:20 +00:00
Thomas Huth
c453b85f81
Remove old unzip.c code (it's not used anymore)
2026-11-01 18:15:44 +01:00
Thomas Huth
0506a8b0ab
Replace functions from file.c with the VFS file functions for libretro
2026-11-01 18:15:44 +01:00
Thomas Huth
60288c1ea7
Check whether libretro.h supports the v4 retro_vfs_stat_64_t interface
...
Disable the corresponding code if it's not available, so we can
finally enable the vfs.c code in the normal build, too.
2026-11-01 17:37:47 +01:00
Thomas Huth
3bbde0b20d
Use HAVE_FTELLO and HAVE_FSEEKO in the vfs code
2026-11-01 17:37:47 +01:00
Craig Carnell
f8e2fafa79
Add VFS support to retro core
...
[Modified by Thomas: Dropped changes to file.c for now, will be added
later in a different way]
2026-11-01 17:37:47 +01:00
Thomas Huth
d90f886450
Move filename related functions into a separate file
...
file.c is a mixture between filename handling functions and file access
functions. We want to keep using the filename related functions for libretro,
but switch to different file access functions there. To make this possible,
split the filename handling functions into a separate file first.
2026-11-01 17:36:12 +01:00
Thomas Huth
84d56f5c5e
Don't build the emulator files in case only tools should be built
2026-11-01 11:15:22 +01:00
Thomas Huth
39d894e21f
Don't build the debugger files twice
2026-11-01 11:09:32 +01:00
Thomas Huth
efb1741a49
Add ENABLE_HATARI option to disable building main binary
2026-11-01 10:36:19 +01:00
Thomas Huth
0e9eaea6e3
Add option to build without tools
...
Based on a patch from Craig Carnell
2026-11-01 09:48:00 +01:00
Thomas Huth
59e53cb718
Use option() instead of set() for build options
2026-11-01 09:43:58 +01:00
Thomas Huth
2496cad3b7
Use cmake_dependent_option() to define options that depend on a variable
...
It's shorter this way and we don't have to repeat the help text
2026-11-01 09:40:52 +01:00
Thomas Huth
2223fd5c01
Add UTIME/SYS_UTIME checks
...
Some systems might have neither of this header, and in this case
we cannot use utime(). Thanks to Craig Carnell for the hint!
2026-10-31 09:12:05 +01:00
Thomas Huth
7a9bee6766
Replace hard-coded PATH_MAX file name array with dynamic allocation
...
PATH_MAX is not available on some systems, so it should not be used.
Since we know the length of the file name here, we can replace it
easily with a dynamic allocation.
2026-10-31 08:58:53 +01:00
Thomas Huth
23bc3060eb
Add missing include <stdarg.h> for va_list
2026-10-25 11:12:39 +01:00
Thomas Huth
d649c3e631
Always test retro_run() in the test
...
Now that the retro_init() function switches to fake-TOS mode in case the
tos.img cannot be found, we can always run the retro_run() function now.
2026-10-25 09:55:48 +01:00
Thomas Huth
8b95c5148c
Extend test code with env callbacks that have been added recently
2026-10-25 09:55:48 +01:00
Thomas Huth
5fc7ff8e53
Add logging to retroarch log for the core
2026-10-25 09:55:48 +01:00
Thomas Huth
01c50229b5
Add bios missing message to retro core
...
... and avoid crashing in that case by setting bUseTos to false.
Retro_LogFrontend() code has been taken from a patch from Craig Carnell.
2026-10-25 08:43:01 +01:00
Craig Carnell
d355dc5502
Apply boot time options correctly on different platforms on retro core
...
(Changes by Thomas: Define a Main_ApplyStartupOptions() function in both,
SDL code and libretro code, instead of using ifdefs)
2026-10-25 08:43:01 +01:00
Thomas Huth
8f475ba277
Remove the superfluous video_refresh_cb at the end of retro_run()
...
It's done from the code in screen.c already - doing it here again
is only slowing things down!
2026-10-24 09:10:31 +02:00
Thomas Huth
5bb8cda09b
Add screen refresh rate updates to retro core
...
Based on a patch by Craig Carnell
2026-10-24 08:57:29 +02:00
Craig Carnell
56524ef6a5
Add hard disk and m3u support to retro core
2026-10-24 08:26:01 +02:00