Skip to content

Add load options for PRG and CHR banks#28

Merged
CBongo merged 1 commit intokylewlacy:mainfrom
CBongo:main
Jun 14, 2025
Merged

Add load options for PRG and CHR banks#28
CBongo merged 1 commit intokylewlacy:mainfrom
CBongo:main

Conversation

@CBongo
Copy link
Collaborator

@CBongo CBongo commented Jun 8, 2025

The primary feature of this commit is to add load options for PRG and CHR banks. Selecting the Options button in the load dialog will show (if appropriate for the mapper) choices for the base address of each PRG bank, and a choice of how to handle CHR banks.

There is a fair bit of refactoring going here to support this, as well as preparing for more generalized mapper support in the future. In particular, there has been some shuffling of code between the NesRom, GhidraNesLoader, and NesMapper classes to better align them with their logical responsibilities. The separate classes for UxROM and MMC4 have been rendered moot as a result, so they have been removed.

I've also started adding more informational messages that will appear in the log window when loading a ROM.

Oh, and just for fun, I also updated the README.md with instructions on how to adjust fallthrough when mappers swap banks out from under you. I didn't have a chance to add screenshots yet, though.

@kylewlacy As this is a bit more significant of a change, I was hoping you'd chime in if you have thoughts on whether this approach seems reasonable.

The primary feature of this commit is to add load options for PRG and
CHR banks.  Selecting the Options button in the load dialog will
show (if appropriate for the mapper) choices for the base address
of each PRG bank, and a choice of how to handle CHR banks.

There is a fair bit of refactoring going here to support this, as well
as preparing for more generalized mapper support in the future.  In
particular, there has been some shuffling of code between the NesRom,
GhidraNesLoader, and NesMapper classes to better align them with their
logical responsibilities.  The separate classes for UxROM and MMC4
have been rendered moot as a result, so they have been removed.

I've also started adding more informational messages that will appear
in the log window when loading a ROM.
@CBongo CBongo requested a review from kylewlacy June 8, 2025 22:45
Copy link
Owner

@kylewlacy kylewlacy left a comment

Choose a reason for hiding this comment

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

LGTM!

Awesome to see that several custom classes just fully deleted while still adding more mappers! To me that's the clearest sign that this is the right direction to go. Love to see the extra debug output too

(Feel free to merge whenever, I only held off because I saw some TODO comments so I wasn't sure if you were planning on pushing more changes before merging or if those were for future follow-ups)

@CBongo CBongo merged commit 0ef9a8f into kylewlacy:main Jun 14, 2025
10 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.

2 participants