Is it possible to hard code Widescreen code inside an iso?
- ShadowOne333
- Posts: 101
- Joined: Fri Jan 11, 2013 9:06 am
- Location: Mexico
- Contact:
Re: Is it possible to hard code Widescreen code inside an is
Really interesting...
I'm a little interested too in knowing how the code interacts directly with the HEX ROM values in the case of Mario Kart's code.
I'm a little interested too in knowing how the code interacts directly with the HEX ROM values in the case of Mario Kart's code.
Re: Is it possible to hard code Widescreen code inside an is
I'm more interested in the way Ralf can discover how and where you have to do the mod.
-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
The Wind Waker game use a predefined single-precision 32-bit IEEE 754 floating-point constant for the aspect ratio:
0x3FAAAAAB = 1.33333333 = 4:3
In the NTSC-U version of the game, this constant is stored at address 0x803FA998 in memory. The WW 16:9 Aspect Ratio code simply replaces the 4:3 aspect ratio constant with an appropriate value for a widescreen aspect ratio:
0x3FE38E39 = 1.77777778 = 16:9
MKDD doesn't use a predefined constant for the aspect ratio. The aspect ratio and culling boundaries are calculated once during game start:
0x3FADB6DB = 1.35714281 = 608:448 (aspect ratio)
0x402E7E47 = 2.72645736 (culling)
In the NTSC-U version of the game, these variables are stored at address 0x803CBE08 & 0C in memory. The MKDD 16:9 Aspect Ratio code replaces these variables with appropriate values for widescreen format.
Unfortunately, there's no predefined constant we can use for an ISO aspect ratio patch. So instead, we need to patch the aspect ratio calculation function directly:
0x3FAAAAAB = 1.33333333 = 4:3
In the NTSC-U version of the game, this constant is stored at address 0x803FA998 in memory. The WW 16:9 Aspect Ratio code simply replaces the 4:3 aspect ratio constant with an appropriate value for a widescreen aspect ratio:
0x3FE38E39 = 1.77777778 = 16:9
Code: Select all
AR/WiiRD 16:9 Aspect Ratio code
043FA998 3FE38E39
04 = Code type (32-bit RAM write)
3FA998 = Address
3FE38E39 = Value
MKDD doesn't use a predefined constant for the aspect ratio. The aspect ratio and culling boundaries are calculated once during game start:
0x3FADB6DB = 1.35714281 = 608:448 (aspect ratio)
0x402E7E47 = 2.72645736 (culling)
In the NTSC-U version of the game, these variables are stored at address 0x803CBE08 & 0C in memory. The MKDD 16:9 Aspect Ratio code replaces these variables with appropriate values for widescreen format.
Unfortunately, there's no predefined constant we can use for an ISO aspect ratio patch. So instead, we need to patch the aspect ratio calculation function directly:
Code: Select all
Original aspect ratio calc function
801D6578: 9421FFF0 stwu r1,-16(r1)
801D65A4: EC651024 fdivs f3,f5,f2 ; f5: x res f2: y res
801D65D0: D06DA9E8 stfs f3,-22040(r13) ; aspect ratio (f3 = 0x3FADB6DB = 1.35714281 = 608:448)
801D65F0: 93E1000C stw r31,12(r1)
801D65FC: EC454824 fdivs f2,f5,f9
801D6660: D04DA9EC stfs f2,-22036(r13) ; culling (f2 = 0x402E7E47 = 2.72645736)
801D66D4: 83E1000C lwz r31,12(r1)
801D66EC: 38210010 addi r1,r1,16
Modified aspect ratio calc function
801D6578: 3D203FE3 lis r9,0x3FE3
801D65A4: 61298E39 ori r9,r9,0x8E39
801D65D0: 912DA9E8 stw r9,-22040(r13) ; aspect ratio (r9 = 0x3FE38E39)
801D65F0: 7FEEFB78 mr r14,r31
801D65FC: 3DE04064 lis r15,0x4064
801D6660: 61EF9373 ori r15,r15,0x9373
801D66D4: 7DDF7378 mr r31,r14
801D66EC: 91EDA9EC stw r15,-22036(r13) ; culling (r15 = 0x40649373)
Re: Is it possible to hard code Widescreen code inside an is
Those replacement numbers are slightly distorted, to convert a 4:3 aspect to 16:9 you should be multiplying by 4/3. 1.35714281 * 4/3 != 1.77777778.
Re: Is it possible to hard code Widescreen code inside an is
Thanks for the detailed explanation Ralf!
It's a bit more complicated for me to do than what I suspected... 


Re: Is it possible to hard code Widescreen code inside an is
hey Ralf !
I wanted to do the same mod on the PAL iso.
I used the informations in the Wind Waker Pal thread you created :
16:9 Aspect Ratio (Widescreen) [Ralf]
044021C0 3FE38E39
in a Hex editor, but i don't know how to find the adress "4021C0", and which data i have to change for "3FE38E39".
I'm pretty new in game hacking, so i would appreciate some help
Thank you !
I wanted to do the same mod on the PAL iso.
I used the informations in the Wind Waker Pal thread you created :
16:9 Aspect Ratio (Widescreen) [Ralf]
044021C0 3FE38E39
in a Hex editor, but i don't know how to find the adress "4021C0", and which data i have to change for "3FE38E39".
I'm pretty new in game hacking, so i would appreciate some help

Thank you !
-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
Search for the following byte sequence in the PAL Wind Waker ISO:
C2480000 453B8000 3EDC28F6 3D3851EC
43660000 00000004 3FAAAAAB 481C4000
7F7FFFFF 00000000 3FE66666 40200000
00000000 44200000 43F00000 3F666666
3F000000 40000000 41A00000 3F800000
3FAAAAAB -> 3FE38E39
C2480000 453B8000 3EDC28F6 3D3851EC
43660000 00000004 3FAAAAAB 481C4000
7F7FFFFF 00000000 3FE66666 40200000
00000000 44200000 43F00000 3F666666
3F000000 40000000 41A00000 3F800000
3FAAAAAB -> 3FE38E39
Re: Is it possible to hard code Widescreen code inside an is
Sorry, i was no sure i had to search the same hex sequence.
So i'll try this in the next couple of hours.
Thanks !!
So i'll try this in the next couple of hours.
Thanks !!
-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
It's not the same byte sequence, two floating-point constants are slightly different.
Re: Is it possible to hard code Widescreen code inside an is
I was meaning the "3FAAAAAB".
Hell, i must study all this !
Hell, i must study all this !
Re: Is it possible to hard code Widescreen code inside an is
Me again.
So i tried, and failed.
I've done the swap, using HxD software. I loaded the iso using swiss (r283) but got a black screen (the iso is recognized in swiss).
I'll have to do more tests.
Thank you for your support !
EDIT :
the sequence around the sting i have to check doesn't look like yours.
My iso was ripped by myself from an original.
There must be something i miss in the how-to.
EDIT2 :fu**ing shame on me. I found the sequence you gave. I thought there could be only one per iso. -_-
I'm gona hide somewhere... a Mario's pipe...
So i tried, and failed.
I've done the swap, using HxD software. I loaded the iso using swiss (r283) but got a black screen (the iso is recognized in swiss).
I'll have to do more tests.
Thank you for your support !
EDIT :
the sequence around the sting i have to check doesn't look like yours.
My iso was ripped by myself from an original.
There must be something i miss in the how-to.
EDIT2 :fu**ing shame on me. I found the sequence you gave. I thought there could be only one per iso. -_-
I'm gona hide somewhere... a Mario's pipe...
Re: Is it possible to hard code Widescreen code inside an is
Hello guys... Back again... 
Ralf... Would it be ok with you if I request 1-2 more games to have their respective widescreen code please...?

Ralf... Would it be ok with you if I request 1-2 more games to have their respective widescreen code please...?

-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
Thank you! Would it be possible to have:
Twilight Princess (NTSC)
Super Mario Sunshine (NTSC)
Luigi's Mansion (NTSC)
Twilight Princess (NTSC)
Super Mario Sunshine (NTSC)
Luigi's Mansion (NTSC)
-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
The Legend of Zelda: Twilight Princess (NTSC-U & PAL)
42080000 44610000 3F866667 3F933334
BF400000 3FAAAAAB 3EDC28F6 3D3851EC
3DF5C28F 00000004 43660000 3FADB6DB
481C4000 43700000 3F8E147B 3F666666
3F000000 00000000 43300000 80000000
3FADB6DB -> 3FE79E79
42080000 44610000 3F866667 3F933334
BF400000 3FAAAAAB 3EDC28F6 3D3851EC
3DF5C28F 00000004 43660000 3FE79E79
481C4000 43700000 3F8E147B 3F666666
3F000000 00000000 43300000 80000000
Super Mario Sunshine (NTSC-U & PAL)
61000000 BF800000 2F000000 00000000
43300000 80000000 00000000 BF800000
3F800000 3F69D89C 2E736200 2F000000
70617261 6D730000 8D8790AC 33000000
43300000 00000000 00000000 3F800000
3F69D89C -> 3F9A7643
61000000 BF800000 2F000000 00000000
43300000 80000000 00000000 BF800000
3F800000 3F9A7643 2E736200 2F000000
70617261 6D730000 8D8790AC 33000000
43300000 00000000 00000000 3F800000
Luigi's Mansion (PAL)
800700DC 7CA62850 90A1013C 7C030050
90010134 90810138 90810130 C8210138
C8010130 EC211028 EC001028 EC010024
D00700B0 806D02F0 A0030000 540007FF
4182001C 81830008 280C0000 41820028
EC001028 -> 3C603FE3
EC010024 -> 60638E39
D00700B0 -> 906700B0
800700DC 7CA62850 90A1013C 7C030050
90010134 90810138 90810130 C8210138
C8010130 EC211028 3C603FE3 60638E39
906700B0 806D02F0 A0030000 540007FF
4182001C 81830008 280C0000 41820028
I don't have the US version of Luigi's Mansion, but there's a good chance that the same ASM code is used in the NTSC-U game. The blue marked Hex value could be different in the US version.
42080000 44610000 3F866667 3F933334
BF400000 3FAAAAAB 3EDC28F6 3D3851EC
3DF5C28F 00000004 43660000 3FADB6DB
481C4000 43700000 3F8E147B 3F666666
3F000000 00000000 43300000 80000000
3FADB6DB -> 3FE79E79
42080000 44610000 3F866667 3F933334
BF400000 3FAAAAAB 3EDC28F6 3D3851EC
3DF5C28F 00000004 43660000 3FE79E79
481C4000 43700000 3F8E147B 3F666666
3F000000 00000000 43300000 80000000
Super Mario Sunshine (NTSC-U & PAL)
61000000 BF800000 2F000000 00000000
43300000 80000000 00000000 BF800000
3F800000 3F69D89C 2E736200 2F000000
70617261 6D730000 8D8790AC 33000000
43300000 00000000 00000000 3F800000
3F69D89C -> 3F9A7643
61000000 BF800000 2F000000 00000000
43300000 80000000 00000000 BF800000
3F800000 3F9A7643 2E736200 2F000000
70617261 6D730000 8D8790AC 33000000
43300000 00000000 00000000 3F800000
Luigi's Mansion (PAL)
800700DC 7CA62850 90A1013C 7C030050
90010134 90810138 90810130 C8210138
C8010130 EC211028 EC001028 EC010024
D00700B0 806D02F0 A0030000 540007FF
4182001C 81830008 280C0000 41820028
EC001028 -> 3C603FE3
EC010024 -> 60638E39
D00700B0 -> 906700B0
800700DC 7CA62850 90A1013C 7C030050
90010134 90810138 90810130 C8210138
C8010130 EC211028 3C603FE3 60638E39
906700B0 806D02F0 A0030000 540007FF
4182001C 81830008 280C0000 41820028
I don't have the US version of Luigi's Mansion, but there's a good chance that the same ASM code is used in the NTSC-U game. The blue marked Hex value could be different in the US version.
Re: Is it possible to hard code Widescreen code inside an is
Thank you very, very much!
I'll try then tomorrow when I get home and let you know... 


- ShadowOne333
- Posts: 101
- Joined: Fri Jan 11, 2013 9:06 am
- Location: Mexico
- Contact:
Re: Is it possible to hard code Widescreen code inside an is
Sorry to bump this thread.
I found a cheat code that switches the buttons A and B for Megaman Anniversary Collection NTSC-U.
I was wondering if the code could be hardcoded into the ISO.
I don't know which one of the two is the right one, but here they are:
And here is the other one:
Could you help me out as to how to hard-code that one into the game?
I found a cheat code that switches the buttons A and B for Megaman Anniversary Collection NTSC-U.
I was wondering if the code could be hardcoded into the ISO.
I don't know which one of the two is the right one, but here they are:
Code: Select all
G6QE08
Megaman Annivesary Collection (US)
0603CCB8 00000008
5405BFFE 5406C7FE
Code: Select all
00D0C0DE 00D0C0DE
0603CCB8 00000008
5405BFFE 5406C7FE
F0000000 00000000
-
- Posts: 3909
- Joined: Sun Mar 16, 2014 9:31 am
Re: Is it possible to hard code Widescreen code inside an is
I don't have the Megaman Annivesary Collection, so I'm afraid I can't be of much help here:
The 2nd code is identical with the first one, but in old Ocarina code format.
00D0C0DE 00D0C0DE - start code list
0603CCB8 00000008
5405BFFE 5406C7FE
F0000000 00000000 - end code list
The code itself is a simple string code which writes 8 bytes to address 0x8003CCB8-0x8003CCBF in memory.
8003CCB8: 5405BFFE
8003CCBC: 5406C7FE
If you are going to hard-code these 8 bytes into the ISO you will need the original byte-values at address 0x8003CCB8/BC (and some more) as a search criteria.
The 2nd code is identical with the first one, but in old Ocarina code format.
00D0C0DE 00D0C0DE - start code list
0603CCB8 00000008
5405BFFE 5406C7FE
F0000000 00000000 - end code list
The code itself is a simple string code which writes 8 bytes to address 0x8003CCB8-0x8003CCBF in memory.
8003CCB8: 5405BFFE
8003CCBC: 5406C7FE
If you are going to hard-code these 8 bytes into the ISO you will need the original byte-values at address 0x8003CCB8/BC (and some more) as a search criteria.
Re: Is it possible to hard code Widescreen code inside an iso?
Hello,
Thanks for this topic.
I create a little app for windows in c# for MKDD iso, widescreen hack : Mario Kart 64 16/9 Patcher. US and PAL ISO compatible.

Download : Mario Kart 64 16/9 Patcher
Website link : bidouillouzzz.blogspot
If you prefer the hex edition, the tutoriel is here : MKDD 16/9 widescreen french tut
Widescreen VS Widescreen hack short video : https://www.youtube.com/watch?v=pdjCCr4KSQk
(youtube integration doesn't work)
Thanks for this topic.
I create a little app for windows in c# for MKDD iso, widescreen hack : Mario Kart 64 16/9 Patcher. US and PAL ISO compatible.

Download : Mario Kart 64 16/9 Patcher
Website link : bidouillouzzz.blogspot
If you prefer the hex edition, the tutoriel is here : MKDD 16/9 widescreen french tut
Widescreen VS Widescreen hack short video : https://www.youtube.com/watch?v=pdjCCr4KSQk
(youtube integration doesn't work)
- Aleron Ives
- Posts: 90
- Joined: Thu Oct 13, 2016 3:56 am
- Location: California
Re: Is it possible to hard code Widescreen code inside an iso?
You don't really need to write a program from scratch for this sort of thing; you can create patches with Xdelta, IPS, or CodeFusion that will get the job done easily without needing to write a separate program for each game.
Re: Is it possible to hard code Widescreen code inside an iso?
Something that would be much more interesting is a program that would take arbitrary AR/Gecko codes as input and patch the ISO with them.
Re: Is it possible to hard code Widescreen code inside an iso?
Aleron Ives : interesting, can you make this patches ?
Ar/gecko codes works but you must enter the long codes.
Swiss have the widescreen cheat but you must use Swiss ans isn't LAN compatible.
I write the app by pleasure.
If anyone want to play on MKDD Warpipe, i'm here.
Ar/gecko codes works but you must enter the long codes.
Swiss have the widescreen cheat but you must use Swiss ans isn't LAN compatible.

I write the app by pleasure.
If anyone want to play on MKDD Warpipe, i'm here.
- Aleron Ives
- Posts: 90
- Joined: Thu Oct 13, 2016 3:56 am
- Location: California
Re: Is it possible to hard code Widescreen code inside an iso?
IMHO the best method for creating permanent file patches is Code Fusion, because unlike Xdelta and IPS, it includes file verification abilities. Most games require separate patches for each regional release, and games with multiple releases per region may need more than one patch, too. The basic strategy for users to apply patches is:
Xdelta and IPS will get the job done, and you could even create patches that will work on the ISO itself, so that GCRebuilder isn't needed, but this method provides no verification that you're even patching the correct game, let alone the correct release, so users may end up with a corrupt ISO if they don't know what they're doing. Xdelta and IPS have cross-platform options, though, which some people may consider important.
- Extract the game's DOL file with GCRebuilder.
- Run the patching program for your release of the game, and patch the DOL file.
- Import the patched DOL back into the ISO with GCRebuilder.
Xdelta and IPS will get the job done, and you could even create patches that will work on the ISO itself, so that GCRebuilder isn't needed, but this method provides no verification that you're even patching the correct game, let alone the correct release, so users may end up with a corrupt ISO if they don't know what they're doing. Xdelta and IPS have cross-platform options, though, which some people may consider important.
-
- Posts: 4
- Joined: Mon Oct 01, 2018 10:30 am
Re: Is it possible to hard code Widescreen code inside an iso?
Someone could help me on how to modify the codes? I try to change ones I have with those of Ralf but do not understand as much as manage the Hexa editor, a small tuto or something pls:(
I wanted to modify the Wiird codes of mode 60hz for Beyond good & Evil and the Prince of Persia two thrones and Warrior within, all from region PAL.
I wanted to modify the Wiird codes of mode 60hz for Beyond good & Evil and the Prince of Persia two thrones and Warrior within, all from region PAL.
-
- Posts: 33
- Joined: Tue May 01, 2012 8:59 am
Re: Is it possible to hard code Widescreen code inside an iso?
Hello everybody,
And is it possible to force 480p inside a PAL ISO file with this cheat code technic?
Thanks
And is it possible to force 480p inside a PAL ISO file with this cheat code technic?
Thanks