Homebrew d2x cIOS possibly causing faster disc load times

Thurler

Member
OP
Newcomer
Joined
Jan 23, 2022
Messages
10
Trophies
0
Age
27
XP
22
Country
Brazil
Hello everyone, first some context into what me and some other friends are testing:

We speedrun Trauma Center Second Opinion on Wii, and because we're encouraged to keep our playing environment as close as possible to an unmodified Wii playing an unmodified game, the ideal scenario would be to run a physical copy of the game through the disc channel. But as fate would have it, it's faster to play a Japanese copy of the game, so we need to bypass the region lock. Enter Gecko OS, Neogamma and USB Loader GX, all viable options for loading a physical copy of the JP game on a US/EU console.

Recently, one player finished one of the episodes in the game with record time, with an IGT (in-game time) of 2:36.99. Another player then beat his IGT time with a 2:36.06, but when we looked at the RTA (real time attack, aka the actual real time elapsed) times, the previous player had the smaller RTA time by nearly 6 whole seconds. How was it possible that players with identical game copies on (near) identical hardware had such a big gap on RTA? The answer turned out to be, load times.

There is a screen transition when taking certain mandatory actions in the episode, where the game fades to black, likely loads some data from the disc, and then presents the new screen. These turned out to be much faster for one player compared to the other, so we began testing out different scenarios in search of a pattern and alleged culprit.

I'll cut to the chase here and mention the two things that stood out from the data: DVD drive version and whether or not d2x-cIOS was installed. The first one was easy enough to account for, the player with the latest model had the advantage of having a faster drive, which is known to be faster than its peers in other games: An example from the Pikmin 2 speedrunning community

After both players had Wiis with the "fast" DVD drives, we began looking at possible effects different loaders had. The numbers presented below are our findings, and the value itself doesn't mean much, just know that less is generally better (ie, the game exited the screen transition faster). The data has been averaged over some runs to remove some of the natural variance associated with reading from discs. All data is collected with a physical copy of the US release of the game and the latest version of the respective loaders:
  • Disc channel on a "slow Wii": 4.733 seconds
  • Disc channel on a "fast Wii": 4.633 seconds
  • Disc channel on a vWii: 4.616 seconds
  • Gecko OS on a "slow Wii", without d2x-cIOS: 4.783 seconds
  • Gecko OS on a "fast Wii", without d2x-cIOS: 4.633 seconds
  • Gecko OS on a "fast Wii", with d2x-cIOS: 4.633 seconds
  • Neogamma on a "slow Wii", without d2x-cIOS: 4.733 seconds
  • Neogamma on a "fast Wii", without d2x-cIOS: 4.633 seconds
  • Neogamma on a "fast Wii", with d2x-cIOS: 4.433 seconds
  • USB Loader GX on a "slow Wii", without d2x-cIOS: 4.550 seconds
  • USB Loader GX on a "fast Wii", without d2x-cIOS: 4.433 seconds
  • USB Loader GX on a "fast Wii", with d2x-cIOS: 4.416 seconds
From the data, it would appear that something finicky is going on with Neogamma and USB Loader GX, but for Neogamma specifically, only when d2x-cIOS is present. Messing around with Neogamma settings after seeing the output it was giving when loading the game ("requested IOS = 9" followed by "blocking IOS reloads"), we changed the following settings:
  • General -> IOS for games = "correct IOS"
  • Wii -> Block IOS Reload = "No"
This changed the messages when loading the game from the ones above to "loading IOS 9", without a follow-up regarding blocking reloads. If my understanding is correct (and this is a big if since I'm no expert when it comes to how homebrew works), Neogamma was previously defaulting to loading the game with IOS 249, which would be a stub when there's no cIOS or BootMii installed. This stub would then cause the loader to default to whatever IOS the game wants to use (9 in this case). Configuring it like this actually changed the load times for it:
  • Neogamma on a "fast Wii", with d2x-cIOS, but configured to use IOS 9: 4.633 seconds
This doesn't explain how USB Loader GX can save on load times on any Wii, regardless of cIOS being installed or not. But at least for Neogamma, changing that setting seems to make it align with the "ground truth" of the disc channel. I have no understanding of what Neogamma, USB Loader GX, or d2x-cIOS is doing, so I'm turning to these forums in hopes someone can help shed some light on what is going on. I'll be happy to provide any other information you want/need, as well as further elaborate on how we got to those numbers, if needed.

"But why does any of this matter?" you might be asking. In speedrunning, we try and match the "vanilla" environment as closely as possible, to ensure that people aren't required to homebrew in a specific way to compete. And a faster load time resulting from installing homebrew is the opposite of that goal, and we use the disc channel as a ground truth for that.

Thank you for reading and sorry if it's too big of a wall of text, but I felt the need to provide as much context as possible since it's a very specific issue. Hoping someone can help!
 
  • Like
Reactions: Exidous and CoolMe

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
12,597
Trophies
2
Age
36
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
6,968
Country
Cyprus
Even without cios usbloader gx may be using IOS58 in some capacity which had faster loading times, especially if running from usb.

What is your question exactly?

If you want consistency then you would need a consistent setup. So using stock game ios, and you can region free your disc channel using priiloader if necessary.

I'm assuming you want to avoid usb loading as that would most certainly have faster load times, and those could vary from hdd to hdd.
 

Thurler

Member
OP
Newcomer
Joined
Jan 23, 2022
Messages
10
Trophies
0
Age
27
XP
22
Country
Brazil
I guess I forgot to mention in the OP, but Trauma Center Second Opinion has an extra layer of annoying things to deal with, namely that it forces 480i when the Wii is set to 480p. So we rely on loaders to both boot out of region discs and force the game to boot in 480p by patching video. Which we did test and had no effect on load times.

Indeed, we already disallow loading from USB since it's a mess of loading times, so really we just want to standardize a homebrew setting that offers no advantage over someone with no homebrew running the disc channel.

The question exactly could be separated into 2-3, regarding the different loaders:
  • Are we seeing faster loadings from USB Loader GX (regardless of cIOS) specifically because it uses IOS 58 in some way? Since from what I read, that IOS would only realy impact when loading from USB
  • A possible follow-up: can we disable this behavior in any way, so that people already used to USB Loader GX don't have to change their setup?
  • Is our understanding of Neogamma loading on cIOS (when it is present) instead of the game's default IOS correct? We already seem to have the data showing it's something like that, but it'd nice to have a thorough explanation for transparency
I could be wrong, but last time I checked enabling the region free disc channel on Priiloader still caused the disc channel to not recognize out of region discs. I'll double check just to be sure.
EDIT: It did recognize out of region discs just fine, but booted into a black screen.
 
Last edited by Thurler,

Clector

Well-Known Member
Member
Joined
Mar 15, 2016
Messages
1,032
Trophies
0
Location
Not here
XP
394
Country
Bangladesh
Nintendo optimized things eventually with faster read speeds of things like NAND for example on later IOS version.
Hence running a game with a newer IOS may end up in things loading a bit faster, which in this case may be more noticeable so as this game uses a very old IOS version.
You can try to manually change the IOS USBLoaderGX uses to load games on its settings, but not sure if that will be able to load the game, but it may be worth the try.
 
Last edited by Clector,
  • Like
Reactions: Thurler

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
12,597
Trophies
2
Age
36
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
6,968
Country
Cyprus
I think you'd probably want your users to post a syscheck, and confirm the running ios is the same version/consistent
https://gbatemp.net/threads/posting-a-system-check.300279/

And you'll also want to confirm neogamma settings are consistent, to either use cios249 or the game ios consistently
 

Thurler

Member
OP
Newcomer
Joined
Jan 23, 2022
Messages
10
Trophies
0
Age
27
XP
22
Country
Brazil
You can try to manually change the IOS USBLoaderGX uses to load games on its settings, but not sure if that will be able to load the game, but it may be worth the try.
Last I checked I could only set IOS 200-255 as the game IOS in USBLoaderGX, it doesn't allow me to set anything below that. It makes sense why it would do that since you can't expect people to change this to the correct IOS for each game, but it would be nice to be able to override it

And you'll also want to confirm neogamma settings are consistent, to either use cios249 or the game ios consistently
That does seem to be the most effective solution, to force people to use either Gecko or Neogamma with the settings to use the correct IOS. There's no guarantee every cIOS is going to behave the same way, and even then, we'd be straying a bit too far from "staying as close as possible to the vanilla scenario".

Have you eliminated the possibility of something as simple as a dirty laser?
If it were a dirty laser it wouldn't make sense for specific configurations to be consistently faster than others. All measurements were taken using the disc, and the same conclusion has been reached with at least 3 different Wiis, I don't think all 3 would be dirty and randomly work better just when specific configurations are applied.

---

One thing that did occur to me just now is that maybe it isn't d2x-cIOS causing the discrepancies, but rather the base IOS used when installing it. Following the installation on Wii Guide we'd use 57 as a base and slap it onto 249, 56 as a base onto 250, and 38 as a base onto 251. Clector mentioned that it's possible the load discrepancies are from using a newer IOS, so it would make sense that using the cIOS with a recent IOS as a base would lead to the same issue.

Maybe I'm misunderstanding what the base IOS is for when installing the cIOS, but hey, how stupid of a question can it really be? :P
On that train of thought, if it were possible to use IOS 9 as a base for cIOS, maybe it would fix the load time discrepancies. I'll also look for any way to fork USB Loader GX to allow games to use IOS slots lower than 200, shouldn't be that big of a change in the code.
 

Thurler

Member
OP
Newcomer
Joined
Jan 23, 2022
Messages
10
Trophies
0
Age
27
XP
22
Country
Brazil
While that is true, it would be easier and faster to just force everyone to use specific settings to standardize things, it would be nice to better understand what is going on - if anything just for transparency when we inevitably have to explain why certain loaders are not allowed.

It would be even nicer if we could figure out how to allow more loaders so that people don't need to bend their setups to the standard rules too much - someone that already has USB Loader GX and is used to it, for example, wouldn't have to get used to a different loader just for this. I know it's just a mild inconveniece that many wouldn't care about, but it certainly wouldn't hurt to have more loaders allowed, even if it means configuring them in oddly specific ways.

The whole problem of "how can we make this standard" is already solved (and solvable for any other setup) by measuring the load times and comparing to our current findings. Personally I just want to know, with some certainty/clarity, why these differences are showing up, and if it is possible in any way to make the loaders behave closer to what we measured for disc channel.
 

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
12,597
Trophies
2
Age
36
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
6,968
Country
Cyprus
The ios loaded is like a driver, the game was built to run on ios9, but it can also run on other drivers (that doesn't mean it will run properly on just ANY ios mind you). Custom drivers (or custom ios's, or cios's) were built by tweaking existing drivers and even adding more components/modules to them, this is what we mean by a base ios. So for example, a cios with base 57 is based on IOS57 (to further complicate things each ios has version numbers too). So d2x v1 base 57 versus d2x v10 base 57, they are both based on the same original ios, but the changes/additions are different. These cios's typically get installed to unused slots, like 249 or 250. Over time cios's have been improved such that 1 or 2 can play 99% of games, but on a stock wii over a dozen different ios's could be commonly used, and vary from game to game depending on what ios it was designed to work with.

The explanation as to load times differ is simply that it's using a different driver.

So long as the driver is the same, the loader shouldn't really matter, so long as it's being loaded without any additional tweaks or patches (or the same tweaks/patches are applied consistently from one loader to the next). For example, theres a 480p patch or a deflicker patch etc, and this is basically making additional relatively minor changes to the cios in memory (I may be oversimplifying but you get the idea).

So if you were to run a syscheck and confirm consistent ios is being used, the loader can change, and all else being equal (I.E. Consistent video mode patches, etc) I would expect similar results between pretty much any loader. Again this is assuming it's running from disk, if you introduce usb hard drives to the mix then that would definitely introduce variability and faster loading times for those with better hardware.

Edit: there is one other thing you could try to test, but I haven't mentioned it before now because I think it will not give u as consistent results as what we have been discussing so far. But yeah, alternatively you could run sneek or uneek to load a Japanese emulated nand / system menu and load the game that way. This way you would be able to have any region wii behave as if it was Japanese, and use a STOCK ios9 to play the game from the disc channel. The one thing I'm not sure about is whether device storing the emulated nand will have a significant impact on load times (i. E. Emunands can be saved to sd card or USB hard drives, ios 9 will be included on these emulated nands and used when playing discs from within the emunand, so even though the game is running from the disc, the driver is running from the emunand/external media device).

Edit2: if you are an ultra purist, you could actually region change your real nand to be Japanese, then run the disc from the disc channel without any other mods, it would be like you purchased a stock Japanese wii. I'm not a big advocate of unnecessary region changing, especially with region free patches, but thought I'd mention it all the same.

Edit 3: btw my app ModMii can help with softmodding, region changing, setting up sneek/uneek, building an emulated nand, etc.
 
Last edited by XFlak,

Thurler

Member
OP
Newcomer
Joined
Jan 23, 2022
Messages
10
Trophies
0
Age
27
XP
22
Country
Brazil
Firstly, thank you very much XFlak for the long but precise explanation, it helped me click a few missing pieces of the puzzle. The driver analogy helped me find other posts in the forum here about how the Wii only loads one IOS at a time, rather than different IOSs being made for different purposes and "coming together" to make a complete thing along with the lower IOS slots. Which in turn finally helped me accept why loaders running off of IOS 58 or d2x-cIOS based on IOS 57 are loading faster than IOS 9 (explaining the Neogamma / USB Loader GX behavior observed).

Regarding your edits: the idea of running an emuNAND sounds very promising as an alternative to all this, though as you mentioned, maybe it would just shift the problem to saving and loading save files. Which would help greatly for this game, but maybe not as much for some other one. The idea of messing with the real nand seems like it would solve this, but that sounds risky enough just typing it out, lol. I know there's plenty of brick protection in place, but it really could be a way out. I'll definitely look more into it when I have more free time, ModMii seems like it'd help immensely there. :)

---

A friend of mine was following along and messing around with different base IOSs for d2x-cIOS, and apparently using IOS 38 as a base instead of the usual 57 or 56, then putting it in IOS 251 (as recommended by the cIOS guide in wii.guide) seemed to normalize the load times to values very close to the ones measured through disc channel / IOS 9, so we could use this as a possible solution for those that really insist on using USB Loader GX, that only allows to override IOS 249 for games to IOS 200~255.

Trying to go further beyond, I had the idea of just making a copy of plain old IOS 9 v1034 (for regular Wii) on IOS 251 (or whatever other slot is free) using WiiMod Lite, and after fiddling a bit with NUS Downloader I got the WAD to install, and got the game to load just fine through USB Loader GX using IOS 251. Unsurprisingly, the load times were consistent with disc channel and previous IOS 9 measurements.

It being a plain old IOS instead of a patched cIOS makes it show up as an "unpatched" IOS on SysCheck, which does raise some concerns about enforcing this configuration, but that is a separate issue far beyond the scope of this thread. Thank you very much to everyone that shared their thoughts and knowledge (and for putting up with my walls of text :P), but I feel like I have a MUCH better understanding of what's going on and of which tools are available to help me navigate through other problems regarding homebrew.
 
  • Like
Reactions: XFlak

XFlak

Wiitired but still kicking
Member
Joined
Sep 12, 2009
Messages
12,597
Trophies
2
Age
36
Location
Cyprus, originally from Toronto
Website
modmii.github.io
XP
6,968
Country
Cyprus
Btw modmii classic's advanced downloads page makes it easy to download ios9 (or any ios for that matter) and change the slot number. The only issue is that there isn't a good way to confirm this is installed to a particular slot. If you run syscheck it will tell you some info, but really you'd want it to be tagged so that it's clear it's ios9 installed to whatever slot. Just adding a tag to an ios won't impact it's performance, however there's nothing preventing me from tagging any ios in any way I want, but this is probably beyond what most people would be familiar with.

In other words, with some modifications one could add a tag to ios9 so that it's clear in syscheck's that it's a stock ios9 installed to a different slot. But there's nothing stopping someone with the required knowledge to sign IOS58 (for example) so it appears as if it's ios9. That being said, you couldn't pass off a patched ios or custom ios as a clean/stock ios9, as this would be detected by syscheck.

Edit: maybe IOS58 was a bad example, because iirc syscheck detects its usb2 support
 
  • Like
Reactions: jeannotte
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: In my day we had to train to fight off the communist menace because Russia might inva.... Well...