Skip to content

Forward-port ZallaxDev's #140: optional vanilla boot RNG seed (7 locales) - #309

Merged
ZallaxDev merged 8 commits into
ZallaxDev:integrationfrom
mkrieger95:rescue/maintainer-pr140-random-boot-seed
Nov 24, 2026
Merged

ZallaxDev merged 8 commits into
ZallaxDev:integrationfrom
mkrieger95:rescue/maintainer-pr140-random-boot-seed

Conversation

@mkrieger95

@mkrieger95 mkrieger95 commented Nov 21, 2026 •

Copy link
Copy Markdown

Original authorship and why this PR exists

This is @ZallaxDev's original feature from PR #140, not an independent new implementation by me. Original author, design, code and first successful CI: ZallaxDev, original commit 98ce5526. The original #140 was ready for review but fell 457+ commits behind modern integration, developing conflicts as the locale and Options infrastructure changed.

This PR forward-ports the existing feature and its tests, keeping the original implementation and its copyright/credit. Every port commit includes Co-authored-by: ZallaxDev and links the original PR. Please preserve #140's history; if this version merges, reference #140 as the source contribution and close #140 as superseded afterward.

Feature

Find RANDOM BOOT SEED under OPTIONS → GENERAL → SYSTEM. The toggle is localized in all seven supported languages and takes effect on the next cold boot or soft reset.

  • ON (default): preserves the port's clock-based boot and soft-reset seed. A settings file without boot_seed= uses this behavior.
  • OFF: restores vanilla Emerald's zero boot seed. The first OFF selection is saved as boot_seed=0 even when the settings file never contained the key.
  • New games still seed both portable trainer-ID draws from console timing in either mode. Measured scenarios retain their deterministic seed and skip timing-based reseeding.

Validation and acceptance

  • The host RNG regression passed in eight build configurations on bootstrapped production sources. It checks the System row, localized labels, the ON default, the OFF seed, and deterministic scenario behavior.
  • The settings saver fixture passed its normal path and both fault cases, including saving the first OFF selection and reloading it.
  • The strict repository audit passed. Fresh 3DS build CI is tracked in the Checks tab.

Emulator and physical 3DS acceptance are still needed on this revision:

  1. Open OPTIONS → GENERAL → SYSTEM and confirm the toggle appears. With a fresh or existing settings file that lacks the key, it should show ON.
  2. With ON, confirm cold boots and soft resets use timing. The 16-bit seed can repeat by chance.
  3. Switch to OFF, confirm the zero-seed stream after a soft reset, then quit and relaunch to confirm OFF persists.
  4. Check localized label width and the new-game trainer-ID path in both modes.

The original PR #140 remains the source contribution.

mkrieger95 and others added 6 commits November 21, 2026 17:26
Original implementation by @ZallaxDev: ZallaxDev#140 (commit 98ce552).
Forward-port only; seven-language menu compatibility adapted for modern integration.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
Original implementation by @ZallaxDev: ZallaxDev#140 (commit 98ce552).
Forward-port only; seven-language menu compatibility adapted for modern integration.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
Original implementation by @ZallaxDev: ZallaxDev#140 (commit 98ce552).
Forward-port only; seven-language menu compatibility adapted for modern integration.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
Original implementation by @ZallaxDev, ZallaxDev#140.
Original commit: 98ce552
Maintenance forward-port; retains the original author's RNG behavior and credit.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
Original implementation by @ZallaxDev, ZallaxDev#140.
Original commit: 98ce552
Maintenance forward-port; retains the original author's RNG behavior and credit.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
Original implementation by @ZallaxDev, ZallaxDev#140.
Original commit: 98ce552
Maintenance forward-port; retains the original author's RNG behavior and credit.

Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
The original test regex was incorrectly double-escaped during forward-port.
Parse the literal C initializer instead and assert all seven localized labels.
No runtime behavior or ZallaxDev's original RNG implementation changes.

Original implementation: ZallaxDev#140.
Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>

Copy link
Copy Markdown
Author

CI follow-up for the modern #140 forward-port: the initial build-3ds failure was only in my newly adapted seven-locale RNG test (rng_seeding_test.py), not the original gameplay implementation. I accidentally doubled the backslashes in the label-matching regex, producing AssertionError: boot seed option must have localized label. Fixed in e1ce7ec9: parse the literal CTR_TEXT(...) initializer and check all seven language labels. No RNG or game-runtime code changed. New CI run: host tests, both Python audits, and release-version check have passed; full build-3ds is still running at the time of this comment. Physical 3DS boot/reset validation remains outstanding.

@mkrieger95
mkrieger95 marked this pull request as ready for review November 21, 2026 22:47
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-21T22:47:46.873237Z
We couldn’t complete this review. Comment @codex review to try again.
e1ce7ec Draft marked ready
ℹ️ 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

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@ZallaxDev

Copy link
Copy Markdown
Owner

Thanks a lot for the PR, @mkrieger95! We built it and tried it in the emulator. Two things before we can merge:

  1. The RANDOM BOOT SEED row does not show up in OPTIONS. We went through every tab (GENERAL, WORLD, BATTLE, MODES, CHEATS) and it is not there, so the option cannot be turned on from the UI. The rows come from the fixed EXTRA_ROW("key") lists in 3ds_port/src/3ds_bottom_options.inc, and boot_seed is not in any of them. Could you add EXTRA_ROW("boot_seed") to a suitable tab?

  2. Default value. With OFF as the default, every boot and soft reset uses seed 0, so the game becomes deterministic. Today the seed always comes from the clock. Unless the goal is to change the current behaviour, the default should be ON (the current behaviour). If OFF stays the default, please mention it in the CHANGELOG.

Once the row is in, we will test it again (including the soft reset with ON and OFF). Thanks again for the contribution!

Keep clock-based seeding as the default and persist an explicit OFF even when the settings file never had the key. Cover the visible menu row and the first OFF selection in the host fixtures.

Original implementation: ZallaxDev#140.
Co-authored-by: ZallaxDev <86362063+ZallaxDev@users.noreply.github.com>
@mkrieger95

Copy link
Copy Markdown
Author

Thanks for testing this and catching the missing row @ZallaxDev . I added Random Boot Seed under Options → General → System and made it default to ON, so existing installs keep clock-based seeding on boot and soft reset. OFF restores Emerald’s zero seed. I also fixed a settings bug so the first switch to OFF survives a full quit and relaunch.

CI #950⁠ passed all five jobs on c5efdfd. When you retest in the emulator, could you check soft reset in both modes and confirm that OFF persists after relaunch?

@ZallaxDev

Copy link
Copy Markdown
Owner

Thanks a lot, @mkrieger95, for the forward-port and for exposing the setting in OPTIONS > GENERAL > SYSTEM as requested. We checked the new commit in the emulator: the RANDOM BOOT SEED row shows up and the value persists across restarts. Merging now.

@ZallaxDev
ZallaxDev merged commit 0d70ee2 into ZallaxDev:integration Nov 24, 2026
5 checks passed
@mkrieger95
mkrieger95 deleted the rescue/maintainer-pr140-random-boot-seed branch November 24, 2026 16:14
DannyM90 added a commit to DannyM90/emerald-3ds that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PjZs53yVtumpNLmM8AycET

# Conflicts:
#	3ds_port/src/3ds_extras.c
ZallaxDev added a commit that referenced this pull request Nov 25, 2026
- Verify Arreglar verify-randomizer-locales: «Graphic outside ROM» tras
- Size the synthetic ROM in the locale stager test to cover the battle box graphics
- Voxel world: cave look, night fireflies, moonlight and moon shadows, sprite filter, off-screen shadow casters, lighter and faster builds
- Follower and visible wild Pokémon rustle the tall grass they step into
- Verify Verificar en Azahar «HP» y estados de combate en cada idioma (H
- Battle test harness: CTR_BATTLE_TEST_STATUS puts every status on the battlers
- Rebase the locale manifests onto the current tree
- Stage the battle box HP label and status pill tiles for French and Spanish
- Verify Corregir errores gráficos en los bordes durante la animación de
- Remove scratch scripts used to inspect the evolution rays' maps
- Drop the internal path from the scratch crop script; document the tilemap buffer size
- Add scratch scripts used to inspect the evolution rays' maps
- Evolution scene: mirror the rays' maps so the wide screen shows no seams or borders
- Verify Localizar estados alterados y etiqueta «HP» en combate según id
- Italian: stage the battle info box HP label and status pills from the ROM
- Verify Menú de pantalla inferior: volver siempre al mapa al salir de o
- Spend the dock's chosen-screen flag once its game screen opens
- Keep the dock's chosen screen across the game screen closing
- Return the bottom screen to the map on first field entry and after any other screen
- Verify Arreglar botones físicos en pantalla de guardar y menú contextu
- Fix physical buttons on the save screen and the bag's item menu
- Forward-port ZallaxDev's #140: optional vanilla boot RNG seed (7 locales) (#309)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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