Skip to content

Reduce Amiga handler size with scoped helpers and CDDA formatting - #19

Merged
reinauer merged 2 commits into
mainfrom
reduce-amiga-handler-size
Sep 7, 2026
Merged

Reduce Amiga handler size with scoped helpers and CDDA formatting#19
reinauer merged 2 commits into
mainfrom
reduce-amiga-handler-size

Conversation

@reinauer

@reinauer reinauer commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Release handlers retain unused helpers and pull in the general formatter for generated CDDA metadata. Limit helper visibility by frontend and build CDDB/CD-Text output with bounded string and numeric helpers, preserving the generated contents. Shared field and CD-Text key helpers keep the formatting call sites readable.

The first commit makes the ISO directory helper private, limits unused core utilities to host builds with matching header declarations, and retains OS4 vector exports while omitting OS4-only wrappers from OS3. The second replaces CDDA printf formatting and checks the complete generated CDDB and CD-Text files in the existing tests.

Measured stripped artifact sizes against 441d765, using fresh source/build directories and identical version/date metadata:

Artifact Before After Bytes saved
OS3 68000 handler 89,992 84,044 5,948
OS3 68020 handler 86,848 81,144 5,704
OS4 handler 139,252 133,924 5,328
OS4 Kickstart module 141,732 137,100 4,632
ROM profile 31,860 31,860 0

Validation: all 112 host unit tests passed; fresh OS3 68000, OS3 68020, OS4 executable/Kickstart, and ROM builds passed. Measurements used m68k GCC 13.4.0b (20260811114005) and PPC GCC 8.4.0 with release settings and debug logging disabled. The ROM remains byte-for-byte identical: it excludes CDDA and already removes unused code through LTO. Amiga runtime behavior was not tested.

Limit host-only core utilities to non-Amiga builds and keep their
public declarations consistent with those guards. Make the ISO
directory stub private, retain external linkage for OS4 vector
operations, and omit OS4-only wrappers from the classic handler.

This lets release builds drop unused code without removing any
operations used by the current OS3 or OS4 frontends.
Replace printf-based CDDB and CD-Text formatting with bounded string,
decimal and hexadecimal append helpers. Share numeric key/value lines
and CD-Text keys so the output structure remains readable without
repeating block and track prefixes at each call site.

Keep the generated metadata unchanged and check the complete CDDB and
CD-Text output in the existing unit tests. Removing the CDDA formatter
dependency reduces the size of release handlers.
@reinauer
reinauer merged commit 2680bb8 into main Sep 7, 2026
2 checks passed
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