-
Notifications
You must be signed in to change notification settings - Fork 159
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
SA-1 DMA won't transfer to bank 0x41 #309
Comments
Do you happen to have a test case? |
Ultimately, finding this came from some custom code for handling dynamic sprites used in Vitor's SA-1 enhancement patch for SMW. You can see an example of the code used here, among a few other spots; Is that sufficient, or were you looking more for a test ROM of some sort? |
A test ROM would always be helpful. The only reference I see to anything 18-bit in the manual is related to the Timer Circuit, in Book 2, Page 1-2-2. On the other hand I do see that DDA is a 24-bit register on Page 1-4-22. So I believe using a |
Sorry, the 18 bit size I was getting was from table 1-9-2 on page 1-9-3. Presumably it says 18 bits because that's the maximum possible size of BW-RAM, even if DDA is 24 bits. |
SA-1 DMA should work for banks $40-$43, it's documented on SA-1 dev book. I
recommend changing the register to 24-bit.
I don't have a test ROM available right now but I can test this in the
nearby future.
Vitor
Em dom., 14 de jan. de 2024, 00:36, Fernap ***@***.***>
escreveu:
… Sorry, the 18 bit size I was getting was from table 1-9-2 on page 1-9-3.
Presumably it says 18 bits because that's the maximum possible size of
BW-RAM, even if DDA is 24 bits.
—
Reply to this email directly, view it on GitHub
<#309 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADBPJYRXUFAYDIX4LGEOL2DYONHCDAVCNFSM6AAAAABBZLPYNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHAZTMMBUGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
DDA was incorrectly capped at 16 bits instead of 24, making DMAs to BWRAM banks 0x41-43 be sent to the corresponding spot in 0x40 instead. See [the corresponding bug in bsnes](bsnes-emu/bsnes#309) for some more context.
Any attempts to use SA-1 side DMA to BWRAM with a destination in bank 0x41 will result in a transfer to the corresponding address at bank 0x40 instead. Changing line 6 in bsnes/sfc/coprocessor/sa1/dma.cpp from a
uint16
to auint24
should fix the problem (the SNES dev manual indicates 18 bits are actually used). This bug was apparently introduced here.Credit to @VitorVilela7 and @TheLX5 for originally diagnosing the problem, and Vitor for tracking down when the regression was introduced.
The text was updated successfully, but these errors were encountered: