Respectfully, this description is no better than any of the existing documentation. :\ Which is it?

a) B0->$21xx B0->$21xx (e.g. byte 0 of source written to $21xx, followed by byte 0 of source written to $21xx)b) B0->$21xx B1->$21xx (e.g. byte 0 of source written to $21xx, followed by byte 1 of source written to $21xx)

The latter.

Quote:

Two writes to a single MMIO register still technically is "transferring" two bytes of data.

Sure, but given that there is literally no register that requires/expects you to always write the same value to it twice at a time (versus several registers that are 16-bit write-twice), I think it's pretty obvious that "2 bytes" in Nintendo's docs means the same thing for that mode that it does for every other multiple-byte mode, w/r/t reading data from the source address.

The misinformation about %010 being the same as %000 probably just stemmed from people only testing it with regular DMA, where it is functionally identical since you're measuring the source data size in bytes instead of scanlines.

Sure, but given that there is literally no register that requires/expects you to always write the same value to it twice at a time (versus several registers that are 16-bit write-twice), I think it's pretty obvious that "2 bytes" in Nintendo's docs means the same thing for that mode that it does for every other multiple-byte mode, w/r/t reading data from the source address.

The misinformation about %010 being the same as %000 probably just stemmed from people only testing it with regular DMA, where it is functionally identical since you're measuring the source data size in bytes instead of scanlines.

Could I ask for you to expand on this, particularly the 2nd paragraph? I don't see how in general DMA mode %010 is identical to %000. Sorry if I sound like a broken record, but B0->$21xx and B0->$21xx B1->$21xx are most certainly not the same.

With HDMA, it matters because it changes the number of bytes that are transferred per scanline (from 1 byte to 2). With regular DMA, $43x5/43x6 measure the total transfer size in bytes regardless of which transfer mode you use, so those two modes end up doing basically the same thing. That's why I think some early documentation had that mistake, just because the difference isn't apparent unless you're using one of them with HDMA instead of regular DMA.

I used the bsnes debugger and stepped through my NMI, turns out it had to deal with how I had my REP's & SEP's placed near the beginning and end of my NMI. I made it so when the NMI starts (before pushing everything) that I set A,X,Y to 8-bits. Then, at the end of the NMI (before pulling everything) I make sure to set A,X,Y to 8-bits again, then when I watch the stack address during pulling, it matched the address it was before the pushing, resulting in going back to my reset vector infinite loop.

I also recommend http://oxyron.de/html/opcodes816.html as a quick cheat sheet, especially if you're already familiar with the original 6502 instructions. It lists all opcodes in a table along with their addressing mode and cycle count, plus notes about which flags they affect, etc.

Said manual is easy to understand and goes over all the addressing modes. There is also an opcode breakdown in Chapter 13 that makes it easier to remember what opcode supports what addressing mode.

In short: yes, there are 24-bit long indexed addressing modes, and yes you can use them to access anything in the entire 24-bit address space of the 65816. But I'm not going to go into the rest because I'm going to make you get the manual and read it. :-) Make sure you understand the B register (bank; sometimes called DB (data bank)) as well (relates to 16-bit addressing). Don't confuse this with the upper vs. lower bytes of the 16-bit accumulator (which are often called "A" and "B", hence xba opcode).

Next, be aware that different assemblers use different syntax for long addressing. Refer to your assembler documentation for how. And most use [] (brackets, not parenthesis!) for indirect long addressing, but again, it depends on the assembler.

Finally, if you're using WLA DX, you may need to get familiar with using the .b and .w and .l suffixes on opcodes, ex. lda.b vs. lda.w vs. lda.l, to tell the assembler what addressing mode / "operand length" you want to use (8-bit vs. 16-bit vs. 24-bit). You can also put those suffixes on the end of the operand, but that tends to look incredibly gross/ugly. There's docs on that here and here (look up .8bit, .16bit, .24bit in Section 2, and ESPECIALLY see Section 14.5). Sometimes it can figure it out on its own, other times it cannot -- and when it can't, or picks the wrong one, you'll need assembly listings to figure it out (or step through the code in a debugger and see that it's using the wrong opcode/addressing mode).

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum