Skip to content

melonDS changes to teakra #68

Description

@Arisotura

teakra has been retrofitted into melonDS back in 2021, to emulate the DSi's DSP.

I've had to modify teakra to make it work in this context. I was thinking maybe some of the modifications could interest you? If so, I could work out something and make a PR.

Namely:

  1. I added the retd instruction, which is used in aac.a (DSi Sound App ucode). The way I did it is a hack (it executes two instructions before returning -- should be two cycles).
  2. Similarly, commented out an exception in OffsetAddress(), because it was getting hit. The way the function works seems to be correct for this use case.
  3. aac.a kicks DMA by writing to 0x8184, so I had to add support for that.
  4. I added support for driving the BTDMP with an external clock -- on the DSi, it is driven by the I2S clock, not the internal timer.
  5. I also added support for BTDMP input -- on the DSi, it's used for mic input. I don't know if it's used on the 3DS. It seems to function mostly the same as BTDMP output, except the FIFO empty bit is backwards.
  6. I modified teakra to take callbacks to read/write memory, so that it could directly access melonDS's NWRAM blocks. Handling it this way is probably not the most efficient, but it was less likely to cause problems than trying to keep teakra's internal buffer in sync with melonDS's memory.

I've also observed a bug with the graphics ucode's scaling function, which suggests that the AHBM functions differently wrt alignment on the DSi, but I'll need to investigate that one.

That's about it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions