MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

BlackGreen
Reged: 07/11/13
Posts: 41
Send PM


Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required)
#319607 - 01/02/14 02:23 AM


Hi:

Mame: 0.148
Rom: SF2HF

Game runs fine but is crazy fast. I read this thread (last post):
http://mametesters.org/view.php?id=00408

... saying that the CPU clock has to be manually adjusted down to 74% to run like the arcade. I did set the overclock to 74% and the speed is much more acceptable.

Can someone confirm that setting the MAME overclock to 74% is the correct arcade speed? I don't have a real arcade cabinet to compare.

Thanks.



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#319612 - 01/02/14 03:23 AM


There are unemulated waitstates. You might be able to get it closer by underclocking but it still won't be accurate.



BlackGreen
Reged: 07/11/13
Posts: 41
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#319613 - 01/02/14 03:24 AM


As a side note, I do see in:
mame/drivers/cps2.c

... the cps2 is underclocked:

Quote:


machine().device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */




I am using this value myself for now unless someone presents a case for a different value.

Thanks.



BlackGreen
Reged: 07/11/13
Posts: 41
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Smitdogg]
#319614 - 01/02/14 03:26 AM


> There are unemulated waitstates. You might be able to get it closer by underclocking
> but it still won't be accurate.

Thanks Smitdogg - do you think the current 0.7375 is the closest possible to a correct emulation?



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#319615 - 01/02/14 03:35 AM


I don't know off hand. I uploaded a recording from the real pcb a few years ago, you could run it side by side with mame to check, but there is some dip configuration that changes the speed too and I don't recall if I used it or not in the recording.



BlackGreen
Reged: 07/11/13
Posts: 41
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Smitdogg]
#319617 - 01/02/14 03:38 AM


> I don't know off hand. I uploaded a recording from the real pcb a few years ago, you
> could run it side by side with mame to check, but there is some dip configuration
> that changes the speed too and I don't recall if I used it or not in the recording.

Do you have a link to the recording?



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#319618 - 01/02/14 03:45 AM


You can also use MAMEUIFX. It plays SF2HF at the correct speed

bug...
http://mametesters.org/view.php?id=00408



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#319620 - 01/02/14 03:47 AM


http://mametesters.org/view.php?id=4194
http://mametesters.org/view.php?id=4015
http://mametesters.org/view.php?id=4003



Anonymous
Unregistered
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Envisaged0ne]
#319625 - 01/02/14 04:34 AM


> It plays SF2HF at the correct speed

I bet it doesn't, it's probably closer to the correct speed though.



BlackGreen
Reged: 07/11/13
Posts: 41
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Smitdogg]
#319626 - 01/02/14 04:36 AM


Thanks for the links and info.



boodroe
MAME Fan
Reged: 03/20/14
Posts: 1
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: ]
#323595 - 03/20/14 07:22 PM


I fixed the problem by changing the M68000 speed from 12Mhz to 8Mhz in the CPS1.C driver file and recompiling mame. Works great. Speed is close to perfect when comparing to actual PCB. You can make it any speed you want, mame has a file (xtal.h) that has just about every frequency you can imagine to speed up or slow down the emulation of the M68000 chip. If you need help with the code or recompiling mame, let me know.



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: boodroe]
#328527 - 07/23/14 10:00 PM


Hello,

is there still an option to set the overclock settings? When I bring up the slider controls, I don't see that option. Or, if there isn't, then could someone explain the steps to changing the M68000 speed from 12Mhz to 8Mhz in the CPS1.C driver?



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



Sune
Connected
Reged: 09/21/03
Posts: 5648
Loc: Lagoa Santa, Brasil
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Envisaged0ne]
#328529 - 07/23/14 10:34 PM


> Hello,
>
> is there still an option to set the overclock settings? When I bring up the slider
> controls, I don't see that option.

Enable cheats.

S



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Sune]
#328548 - 07/24/14 05:05 AM


AAAahhh, that did it Thank you very much. I had disabled cheats because they were causing some issues with a couple games



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



Moksi
MAME Fan
Reged: 04/21/16
Posts: 23
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: BlackGreen]
#357783 - 08/17/16 12:48 AM


Can some one plz explain me how to adjust the speed manually in the drivers for Time Crisis
It runs all choppy , with the sliders it takes a long time too adjust them fully



Snarf
MAME Fan
Reged: 09/25/17
Posts: 3
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Moksi]
#369893 - 09/25/17 10:24 PM Attachment: cps1.zip 113 KB (2 downloads)


> Can some one plz explain me how to adjust the speed manually in the drivers for Time
> Crisis
> It runs all choppy , with the sliders it takes a long time too adjust them fully

I know this is an older topic but I wanted to provide what I did to fix the speed issue. I found what I believe is the correct speed or close to. I used to own the SF2HF Board and I ran several tests to get the timing down.

I edited the file cps1.cpp (within the folder src\mame\drivers) with the following changes below.

Find this Code:

static MACHINE_CONFIG_START( cps1_10MHz, cps_state )

/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz ) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cps_state, cps1_interrupt)

MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(sub_map)

MCFG_MACHINE_START_OVERRIDE(cps_state,cps1)

/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(CPS_PIXEL_CLOCK, CPS_HTOTAL, CPS_HBEND, CPS_HBSTART, CPS_VTOTAL, CPS_VBEND, CPS_VBSTART)
MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_cps1)
MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1)
MCFG_SCREEN_PALETTE("palette")

MCFG_GFXDECODE_ADD("gfxdecode", "palette", cps1)
MCFG_PALETTE_ADD("palette", 0xc00)

MCFG_VIDEO_START_OVERRIDE(cps_state, cps1)

/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")

MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")

MCFG_YM2151_ADD("2151", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.35)
MCFG_SOUND_ROUTE(1, "mono", 0.35)

/* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/4/4, OKIM6295_PIN7_HIGH) // pin 7 can be changed by the game code, see f006 on z80
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END


Add the following Code After:

static MACHINE_CONFIG_START( cps1_8_2MHz, cps_state )

/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_8_2MHz ) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cps_state, cps1_interrupt)

MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(sub_map)

MCFG_MACHINE_START_OVERRIDE(cps_state,cps1)

/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(CPS_PIXEL_CLOCK, CPS_HTOTAL, CPS_HBEND, CPS_HBSTART, CPS_VTOTAL, CPS_VBEND, CPS_VBSTART)
MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_cps1)
MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1)
MCFG_SCREEN_PALETTE("palette")

MCFG_GFXDECODE_ADD("gfxdecode", "palette", cps1)
MCFG_PALETTE_ADD("palette", 0xc00)

MCFG_VIDEO_START_OVERRIDE(cps_state, cps1)

/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")

MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")

MCFG_YM2151_ADD("2151", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.35)
MCFG_SOUND_ROUTE(1, "mono", 0.35)

/* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/4/4, OKIM6295_PIN7_HIGH) // pin 7 can be changed by the game code, see f006 on z80
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END


Find the Code:

GAME( 1992, sf2hf, 0, cps1_12MHz, sf2, cps_state, cps1, ROT0, "Capcom", "Street Fighter II': Hyper Fighting (World 921209)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1992, sf2hfu, sf2hf, cps1_12MHz, sf2, cps_state, cps1, ROT0, "Capcom", "Street Fighter II': Hyper Fighting (USA 921209)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, sf2hfj, sf2hf, cps1_12MHz, sf2j, cps_state, cps1, ROT0, "Capcom", "Street Fighter II' Turbo: Hyper Fighting (Japan 921209)", MACHINE_SUPPORTS_SAVE )


Replace it with this Code:

GAME( 1992, sf2hf, 0, cps1_8_2MHz, sf2, cps_state, cps1, ROT0, "Capcom", "Street Fighter II': Hyper Fighting (World 921209)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1992, sf2hfu, sf2hf, cps1_8_2MHz, sf2, cps_state, cps1, ROT0, "Capcom", "Street Fighter II': Hyper Fighting (USA 921209)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, sf2hfj, sf2hf, cps1_8_2MHz, sf2j, cps_state, cps1, ROT0, "Capcom", "Street Fighter II' Turbo: Hyper Fighting (Japan 921209)", MACHINE_SUPPORTS_SAVE )


This basically slows the clock down from 12Mhz to 8.2Mhz which seems much better in my opinion. I don't know if the cps1.cpp file ever changes but I have attached the modified one I used with all of the changes above. It's from the v0178 Mame Source.

Edited by Snarf (09/26/17 03:06 PM)



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Snarf]
#369894 - 09/26/17 01:03 AM


You can just underclock it with the slider if that's what you want to do but it's not a proper fix.



Snarf
MAME Fan
Reged: 09/25/17
Posts: 3
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Smitdogg]
#369901 - 09/26/17 04:14 PM


> You can just underclock it with the slider if that's what you want to do but it's not
> a proper fix.

Do you have to set the slider every time you play the game?



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Snarf]
#369902 - 09/26/17 04:31 PM


Last I checked that is how it works but to me it's less work to use the slider if you're going to edit and wait for the compile every month when a new mame comes out.



Snarf
MAME Fan
Reged: 09/25/17
Posts: 3
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Smitdogg]
#369906 - 09/26/17 07:49 PM


> Last I checked that is how it works but to me it's less work to use the slider if
> you're going to edit and wait for the compile every month when a new mame comes out.

It depends on your setup but for most people yeah you're right. For my needs compiling it as needed works since I don't usually update my MAME version much at all. SF2HF is one of my all time favorite games if not the number one. So I'll take the time to do the editing and compiling.

With that said do you happen to know what the correct CPU clock should be? I saw a few posts here and on mametesters that it's supposed to be 74% slower. So would the clock be set at 8.8799Mhz?



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Snarf]
#369907 - 09/26/17 08:09 PM


My understanding is that what you are asking for is technically not possible because the missing wait states don't slow the game down the same way / with the same consistency that underclocking the CPU would, so it's not going to run the game accurately no matter what you set the clock at. If you run the pcb side by side and get it as close as you can, that's as good as it gets for now until someone emulates the wait states. They must be nearly impossible to emulate because the CPS1 is one of the most loved arcade hardware ever made.



Phil Bennett
L'Emuchat
Reged: 04/20/04
Posts: 888
Send PM


Re: Street Fighter 2 Hyper Fighting: Too Fast? (Overclock required) new [Re: Snarf]
#369908 - 09/26/17 08:31 PM


Somebody please loan me an SF2 boardset so I can stick my logic analyzer on it and end this once and for all...


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 24 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 8073