Open
Conversation
Special Wave from AddMusicM has been restored! However, the SRCN ID must be initialized first, and a C++-side modification is pending to perform this task automatically.
These are here to avoid BRR overwriting chaose caused by the special wave being more dependent on the SRCN ID, and I accidentally left a security hole in this VCMD in the process of doing so, hence this patch.
The BRR file was copied from AddMusicM incorrectly, accidentally omitting the opening BRR block. This affected how the PWM played, and thus did not make it authentic to AddMusicM.
Due to the presence of a gate at the beginning, there was no need for this opcode at the end of the routine, since it was already there at the beginning.
Turns out there was a misunderstanding about the #AMM sample group: its only purpose is to provide padding so that sample IDs $20 and up are allocated to the custom samples used in an AddMusicM song. Two new sample groups were going to be created via overwriting sample ID $09, but there is a conflict with the bonus end song, a default global song at that, meaning that it would not be feasible to have this done by default. Thus, SPECIALWAVE.brr has been reallocated from sample ID $1D to sample ID $14, with $1D being the starting expected sample ID plus $09, which was the source of the original misinterpretation... as a zero was used.
Due to an optimization made in the master branch to auto-reload $46 to X upon execution of a VCMD ($DA and up), this opcode is redundant, which in turn will save bytes down the road.
15 tasks
The last piece of the puzzle to fully implement the Special Pulse Wave feature is complete. This commit closes #31.
Owner
Author
|
The last thing I have to do is to update the AddmusicM porting notes, because the default sample set used with AddMusicM is not compatible with the Bonus End song with the Special Pulse Wave in its default ID, and thus some updating has to be done. Plus, in hindsight, I have to program the conversions from the AMM special wave commands. |
Sometimes things get way tricker than they're supposed to be when it comes to analyzing what memory locations are supposed to be used where, simply because the way it is specified in the assembly is a bit non-intuitive. Although the final compiled result can't be helped in this fashion, the raw assembly code to compile, on the other hand, can, so that the user can more easily search for what memory locations are used where. This commit is specific to the changes done to the special pulse wave restoration, which used a setp/clrp section.
The addw opcode does factor in the carry at all during its operations, thus this safety opcode is not needed.
…file Because of an incompatibility in the sample ID, this is required. This is also the last piece of the puzzle for a full restoration. This commit closes #31.
In addition to saving a few bytes, this allows less opcodes to be executed per loop. It does require that the initial pointer not be offset by a byte, since it is instead done by the dbnz opcode, which omits the zero offset.
Looks like this code had some room for optimization. I got to take advantage of some of the SPC700's specialties in the opcode department in order to shrink this down. Plus, no more need to use an array.
…ation The sources themselves were added in during the merge commit to avoid HTML table misalignments.
GetCommandData is no longer needed since it is pre-fetched by cmdFA, so we get rid of them.
An oversight in the code meant that SRCN IDs above $3F were reading the incorrect pointers in the sample directory, causing corruption of the samples.
We only need one jmp within a certain radius of code if it goes to the same place.
Now that we're clearing a strip of 16 bytes, we can use a later loop to save some memory.
This is a continuation of b6bef0f .
This is one byte cheaper than using shifting opcodes with regards to setting up the offset to the sample directory.
Courtesy of the relocation of the code for VCMD $FA $10.
Partially cherry picked off of commit e026687 .
…g $016B This does the same thing as checking for a zero in $016B since we already stored there. The accumulator is overwritten, but we're not really using it afterwards, so we save two bytes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This merge request closes #31.
These pull requests, once merged, will require this pull request be updated: