Change core clock from 59.18 hz to 60 hz

wondermagenta
Posts: 6
Joined: Thu Jul 08, 2021 9:49 am
Has thanked: 2 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by wondermagenta »

uberyoji wrote: Tue Sep 28, 2021 1:05 pm Ok I'll check over the weekend and make builds.
Just wanted to say thank you for looking into this, I know it's gonna be a big help for a ton of people.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Arg. I am a bit screwed. The timings are already tweaked on the pll component. I would need base timings to recalculate the ratios. Anyone knows the proper timings? Gameboy is quite far from the 96/48 baseline.

Currently this is what is set:
GBA
- 100.663296
- 50.331648

Gameboy
- 67.108864
- 33.554432
wondermagenta
Posts: 6
Joined: Thu Jul 08, 2021 9:49 am
Has thanked: 2 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by wondermagenta »

I'll try pinging Robert on Discord/Twitter.
FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by FPGAzumSpass »

For GBA:

base clock is 16.78Mhz.
Core is using 6x this clock, so 100.68 Mhz.
In total there are 280896 pixels (visible and blank), resulting in 59.73 Hz

So let's do the math other way around: 60hz * 280896 = 16.853760 mhz * 6 = 101.122560Mhz

You can probably round it a bit if the PLL cannot directly match it.


For Gameboy:
base clock is 4.194Mhz.
Core is using 8x this clock, so 33.552 Mhz. (core is actually using 33.56)
In total there are 70224 pixels (visible and blank), resulting in 59.72 Hz

So let's do the math other way around: 60hz * 70224 = 4.213440 mhz * 8 = 33.707520 Mhz
You also need to set SDRAM clock to 16 times clock: 4.213440 mhz * 16 = 67.415040 Mhz (currently 67.12)
Make sure both clocks are excatly 1:2 in ratio!


I hope i didn't miscalculate somewhere, that's why i kept the math here.

Have fun!
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Wow. By the man himself ;) thank you. I'll do the mods right away.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Updated the mega folder with 60hz gameboy and gba core test builds.
wondermagenta
Posts: 6
Joined: Thu Jul 08, 2021 9:49 am
Has thanked: 2 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by wondermagenta »

Amazing, thank you so much! (and Robert for providing the necessary math) I don't have access to my MiSTer at the moment but I should be able to report back by Tuesday at the latest.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Updated the latest neogeo core to 60hz. See mega folder.
User avatar
emmadness
Posts: 29
Joined: Sun May 24, 2020 6:48 pm
Location: Argentina
Been thanked: 1 time
Contact:

Re: Change core clock from 59.18 hz to 60 hz

Unread post by emmadness »

Thanks for the Toaplan "extras" I was looking for; It works like a charm.

Will you upload more stuff? Thank you in advance and a big greeting from Argentina!
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

Latest 20220212 core patched to 60Hz

https://mega.nz/file/qShQjAjD#5J6MJsUah ... TC_W1AVwgo
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

lufeig wrote: Fri Mar 25, 2022 1:15 am Latest 20220212 core patched to 60Hz

https://mega.nz/file/qShQjAjD#5J6MJsUah ... TC_W1AVwgo
Maybe we should start an github fork together and release those thru a custom db. What do you think?
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

I'm sorry but don't have the knowledge nor the discipline for that.

I just modified the source code according to the instructions given on this post and compiled it.

Sharing the compiled patched core is my way to say "thanks" for all the information shared here. ;)

_________________________

EDIT: @uberyoji, if you want, feel free to test and upload to your Mega account the file I shared here. No need for credits, all I did was following instructions.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Eheh all good lufeig. I'll make it happen now that I know how to make custom mister DBs.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Done. Now you can use the update_all script to update the custom core. Enjoy!

Add the following to the bottom of /media/fat/downloader.ini on your MiSTer:

Code: Select all

[uberyoji_neogeo_mister_60hz]
db_url = https://raw.githubusercontent.com/uberyoji/NeoGeo_MiSTer_60hz/master/releases/uberyoji_neogeo_mister_60hz.json
If you want to update manually, I will put them in the release folder of the github fork.
https://github.com/uberyoji/NeoGeo_MiSTer_60hz
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

uberyoji wrote: Fri Mar 25, 2022 4:38 am Done. Now you can use the update_all script to update the custom core. Enjoy!

Add the following to the bottom of /media/fat/downloader.ini on your MiSTer:

Code: Select all

[uberyoji_neogeo_mister_60hz]
db_url = https://raw.githubusercontent.com/uberyoji/NeoGeo_MiSTer_60hz/master/releases/uberyoji_neogeo_mister_60hz.json
If you want to update manually, I will put them in the release folder of the github fork.
https://github.com/uberyoji/NeoGeo_MiSTer_60hz
nice initiative, congrats! well done!
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

uberyoji wrote: Fri Mar 25, 2022 4:38 am Done. Now you can use the update_all script to update the custom core. Enjoy!

Add the following to the bottom of /media/fat/downloader.ini on your MiSTer:

Code: Select all

[uberyoji_neogeo_mister_60hz]
db_url = https://raw.githubusercontent.com/uberyoji/NeoGeo_MiSTer_60hz/master/releases/uberyoji_neogeo_mister_60hz.json
If you want to update manually, I will put them in the release folder of the github fork.
https://github.com/uberyoji/NeoGeo_MiSTer_60hz
neo geo core was updated yesterday, march 26th.

this is the updated core with the 60Hz patch. you can upload it to your github release folder if you want to save a couple of minutes instead of compiling it. ;)

https://mega.nz/file/6fwlWLKK#6xHUo_U1v ... Uj1Cgqt3IA
User avatar
emmadness
Posts: 29
Joined: Sun May 24, 2020 6:48 pm
Location: Argentina
Been thanked: 1 time
Contact:

Re: Change core clock from 59.18 hz to 60 hz

Unread post by emmadness »

Thank you very much for this work! I have some questions:

1. When I access this modified 60Hz Core, is there something to "activate" in the options?

2. What are the games where you can feel the difference with 60Hz?

I am using a Dell LCD 17" FP1708FP 1280x1024@60Hz monitor with DVI to HDMI output.

I would like to do some tests well and draw conclusions. Thank you very much!
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

There is nothing to activate as both aes and mvs have their timing set to 60hz. However what I could do is change the timing only on the mvs. This way 60hz be toggled by using the menu.
User avatar
emmadness
Posts: 29
Joined: Sun May 24, 2020 6:48 pm
Location: Argentina
Been thanked: 1 time
Contact:

Re: Change core clock from 59.18 hz to 60 hz

Unread post by emmadness »

uberyoji wrote: Sun Mar 27, 2022 8:10 pm There is nothing to activate as both aes and mvs have their timing set to 60hz. However what I could do is change the timing only on the mvs. This way 60hz be toggled by using the menu.
That's good because I just like the MVS arcade experience and I play that way.
Can you tell me a couple of games where at 60Hz the change is noticeable? Whether for better or worse, no problem. I want to feel the difference.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Core updated. Just run the updater if you configured the custom db.
On my end I didnt notice any difference in any roms.
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

On Samurai Shodown II (Samurai Spirits II), on the character selection screen, the background moves constantly from right to left.

On the original core I notice it stuttering from time to time.

On the patched core it moves smoothly.
pac
Posts: 75
Joined: Mon May 25, 2020 6:11 am
Has thanked: 63 times
Been thanked: 25 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by pac »

Just had a look out of curiosity - no issues here with the original core in the SS2 character select screen. But as always, depends on lots of factors like the display used (LG OLED gen 8 here).
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

It is mainly for crts.
User avatar
mistahsnart
Posts: 16
Joined: Wed Apr 07, 2021 4:06 pm
Has thanked: 6 times
Been thanked: 5 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by mistahsnart »

For those curious about what 60hz does for HD displays, we had a good discussion on it a while ago. 15khz shadow flickers on the Neo Geo are usually the most notable visible artifact with it's slightly off timing on fixed refresh panels. I have a crystal modded MVS to run at 60hz just for this issue.

viewtopic.php?t=2562

Does it "matter"? Subjectively it can be a distraction, but it's one of those "once you see it, you can't unsee it" things.
User avatar
emmadness
Posts: 29
Joined: Sun May 24, 2020 6:48 pm
Location: Argentina
Been thanked: 1 time
Contact:

Re: Change core clock from 59.18 hz to 60 hz

Unread post by emmadness »

lufeig wrote: Sun Mar 27, 2022 9:26 pm On Samurai Shodown II (Samurai Spirits II), on the character selection screen, the background moves constantly from right to left.

On the original core I notice it stuttering from time to time.

On the patched core it moves smoothly.
I've tried it and you're right, good detail!
User avatar
lufeig
Posts: 15
Joined: Sat Feb 12, 2022 3:29 am
Location: Brazil
Has thanked: 13 times
Been thanked: 6 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by lufeig »

60hz patched core based on the latest release 20220403

https://mega.nz/file/HDYQmYYD#Kem7qH2rw ... ulO42f5LN4
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Eheh i updated also. If you run update_all with the custom db ;)
Insert Disk Two
Posts: 192
Joined: Sun May 24, 2020 7:59 pm
Has thanked: 10 times
Been thanked: 23 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by Insert Disk Two »

I really appreciate people patching cores to 60hz even though certain certain elitist gatekeepers, don't appreciate because they are against options. Is there a way this can be automated, especially for arcade cores where frequencies are all over the place!

Thanks and keep up the good work.
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Unfortunately it is very difficult to automate :-/ as each source files are different. On top of that, I don't believe you can automate the compilation online with github tasks for example. As for the neogeo, no worries, I will maintain this fork for a long time. My setup is done and it takes me just a couple of minutes to sync, compile and deploy the custom db.

I tried to modify some cores from jotego but he's using a linux env/setup which I haven't spent enough time putting in place properly.

Is there a particular arcade core you have in mind?
User avatar
uberyoji
Posts: 48
Joined: Sun May 24, 2020 11:03 pm
Has thanked: 5 times
Been thanked: 20 times

Re: Change core clock from 59.18 hz to 60 hz

Unread post by uberyoji »

Oh after reading about github actions, I believe some automation could be performed after all as Quartus seems available on linux and could potentially called from command line. Maybe I should start a new thread for further discussion about this.
Post Reply