Skip to content

Edit NSF export format to allow adding more effects#46

Merged
Gumball2415 merged 1 commit intomasterfrom
nsf-driver
Apr 17, 2021
Merged

Edit NSF export format to allow adding more effects#46
Gumball2415 merged 1 commit intomasterfrom
nsf-driver

Conversation

@nyanpasu64
Copy link
Copy Markdown
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