Change core clock from 59.18 hz to 60 hz

User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

I can now build the core.

Once I confirm it works, I will update this thread with a new version when there is an update on the original core. I might do it thru a github branch in the future. For the time being, mega will suffice for storage I guess.
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Its been a long a difficult journey but I was finally was able to make it happen. Enjoy.
https://mega.nz/folder/xlUVEIzB#vKdNV8vkMuQixxPgItnV2w
User avatar
dataDave
Posts: 6
Joined: Thu Mar 11, 2021 9:44 am
Has thanked: 19 times
Been thanked: 4 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by dataDave »

uberyoji wrote: Thu Feb 25, 2021 2:13 am Its been a long a difficult journey but I was finally was able to make it happen. Enjoy.
https://mega.nz/folder/xlUVEIzB#vKdNV8vkMuQixxPgItnV2w
Thank you so, so, much for this. Also to all the others that have contributed to this thread.

Outside of my main retro gaming PVM I have an ASUS ROG Swift PG279Q, an Iiyama RedEagle G-Master, and downstairs a Samsung JU7500. The NeoGeo core simply flat-out refuses to lock sync on any of them. I get nothing but a series of flickers followed by a black screen unless I want to forfeit vsync_adjust=2 (no thanks). The only solution up until now was to run the MiSTer through my old Elgato Game Capture HD and activate its software through my computer which would bridge some form of pass-through or sync handshake to my various displays. Hardly ideal.

These revised cores have fixed all of this. Thank you again, honestly. I don't like to power my PVM up unless I'm going to be playing for extended durations, so this has enabled quick-fix bouts of Neo gaming through my LCDs. To me, at least, this is a big deal. If I didn't have the PVM I wouldn't have been able to play at all.

How difficult is the process? It's something I'd like to learn how to do myself and maybe assist with. :)
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Not too complicated honestly if you have a little xp in software devs. It is basically those steps high level:
1) install Quartus lite v17.0 (once)
2) Install git (once)
3) Get/update source code from repo
4) Modify Entity pll from 96 to 97.330180 and 48 to 48.665090
5) Compile core
6) Profit

I plan to maintain the 60hz fork forever so no worries, I will always update this thread each time there is a version in a timely fashion now that my setup is done. I put some notifications on the repo to alert myself when the master is updated.
zakk4223
Posts: 196
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 53 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by zakk4223 »

Is this an issue where an incompatible pixel clock is being calculated for some displays? I wonder if changing the video mode would help a bit.
A real example. I run vsync_adjust=2 unless forced to otherwise. I had a global video_mode set to 1920x1080@60hz (one of the standard modes available).

The arcade scramble core WOULD NOT sync to my freesync monitor unless I used vsync_adjust=0. I brought it up in the bug tracker and Sorg said that sometimes the calculated pixel clock isn't compatible, so maybe try the PAL (50hz) mode. That works, and since I am using vsync_adjust=2, the vertical refresh matches the core like it should.

If you're using vsync_adjust=2 try another video mode and see what happens.

Issue for reference: https://github.com/MiSTer-devel/Arcade- ... /issues/25
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Maybe I am mistaken, but I always though the vsync_adjust param to be related to the scaler and therefore attached to the hdmi output (unless you are using the scaler on vga). I personally don't have any issues with hdmi output on any of my lcd tvs using the original neogeo core. The tweak is aimed more at forcing 60hz for crt usage. Without this fix, on my end, I have a slight roll/wave on my sony trinitron. Now the picture is more stable at the cost of accuracy I guess.
Ganondork
Posts: 7
Joined: Sun May 24, 2020 9:47 pm

Re: Change core clock from 59.18 hz to 60 hz

Unread post by Ganondork »

You are actually wrong here, vsync_adjust only applies to hdmi-output.
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Ganondork wrote: Sun Apr 04, 2021 6:03 pm You are actually wrong here, vsync_adjust only applies to hdmi-output.
I think this is what I said :) vsync_adjust applies to hdmi output.
User avatar
rastan
Posts: 6
Joined: Tue May 26, 2020 4:49 am
Has thanked: 3 times
Been thanked: 1 time

Re: Change core clock from 59.18 hz to 60 hz

Unread post by rastan »

Thank you for this. This has fixed the issue of stuttering scrolling on my TCL 55R617. I'd like to try this with the double dragon core as well, as the 57hz refresh rate causes stuttery scrolling on my TV. However speeding that game up to 60hz would probably affect gameplay more noticeably than the neo's slight increase?
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

rastan wrote: Wed Apr 07, 2021 4:57 pm Thank you for this. This has fixed the issue of stuttering scrolling on my TCL 55R617. I'd like to try this with the double dragon core as well, as the 57hz refresh rate causes stuttery scrolling on my TV. However speeding that game up to 60hz would probably affect gameplay more noticeably than the neo's slight increase?
I can have a look for you. Is it the jtdd core?
User avatar
darksakul
Posts: 213
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 207 times
Been thanked: 37 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by darksakul »

Insert Disk Two wrote: Sat Jan 16, 2021 6:46 pm Updates on Neogeo are done by Sorgelig himself and he does not want to include this option.
I am sure with everything else on his plate, and he understands how individual cores interface with the main framework that Sorgelig got his reasons.
Plus he is not fond of 15khz CRTs so there no motivation on his part to include the option in the core.
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
User avatar
rastan
Posts: 6
Joined: Tue May 26, 2020 4:49 am
Has thanked: 3 times
Been thanked: 1 time

Re: Change core clock from 59.18 hz to 60 hz

Unread post by rastan »

uberyoji wrote: Wed Apr 07, 2021 10:35 pm
rastan wrote: Wed Apr 07, 2021 4:57 pm Thank you for this. This has fixed the issue of stuttering scrolling on my TCL 55R617. I'd like to try this with the double dragon core as well, as the 57hz refresh rate causes stuttery scrolling on my TV. However speeding that game up to 60hz would probably affect gameplay more noticeably than the neo's slight increase?
I can have a look for you. Is it the jtdd core?
Yes. thanks for offering to look at it!
Insert Disk Two
Posts: 101
Joined: Sun May 24, 2020 7:59 pm
Has thanked: 7 times
Been thanked: 15 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by Insert Disk Two »

darksakul wrote: Thu Apr 08, 2021 1:39 pm
Insert Disk Two wrote: Sat Jan 16, 2021 6:46 pm Updates on Neogeo are done by Sorgelig himself and he does not want to include this option.
I am sure with everything else on his plate, and he understands how individual cores interface with the main framework that Sorgelig got his reasons.
Plus he is not fond of 15khz CRTs so there no motivation on his part to include the option in the core.
Ummm adding a 60hz option would be beneficial to LCD screen users not CRT.
User avatar
darksakul
Posts: 213
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 207 times
Been thanked: 37 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by darksakul »

Insert Disk Two wrote: Wed Jun 02, 2021 11:14 am
Ummm adding a 60hz option would be beneficial to LCD screen users not CRT.
Nothing to do with what I was talking about

15Khz is the carrier frequency not the refresh rate.
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
User avatar
dataDave
Posts: 6
Joined: Thu Mar 11, 2021 9:44 am
Has thanked: 19 times
Been thanked: 4 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by dataDave »

uberyoji wrote: Thu Apr 01, 2021 10:06 pm Not too complicated honestly if you have a little xp in software devs. It is basically those steps high level:
1) install Quartus lite v17.0 (once)
2) Install git (once)
3) Get/update source code from repo
4) Modify Entity pll from 96 to 97.330180 and 48 to 48.665090
5) Compile core
6) Profit

I plan to maintain the 60hz fork forever so no worries, I will always update this thread each time there is a version in a timely fashion now that my setup is done. I put some notifications on the repo to alert myself when the master is updated.
Hello mate, any chance of 'NeoGeo_20210713.rbf' being given your magic touch? Thanks!
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Sure. But if I read the github thread correctly, sorgelig agreed to make the mvs and aes timing different. It might fix our crt problem by selecting aes. I will have to check if I can still apply the mod.
You can see the discussion here: github.com/MiSTer-devel/NeoGeo_MiSTer/pull/134
paulbnl
Posts: 133
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 12 times
Been thanked: 58 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by paulbnl »

Since there is now a clock switch used in the core you'll have to change it to 60Hz in a different way.

There are 2 numbers here: https://github.com/MiSTer-devel/NeoGeo_ ... eo.sv#L373

Code: Select all

cfg_data <= sys_mvs_r ? 2576980378 : 2865308404;
The first is for MVS and the second for AES. The number for 60Hz should be 3148288251. So just change one or both numbers.

You might also still need to change the PLL to the higher clocks if it is unstable.
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

paulbnl wrote: Tue Jul 20, 2021 10:21 am Since there is now a clock switch used in the core you'll have to change it to 60Hz in a different way.

There are 2 numbers here: https://github.com/MiSTer-devel/NeoGeo_ ... eo.sv#L373

Code: Select all

cfg_data <= sys_mvs_r ? 2576980378 : 2865308404;
The first is for MVS and the second for AES. The number for 60Hz should be 3148288251. So just change one or both numbers.

You might also still need to change the PLL to the higher clocks if it is unstable.
I finally decided to get back to this. How do you calculate the fractionnal? On my end I approximated to 3148289000 but I can use your constant instead. I am building a version and will test shortly.
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Here's the latest version fixed at 60hz.
https://mega.nz/file/sxUi3BrC#CBxoZxTKy ... h3eQ9Abz44
User avatar
uberyoji
Posts: 26
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Updated folder with a patched version of the Sept 8th release.
https://mega.nz/folder/xlUVEIzB#vKdNV8vkMuQixxPgItnV2w
paulbnl
Posts: 133
Joined: Sun May 24, 2020 8:48 pm
Has thanked: 12 times
Been thanked: 58 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by paulbnl »

uberyoji wrote: Sat Jul 31, 2021 10:12 pm I finally decided to get back to this. How do you calculate the fractionnal? On my end I approximated to 3148289000 but I can use your constant instead.
I just changed the PLL to the higher clock and then the value is at Advanced Parameters -> K-Fractional Division Value (DSM).
Post Reply