Tutorial  Updated

How to play NDS Games in HD Widescreen (16:9, 21:9, 32:9)!

c8Cp7XCK_o.png

~ Pokémon Diamond Version in 3840x1080 HD (32:9 1080p) with 3D Rasterized in x16 Native Resolution (Captured from Retroarch DeSmuME core)

Notes

  1. If you made a cheat code using the old formula (the one @PRAGMA made) then please update your code to the new formula below which is way more accurate and fixes im-proportionate pixels.
  2. Make sure both the Cheat Code and Emulator Window aspect ratio's match or the frames may look stretched.
Supported Systems

  • DeSmuME on Windows using DeSmuMAR, or DeSmuME on any PC OS however you will need to manually configure DeSmuME to allow window stretching and manually stretch the window to be the Aspect Ratio you wish for.
  • Any core on Retroarch as you can force a specific aspect ratio in Retroarch settings.
  • DrasticDS on Mobile as it allows you to stretch the emulator display.
  • Probably others too! Perhaps MelonDS?
General steps for non-specific systems

  1. Stretch the emulator's output to be the wanted Aspect Ratio. Either by code, settings, wrapper applications, or manually.
  2. Add a cheat code (which can be found below) for the games and Aspect Ratio you wish to use.
  3. Done, run the game, as long as the cheat code works, and the emulator's output is the correct Aspect Ratio, it should look great!
Tutorial for DeSmuME on Windows using DeSmuMAR

  1. Download DeSmuMAR, copy it to C:/Program Files/DeSmuME (Create folder if needed).
    For Windows 8.1 and older: Right-click DeSmuMAR.exe -> Properties -> Compatibility Tab -> Tick "Run this program as an Administrator" checkbox -> Save.
  2. Open DeSmuMAR and it will ask you if you want to download the latest official master branch Dev Build (Auto-build from from an official AppVeyor link).
    Say (y) to download it or (n) for instructions on manually downloading DeSmuME for DeSmuMAR integration.
  3. Right-click DeSmuME.exe -> Properties -> Compatibility Tab -> Tick "Run this program as an Administrator" checkbox -> Save.
    If DeSmuME doesn't get write permission while being inside the "C:/Program Files" directory then it cant save! By doing the above with the Properties, DeSmuME will always require Administrator permission to run, which prevents the problem of saving and such not working without your realizing. Regardless if you're using DeSmuMAR or not, I recommend doing this!
  4. Open DeSmuMAR.exe and enter in the Aspect Ratio and Resolution (Size) you wish to use. It will then open DeSmuME with the exact size you asked for! It will also change various DeSmuME settings to ensure it's able to be opened to the Aspect Ratio and Resolution you specified. All this, automatically! The next time you open DeSmuMAR it will automatically apply the same Aspect Ratio and Resolution, this can be changed by deleting "DeSmuMAR.ini" and re-opening.
  5. Read on below for instructions on getting an Action Replay Cheat Code to use, a cheat code is required or the game will look stretched. When adding a Cheat Code, make sure you tick "turn on code" and if the ROM already booted, reset the ROM to apply the cheat code.
Done! Now, always open DeSmuMAR.exe instead of DeSmuME.exe from now on. You can even associate it as the default application for .nds ROMs or drag and drop supported files onto DeSmuMAR.exe and it will work!

NOTE:
  • View -> LCDs Layout -> Only Horizontal and One LCD options are supported at the moment.
  • If you want a better viewing enjoyment, then I recommend you fiddling with Config -> 3D Settings -> "General Options" Area -> "GPU Scaling Factor". This option changes the resolution of 3D objects, essentially the bigger the scaling factor, the less pixelated 3D objects will be.
  • For Pixel-based games like Zelda, Pokémon, I don't recommend using Texture Scaling as it just makes them less crisp by scaling and using a blur kernel, it doesn't really make them look better at all, if not worse.
Example 16:9 Action Replay Cheat Codes for a handful of popular games


520775D0 00001555
020775D0 00001C72
D2000000 00000000
by @KazoWAR
5201E9E4 00001555
0201E9E4 00001C72
D2000000 00000000
by ?
5202022C 00001555
0202022C 00001C72
D2000000 00000000
by ?
52022F80 00001555
02022F80 00001C72
D2000000 00000000
by ?
52282308 00001555
02282308 00001C72
D2000000 00000000
by @KazoWAR
52282328 00001555
02282328 00001C72
D2000000 00000000
by @KazoWAR
5226FE50 00001555
0226FE50 00001C72
D2000000 00000000
by @KazoWAR
5226FE90 00001555
0226FE90 00001C72
D2000000 00000000
by @KazoWAR
52039288 00001555
02039288 00001C72
D2000000 00000000
by @RadDude McCoolguy
52324998 00001555
02324998 00001C72
D2000000 00000000
by @RadDude McCoolguy
52101A64 00001555
02101A64 00001C72
D2000000 00000000
-
Side effects:
- Chickens (and possibly other entities) can walk through walls a bit near the top of the screen, possibly game breaking I dont know.
- Some NPC's eyes are glitched out and are 100% round and black, they look like zombies.
by @RadDude McCoolguy

For more, check the replies of this thread, or look below for information on crafting your own code.

Crafting your own Widescreen Code!

To craft your own cheat code, there's a fair bit involved and a lot of trial and error, you will need to have a bit of time on your hands if you haven't done something like it before.

The general idea is to look for ROUND(0x1000 * 0x04 / 0x03) which is 0x1555/5461 in the games RAM while a 3D object is loaded into view.

0x1555 is the HEX value for the camera's aspect ratio, which is 4:3. Usually this value wouldn't change, but we gonna do it anyway to trick the game into thinking our "Nintendo DS" has a 16:9 (or other) display, to get it to render 3D objects accordingly.

First things first we need to find out the HEX value for the aspect ratio we want. Down below I put the formula for calculating the HEX value for any aspect ratio you want. Do that to get the HEX value for an Aspect Ratio that would be obvious, I tend to go for something outrageous like 32:9.

Now we need to find the address that holds the 1555 value. I like to use DeSmuME's RAM Searcher to search for the original 4:3 HEX value which as explained earlier is 1555(h). More than one address will show so you will have to just trial & error every one of them until it works.

Change each address's value to the test HEX value we calculated earlier with the formula, and once it actually works, write down the address you changed, it should start with "02". Enter the address into the Cheat Code Format below to finish crafting your cheat code. Feel free to change the Aspect Ratio HEX value you used in debugging with the value you actually want, it still needs to be HEX calculated with the formula below.

Code:
{Address but change the starting "02" with "52"} 00001555
{Address} 0000{Aspect Ratio HEX Value}
D2000000 00000000

While it will just work with the Address and the value of whatever aspect ratio you want, it will be applied every frame even when it may not be in use (Thanks @KazoWAR for the tip)
The first and third line essentially just does a pre-check before trying to overwrite them.
If you're confused by the format, just take a look at the above pre-made cheat codes as an example.

Aspect Ratio Value Formula by (@Vague Rant)


chart.png

HEX(ROUND(0x1000 * WIDTH / HEIGHT))

0x1000 == 4096
ROUND == round to the nearest whole number
HEX == convert decimal to hex (base10 to base16)


e.g.
HEX(ROUND(0x1000 * 16 / 9)) == 0x1C72


Common result values using this formula to spare you time:
  • 16:9 - 0x1C72
  • 16:10 - 0x199A
  • 18:9/2:1 - 0x2000
  • 21:9 - 0x2555
  • 32:9 - 0x38E4
 
Last edited by PRAGMA,

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
Added new instructions, simplifying the whole process, I made an exe named "DeSmuME Resizer" which will make it basically 1 click to enable 16:9 sparing you tons of time each launch.
 
  • Like
Reactions: Milozaki

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
Updated DeSmuME Resizer to be a tad bit more Efficient and also updated the tutorial to use the official branch DeSmuME since the Nightly and AutoBuilds for 0.9.12 supports increasing the internal resolution now! :D
 

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
would love it for platinum, i just started new playthrough.

also, doesn anyone know if it will work at DSTWO?
It would but you can't stretch official hardware's screens, that would only be possible on 3DS hardware but no one knows if it can actually be done.

--------------------- MERGED ---------------------------

would love it for platinum, i just started new playthrough.

also, doesn anyone know if it will work at DSTWO?
Added support for Pokemon Platinum :)
Steps are no different apart from the Widescreen Action Replay code which I have added to the tutorial.
 

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
hW4qHhz.png

~ Pokémon Diamond Version in 3840x1080p HD in 32:9 Aspect Ratio with 3D Rasterized in X16 Native Res

Found a way to play in 32:9 and 21:9, would anyone actually want these? 32:9 almost all the time you see areas loading in/out, 21:9 might not but still could occasionally show it.

--------------------- MERGED ---------------------------

Added support for HeartGold/SoulSilver, I can't find the Camera Addresses for Black/White Black2/White2, so if you know them, let me know!

--------------------- MERGED ---------------------------

Added instructions for 21:9 and 32:9
 
  • Like
Reactions: noctis90210

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
Heya, seems great to be able to go back to the games like this! Any idea on the code I'd need for 18:9? Or just 2:1 lol, fancying giving this a shot on my phone and wanted it to completely fill the screen.
Try 3D28 [EDIT: Nope, its 1FFF] (replace last 4 of any above codes with that)

Edit ages later, Nope, its 2000
 
Last edited by PRAGMA,
  • Like
Reactions: Scarlet

Scarlet

Onion Soup
Editorial Team
GBAtemp Patron
Joined
Jan 7, 2015
Messages
5,134
Trophies
2
Location
Middleish North-Right
Website
scarlet.works
XP
14,758
Country
United Kingdom
Hmm odd stuff, Im still looking into properly getting the ratio's, my math must be off a bit. :/
No worries, stretched 16:9 is still a huge improvement over stretched 4:3 lol
 
  • Like
Reactions: PRAGMA

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
I've discovered the formula!

What I did to calculate it, was I got the original decimal value from DeSmuME RAM Searching @ the Address for the Camera, the original Decimal is 5461 (0x1555)
So, since we KNOW this is 1.33' (4:3), we can figure out how to get any aspect ratio from it, but first to be able to do that, we need to figure out what 1.00' (1:1) is.
To do this, we simply ((3 / 4 * 100)% of 5461) which is 4095.75, in theory, this is 1.00 (1:1) aspect ratio, so I went and tested against unmodified vs modified 1:1 calculation by overlaying via photoshop: https://imgur.com/cVw0es9
As you can see, they match pretty much perfectly, the reason its a tad bit different is because of decimal places and the fact we cant do much about it in only a 2 byte restricted value.
But we got 1:1! Now all we need to do is:
((3 / 4 * 100)% of 5461) * (16 / 9) = 7281.33'
Which results in the decimal value for 16:9! How do I know? They match up just like 1:1 pretty much bang on, just slightly off thanks to decimal places again.
Funny enough, this decimal value 7281.33' (0x1C71) is also the exact same as the original code I got from a Database, so this confirms these codes to be a correct formula.

Finalized Formula!
Code:
((oAH / oAW * 100)% of oD) * (cAW / cAH)
Where:
oAH = Original Aspect Height (3)
oAW = Original Aspect Width (4)
oD = Original Decimal Value (5461)
cAW = Custom Aspect Width (16)
cAH = Custom Aspect Height (9)
So for 21:9
((3 / 4 * 100)% of 5461) * (21 / 9)
2:1
((3 / 4 * 100)% of 5461) * (2 / 1)
40:40
((3 / 4 * 100)% of 5461) * (40 / 40)

--------------------- MERGED ---------------------------

No worries, stretched 16:9 is still a huge improvement over stretched 4:3 lol
1FFF :D




EDIT: Formula is wrong, correct formula discovered, see op.
 
Last edited by PRAGMA,

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
Thanks for all your work!

View attachment 167846
No problem! Hope you enjoy.

--------------------- MERGED ---------------------------

Updated DeSmuME Resizer with Aspect Ratio Support, Screens Amount Support and ROM Passthrough support! (You can now drag drop roms onto DeSmuME Resizer or make DeSmuME Resizer your default .nds app and it will pass the rom along to DeSmuME!)
 
Last edited by PRAGMA,

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
Black OW
52282308 00001555
02282308 00001C71
D2000000 00000000

White OW
52282328 00001555
02282328 00001C71
D2000000 00000000

Black 2 OW
5226FE50 00001555
0226FE50 00001C71
D2000000 00000000

White 2 OW
5226FE90 00001555
0226FE90 00001C71
D2000000 00000000
May I ask how you found these, and why they are different the all other games?

--------------------- MERGED ---------------------------

Well cool, guess that's all the core series Pokemon DS Games in Widescreen! :D, It's possible to do this in a multitude of other games, so perhaps I may remodel this tutorial into a more inclusive tutorial soon giving addresses for other games aswell?
 

PRAGMA

Well-Known Member
OP
Member
Joined
Dec 29, 2015
Messages
2,258
Trophies
1
Location
Ireland
Website
github.com
XP
5,036
Country
Ireland
P.S. The first and last lines here arent actually needed.
The first line is the original address and value in 4 byte length.
The second line is the only line of interest and the last line is just an ender.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    fluff663 @ fluff663: hoi