|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
Derivation of PAL aspect ratio and AMD display trick
Posted: Thu Jul 21, 2022 11:40 pm Last edited by mark_eire on Thu Mar 16, 2023 10:37 pm; edited 1 time in total |
Fascinated by recent PAL 256x240 discussions, I wanted to share some derivation calculations for aspect ratio as I'd struggle to find these myself.
Calculation credit goes entirely to Kitrinx, a MiSTer FPGA core developer, whose aspect ratio calculations were compiled into a handy website: https://morf77.pythonanywhere.com/ar (Aspect Ratio Calculator) Calculating NTSC; NTSC Pixel clock rate = 5.3693175 MHz Visible Pixels = 256 Visible Lines = 192 Video Type = NTSC Display Aspect Ratio (DAR) = 32:21 (1.5238095) Storage Aspect Ratio (SAR) = (256/192) = 1.3333333 Pixel Aspect Ratio (PAR) = DAR/SAR = 1.1428571 or 8:7 Calculating PAL; PAL Pixel clock rate = 5.3203424 MHz Visible Pixels = 256 Visible Lines = 192 Video Type = PAL Display Aspect Ratio (DAR) = 512:277 (1.8483755) Storage Aspect Ratio (SAR) = (256/192) = 1.3333333 Pixel Aspect Ratio (PAR) = DAR/SAR = 1.3862816 (almost but not quite 18:13) As a childhood SMS fan and very beginner SMS programmer (huge thanks to Maxim for the tutorial), I wanted to check a simple PAL image for programming practice. Since most art programs will have fixed square pixels, I've found one simple workaround for Windows using my AMD graphics card which will hopefully help others. Using the regular drivers and "AMD Adrenalin", the Display tab allows for entry of custom resolutions. For my 1920x1200 monitor, I entered 1384x1200 (in "Resolution (Px)" and "Timing Display"). Ensure AMD "Scaling Mode" is set to "Full Panel", "Integer Scaling" to "Disabled" and then apply the new resolution via the regular Windows menu. Now my monitor is a very close approximation to representing PAL PAR. For my incredibly rough test, I wanted to try PAL 240 with my Ever Oasis profile image. Manipulated using: https://www.smspower.org/Development/BMP2Tile (BMP2Tile) and https://haroldo-ok.github.io/RgbQuant-SMS.js/RgbQuant-SMS.js/demo/index.html (RgbQuant-SMS) (EDIT: Link updated March 2023) Minor addition to the Hello World tutorial code to set both Registers $00 and $01 to allow 240 lines, and VRAM write location reference changed from $3800 to $3700 (Thanks to reading a recent Discord conversation alongside Maxim's 240 test code http://github.com/maxim-zhao/sms-240-tester (sms-240-tester) The circle has remained a circle! Hopefully some of the above will be useful to others. |
|
|
Posted: Fri Jul 22, 2022 1:28 pm |
I know it's possible to modify the XML files used in Aseprite to add more PAR settings... but I haven't gotten around to this and just wound up using alternative methods to get a helpful PAR out of the non-tileset drawings I've done (ie. fullscreen or large scale art).
I usually wind up drawing for a 1.2 (6:5) PAR though, simply because it's a useful inbetween of the two - so that artwork can show up reasonably fine on both the PAL and NTSC machines, and roughly about the Game Gear's PAR. I've been meaning to use a CRT connected to my GPU for some kind of realtime output on a CRT though - but I'll need to move house first so I can get the room to connect my computer to my CRT through a HDMI > Component converter chain hahaha. Or I just use one of my smaller 31kHz monitors @ 120Hz. |
|
|
Posted: Fri Jul 22, 2022 11:20 pm |
Outputting to CRT would be ideal for sure.
Designing at 6:5 is a good in-between. Since the only SMS I've ever had is a PAL Model 2, I figured I'd design for its aspect specifically just for fun. I always have to play my childhood games in PAL or it breaks my mind, though I appreciate most games hardly took the difference into account. If I do ever manage to make a half decent bit of a game I'll try to rectify that and have at least one corrected circle or square in the game! :D |
|