Hello everyone.
For the games it supports, the Virtual Console DS emulator is, in my opinion, the best way to play DS games. The Wii U gamepad is a perfect way to handle the second screen, something PC DS emulators struggle with. There is one aspect with which PC emulators are universally better though, and that is with upscaling. For the uninitiated, upscaling is process of taking an image and increasing its resolution so that it can be displayed at a larger size. The way the DS Virtual Console emulator handles upscaling from the tiny DS screen to the relavitly massive Wii U screen is less than graceful.
There is a "Screen Settings" option within the emulator that lets you set the size and location of each display to a number of preset options. Your options are pretty limited, but fortunately, you can set the size and location to whatever you'd like by editing a file called "configuration_cafe.json" in the "content\0010" folder of the emulator's files.
Both displays on the DS have a resolution of 256 x 192, so setting the size of a screen to a multiple of said resolution (i.e. 256 x 192, 512 x 384, 768 x 576, ect.) will use integer scaling while upscaling the image. Integer scaling means that every pixel of the DS' display corresponds to a perfectly square array of pixels on the Wii U's display. This produces a very sharp looking image, and it is by far the best way to upscale displays as low resolution as the DS' screens. The trade-off to using integer scaling is that it requires the DS screen size to be set to a small number of fixed values, so invariably you will need letterboxing (black bars to fill the sides of the screen) to make up for the fact that none of the fixed sizes fill up the Wii U's entire display.
If the size is not set to a multiple of 256 x 192, the screens will still upscale, but they will use a more sophisticated upscaling algorithm that leaves artifacts. Under most circumstances, these artifacts aren't too noticable, and they are worth the trade-off of being able to set the DS screen size to something that fills most of the Wii U's displaty with little letterboxing. This is not the case with vertically oriented games. The below screenshot is the default layout for vertically oriented DS games. It scales each screen to 522 x 696 (696 x 522 rotated 90°). The game pictured is Tokimeki Memorial: Girl's Side - 1st Love Plus.
When upscaled to this resolution, illistrations (characters, backgrounds, ect.) look fine, but the font is abrasively terrible. Notice how the strokes of letters are of unequal thickness. The stem of the letters like "t," "k," and "p" are sometimes way too thin. The letters like "w" and "o" loose their symmetry. The curvature on almost every letter looks squished. The more you look at it, the worse it gets. It would be an exageration to say it makes the game unplayable, but it is distracting to the point that it is massivly determintal to the experience.
You are able to switch to a different upscaling algorithm by changing the "PixelArtUpscaler" setting in configuration_cafe.json from 0 to 1, but I think the results speak for themselves:
The natural solution to this problem would be to adjust the size of the DS screens so that they use integer scaling. The internal resolution of the Virtual Console DS emulator is 1280 x 720, so the largest possible multiple of 192 x 256 you can set the DS screen size to without exceeding the bounds of the display is 384 x 512. That looks like this:
The image becomes very sharp. In my opinion, this is much more acceptable than the above two, but there is a new problem in that the letterboxing is rather egregious. Fortunately, there is (potentially) a solution.
The limiting factor in increasing the size further is the height of the DS display, so the following calculations will focus on the y-axis of the resolution. The perctange of the y-axis that consists of letter boxing when using the largest possible integer scaling compatible screen size can be calcualted with the equation "100 * (n mod 256) / n" where n is the height of the emulator's internal resolution. The Wii U has three possible wide screen resolutions: 1920 x 1080, 1280 x 720, and 856 x 480. Here is what the percantage of vertical lettboxing is for each:
480p: 100 * (480 mod 256) / 480 = 46.67% of the height is letterboxing.
720p: 100 * (720 mod 256) / 720 = 28.89% of the height is letterboxing.
1080p: 100 * (1080 mod 256) / 1080 = 5.19% of the height is letterboxing.
For whatever reason, even though the Wii U's maximum output resolution is 1920 x 1080, the developers of the Virtual Console DS emulator set the app's internal resolution to 1280 x 720. Had they instead opted to set the emulator's resolution to 1080p, it would be possible to use integer scaling with virtually no letterboxing. I made a mockup of what that would look like:
This image is immaculate. My goal is to try to modify the Virtual Console DS emulator's executable file to increase its internal resolution from 1280 x 720 to 1920 x 1080 to allow for scaling like in the mockup above. With a little research, I was able to convert the emulator's .rpx file to a .elf file, open it in Ghidra, edit it, and re-convert it back to a .rpx file that runs both in CEMU and on original hardware. Here is where I hit a wall; I am not at all familiar with the Wii U's rendering framework, and documentation of it online is scarce. I don't really know what to do from here.
I tried searching for instances of the constants 1280 and 720 and changing them to 1920 and 1080 respectively. Going off of another thread I found on GBATemp, I tried changing the value of the third parameter of GX2SetTVBuffer() from 2 to 4. I may have made a few other changes, but to be perfectly honest, this was a few days ago and I don't remember perfectly.
After a lot of trial and error, I got the emulator to boot at a higher resolution... kinda....
The app's resolution increased, but the DS screens where still drawn to the bounds of 1280 x 720. If I try to open the Virtual Console menu, it looks like this:
This screen also appears bounded to 720p, only its centered. Interestingly, you can actually see the buttons fly in from the "out of bounds" region of the screen during the animation that plays upon opening the menu. Ultimately, I don't mind this screen being wrong. The biggest problem my changes cause is that they make the emulator incredibly unstable. The emulator hangs on boot if you have restore point data, and most games can't get past the title screen before a crash. Brain Age (which is the e-shop release this instance of the emulator is from, if that matters) can't even boot to the title screen. It crashes after the intro screen.
I have a suspicion that these problems are solvable, but I don't have enough technical knowledge about the Wii U to know how to proceed from here. If anyone has any ideas, please let me know. If it would help, I can generate an xdelta patch for my new version of the emulator's rpx file. I can also go back and try to see the exact changes I made in Ghidra.
Thank you,
Lorzen
For the games it supports, the Virtual Console DS emulator is, in my opinion, the best way to play DS games. The Wii U gamepad is a perfect way to handle the second screen, something PC DS emulators struggle with. There is one aspect with which PC emulators are universally better though, and that is with upscaling. For the uninitiated, upscaling is process of taking an image and increasing its resolution so that it can be displayed at a larger size. The way the DS Virtual Console emulator handles upscaling from the tiny DS screen to the relavitly massive Wii U screen is less than graceful.
There is a "Screen Settings" option within the emulator that lets you set the size and location of each display to a number of preset options. Your options are pretty limited, but fortunately, you can set the size and location to whatever you'd like by editing a file called "configuration_cafe.json" in the "content\0010" folder of the emulator's files.
Both displays on the DS have a resolution of 256 x 192, so setting the size of a screen to a multiple of said resolution (i.e. 256 x 192, 512 x 384, 768 x 576, ect.) will use integer scaling while upscaling the image. Integer scaling means that every pixel of the DS' display corresponds to a perfectly square array of pixels on the Wii U's display. This produces a very sharp looking image, and it is by far the best way to upscale displays as low resolution as the DS' screens. The trade-off to using integer scaling is that it requires the DS screen size to be set to a small number of fixed values, so invariably you will need letterboxing (black bars to fill the sides of the screen) to make up for the fact that none of the fixed sizes fill up the Wii U's entire display.
If the size is not set to a multiple of 256 x 192, the screens will still upscale, but they will use a more sophisticated upscaling algorithm that leaves artifacts. Under most circumstances, these artifacts aren't too noticable, and they are worth the trade-off of being able to set the DS screen size to something that fills most of the Wii U's displaty with little letterboxing. This is not the case with vertically oriented games. The below screenshot is the default layout for vertically oriented DS games. It scales each screen to 522 x 696 (696 x 522 rotated 90°). The game pictured is Tokimeki Memorial: Girl's Side - 1st Love Plus.
When upscaled to this resolution, illistrations (characters, backgrounds, ect.) look fine, but the font is abrasively terrible. Notice how the strokes of letters are of unequal thickness. The stem of the letters like "t," "k," and "p" are sometimes way too thin. The letters like "w" and "o" loose their symmetry. The curvature on almost every letter looks squished. The more you look at it, the worse it gets. It would be an exageration to say it makes the game unplayable, but it is distracting to the point that it is massivly determintal to the experience.
You are able to switch to a different upscaling algorithm by changing the "PixelArtUpscaler" setting in configuration_cafe.json from 0 to 1, but I think the results speak for themselves:
The natural solution to this problem would be to adjust the size of the DS screens so that they use integer scaling. The internal resolution of the Virtual Console DS emulator is 1280 x 720, so the largest possible multiple of 192 x 256 you can set the DS screen size to without exceeding the bounds of the display is 384 x 512. That looks like this:
The image becomes very sharp. In my opinion, this is much more acceptable than the above two, but there is a new problem in that the letterboxing is rather egregious. Fortunately, there is (potentially) a solution.
The limiting factor in increasing the size further is the height of the DS display, so the following calculations will focus on the y-axis of the resolution. The perctange of the y-axis that consists of letter boxing when using the largest possible integer scaling compatible screen size can be calcualted with the equation "100 * (n mod 256) / n" where n is the height of the emulator's internal resolution. The Wii U has three possible wide screen resolutions: 1920 x 1080, 1280 x 720, and 856 x 480. Here is what the percantage of vertical lettboxing is for each:
480p: 100 * (480 mod 256) / 480 = 46.67% of the height is letterboxing.
720p: 100 * (720 mod 256) / 720 = 28.89% of the height is letterboxing.
1080p: 100 * (1080 mod 256) / 1080 = 5.19% of the height is letterboxing.
For whatever reason, even though the Wii U's maximum output resolution is 1920 x 1080, the developers of the Virtual Console DS emulator set the app's internal resolution to 1280 x 720. Had they instead opted to set the emulator's resolution to 1080p, it would be possible to use integer scaling with virtually no letterboxing. I made a mockup of what that would look like:
This image is immaculate. My goal is to try to modify the Virtual Console DS emulator's executable file to increase its internal resolution from 1280 x 720 to 1920 x 1080 to allow for scaling like in the mockup above. With a little research, I was able to convert the emulator's .rpx file to a .elf file, open it in Ghidra, edit it, and re-convert it back to a .rpx file that runs both in CEMU and on original hardware. Here is where I hit a wall; I am not at all familiar with the Wii U's rendering framework, and documentation of it online is scarce. I don't really know what to do from here.
I tried searching for instances of the constants 1280 and 720 and changing them to 1920 and 1080 respectively. Going off of another thread I found on GBATemp, I tried changing the value of the third parameter of GX2SetTVBuffer() from 2 to 4. I may have made a few other changes, but to be perfectly honest, this was a few days ago and I don't remember perfectly.
After a lot of trial and error, I got the emulator to boot at a higher resolution... kinda....
The app's resolution increased, but the DS screens where still drawn to the bounds of 1280 x 720. If I try to open the Virtual Console menu, it looks like this:
This screen also appears bounded to 720p, only its centered. Interestingly, you can actually see the buttons fly in from the "out of bounds" region of the screen during the animation that plays upon opening the menu. Ultimately, I don't mind this screen being wrong. The biggest problem my changes cause is that they make the emulator incredibly unstable. The emulator hangs on boot if you have restore point data, and most games can't get past the title screen before a crash. Brain Age (which is the e-shop release this instance of the emulator is from, if that matters) can't even boot to the title screen. It crashes after the intro screen.
I have a suspicion that these problems are solvable, but I don't have enough technical knowledge about the Wii U to know how to proceed from here. If anyone has any ideas, please let me know. If it would help, I can generate an xdelta patch for my new version of the emulator's rpx file. I can also go back and try to see the exact changes I made in Ghidra.
Thank you,
Lorzen