Skip to content

Libretro fixes - #128

Open
sasq64 wants to merge 3 commits into
libretro:mainfrom
sasq64:fixes
Open

Libretro fixes#128
sasq64 wants to merge 3 commits into
libretro:mainfrom
sasq64:fixes

Conversation

@sasq64

@sasq64 sasq64 commented Sep 4, 2026

Copy link
Copy Markdown

These are claude assisted fixes that I needed to make the libretro build work;

  • Fix: Options was not applied at all.
  • Fix: BootOptions was applied to late to take effect.
  • Fix: hatari_borders had no effect

If you don't accept AI code then just see this PR as documentation.

sasq64 and others added 3 commits September 4, 2026 21:20
retro_init() returned early from the branch that passes --tos to
Main_Init(), so whenever a system directory (and thus a TOS image) was
found — the normal case — Core_ApplyBootOptions() was never reached and
none of the core options had any effect. Turn the early return into an
else branch so both paths fall through to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DXACgnzMXVboN9tWyZuu5F
… after

Core_ApplyBootOptions() used to run in retro_init() after Main_Init() had
already built the machine, so it had to force a reconfigure+cold reset to
make machine/CPU/memory/ROM options take effect. Rename it to
Core_SetBootOptions() and call it from Main_Init() itself, right after the
config file and command line are read but before anything is built from
them, so the machine comes up correctly configured the first time.

Also fix the CoreRetro static library target missing libretro.h include
path, needed now that main.c pulls in retro/options.h.

Generated with Claude Code
Screen_Init() was capping the display at exactly 320x200, the ST
screen's own size, so ConvST_SetSTResolution() never had any border
pixels left to draw and the hatari_borders core option was a no-op.
Raise the cap to the full 416x276 visible area (still below 640x400 so
low res doesn't get doubled, which is the frontend's job).

Also call Screen_ModeChanged() after Core_ApplyRuntimeOptions() applies
the config, so a changed border/monitor/aspect option takes effect
immediately instead of waiting for the emulated program to switch
resolution on its own.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@cscd98

cscd98 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

We are not accepting AI contributions at this time, as this project is trying to get the core merged into hatari upstream but I will look at those fixes. Thanks !

@cscd98

cscd98 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@sasq64 I have gone through the code and made additions/changes where required. Should be on the buildbot in the next few hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants