Page 1 of 2

Cpu speed test rom (md+scd)

Posted: Sat Feb 16, 2019 10:14 am
by Ti_
screenshot from asian md2 + mega-cd 2. (mega everdrive 1)

Re: Cpu speed test rom (md+scd)

Posted: Sat Feb 16, 2019 10:57 am
by Stef
That's nice how do you measure that ? executing long loop then calculating elapsed time ?

Re: Cpu speed test rom (md+scd)

Posted: Sat Feb 16, 2019 11:04 am
by Ti_
Yes, it's count number of cycles for 1 second, then repeat again.
for gfx processor it's repeats 128x128 conversion in a loop.

Re: Cpu speed test rom (md+scd)

Posted: Sun Feb 17, 2019 5:09 pm
by Sik
Probably explains why the CPU speed got measured a bit too slow (because some cycles are lost to refresh, even the cartridge slot gets a few, while RAM gets a lot more).

Re: Cpu speed test rom (md+scd)

Posted: Mon Feb 18, 2019 10:01 pm
by Chilly Willy
My Genesis 2/CD2/32X
PCB ver 2 NTSC CD2 2.11X U
Main - 7,559,458
Z80 - 3,584,113
Sub - 12,162,088
ASIC - 1,835,008

My Nomad
PCB ver 2
Main - 7,559,462
Z80 - 3,584,112

My CDX
PCB ver 2 BTSC CD2 2.21X U
Main - 7,559,476
Z80 - 3,584,092
Sub - 12,222,928 (more variance in this than my CD2)
ASIC - 1,835,008

It does not work on my CDX. I get a pink screen and nothing at all on it. Maybe something is happening when it goes to test the CD.

EDIT: Works fine on my CDX - the 32X I had plugged into it is getting flakey. Probably needs cleaning... again. Anywho added CDX speeds... which are pretty much the same as the others.

Re: Cpu speed test rom (md+scd)

Posted: Fri Mar 15, 2019 6:53 am
by tryphon
Just out of curiosity, how do you know the loop lasts exactly one second without counting cycles ?

Re: Cpu speed test rom (md+scd)

Posted: Sat Mar 16, 2019 10:56 am
by Sik
I didn't check that code, but I suppose vblank is involved? That's how I did the measurement in 68kbench (check how many times the loop runs for 10 frames). You do need to account for the difference between NTSC and PAL, mind you (as well as the fact that the code will run slower if running from RAM rather than ROM).

Re: Cpu speed test rom (md+scd)

Posted: Sat Mar 16, 2019 12:34 pm
by Ti_
Test goes 1 second, counter - 50 vblanks for PAL, and 60 vblanks for NTSC. Code executed from ROM.
About RAM I did not know, maybe I will do this too.

Re: Cpu speed test rom (md+scd)

Posted: Sun Mar 17, 2019 10:58 am
by tryphon
Sorry for the dumb question, but how is VBlank triggered ? I guess it's an internal clock to the VDP ?

So how is it possible this way measuring a timing problem in the VDP ?

And I guess the CPU is timed the same way. So how do we differentiate a problem with the VDP and a problem with the CPU ?

Sorry for the dumb questions, I have very little knowledge in hardware :oops:

Re: Cpu speed test rom (md+scd)

Posted: Sun Mar 17, 2019 2:38 pm
by Chilly Willy
No, those are very good questions. The engineer in me loves those sorts of questions. The short answer is that detecting problems with the clock rate of the CPU and VDP will be a tough nut to crack. The MD uses a master crystal and divides down all clocks from it, so if one clock is off, they all will probably be as well. Maybe supply an external clock to the TH line on a controller port. Say, a 100Hz signal that you've verified as accurate. Then use that as the timing signal for the program.

If I remember rightly, the MD triggers the vblank on a particular raster line, which varies for NTSC and PAL. That should be in the hardware manual.

Re: Cpu speed test rom (md+scd)

Posted: Sun Mar 17, 2019 8:20 pm
by Sik
Wouldn't the TV barf at the resulting signal if the VDP clock goes off?

And yeah, everything is fed from a single master clock but also they get divided clocks (so things run at different rates) so it's still possible for only one component to have a clock problem if the issue happens between the divider and the component.

Re: Cpu speed test rom (md+scd)

Posted: Sun Mar 17, 2019 8:26 pm
by Ti_
"Ram" version:

Tested - yes, it even more slowly:

Re: Cpu speed test rom (md+scd)

Posted: Sun Mar 17, 2019 8:29 pm
by Chilly Willy
I used to tune Atari XL and C64 oscillators by looking at the color of Pitfall II on the TV, knowing what the colors SHOULD be. :lol:

It gets you close enough without needing an o-scope, but if you have an o-scope, so much the better. From the schematics in the service manuals, the MD video encoder seems to take the osc input from the MD and not a separate crystal, so you should be able to see a color shift if the MD clock was far enough off. Note that this is on old CRT TVs. Digital TVs tend to be immune to things like frequency shifts as long as they don't go too far out of spec.

Re: Cpu speed test rom (md+scd)

Posted: Mon Mar 18, 2019 8:54 pm
by Ti_
Got 7,645 by code executing from a12010-a12013 (scd registers area):
also tested $200000 (sram) and $600000 (scd word-ram) - 7,525 same as rom.

Re: Cpu speed test rom (md+scd)

Posted: Tue Mar 19, 2019 8:35 am
by Stef
Would be nice to have a version showing speed from different area :
ROM / RAM / comm registers... :)