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

SPC-Side Optimization Collection 2 #412

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Oct 31, 2023

  1. Configuration menu
    Copy the full SHA
    14c7231 View commit details
    Browse the repository at this point in the history
  2. Consolidate some noise-related operations

    Six bytes are saved. One is saved by consolidating setting !MusicNoiseChannels
    and $0389 into a Noiz subroutine, but only with !noSFX set to !false. The other
    five are saved by recycling VCMD $F8's code.
    
    !noSFX gets a different saving: namely, by getting rid of a redundant set of
    !MusicNoiseChannels, because VCMD $F8's code does the job instead, and it's
    never skipped since the SFX check naturally does not exist.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    0828395 View commit details
    Browse the repository at this point in the history
  3. Recycle a call for writing to KOFF DSP register in .silent

    By taking advantage of the accumulator and recycling a call to KeyOffVoices
    (though we skip clearing !PlayingVoices), we save two bytes.
    
    This one (and a missed optimization) was also ported to the old unpause silent
    SFX ASM that was kept for historical reasons and also to act as an example.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    8dcbdca View commit details
    Browse the repository at this point in the history
  4. Check for a music tempo tick by sending Y to A

    This does the same thing as checking for a zero in Y. The accumulator is
    overwritten, but we're not really using it afterwards, so we save a byte.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    606566d View commit details
    Browse the repository at this point in the history
  5. Send Y to A prior to SFX priority check

    Y is already zero in the first place, so we save a byte by doing this.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    f2b9019 View commit details
    Browse the repository at this point in the history
  6. Use a word write for writing the pointer to $14 prior to clearing the…

    … echo RAM
    
    This saves four bytes.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    ee00ac6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e5e5e6d View commit details
    Browse the repository at this point in the history
  8. Set the X register and $46 to the 1DFA channel ID for hardcoded SFX

    Set these prior to performing the ID comparisons for ProcessAPU1SFX. Saves ten
    bytes in the process, but they're only saved for the hardcoded 1DFA SFX.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    4de894d View commit details
    Browse the repository at this point in the history
  9. Clear out $48 prior to performing comparisons in ProcessAPU1SFX

    Another three bytes saved by doing this, but again, only for hardcoded 1DFA SFX.
    KungFuFurby committed Oct 31, 2023
    Configuration menu
    Copy the full SHA
    0a9a6c7 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Configuration menu
    Copy the full SHA
    917a04f View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2024

  1. Configuration menu
    Copy the full SHA
    dd2e504 View commit details
    Browse the repository at this point in the history
  2. Check for a SFX tempo tick by sending Y to A

    This does the same thing as checking for a zero in Y. The accumulator is
    overwritten, but we're not really using it afterwards, so we save a byte.
    KungFuFurby committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    8720e27 View commit details
    Browse the repository at this point in the history
  3. For hardcoded jump $1DFA SFX, jump to HandleSFXVoice_handlePitchSlide

    Calling L_09CD then jumping to pitch is already handled by the main SFX
    code, and jumping there saves three bytes for the hardcoded SFX.
    KungFuFurby committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    dc4a82a View commit details
    Browse the repository at this point in the history