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

Edit NSF export format to allow adding more effects #46

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

nyanpasu64
Copy link
Collaborator

Previously, NSF export wrote command numbers as even bytes, and used them directly as indexes into an array of 2-byte command handler addresses. However we ran out of even bytes in the range of bytes interpreted as commands [$80 .. $E0), meaning there's no unused IDs to use for new effects.

Now, each command number is an arbitrary byte, and the driver multiplies commands by 2 (dropping the high bit), turning them into valid indices into an array of 2-byte command handler addresses. Now we have twice as many slots available for effects/commands. This enables adding more effects into the NSF driver, both effects implemented in the tracker but missing from NSF export, and future effects.

@nyanpasu64 nyanpasu64 marked this pull request as draft March 30, 2021 13:23
Previously, NSF export wrote command numbers as even bytes,
and used them directly as indexes into an array of 2-byte command
handler addresses. However we ran out of even bytes in the range of
bytes interpreted as commands [$80 .. $E0).

Now, each command number is an arbitrary byte,
and the driver multiplies commands by 2 (dropping the high bit),
turning them into valid indices into an array of 2-byte command handler
addresses. Now we have twice as many slots available for
effects/commands.
@nyanpasu64 nyanpasu64 marked this pull request as ready for review April 13, 2021 21:28
@Gumball2415 Gumball2415 merged commit fed5934 into master Apr 17, 2021
@Gumball2415 Gumball2415 deleted the nsf-driver branch June 25, 2021 08:33
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