DMA vs mvn/mvp

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
Ramsis
Posts: 341
Joined: Sun Jul 01, 2012 6:44 am
Location: Lion's den :3
Contact:

DMA vs mvn/mvp

Post by Ramsis » Sun Jan 10, 2016 10:48 am

So from what I've read, DMA takes 8 cycles per byte. The mvn/mvp instructions, on the other hand, each take only 7 cycles per byte, assuming the WDC document on the 65816 is correct.

Is this true? Should I refrain from using DMA (at least for memory regions available on the A-bus) altogether, especially when doing large (non-fixed-source) transfers e.g. from ROM to WRAM?
Some of my projects:
Furry RPG!
Unofficial SNES PowerPak firmware
(See my GitHub profile for more)

Optiroc
Posts: 129
Joined: Thu Feb 07, 2013 1:15 am
Location: Sweden

Re: DMA vs mvn/mvp

Post by Optiroc » Sun Jan 10, 2016 11:52 am

That would be 8 master cycles per byte for DMA (ie. 1 cpu cycle at 2.68MHz), while mvn/mvp takes 7 cpu cycles per byte.

User avatar
Ramsis
Posts: 341
Joined: Sun Jul 01, 2012 6:44 am
Location: Lion's den :3
Contact:

Re: DMA vs mvn/mvp

Post by Ramsis » Sun Jan 10, 2016 12:24 pm

Optiroc wrote:That would be 8 master cycles per byte for DMA (ie. 1 cpu cycle at 2.68MHz), while mvn/mvp takes 7 cpu cycles per byte.
Thanks for NOT READING my post at all. :roll:
Some of my projects:
Furry RPG!
Unofficial SNES PowerPak firmware
(See my GitHub profile for more)

User avatar
Memblers
Site Admin
Posts: 3770
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: DMA vs mvn/mvp

Post by Memblers » Sun Jan 10, 2016 12:34 pm

You misunderstood, he's saying 1 CPU cycle is 8 master cycles, which means the mvn/mvp would be 7 CPU cycles x 8 master cycles.. 56 cycles compared to 8 for the DMA.

User avatar
Ramsis
Posts: 341
Joined: Sun Jul 01, 2012 6:44 am
Location: Lion's den :3
Contact:

Re: DMA vs mvn/mvp

Post by Ramsis » Sun Jan 10, 2016 12:50 pm

Memblers wrote:You misunderstood, he's saying 1 CPU cycle is 8 master cycles, which means the mvn/mvp would be 7 CPU cycles x 8 master cycles.. 56 cycles compared to 8 for the DMA.
Aha. Well, okay. Sorry, Optiroc. :lol:

Then again, where can I read more about CPU/master cycles? Up until now, to the best of my knowledge. they were the same ... :| :?:
Some of my projects:
Furry RPG!
Unofficial SNES PowerPak firmware
(See my GitHub profile for more)

Optiroc
Posts: 129
Joined: Thu Feb 07, 2013 1:15 am
Location: Sweden

Re: DMA vs mvn/mvp

Post by Optiroc » Sun Jan 10, 2016 12:55 pm

Ramsis wrote:
Optiroc wrote:That would be 8 master cycles per byte for DMA (ie. 1 cpu cycle at 2.68MHz), while mvn/mvp takes 7 cpu cycles per byte.
Thanks for NOT READING my post at all. :roll:
Sorry for clearing things up! :twisted:

Detailed info on timing: http://wiki.superfamicom.org/snes/show/Timing

User avatar
Memblers
Site Admin
Posts: 3770
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: DMA vs mvn/mvp

Post by Memblers » Sun Jan 10, 2016 1:03 pm

Here are a couple of the docs that I'm aware of:
http://wiki.superfamicom.org/snes/show/Timing
http://folk.uio.no/sigurdkn/snes/timing.txt

When it talks about a "memory access cycle" or similar, that's the same as a CPU cycle. The 6502/65816 pretty much does a memory access, whether a read or a write, on every instruction cycle. Even if it's a dummy access and the results aren't used.

byuu
Posts: 1540
Joined: Mon Mar 27, 2006 5:23 pm
Contact:

Re: DMA vs mvn/mvp

Post by byuu » Sun Jan 10, 2016 2:24 pm

Yeah, unfortunately mvn/mvp are maddeningly slow.

It's really only useful for performing WRAM->WRAM transfers for things like LZSS decompression.

Post Reply