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

Default to the ramcontroller that matches the current ROM #47

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bmclarnon
Copy link
Contributor

Each ramcontroller may provide a Lua pattern to match against the ROMs name (as provided by gameinfo.getromname()); the ramcontroller with the first matching pattern is used as the default.

The pattern is specified by a comment rather than a function or global variable since (a) it's slow to run all of the ramcontrollers on startup, and (b) the ramcontrollers may modify global state. A comment is also trivially backwards-compatible with any existing third-party ramcontrollers.

Each ramcontroller may provide a Lua pattern to match against the ROMs name (as provided by gameinfo.getromname()); the ramcontroller with the first matching pattern is used as the default.

The pattern is specified by a comment rather than a function or global variable since (a) it's slow to run all of the ramcontrollers on startup, and (b) the ramcontrollers may modify global state. A comment is also trivially backwards-compatible with any existing third-party ramcontrollers.
@bmclarnon
Copy link
Contributor Author

I opted not to hide non-matching ramcontrollers in case the matching fails for some reason (e.g., the 'OoTR' game name changes) or a different ROM is loaded after the lua script has been started.

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