Skip to content

Add host-quit, which closes Amiberry - #22

Merged
midwan merged 1 commit into
masterfrom
feat/host-quit
Oct 26, 2026
Merged

midwan merged 1 commit into
masterfrom
feat/host-quit

Conversation

@midwan

@midwan midwan commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Changes proposed in this pull request:

  • New tool host-quit: it closes Amiberry, as quitting from its menu does. It calls uaelib's ExitEmu (trap 13) through uae.resource, then waits for Amiberry to close; Ctrl-C returns. It replaces the third-party AmiQuit that Amiberry's WHDLoad booter runs when a game exits; a follow-up Amiberry PR switches the booter over.
  • Built to run on every machine the booter starts, Kickstart 1.3 and the 68000 included:
    • It's plain 68000 code with no C runtime (-nostartfiles -nostdlib -ffreestanding). On a 68000, libnix does 32-bit arithmetic through utility.library, which Kickstart 1.3 doesn't have; a libnix build failed there with "utility.library failed to load".
    • It has its own entry point, kept first with -fno-toplevel-reorder. It takes the AmigaDOS arguments from A0 and D0, and prints with Output()/Write(), which Kickstart 1.2 has.
  • Same conventions as the other tools: ? help, exit code 10 for an unexpected argument, 2 without uae.resource. It doesn't need Native Code, because only the host-command traps (88-95) do.
  • Registered everywhere tools are listed:
    • Makefile, installer (P_InstallCommandTool) and .gitignore;
    • the package layout test (binary, $VER and guide entry);
    • the AmigaGuide node and tool counts, the README and the wiki pages (now 12 commands, 7 on Windows);
    • the changelog.

Verified:

  • Emulator runs: Amiberry, headless, booting a host folder whose S/Startup-Sequence runs DH0:C/host-quit.
    • A500 with Kickstart 1.3 (68000): Amiberry exits with code 0 after 7 s.
    • A1200 with Kickstart 3.1: exits after 2 s.
    • host-quit ? prints the help and returns 0; host-quit extra prints "Unexpected argument" and returns 10.
  • Disassembly: the first instruction is the entry point, and there are no 68020 instructions.
  • CI image (sacredbanana/amiga-compiler:m68k-amigaos): make all and make test-package pass. make test-unit fails in host-env's "temp directory should be removed" on unmodified master too, in this local Docker setup.

@midwan

Amiberry's WHDLoad booter ran the third-party AmiQuit when a game exits;
host-quit replaces it with our own. It calls uaelib's ExitEmu through
uae.resource and waits for Amiberry to close.

The booter runs it on every machine, Kickstart 1.3 and the 68000
included, so it is plain 68000 code built without the C runtime: libnix
needs utility.library for 32-bit arithmetic on a 68000, and Kickstart 1.3
has none. It has its own entry point, takes the AmigaDOS arguments from
the registers and prints through dos.library calls Kickstart 1.2 has.
@midwan

midwan commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T20:45:42.669735Z 92a5c33 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 92a5c33404

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@midwan
midwan merged commit 90bda51 into master Oct 26, 2026
2 checks passed
@midwan
midwan deleted the feat/host-quit branch October 26, 2026 20:56
@midwan midwan mentioned this pull request Oct 26, 2026
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.

1 participant