Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize CPU and hardware registers to post-bootrom values #50

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

diogotito
Copy link
Collaborator

I used the values found at
https://gbdev.io/pandocs/Power_Up_Sequence.html#console-state-after-boot-rom-hand-off.

I also moved these values from the LR35902 constructor to the fpt library crate root module, in a Gameboy method, that is optionally called from fpt-cli by passing --fake-bootrom dmg0 as the first argument in the CLI (maybe this should be the default, instead of fully emulating the bootrom?)

I'm open to other ways of modeling other bootrom values, or going with a simpler approach (maybe it's too early for a struct GameboyConfig in fpt-cli?).

Copy link
Collaborator

@joajfreitas joajfreitas left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Owner

@pineman pineman left a comment

Choose a reason for hiding this comment

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

can we apply this for fpt-egui too please?

@diogotito
Copy link
Collaborator Author

can we apply this for fpt-egui too please?

Done.

The logic is a bit duplicated.
Maybe we could generalize fpt-cli's GameboyOptions into a GameboyBuilder in project fpt, and derive some clap traits on it, but I don't know about adding the clap dependency on fpt.

btw fpt-egui is building with errors, but they should be fixed when overall work on #47 (which this PR complements) finishes.

@diogotito diogotito merged commit 3124b9b into run_test_roms Jun 11, 2024
@diogotito diogotito deleted the run_test_roms__init_hw_regs branch June 11, 2024 17:58
@joajfreitas joajfreitas added the enhancement New feature or request label Aug 22, 2024
@joajfreitas joajfreitas assigned diogotito and unassigned joajfreitas Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants