silly question: z80 and 68k cycles.

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

silly question: z80 and 68k cycles.

Post by sigflup » Thu Feb 06, 2014 2:28 am

Does accessing the 68K bank from the Z80 take away 68K cycles?

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Thu Feb 06, 2014 2:43 am

Yep. I did some logic analyzer captures a while back to figure out the typical number of wait states on the Z80 side for such an access. I also captured some of the 68K bus signals to better understand what was happening, so I should be able to produce an estimate of the number of cycles lost if you like.

I also suspect that accessing $7F00 region (to access the PSG for instance) also involves requesting the 68K's bus, but I haven't gotten around to testing that yet.

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 2:45 am

THANK YOU SO MUCH FOR YOUR WORK!!

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Thu Feb 06, 2014 6:37 am

Based on a quick look at one of my captures, it looks like something in the neighborhood of 9-11 68K cycles is typical. If you're doing a word-wide access from the Z80 the second byte will typically result in a slightly longer delay on the 68K side. This is not surprising given that the request takes longer on the Z80 side as well.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu Feb 06, 2014 9:16 am

PSG access goes on the 68K bus aswell, so if you are doing DMA avoidance or such on Z80 side and happen to touch PSG you'll be frozen in place.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 9:36 am

wait wait. I'm having a hard time understanding that last statement. dma avoidance on the z80 side? Like detecting a transfer on the z80?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu Feb 06, 2014 9:41 am

When DMA is in progress and Z80 makes a ROM (or PSG or VDP) access it will be frozen until DMA ends. This is also one of the reasons PCM sound sucks in MD games.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 9:43 am

ahh.. thank you

Post Reply