Videopac / Odyssey2 forum

Emulation => Emulating the Videopac / Odyssey2 => Topic started by: Sdw on October 22, 2017, 07:27:40 PM



Title: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Sdw on October 22, 2017, 07:27:40 PM
I started noticing some things seeming off in the timing when comparing emulator and real PAL hw, for example my music routine played faster in emulator.

Just to verify things I wrote a short program that changes background color every 128th frame so I can count frames and time with a stop watch.
Frame-waiting is done with the waitvsync standard routine.

When running the emulator, I always get a frame-rate that corresponds to 60Hz, regardless if I run the emulator with the -euro switch or not. When counting on my real HW, I get the proper 50Hz.

The output in the console when running with -euro switch says:

..
Video-mode set to PAL.
Autodetecting Joystick.
Joystick 2 set to Keyboard W A S D/SPACE.
Joystick 1 set to Joystick.
Browser sorts by Gamename.
Sort order in browser set to gamename.
Video-mode set to PAL.
..

So the emulator has recognized the switch, but it still seem to run at 60Hz framerate.
Is this a known bug?


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Sdw on December 14, 2017, 05:46:07 PM
*bump*

No one else who has noticed this phenomenon? I guess it should be visible as PAL games playing faster in emulator than on real HW as well.


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on December 15, 2017, 02:57:26 PM
I will look into this (I decided to do a little more work on O2EM again ;-) )


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: ccc--- on December 15, 2017, 03:50:20 PM
Really? Now?  :D


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on December 15, 2017, 07:16:24 PM
nothing better than sitting under the South American sun and programming a bit ... maybe even trying to work on a certain game ... ;)


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: ccc--- on December 15, 2017, 09:04:37 PM
 :D


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Janzl on December 16, 2017, 06:59:03 AM
Dear fellow forum members,

I hereby whish to tell you that Manopac has been banned from the Videopac forums.

For how long? I don't know... and frankly I don't care. That arrogant little pr*ck. He can go to Atariage for all I care! Sitting in South America! Oh! oh! Look! Look! I'm in the sun! Coding!




B*stard...


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on December 17, 2017, 12:49:40 AM
 :D :D :D :D :D :D :D :D


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Sdw on December 18, 2017, 12:33:18 AM
I will look into this (I decided to do a little more work on O2EM again ;-) )

Great! If you need any assistance, just let me know!


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Rene_G7400 on December 18, 2017, 10:08:44 AM
nothing better than sitting under the South American sun and programming a bit

South America? Are you going to visit Rafael?


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on December 19, 2017, 08:34:17 PM
unfortunately not - I am on the other side of the continent ... I am in Quito, Ecuador for a while ...


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Rafael on December 20, 2017, 02:00:54 AM
nothing better than sitting under the South American sun and programming a bit

South America? Are you going to visit Rafael?

At the beginning of the 20th century grandma crossed from Austria to South America and thanks to this trip the Odyssey won a new 10 games. :)


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Rafael on December 24, 2017, 03:50:44 PM
I will look into this (I decided to do a little more work on O2EM again ;-) )

Let me know if you want some roms. On emulator, Haunted Woods hero is not able to go down the stairs. ( ??? ??? ??? ???)


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: RetroMan on February 10, 2018, 01:29:23 PM
I started noticing some things seeming off in the timing when comparing emulator and real PAL hw, for example my music routine played faster in emulator.

So the emulator has recognized the switch, but it still seem to run at 60Hz framerate.
Is this a known bug?

I have the same problem running the LibRetro version in RetroArch. All games run @ 60 FPS, no matter what ROM is loaded (US O2 or EU VideoPac). Also, I tried forcing the use of the EU BIOS (G7400) instead of the default O2 BIOS, but still rock steady @ 60 FPS which is a bit too fast. I hope this can be fixed. If there's anything you want me to test, say the word!

RetroMan


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on March 07, 2018, 03:48:26 AM
Unfortunately I decided to spend my time in South America with traveling instead of O2EM ... (or a certain game that shall not be named)

but I just took the time to look into this and you are all completely right ... the code in O2EM that "waits" between frames does not take into account if the -euro flag is set (the BIOS actually makes no difference - the -euro flag is the one that changes the number of scanlines per frame and thus makes O2EM compatible with PAL-games that rely on strict timing) - however as I said, the frames are still drawn 60 times per second ...

looks like in all the 22 years that O2EM now exists, no one noticed or cared ;-) the good news is:
its an easy fix in the code - but I am actually not sure how I should handle it ... because I am afraid that people might have gotten used to playing the euro only games in 60Hz, which means if I fix it, the games would run slower ... I see a few different options for this:
- make the 50Hz default if "-euro" is set, but make a command line argument that lets you set the frames per second (which I think would be the best option - even though it changes the current behavior, but it also fixes something that has been long wrong)
- keep the current behavior as default and introduce an option that lets you set the fps

any comments on that?

oh - and the even better news: there is a workaround that lets you play the current version of O2EM in 50Hz ...
just use the setting that lets you set the speed of the emulator ... from the docs:
"-speed=n      Relative speed (100 = original speed)"

what this option does is basically delay (or speed up) the waiting time between frames ... from the source code of O2EM:
d = (TICKSPERSEC*100)/(app_data.speed*fps);

(don't let the fps fool you - its set to "NTSC_FPS" always ...
int fps=FPS_NTSC;
)

so by using the command line argument
-speed=83   
(because 50/60 = 0.8333333)

you will get PAL speed ... 50 Frames per second

if you want to have it configured for all PAL games in o2emcfg.xml, just add the line
<option name="speed">83</option>

for all games that have the line
<option name="euro" />



Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: RetroMan on March 10, 2018, 01:20:00 AM

its an easy fix in the code - but I am actually not sure how I should handle it ... because I am afraid that people might have gotten used to playing the euro only games in 60Hz, which means if I fix it, the games would run slower ... I see a few different options for this:
- make the 50Hz default if "-euro" is set, but make a command line argument that lets you set the frames per second (which I think would be the best option - even though it changes the current behavior, but it also fixes something that has been long wrong)
- keep the current behavior as default and introduce an option that lets you set the fps

any comments on that?


Hey Mano,

My five cents: Make O2EM as close to the original as it can be so please fix it. I can assure you that we in EU like to see emulators behave like the original;-) And we're not used to playing "Munchkin" at 20% higher speed...

Another thing is that the LibRetro core version can not be run with command line parameters. So it's better to fix it.

Thanks in advance!

R


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: manopac on March 11, 2018, 12:21:07 AM
Another thing is that the LibRetro core version can not be run with command line parameters. So it's better to fix it.

well - i just took a look at the LibRetro core version - its based on O2EM Version 1.18 from 2007 - so even if I fix it and release a new version now, someone would have to port the current source of 1.20 to the LibRetro API ...


Title: Re: O2em Euro/Pal 50 Hz mode not working? (o2em120b5win)
Post by: Sdw on April 25, 2018, 03:56:50 PM
Thanks for the speed=... tip manopac! That solves the immediate issue!