PAL SGB1 time conversion
2 years ago
Baden-Württemberg, Germany

i have recently stumbled across this tool (http://nudua.com/convert) to convert NTSC SGB1 to GB/SGB2 and was wondering if it is possible to convert times from a PAL SGB aswell.

United States

This took me a surprising amount of research and math to figure out, so I'll detail my findings below. This is way more detail than you specifically need, but hopefully this can now act as a definitive resource.

The main source I used was this webpage detailing the method I've used. We take the SNES CPU clock speed, divide by 5 to get the clock speed the SGB runs at, then compare this against the GB clock speed. The site makes a (tiny) mathematical error here, performing 1 - (GB CPU / SNES CPU) instead of 1 / (GB CPU / SNES CPU), which was part of Radix's methodology for comparing the SGB and GBP, see the linked Excel file. We can instead invert the clock speeds from the start, performing SNES CPU / GB CPU for the same result as Radix. This results in the multiplication rate when using SGB compared with GB.

We have more accurate numbers than the site uses, so let's fill them in.

Wikipedia gives us the various SNES CPU clock speeds. This source agrees with another massive page of SNES technical specifications. The NTSC SNES CPU clock speed is 21.47727 MHz, suggesting a NTSC SGB clock speed of 21.47727 MHz / 5 = 4.295454 MHz. Likewise, the PAL SNES CPU clock speed is 21.28137 MHz, suggesting a PAL SGB clock speed of 21.28137 MHz / 5 = 4.256274 MHz.

Wikipedia also gives us the GBC clock speeds. The lower clock speed is 4.194304 MHz, while the higher clock speed is exactly twice this. Because the GB and GBC share the same processor, the Sharp LR35902, this speed is the CPU clock speed of the GB. All relevant GB-to-console devices (SGB, SGB2, GBP) have this processor, though only the SGB fails to run it at the appropriate speed.

We can now perform our rate calculation. Using the NTSC SNES CPU clock speed, our calculation results in 4.295454 MHz / 4.194304 MHz = 1.024116039276123046875. Therefore, the NTSC Super Game Boy runs 1.024116039276123046875 times faster than a Game Boy. Likewise, using the PAL SNES CPU clock speed, our calculation results in 4.256274 MHz / 4.194304 MHz = 1.014774799346923828125. Therefore, the PAL Super Game Boy runs 1.014774799346923828125 times faster than a Game Boy.

The GB has a framerate of precisely 262144/4389 = 59.7̅2̅7̅5̅0̅0̅5̅6̅9̅6̅0̅5̅8̅3̅2̅7̅6̅3̅ frames/second]. ([TASVideos]((http://tasvideos.org/PlatformFramerates.html) truncates this to 59.727500569606 frames/second, while your site rounds this to 59.72750056960583 frames/second, the 14th digit.) We can tell that the NTSC Super Game Boy runs at an equivalent framerate of 262144/4389 frames/second × 1.024116039276123046875 = 61.1̅6̅7̅8̅9̅1̅3̅1̅9̅2̅0̅7̅1̅0̅8̅6̅8̅0̅7̅9̅2̅ frames/second. Though it is unclear whether your site uses the true GB framerate or its truncated value, both calculations match the site's rounding to the 14th digit, suggesting my calculations are accurate. Likewise, we can tell that the PAL Super Game Boy runs at an equivalent framerate of 262144/4389 frames/second × 1.014774799346923828125 = 60.6099̅6̅2̅4̅0̅6̅0̅1̅5̅0̅3̅7̅5̅9̅3̅9̅8̅4̅ frames/second. You'll want to copy and paste this without the overlines (60.6099624060150375939849) into the calculator on your site.

My calculations were performed with WolframAlpha. You will never need this overwhelming level of precision, but here it is anyway. Real-world factors likely influence this result—note that Radix only obtained five out of six digits correct during his test above, which used audio recordings.

It's worth noting that your site seems to perform a simple calculation, taking the source framerate, dividing it by the conversion framerate, and multiplying this rate by the given time. This calculation is accurate, including the truncated rates displayed.

Because every source I've found suggests the SGB2 has a clock that runs at the exact rate of the GB, the SGB2 is recommended for speedrunning. As I mentioned above, the GBP (which contains the same CPU and hardware as a GBA) also runs at a similar framerate to the GB, though the case is less clear-cut—while Radix's test showed a GBP running at exactly the rate a GB would, this thread shows an example of the GBP running slightly fast. This is said to be an issue in software, which is fixable by using homebrew software for the GBP. Modifications (such as this product) to the SGB exist to fix the discrepancy between SGB and GB, though I would always ask your game's moderators to see if they would allow this.

Edited by the author 2 years ago
MrMonsh, Ivory and 3 others like this
Baden-Württemberg, Germany

oh wow! thank you for the extensive amount of research and detailed explanation! this is gonna help a lot of people for sure.

Edited by the author 2 years ago
Quivico likes this