Skip to content

Add RP9 package support#2186

Open
midwan wants to merge 8 commits into
masterfrom
rp9-support
Open

Add RP9 package support#2186
midwan wants to merge 8 commits into
masterfrom
rp9-support

Conversation

@midwan

@midwan midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a namespace-aware RP9 manifest parser and hardened ZIP package extractor
  • apply RP9 machine, ROM, RAM, peripheral, video, clip, boot, and media settings without WHDBooter metadata
  • support RP9 from positional CLI arguments, --autoload, Quickstart, Play, drag-and-drop, Android, and libretro
  • handle embedded and external floppy, hard-disk, CD, tape, snapshot, shared-data, and boot media
  • register .rp9 and application/vnd.cloanto.rp9 across Linux/FreeBSD/Flatpak, macOS, iOS, Windows, and Android packages
  • add focused parser, Play detection, and cross-platform file-association tests

Why

RP9 packages contain both media and the complete machine configuration required to run them. Treating them like WHDLoad archives would incorrectly depend on WHDBooter JSON and lose the configuration encoded by the package.

The implementation follows the current RetroPlatform manifest, external-content, media-priority, shared-data, and SuperHires/interlaced clipping conventions. Archive extraction also rejects traversal, filesystem collisions, non-portable names, excessive entries, and oversized expansion.

Validation

  • parsed all 248 supplied Amiga Forever packages: 229 runnable packages accepted and 19 gallery/video-only packages rejected as non-emulation content, with no unexpected results
  • manually launched floppy, multidisk, embedded HDF, deploy HDF, CD32, and CDTV samples, including Asteroids, Gravitoids, Team 17 Development System, Nippon Safes, and Flight of the Amazon Queen
  • visually verified RP9 clipping with the full top-left content visible
  • macOS CMake build and generated bundle/codesign verification
  • Android testDebugUnitTest and ARM64 native build
  • full libretro build
  • tests/test_rp9_manifest.sh
  • tests/test_rp9_file_associations.sh
  • tests/test_play_content_detection.sh
  • tests/test_play_start_logic.sh
  • tests/test_play_use_content_logic.sh
  • git diff --check

References

@midwan
midwan marked this pull request as ready for review July 17, 2026 14:00
@midwan midwan self-assigned this Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c0e08fe0b

ℹ️ 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".

Comment thread src/osdep/amiberry_rp9.cpp
Comment thread src/osdep/amiberry_rp9.cpp Outdated
Comment thread src/osdep/amiberry_rp9.cpp Outdated
Persist deployed media and reuse it on later launches.

Reserve DF0 for ADF boot media and honor explicit A500/A2000 Kickstart versions.
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 070e8ddcef

ℹ️ 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".

Comment thread src/osdep/amiberry_rp9.cpp Outdated
Comment thread src/osdep/amiberry_rp9.cpp
Comment thread src/osdep/imgui/quickstart.cpp Outdated
Reset package-owned configuration and media when Quickstart ejects an RP9.
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1dbf61e03

ℹ️ 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".

Comment thread src/osdep/amiberry_rp9.cpp Outdated
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f60d0d068

ℹ️ 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".

Comment thread libretro/libretro.cpp Outdated
Create an exclusive per-load directory before writing frontend-provided WHDLoad or RP9 data. Track and remove only artifacts owned by that load so name collisions cannot overwrite or delete existing save files.
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41d2d681ad

ℹ️ 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".

Comment thread src/osdep/amiberry_rp9.cpp Outdated
Comment thread src/osdep/amiberry.cpp
Comment thread src/osdep/imgui/quickstart.cpp
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e2415881f

ℹ️ 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".

Comment thread src/cfgfile.cpp Outdated
Comment thread src/osdep/amiberry_rp9.cpp
@midwan

midwan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b060a6759

ℹ️ 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".

Comment thread src/osdep/amiberry_rp9.cpp Outdated
Comment on lines +601 to +602
if (root == "absolute" || root == "external")
return path.is_absolute() && std::filesystem::exists(path, error) ? path : std::filesystem::path {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject package-supplied absolute host paths

When an untrusted RP9 declares an absolute or external hard-drive path such as <harddrive root="absolute">/home/user</harddrive>, this branch accepts any existing host directory; add_harddrive() then mounts it read-write because readonly defaults to false. Guest code included in the same package can consequently modify or delete arbitrary user files, so external roots should require explicit user approval or be rejected/read-only.

Useful? React with 👍 / 👎.

Comment thread src/osdep/amiberry_rp9.cpp Outdated
Comment on lines +1006 to +1007
} else {
write_log(_T("RP9: additional CD available in extracted package: %s\n"), path_string.c_str());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep additional packaged CDs available for swapping

When an RP9 contains multiple <cd> entries, only the first is attached; every later image is merely logged and is not retained in another slot, the CD MRU list, or another swap structure. Multi-disc packages therefore have no usable path to select disc 2 from the package during emulation, unlike extra floppies which are preserved in dfxlist.

Useful? React with 👍 / 👎.

Reject package-controlled external host paths to prevent untrusted media from mounting writable user directories. Publish packaged CDs only after successful validation, preserving their priority order for swapping.
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