- This topic is empty.
- November 27, 2021 at 7:43 pm #108217MyRetrozzParticipant
I’ve been struggling with this for a couple of years on and off.. trying to make Retroarch work with custom viewports (for that perfect console look) on ANY resolution.
1) You spend months building the best emulated versions of all old consoles ever.. (in 6 volumes!) playtest to death.. bring them to a friends house to test and…
2) Your friend has one of those crazy ‘superwidescreen’ monitors (game developers.. go figure!) – I am pretty sure that monitor is about 3′ wide! In any event.. your awesome creation.. LOOKS LIKE CRAP. Didn’t scale properly at all.
First solution.. try various routines to detect 1080p or 4k (using DXDIAG or other built in windows functions) and select a custom config accordingly (retroarch.cfg)
Yet.. on some friends who have CRAZY widescreen monitors.. who lknows what resolution that is btw.. (8k?)
Mull it over for a while.. and ask a BRAND NEW developer.. just learning coding. who says ‘I am learning Python’
Being oldskool (yes started coding on 6502 assembler..endless nights pouring through code on a C64 to ‘make legitimate backups ) have no experience with Python, but like anything else.. ‘How hard could it be??’
Well.. it turns out.. extremely simple!
This December.. re-releasing MyRetrozz Classic Minis Volume 1 (31 systems IIRC) with this FIXED, finally once and for all.
In true hac..err coder style, here is my entire source code, I wrote this in spare time over the course of 1 day.. and no I am nowhere near an expert in Python. Yes, could certainly optimize etc.. but code is readable and doesn’t have to be fast for what it does.
What does it do:
1) Reads a custom config file for these key values:
Custom viewport width
Custom viewport height
Custom viewport x position
Custom viewport y position
These are PERCENTAGE values.. meaning percentage of user’s screen size (so viewport width/screen width = percentage value, which is just multiplied back again and put into retroarch.cfg)
The final version shipped will be full .exe so NO python is required on end user machine. If users want to mess with the viewport, just update the .ini file which will be in the root directory. As you’ll see in the source code, nothing is hardcoded.
Here is the link to the source code.. hopefully this will help others for their projects utilizing Retroarch
Included in this archive:
1) The .py python script with commentary for every portion
2) A sample .retroarch.cfg file (in my loader routine, I grab retroarch.cfg from the .
etroarch directory), modify it, and put it back before running the game. The eventual goal is ALL loader routines will be ported to Python (read the VIC 20 loader to see insane routines required sometimes!)
3) A sample .ini file. I think those percentages were based on a initial 3840×2160 screen. You have to have a ‘base’ config to create your ‘percentage scale’ values, which will be used for EVERY other resolution.
4) A fake ‘header file’.. because retroarch doesn’t have the format of .ini with a [header] which can be read by the config loader) – note: I am just pre-pending the header to retroarch.cfg. Note: retroarch doesn’t seem to care about the additional header during loading and autostrips it out (doesn’t affect anything at all!) so makes it a bit easier for coding this.
Check the source code inside, .py and determine which libraries you need to PIP install..December 11, 2021 at 8:27 am #116289MyRetrozzParticipant
Just a quick update.. working through updating MyRetrozz Minis Volume 1 (30+ systems) with this new automagiccalculator screen size thingy module(as a full windows executable so no special setup at all by users)
Taking opportunity to update most of the cores (Retroarch) as well to ensure maximum compatibility.
In some cases.. adding new roms (homebrew) to some systems.
Hopefully into the ‘packaging’ phase soon and re-upload well in time for Christmas!
Note: The entire “Volume 1” will just fit on a 1TB drive. makes a perfect gift for friends/family over the holidays.December 13, 2021 at 12:26 am #116298Ninja UKKeymaster
- You must be logged in to reply to this topic.