MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Speeding up CPS3 flash upgrade
#315701 - 10/11/13 02:30 PM


Hi,

I'm trying to modify MAME to get the flashing process of upgrading a CD in CPS3 to be much quicker than it is now.

The flash memories used by the game (in intelfsh.c) have a write delay of mseconds. I couldn't find anything in this file to speed it up. I also searched in sh2comn.c with no luck. Maybe I missed something. Can someone help?



Naoki
Reged: 11/10/09
Posts: 1998
Loc: United Kingdom
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#315707 - 10/11/13 05:13 PM


> Hi,
>
> I'm trying to modify MAME to get the flashing process of upgrading a CD in CPS3 to be
> much quicker than it is now.
>
> The flash memories used by the game (in intelfsh.c) have a write delay of mseconds. I
> couldn't find anything in this file to speed it up. I also searched in sh2comn.c with
> no luck. Maybe I missed something. Can someone help?

Hold insert or press f10 to unlimit the emulation speed.



----
On a quest for Digital 573 and Dancing Stage EuroMix 2

By gods I've found it!



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Naoki]
#315745 - 10/12/13 02:01 PM



Thanks Naoki, that will cerainly do, but it's rather a question of programming.
I want to learn where this is set, so I completely understand the MAME code. Following MAME code structure can be sometimes complicated.

Anyone can help?



Matty_
Part-time troll
Reged: 01/25/08
Posts: 730
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#315912 - 10/16/13 05:59 AM


It isn't the flash that's slow - it's the way the game code accesses the CD-ROM drive. No matter how fast you make the components - the game code will still run slowly. You'd have to hack the ROM to speed it up, or just do what Naoki says.



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Matty_]
#315987 - 10/16/13 09:36 PM


Matty_

thanks for answer. Can you please elaborate?

I know the ROM of CPS3 very well. Access from CDRom is done via DMA which basically loops waiting for the DMA to show that transfer is done. It does nothing else afaik.

When you say delay is caused by CDROM, do you mean that I should try changing the code in any of these files?

cdrom.c
machine/scsibus.c
machine/scsicd.c
machine/wd33c93.c

I saw some functions in machine/intelfsh.c

which says:
m_timer->adjust( attotime::from_seconds( 1 ) );

But changing that didn't help either.

Some clever guy there can help further?



Matty_
Part-time troll
Reged: 01/25/08
Posts: 730
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#315993 - 10/17/13 12:30 AM


> I know the ROM of CPS3 very well. Access from CDRom is done via DMA which basically
> loops waiting for the DMA to show that transfer is done. It does nothing else afaik.

No it doesn't. It does slow byte-at-a-time PIO transfer, and doesn't even do that in an optimal way.



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Matty_]
#316042 - 10/17/13 01:31 PM


Matty_

thanks for Info, can you tell me in which part of MAME is the byte-at-a-time PIO transfer being made?

Thanks for your help!



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9713
Loc: ECV-197 The Orville
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#316062 - 10/17/13 06:02 PM


> Matty_
>
> thanks for Info, can you tell me in which part of MAME is the byte-at-a-time PIO
> transfer being made?
>
> Thanks for your help!

The CPS-3 BIOS code is programming the WD33C93 to do it. This is the advantage of low-level emulation: we don't know what the ultimate behavior is going to be, we just have to enable it.



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: R. Belmont]
#316079 - 10/17/13 10:44 PM


I thought the wd339c was just a scsi controller. Are you saying it's programmable? Holy sxit.

From what you say, I understand that this is only afecting the upgrade in MAME, right? On the real thing the problem comes from flashing time of flash memories which is of the order of ms, or is it both?

Thanks guys!



Matty_
Part-time troll
Reged: 01/25/08
Posts: 730
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#316093 - 10/18/13 05:15 AM


> I thought the wd339c was just a scsi controller. Are you saying it's programmable?
> Holy sxit.
>
> From what you say, I understand that this is only afecting the upgrade in MAME,
> right? On the real thing the problem comes from flashing time of flash memories which
> is of the order of ms, or is it both?
>
> Thanks guys!

On the real board it takes just as long, and just like in MAME it isn't caused by the FLASH being slow, it's caused by the CPS-3 BIOS code reading the CD very slowly. It isn't MAME's code you'd have to hack - it's the CPS-3 BIOS code itself that causes the slowness.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9713
Loc: ECV-197 The Orville
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Matty_]
#316376 - 10/25/13 05:38 PM


> On the real board it takes just as long, and just like in MAME it isn't caused by the
> FLASH being slow, it's caused by the CPS-3 BIOS code reading the CD very slowly. It
> isn't MAME's code you'd have to hack - it's the CPS-3 BIOS code itself that causes
> the slowness.

I should note that flash memory of that time had pretty slow timings on erase/program so it's likely the case that speeding up the CD reads wouldn't actually help.

The 33C93 isn't "programmable" in the sense of running a program, but it does what it's told and the BIOS doesn't enable DMA (likely because there's not a DMA channel in the hardware for SCSI, so trying to turn it on would simply cause data loss).



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: R. Belmont]
#316665 - 11/01/13 01:56 PM


That makes sense. Thanks for info!



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: R. Belmont]
#316699 - 11/01/13 10:06 PM


By the way, acording to the datasheet:
"Byte Programming (7us typical)" which means about 7 secs per Megabyte and 112 secs for the longest game that has 16Mbytes.

2-3 minutes is very acceptable time for rewriting a game into the simm, comnpared to the 45 minutes that takes now, which is certainly too long.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9713
Loc: ECV-197 The Orville
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: Darksoft]
#316901 - 11/04/13 06:44 PM


> By the way, acording to the datasheet:
> "Byte Programming (7us typical)" which means about 7 secs per Megabyte and 112 secs
> for the longest game that has 16Mbytes.
>
> 2-3 minutes is very acceptable time for rewriting a game into the simm, comnpared to
> the 45 minutes that takes now, which is certainly too long.

The actual byte programming isn't the majority of the time taken; the "erase sector" command is. (This remains true even on modern SSDs and USB sticks and the like). On typical flash of that vintage, it can take a full second or more to erase a block, and you must erase each block prior to programming it. The System 573 games' setup process got an order of magnitude slower when smf put in proper erase timings, and I don't imagine it did CPS-3 any favors either.



Darksoft
MAME and Arcade Fan
Reged: 06/17/11
Posts: 21
Loc: Poland
Send PM


Re: Speeding up CPS3 flash upgrade new [Re: R. Belmont]
#317940 - 11/27/13 02:42 PM


Well,

according to the messages on the screen the actual erasing takes around 20 seconds, the programming is what takes longer.

I have the feeling that reprogramming the BIOS may make the process much faster even in PIO mode.

I'll investigate on the real thing.

Thanks R. Belmont.


Pages: 1

MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 2 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4915