1. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    [​IMG]
    ~ 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)


    [​IMG]
    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, Sep 26, 2020
  2. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    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.
     
    Milozaki likes this.
  3. GalenTheGamer

    GalenTheGamer Advanced Member
    Newcomer

    Joined:
    Jan 8, 2009
    Messages:
    52
    Country:
    United States
    does it work with Black and White?
     
  4. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    You will probably need to find an AR Widescreen code similar to the one for Diamond and Pearl but the premise is basically the same.
     
    reprep likes this.
  5. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    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
     
  6. GravityLoL

    GravityLoL GBAtemp Regular
    Member

    Joined:
    Jun 17, 2012
    Messages:
    179
    Country:
    Poland
    would love it for platinum, i just started new playthrough.

    also, doesn anyone know if it will work at DSTWO?
     
    Last edited by GravityLoL, May 22, 2019
  7. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    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.

    — Posts automatically merged - Please don't double post! —

    Added support for Pokemon Platinum :)
    Steps are no different apart from the Widescreen Action Replay code which I have added to the tutorial.
     
  8. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    [​IMG]
    ~ 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.

    — Posts automatically merged - Please don't double post! —

    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!

    — Posts automatically merged - Please don't double post! —

    Added instructions for 21:9 and 32:9
     
    noctis90210 likes this.
  9. Scarlet

    Scarlet Pretty Pretty Princess
    Reporter

    Joined:
    Jan 7, 2015
    Messages:
    3,798
    Country:
    United Kingdom
    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.
     
  10. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    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, May 18, 2020
    Scarlet likes this.
  11. Scarlet

    Scarlet Pretty Pretty Princess
    Reporter

    Joined:
    Jan 7, 2015
    Messages:
    3,798
    Country:
    United Kingdom
    That one's a bit off lol

    Screenshot_20190523-064855.jpg

    16:9 basically looked alright but I just wanted to properly match my aspect ratio where possible.
     
  12. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    Hmm odd stuff, Im still looking into properly getting the ratio's, my math must be off a bit. :/
     
    Scarlet likes this.
  13. Scarlet

    Scarlet Pretty Pretty Princess
    Reporter

    Joined:
    Jan 7, 2015
    Messages:
    3,798
    Country:
    United Kingdom
    No worries, stretched 16:9 is still a huge improvement over stretched 4:3 lol
     
    PRAGMA likes this.
  14. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    From this I can confirm my calculations for 21:9 + are incorrect, while they look almost correct, they arent. Thanks for asking this so I could figure out :)
     
    Scarlet likes this.
  15. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    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)

    — Posts automatically merged - Please don't double post! —

    1FFF :D




    EDIT: Formula is wrong, correct formula discovered, see op.
     
    Last edited by PRAGMA, May 18, 2020
    IncredulousP, AikoT_T and Scarlet like this.
  16. Scarlet

    Scarlet Pretty Pretty Princess
    Reporter

    Joined:
    Jan 7, 2015
    Messages:
    3,798
    Country:
    United Kingdom
    Thanks for all your work!

    Screenshot_20190523-104833.jpg
     
    PRAGMA likes this.
  17. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    No problem! Hope you enjoy.

    — Posts automatically merged - Please don't double post! —

    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, May 23, 2019
  18. KazoWAR

    KazoWAR GBAtemp Advanced Maniac
    Member

    Joined:
    Aug 12, 2008
    Messages:
    1,947
    Country:
    United States
    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
     
  19. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    Country:
    Ireland
    May I ask how you found these, and why they are different the all other games?

    — Posts automatically merged - Please don't double post! —

    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?
     
  20. PRAGMA

    OP PRAGMA GBAtemp Addict
    Member

    Joined:
    Dec 29, 2015
    Messages:
    2,191
    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.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Widescreen, Games,