libretro / mame2003-plus-libretro

Updated 2018 version of MAME (0.78) for libretro. with added game support plus many fixes and improvements
Other
185 stars 108 forks source link

Atari Star Wars speed issues #1546

Open james-milroy opened 1 year ago

james-milroy commented 1 year ago

I'm currently running Star Wars (set 1) on a Pi4 setup with a proper yoke. Having issues with speed, game seems to be running too fast, it gets real hard real quick. I'm contemplating trying lr-mame2015 and 2016 to see if the game plays any different. On looking at details on ArcadeItalia it seems that the cpu speeds and the refresh rate in the 0.78 xml are vastly different to those in the 0.160 xml used in lr-mame2015. For example the 6809 and the Pokey's are clocked at 1500000 and the TMS5220 at 640000. The screen is refreshing at 30.000000 in the 0.78 xml. The 0.160 xml however sets the clocks as 1512000 for the 6809 and Pokey's and 672000 for the TMS5220 and 41.015625 for the screen refresh. These match the clock speeds quoted on ArcadeItalia for the actual board. Is it possible to update the driver to reflect the proper clock rates?

MistyDreams commented 1 year ago

you could try fbneo as well as newer mame as well until someone looks at it fbneo also runs 40fps

MistyDreams commented 1 year ago

starwars is 30fps for me when I tried just now the controls are sensitive though not sure why but the game is mapping with light gun controls will have a peek when I have time. Never mind all games seem to map to lightgun game mappings even when its not a lightgun game very odd thats happening though. It must be something else in the code thats causing the sensitivity issues.

wn2000 commented 1 year ago

This was brought up in our subreddit as well. I tried mame2003+ and fbneo. The game definitely runs faster in mame2003+. As mentioned by @MistyDreams mame2003+ uses 30fps while fbneo uses 40fps. I tried changing this line to 40. Afterwards, RetroArch reports the fps as 40, but the game still feels faster.

Also someone said that an older build of mame2003+ (maybe sometime 2021) runs this game in correct speed. But the driver code hasn't updated since 2019?

Btw the sound in fbneo for this game is notably better. But that's understandable as there were more sound related fixes after 0.78/0.80.

arcadez2003 commented 1 year ago

This was brought up in our subreddit as well. I tried mame2003+ and fbneo. The game definitely runs faster in mame2003+. As mentioned by @MistyDreams mame2003+ uses 30fps while fbneo uses 40fps. I tried changing this line to 40. Afterwards, RetroArch reports the fps as 40, but the game still feels faster.

Also someone said that an older build of mame2003+ (maybe sometime 2021) runs this game in correct speed. But the driver code hasn't updated since 2019?

Btw the sound in fbneo for this game is notably better. But that's understandable as there were more sound related fixes after 0.78/0.80.

Check the cpu clock speeds and the dividers match them up with FBN or MAME and use 40fps

MistyDreams commented 1 year ago

forgot all about this try these these settings for the speed. Just copy and paste into a file then git apply filename,see if its any better for you.

diff --git a/src/drivers/starwars.c b/src/drivers/starwars.c
index bc765d0f..1ba71441 100644
--- a/src/drivers/starwars.c
+++ b/src/drivers/starwars.c
@@ -394,7 +394,7 @@ INPUT_PORTS_END
 static struct POKEYinterface pokey_interface =
 {
        4,                      /* 4 chips */
-       1500000,        /* 1.5 MHz? */
+       1512000,        /* 1.5 MHz? */
        { 20, 20, 20, 20 },     /* volume */
        /* The 8 pot handlers */
        { 0, 0, 0, 0 },
@@ -412,7 +412,7 @@ static struct POKEYinterface pokey_interface =

 static struct TMS5220interface tms5220_interface =
 {
-       640000,     /* clock speed (80*samplerate) */
+       672000,     /* clock speed (80*samplerate) */
        50,         /* volume */
        0           /* IRQ handler */
 };
@@ -428,15 +428,15 @@ static struct TMS5220interface tms5220_interface =
 static MACHINE_DRIVER_START( starwars )

        /* basic machine hardware */
-       MDRV_CPU_ADD(M6809,1500000)
+       MDRV_CPU_ADD(M6809,1512000)
        MDRV_CPU_MEMORY(main_readmem,main_writemem)
        MDRV_CPU_VBLANK_INT(irq0_line_assert,6)         /* 183Hz ? */

-       MDRV_CPU_ADD(M6809,1500000)
+       MDRV_CPU_ADD(M6809,1512000)
        MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
        MDRV_CPU_MEMORY(sound_readmem,sound_writemem)

-       MDRV_FRAMES_PER_SECOND(30)
+       MDRV_FRAMES_PER_SECOND(41.02)
        MDRV_MACHINE_INIT(starwars)
        MDRV_NVRAM_HANDLER(generic_0fill)
wn2000 commented 1 year ago

Thanks for the patch @MistyDreams . Does this take care of the "dividers" mentioned by @arcadez2003 ?

MistyDreams commented 1 year ago

dont need dividers as no master clocks are in the code afaik youll need to ask arcades. If these changes dont work try setting the sample rate 22050 in the core options and restart the core. Thats about the only advise i can give atm. The other thing could effect it is the interrupt timing.

arcadez2003 commented 1 year ago

Well he mentioned it running correctly in latest MAME and the driver has clock speeds defined and uses dividers hence i mentioned it but no matter it seems @MistyDreams you have offered up a better solution.

james-milroy commented 1 year ago

I'd like to give your patch a try @MistyDreams, I'm running on a Pi4. I take it I'd have to apply the patch and compile a new copy of the core. I'm not sure how to do this, any pointers for a newbie like me?

MistyDreams commented 1 year ago

I dont have a pi well only a pi3 that sits in a dusty drawer. I would get a pie4 if there where any available at a reasonable price maybe next year.

If you can manage to compile mame source all you need to do is copy that text into a file in the mame2003-plus source directory then type git apply filename that you copied it too.