Skip to content

pack_android: rewrite frame rate variants with --xmod for modded modules - #635

Open
catmona wants to merge 1 commit into
igawa6:dev-0.1.8from
catmona:variant-xmod
Open

catmona wants to merge 1 commit into
igawa6:dev-0.1.8from
catmona:variant-xmod

Conversation

@catmona

@catmona catmona commented Nov 25, 2026

Copy link
Copy Markdown

A code mod that branches from main into its own module crashes as soon as a frame rate variant is picked. Examples are ACNH QoL Enhancements (151 b/bl from main into subsdk6) and the cross-module mods the xmod support was written for. Game owned works.

Cause.

  • rewrite() passes --xmod <layout> for each module in xmod_files, and keys the pack with xmod_keys.
  • rewrite_variants() does neither, so <variant>/<m>.xmod.tsv is never written.
  • When DM_PATCH_VARIANT is set, loader.c xmod_apply reads the table from the variant folder. It finds nothing, so the far branches keep their console distance and jump into unmapped memory.

Change.

  • rewrite_variants() takes xmod and is passed xmod_files by the call next to rewrite().
  • For a module in xmod, it adds --xmod and keys the variant as xmod_keys([key], ...)[0] + ' variant=<v>'. Packs built before this change are rebuilt once.
  • It removes a stale <variant>/<m>.xmod.tsv before rewriting.

Tested.

  • test_pack_android_variants (18), test_pack_android_mods (8) and test_xmod (12) pass.
  • test_android_frame_rate_games has 1 failure (the EA Sports FC 27 caps), the same with or without this change.
  • ACNH 3.0.3 with QoL Enhancements, variant 60, on the PC: the rewrite with --xmod passes. Its main.xmod.tsv is identical to the base table (151 rows), and its changed/cuts files are identical to what the phone built.
  • On an AYN Thor, with that table in the pack's 60/, the log shows "main: variant 60" and "xmod: main 151 branches into subsdk6". The game runs at the 60 fps cap (59.5 fps on the title screen) with no crash. Without the table, it crashes at start.

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