• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

16:9 Widescreen w/ options for TV, Monitor, Dolphin

Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
This is a modification to the 16:9 Widescreen code that includes options depending on the device you use to play. Full explanation here.

Document

 
Last edited:

Y-L

Smash Champion
Joined
Jan 16, 2014
Messages
2,436
Location
Ventura, CA
@ Dan Salvato Dan Salvato , would there be any chance you could fix the widescreen hack so that the off screen bubbles are in the 16:9 region instead of the 4:3 region?

 

trash?

witty/pretty
Premium
Joined
Jul 27, 2012
Messages
3,452
Location
vancouver bc
NNID
????
check the update in the reddit thread, melee is specifically at a super weird aspect ratio he didn't take into account so codes are re-updated. it's not the biggest change, from my naked eye, but it's still a bit more accurate

Code:
16:9 for tv’s:
xxxx = 4080, yyyy = 4040
16:9 for monitors:
xxxx = 4200, yyyy = 41c8
16:9 for dolphin:
xxxx = 4260, yyyy = 421c
4:3 for dolphin:
xxxx = 4160. yyyy = 4150
 
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
check the update in the reddit thread, melee is specifically at a super weird aspect ratio he didn't take into account so codes are re-updated. it's not the biggest change, from my naked eye, but it's still a bit more accurate

Code:
16:9 for tv’s:
xxxx = 4080, yyyy = 4040
16:9 for monitors:
xxxx = 4200, yyyy = 41c8
16:9 for dolphin:
xxxx = 4260, yyyy = 421c
4:3 for dolphin:
xxxx = 4160. yyyy = 4150
Thanks, updated the document.
 

RazzleDazzle

Smash Cadet
Joined
Jan 24, 2014
Messages
29
Im still confused, whats the differences between the 3 different widescreen codes?
 
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
Im still confused, whats the differences between the 3 different widescreen codes?
The two different codes are for the two different versions of Melee. The XXXX/YYYY are replaced depending on the type of display you're using. They are all slightly different aspect ratios.
 
Last edited:

mirrorbender

Smash Rookie
Joined
Dec 16, 2013
Messages
12
Location
Arlington, MA
Hey Dan, thanks for posting this so that more people can find it (and for giving me my credit). RazzleDazzle, the difference has to do with the area of the screen that is actually game image in all 3 scenarios. For dolphin, it's the entire screen. On 16:9 monitors with a console, it's less because the wii/cube adds pillar-boxing on the sides, so the actual game image doesn't take up the whole screen. On (most) 16:9 TV's, the display area is the same as 4:3 TV's (which includes some, but not all of the pillar-boxing, I think), so the original code that just multiplies the FOV by 4/3 works as intended.

The PAR is weird. The first set of codes was based on math and the proportions of the console's display that are game image vs pillar-boxing vs horizontal blanking, so I believe that mathematically, they should have been correct. However, someone mentioned that many games use non-standardized PAR's, so I did some testing. I based the updated codes around what made the geometry look right, specifically by measuring the height and width in pixels of the character selector token in high res dolphin screenshots, and finding a ratio that made that the most perfect circle. Interestingly, not all circles in melee have the same proportions. The stage selector pointer and the smash logo on the stage select screen are proportionally wider (very slightly) than the CSS circles, and the circle on the screen display options screen is significantly narrower. Because of this ambiguity, I don't think it's possible to get more precise without knowing what the HAL intended the PAR to be when designing the graphics.

*Edit: First smashboards post hype!
 
Last edited:

Sham Rock

Smash Apprentice
Joined
Feb 10, 2014
Messages
95
Location
Outside of your grab range
16:9 Widescreen Support (PAL)

C2021E54 00000002
39C00001 38600006
60000000 00000000
C236A3AC 00000007
C03F0034 2C0E0001
41820024 3C004080
90010030 3C004040
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 00000000
 

mirrorbender

Smash Rookie
Joined
Dec 16, 2013
Messages
12
Location
Arlington, MA
Hey guys little OCD update here. I have decided that the best benchmark for a perfect circle is the shield, rather than the CSS token, because a) it is a 2D sprite, so there are no weird perspective transformations going on, b) I know it is supposed to be a perfect circle (the shield sprite is 128x128), and c) because it is actually a part of the gameplay and not a menu item, and the gameplay is the most important part to get looking perfect. So with that in mind, I did some more measurements in dolphin and came up with a new PAR of 23:21. This is accurate to within a pixel at 1080p in dolphin. So the new (and hopefully final) values of XXXX and YYYY are as follows:

16:9 Dolphin: XXXX = 42B8, YYYY = 427C
16:9 Monitor: XXXX = 4438, YYYY = 440E
16:9 TV: Same as always XXXX = 4080, YYYY = 4040
4:3 Dolphin: XXXX = 41B8, YYYY = 41A8
 

smashbro29

Smash Champion
Joined
Oct 9, 2007
Messages
2,470
Location
Brooklyn,NY,USA
NNID
Smashbro29
3DS FC
2724-0750-5127
Hey guys little OCD update here. I have decided that the best benchmark for a perfect circle is the shield, rather than the CSS token, because a) it is a 2D sprite, so there are no weird perspective transformations going on, b) I know it is supposed to be a perfect circle (the shield sprite is 128x128), and c) because it is actually a part of the gameplay and not a menu item, and the gameplay is the most important part to get looking perfect. So with that in mind, I did some more measurements in dolphin and came up with a new PAR of 23:21. This is accurate to within a pixel at 1080p in dolphin. So the new (and hopefully final) values of XXXX and YYYY are as follows:

16:9 Dolphin: XXXX = 42B8, YYYY = 427C
16:9 Monitor: XXXX = 4438, YYYY = 440E
16:9 TV: Same as always XXXX = 4080, YYYY = 4040
4:3 Dolphin: XXXX = 41B8, YYYY = 41A8
You should find a way to implement that into 20xx or that netplay build.

I'm so tired of seeing those super wide shields.
 

mirrorbender

Smash Rookie
Joined
Dec 16, 2013
Messages
12
Location
Arlington, MA
If the two values set to be the same, the code should do nothing. It is multiplying the FOV by the XXXX and then dividing it by YYYY (which are each hexadecimal floating point numbers), so if they are the same XXXX/YYYY = 1, and nothing should change.
 

UniClown

Smash Rookie
Joined
Sep 30, 2013
Messages
23
Location
USA
Hey mirrorbender. I love using your widescreen code, but I found an issue with it.


This was using the 16:9 code for monitors, on 3.02 20XX, and recorded using my elgato. This type of issue never happened during singles; only during doubles and happened on one other occasion (also when changing the port from CPU to Off). As you can see, it is quickly fixed, but I thought I'd let you know. I'm unsure if this is due to the code not working well with 20XX, and I have not tried this on a regular Melee ISO.

Edit: It might have to do with this "small bug" from the hack pack

Additions
  • "Random" is Default Highlighted on the Stage Select Screen
  • CSS Hand Cursors Default to the HMN/CPU Button
    • Small Bug: After creating a new name tag from the CSS, the player port will be switched to a CPU.
  • Tournament Mode now replaces Fixed Camera Mode
  • Disable CPU Taunting
 
Last edited:

Y-L

Smash Champion
Joined
Jan 16, 2014
Messages
2,436
Location
Ventura, CA
Hey mirrorbender. I love using your widescreen code, but I found an issue with it.


This was using the 16:9 code for monitors, on 3.02 20XX, and recorded using my elgato. This type of issue never happened during singles; only during doubles and happened on one other occasion (also when changing the port from CPU to Off). As you can see, it is quickly fixed, but I thought I'd let you know. I'm unsure if this is due to the code not working well with 20XX, and I have not tried this on a regular Melee ISO.

Edit: It might have to do with this "small bug" from the hack pack
It might be a bug with the code? I've played doubles on Dolphin with 20xx 3.02 in widescreen and sometimes (even without making a nametag) it will do that randomly. Only in doubles though.
 
Last edited:

mirrorbender

Smash Rookie
Joined
Dec 16, 2013
Messages
12
Location
Arlington, MA
Yeah, wierd bug. My first guess is that there is some kind of conflict with the registers being used to load the FOV multipliers. I didn't write the original code, @ Dan Salvato Dan Salvato did, so maybe he has more insight as to what might be causing it. It definitely could just be a 20XX problem.
 
Last edited:
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
I've never seen that happen so it might just be an issue with the 20XX Hack Pack. I'll do some testing, I guess.
 

mirrorbender

Smash Rookie
Joined
Dec 16, 2013
Messages
12
Location
Arlington, MA
Good question. Dolphin's "Force 16:9" option now lines up with what a TV displays, so the "TV" version of the code works best with that. If you are stretching the aspect ratio to fill a 16:9 monitor, then the old "dolphin" version is still best, but I'd actually recommend using the "TV" code in combination with "force 16:9" and dolphin's crop setting if you are trying to fill a 16:9 monitor, just so you don't have to be continuously switching codes.

Also, I'm working on another option for dolphin that dynamically calculates the aspect ratio based on the projection matrices that the gamecube sets up, so whenever that is completed, using that setting will be able to intelligently correct the geometry for any aspect ratio code that is being used, so look out for that sometime this month.

As always, I'll try to answer any questions that come up about proper usage, because this stuff can get very confusing very quickly if you lose track of what's going on.
 

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
I made the code for version 1.1 on the North American copy of the game:

C2021ABC 00000002
39C00001 38600006
60000000 00000000
C23697C8 00000007
C03F0034 2C0E0001
41820024 3C004093
90010030 3C004040
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 00000000
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
I've made this code and a slight variation of it available for all game versions in the Melee Code Manager (it'll now be included by default in all future versions). Here they are if you want to add them to your library yourself. Once copied to a text file in your Mods Library folder, it will appear in the program where you can toggle it on/off in your game.

-==-


16:9 Widescreen Support (Variation A)
Includes the fullscreen flashing effect fix.
This variation also fixes the position of magnifier bubbles, but also stretches the HUD.

If using with Dolphin, you'll also need to change the setting, "Force 16:9" for the aspect

ratio and make sure "Widescreen Hack" is OFF.

See the notes in the link below for adjustments based on your display device:
https://docs.google.com/document/d/1o_KEmsbKg4_qIm607FfewzIvChQYxayN4r1j3Uy6yX0/edit
[Dan Salvato]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x80021ABC --- 38600006 -> Branch

39C00001 38600006
60000000 48000000

---------- 0x802F3980 --- 387F0000 -> Branch

39C00001 387F0000
60000000 48000000

---------- 0x8036A4A8 --- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.01 ------ 0x1E69C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x2EFAD8 --- 387F0000 -> Branch

39C00001 387F0000
60000000 48000000

----------- 0x3663A8 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.00 ------ 0x1E61C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x2EEE8C --- 387F0000 -> Branch

39C00001 387F0000
60000000 48000000

----------- 0x3651D4 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

PAL ------- 0x1EA34 ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x2F0B54 --- 387F0000 -> Branch

39C00001 387F0000
60000000 48000000

----------- 0x366F8C ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000


-==-


16:9 Widescreen Support (Variation B)
Includes the fullscreen flashing effect fix.
This variation also fixes the position of magnifier bubbles, but also stretches the HUD.

If using with Dolphin, you'll also need to change the setting, "Force 16:9" for the aspect

ratio and make sure "Widescreen Hack" is OFF.

See the notes in the link below for adjustments based on your display device:
https://docs.google.com/document/d/1o_KEmsbKg4_qIm607FfewzIvChQYxayN4r1j3Uy6yX0/edit
[Dan Salvato]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x80021ABC --- 38600006 -> Branch

39C00001 38600006
60000000 48000000

1.02 ----- 0x802F3980 --- 387F0000 -> Branch

39C00001 387F0000
60000000 48000000

1.02 ----- 0x8036A4A8 --- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.01 ------ 0x1E69C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x3663A8 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.00 ------ 0x1E61C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x3651D4 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

PAL ------- 0x1EA34 ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x366F8C ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004080 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000
 
Last edited:

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
I've been able to implement the 16:9 code to the start dol executable which I've figured out after a gecko code has been released and here it is:

Code:
Main.dol offsets
PAL:
0x4E4

39C00001 38600006
4801E96C C03F0034
2C0E0001 41820024
3C004093 90010030
3C004040 90010034
C0010030 EC210032
C0010034 EC210024
39C00000 281E0000
48366E8C 00000000

0x1EA34

38600006 --> 4BFE1690

0x366F8C

C03F0034 --> 4BC99144

v1.00:
0x1420

39C00001 38600006
60000000 4801D614
C03F0034 2C0E0001
41820024 3C004093
90010030 3C004040
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48364194

0x1E61C

38600006 --> 4BFE29E4

0x3651D4

C03F0034 --> 4BC9BE3C

v1.01:
0x1420

39C00001 38600006
60000000 4801D694
00000000 C03F0034
2C0E0001 41820024
3C004093 90010030
3C004040 90010034
C0010030 EC210032
C0010034 EC210024
39C00000 281E0000
48365364 00000000

0x1E69C

38600006 --> 4BFE2964

0x3663A8

C03F0034 --> 4BC9AC6C
Notes: these are codes for the dol file, not for the RAM address.
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
I've been able to implement the 16:9 code to the start dol executable which I've figured out after a gecko code has been released and here it is:

Code:
Main.dol offsets
PAL:
0x4E4

39C00001 38600006
4801E96C C03F0034
2C0E0001 41820024
3C004093 90010030
3C004040 90010034
C0010030 EC210032
C0010034 EC210024
39C00000 281E0000
48366E8C 00000000

0x1EA34

38600006 --> 4BFE1690

0x366F8C

C03F0034 --> 4BC99144

v1.00:
0x1420

39C00001 38600006
60000000 4801D614
C03F0034 2C0E0001
41820024 3C004093
90010030 3C004040
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48364194

0x1E61C

38600006 --> 4BFE29E4

0x3651D4

C03F0034 --> 4BC9BE3C

v1.01:
0x1420

39C00001 38600006
60000000 4801D694
00000000 C03F0034
2C0E0001 41820024
3C004093 90010030
3C004040 90010034
C0010030 EC210032
C0010034 EC210024
39C00000 281E0000
48365364 00000000

0x1E69C

38600006 --> 4BFE2964

0x3663A8

C03F0034 --> 4BC9AC6C
Notes: these are codes for the dol file, not for the RAM address.
My post above yours also has the code converted for different game versions and for going into the DOL, it's just in a different format, which works with the Melee Code Manager.

If someone adds the code with the offsets you've given, it might overwrite custom code for a different mod and cause a crash (simply depending on what the user already has installed - or it could interfere with what they might install in the future, unless they take certain precautions). The difference between adding the code to the DOL using MCM, is that MCM adds codes to the DOL based on what other codes/mods are also installed, adjusting the placement of all code accordingly, to ensure that none overlaps. It also of course avoids the work of finding offsets and calculating branches, or doing any manual hex editing.
 

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
Here's one that should be included in the Melee Code Manager which I removed one of Dan's injection mod code for 1.02 as that one stretches the HUD which shouldn't be stretched. That code was edited at 2F0560 by that user.
-==-


16:9 Widescreen Support (Variation C)
Includes the fullscreen flashing effect fix.
This variation also fixes the position of magnifier bubbles and unstretches the HUD.
If using with Dolphin, you'll also need to change the setting, "Force 16:9" for the aspect ratio and make sure "Widescreen Hack" is OFF.
See the notes in the link below for adjustments based on your display device:
https://docs.google.com/document/d/1o_KEmsbKg4_qIm607FfewzIvChQYxayN4r1j3Uy6yX0/edit

Note: Credit to Dan Salvato for the original codes.
[ShockSlayer (1.02), Brandondorf9999 (Old versions and PAL)]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
PAL ------- 0x1EA34 ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x366F8C ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004093 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.01 ------ 0x1E69C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x3663A8 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004093 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.02 ------ 0x1E69C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x367088 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004093 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000

1.00 ------ 0x1E61C ---- 38600006 -> Branch

39C00001 38600006
60000000 48000000

----------- 0x3651D4 ---- C03F0034 -> Branch

C03F0034 2C0E0001
41820024 3C004093 # <- ____XXXX
90010030 3C004040 # <- ____YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 48000000
 

gamemasterplc

Smash Rookie
Joined
Feb 25, 2017
Messages
4
16:9 Widescreen Support V3 (1.02)
C2367E74 00000009
2C1F0001 40820038
3C804400 807E004C
7C032000 40810028
3C803F40 9081002C
C021002C C001001C
EC010032 D001001C
C0010028 EC010032
D0010028 389F0000
60000000 00000000
C23677C4 00000003
C01C0044 3C603FAB
90610004 C3610004
EC1B0032 00000000
C200E34C 00000003
C05B0044 3C803FAB
90810090 C0610090
EC4300B2 00000000
C2367BAC 00000003
C0450044 3FE03FAB
93E10090 C0610090
EC4300B2 00000000
C2367E10 00000003
3FE03FAB 93E30000
C0630000 C05E0044
EC4300B2 00000000
04302848 3B44FF96
Non-Main game improvements.
 

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
I just thought I could be nice and have this aspect support put on the Melee Code Manager since this adjusts the field of view and that perfectly in-game:

Code:
-==-


Aspect Ratio + Field of View Adjustment
Fixes everything including the view of the trophy in "gallery" mode to run the game with perfect aspect ratio support such as for widescreen mode.

Unlike other variations, this also allows for field of view adjustment.

The key legends alter the following aspect/fov angles:

XXXXXXXX - Horizontal Aspect Ratio (1st Static Overwrite)
YYYYYYYY - Vertical Aspect Ratio (2nd Static Overwrite)
ZZZZZZZZ - Field of View (3rd Static Overwrite)

The fov is increased if the value is lower than 1 (3F800000).

If you are calculating the horizontal aspect ratio, the key is to divide the original 4:3 ratio float "1.333333333333333" by your aspect ratio decimal value, then convert it into 4 byte hex. (Example: 1.333333333333333  1.777777777777778 = 0.75 --> 3F400000)

As with the vertical fov, multiply the aspect ratio by 0.5625.

(Example: 1.333333333333333  0.5625 = 0.75 --> 3F400000)

Credit to Gamemasterplc for the codes provided to fix widescreen:

https://forums.dolphin-emu.org/Thread-unofficial-widescreen-development-topic-archive?pid=439751 # pid439751
[Brandondorf9999]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ------ 0x437D7C ---- 00000000 -> XXXXXXXX # <-- Adjusts the horizontal aspect. (Default value: 3F800000).
----------- 0x437D80 ---- 00000000 -> YYYYYYYY # <-- Adjusts the vertical aspect if the condition is allowed by a certain operation. (Default value is 3F800000).
----------- 0x437D08 ---- 3F800000 -> ZZZZZZZZ # <--- Adjusts the game's field of view (Default value: 3F800000).
----------- 0x33F80C ---- C062E948 -> Branch

3E203F80 92220004
C0620004 48000000 # This section affects the perspective part of the fix.

----------- 0x33F8A0 ---- C122E948 -> Branch

3E203F80 92220000
C1220000 48000000 # This section affects the orthographic part of the fix.

----------- 0x33F844 ---- D09F0014 -> Branch

D09F0014 8A22E97C
2C110001 40820024
C23F0014 C242E9C0
EE3104B2 C242E948
EE3104B2 D23F0014
3A200000 9A22E97C
60000000 48000000 # Checks if the vertical FOV condition is enabled.

----------- 0x364A54 ---- 389F0000 -> Branch

2C1F0001 40820058
3C804400 807E004C
7C032000 40810048
C222E948 C022E9BC
EC210472 C001001C
EC010032 D001001C
C0010028 EC010032
D0010028 C022E9C0
EC210472 C0010030
EC010032 D0010030
C0010038 EC010032
D0010038 389F0000
60000000 48000000

----------- 0x3647F0 ---- 7FE3FB78 -> Branch

3821FFFC 7FE3FB78
2C030001 40820064
3C008039 600010F4
83E100A8 7C00F800
40820050 C022E9BC
C222E948 C0040000
EC010032 EC000472
D0040000 C004000C
EC010032 EC000472
D004000C C022E9C0
C0040014 EC010032
EC000472 D0040014
C004001C EC010032
EC000472 D004001C
38210004 48000000

----------- 0x3643A4 ---- C01C0044 -> Branch

C01C0044 3C603F80
90610004 C3610004
C222E9BC EF7B8824
C222E948 A222E948
2C113F80 41810008
EF7B8824 EC1B0032
C222E9C0 EF9C8824
C222E948 EF9C8824
48000000

----------- 0xAF2C ---- C05B0044 -> Branch

C05B0044 3C803F80
90810090 C0610090
C222E9BC EC638824
C222E948 EC638824
EC4300B2 3A200001
9A22E97C 48000000

----------- 0x36478C ---- C0450044 -> Branch

C0450044 8A450048
2C120001 41820030
3FE03F80 8A450030
93E10090 C0610090
C222E9BC EC638824
C222E948 EC638824
EC4300B2 3A200001
9A22E97C 48000000

----------- 0x3649F0 ---- C05E0044 -> Branch

3FE03F80 93E30000
C0630000 C05E0044
C222E9BC EC638824
C222E948 EC638824
EC4300B2 3A200001
9A22E97C 48000000

----------- 0x2FF428 ---- 7C9A2378 -> 3B44FF96
----------- 0x2F864C ---- C022E168 -> Branch

3F403F80 93410024
C0010024 C022E168
C222E9BC EC218824
C222E948 EC218824
EC210032 3A200001
9A22E97C 48000000

----------- 0x1C9C30 ---- C05C0044 -> Branch

3C803F80 90830000
C0630000 C05C0044
C222E9BC EC428824
C222E948 EC428824
EC4200F2 3A200001
9A22E97C 48000000

----------- 0x33F75C ---- D0030000 -> Branch

C222E9BC EC000472
D0030000 48000000

----------- 0x33F798 ---- D0630014 -> Branch

C222E9C0 EC630472
D0630014 48000000

----------- 0x33F770 ---- EC6B00F2 -> Branch

C222E9BC EC630472
EC6B00F2 48000000

----------- 0x33F784 ---- EC4900B2 -> Branch

C222E9C0 EC420472
EC4900B2 48000000

----------- 0x1E69C ---- 38600006 -> Branch

39C00001 38600006
48000000

----------- 0x3670A0 ---- D03E0044 -> Branch

D03E0044 2C0E0001
4082000C 99DE0048
39C00000 48000000

Note: You'll need to use a lower float value to extend the aspect ratio/fov.

It's only for 1.02 for now, but I'll make this for other versions later.
 
Last edited:

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
Here's a new version of the MCM hack with support for versions aside from NTSC-U (v1.02).

-==-


Aspect Ratio + Field of View Adjustment V2
A new and decent version of the aspect/fov fix. This time it properly fixes the name-tag display to fit the screen.
[Brandondorf9999]
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
NTSC 1.00 --- 0x80365F5C ---- C05E0044 -> Branch

li r18,0
lfs f2, 0x0044 (r30)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80341334 ---- D09F0014 -> Branch

bl <Set_Vertical_FOV>
.long 0x00000000

------------- 0x80365CF8 ---- C0450044 -> Branch

li r18,0
lfs f2, 0x0044 (r5)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x801CC080 ---- C05C0044 -> Branch

lfs f2, 0x0044 (r28)
li r18,1
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x803410A8 ---- D03F0014 -> Branch

stfs f4, 0x0018 (r31)
fmr f4,f1
bl <Set_Vertical_FOV>
lfs f4, 0x0018 (r31)
.long 0x00000000

------------- 0x8038F228 ---- 80630028 -> Branch

lwz r3, 0x0028 (r3)
li r18,1
.long 0x00000000

------------- 0x80365D5C ---- 7FE3FB78 -> Branch

mr r3, r31
cmpwi r3, 1
bne NotOrthographicProjection
cmpwi r18, 1
bne NoOrthographicAspectChange
bl <Set_Aspect>
lfs f0,0(r4)
fmuls f0,f0,f18
stfs f0,0(r4)
lfs f0,0xC(r4)
fmuls f0,f0,f18
stfs f0,0xC(r4)
bl <Get_Perspective_Values>
mflr r17
lwz r0, 0x001C (sp)
lfs f17,0x8(r17)
lfs f19,0(r17)
fcmpu cr0,f19,f17
ble NonWidescreen
fmr f19,f17
NonWidescreen:
fdivs f17,f17,f19
lfs f19,0xC(r17)
lfs f18,0x10(r17)
fmuls f19,f19,f18
fmuls f17,f17,f19
lfs f0,0x14(r4)
fdivs f0,f0,f17
stfs f0,0x14(r4)
lfs f0,0x1C(r4)
fdivs f0,f0,f17
stfs f0,0x1C(r4)
li r18, 0
NotOrthographicProjection:
NoOrthographicAspectChange:
.long 0x00000000

------------- 0x80365FC0 ---- 389F0000 -> Branch

cmpwi r31,1
bne NotOrthgraphicProjection
lis r4,0x4400
lwz r3,0x004C(r30)
cmpw r3,r4
ble NoOrthographicAspectChange
bl <Get_Perspective_Values>
mflr r17
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
lfs f17,0x4(r17)
lfs f18,0(r17)
bge Widescreen
lfs f18,0x8(r17)
Widescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x001C(sp)
fmuls f0,f1,f0
stfs f0,0x001C(sp)
lfs f0,0x0028(sp)
fmuls f0,f1,f0
stfs f0,0x0028(sp)
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x0030(sp)
fmuls f0,f1,f0
stfs f0,0x0030(sp)
lfs f0,0x0038(sp)
fmuls f0,f1,f0
stfs f0,0x0038(sp)
NotOrthgraphicProjection:
NoOrthographicAspectChange:
addi r4, r31, 0
.long 0x00000000

------------- 0x802FB2A4 ---- 807E0028 -> Branch

lwz r3, 0x0028 (r30)
li r18,1
.long 0x00000000

------------- 0x8034124C ---- D0030000 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x4(r17)
lfs f18,0x8(r17)
fdivs f17,f17,f18
lfs f19,0(r17)
fcmpu cr0,f19,f18
blt NonWidescreen
lfs f18,0(r17)
NonWidescreen:
fmuls f18,f18,f17
fdivs f0,f0,f18
stfs f0, 0 (r3)
.long 0x00000000

------------- 0x80341260 ---- EC6B00F2 -> Branch

fdivs f3,f3,f18
fmuls f3,f11,f3
.long 0x00000000

------------- 0x80341274 ---- EC4900B2 -> Branch

lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
fmuls f2,f2,f17
fmuls f2,f9,f2
.long 0x00000000

------------- 0x80341288 ---- D0630014 -> Branch

fmuls f3,f3,f17
stfs f3, 0x0014 (r3)
.long 0x00000000

------------- 0x80341228 ---- EC011028 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x10(r17)
lfs f18,0xC(r17)
fmuls f18,f18,f17
fdivs f10,f10,f18
fsubs f0,f1,f2
.long 0x00000000

<Get_Perspective_Values> ALL
blrl
.float 1.7777777777777778 # Aspect Ratio (Default: 1.3333333333333333)
.float 1.3333333333333333 # Aspect Divisor (Do not modify)
.float 1.7777777777777778 # Aspect Limit Check
.float 75 # Field of View (Default: 75)
.float 0.0133333333333333 # Field of View Multiplier (Do not modify)

<Set_Aspect> ALL
mflr r17
cmpwi r18,0
beq 0x8
mr r31,sp
lwz r18,0x14(r31)
stw r3,0x14(r31)
bl <Get_Perspective_Values>
mflr r3
lfs f17,0(r3)
lfs f18,0x8(r3)
fcmpu cr0,f17,f18
bge Widescreen
fmr f17,f18
Widescreen:
fdivs f18,f18,f17
lfs f17,0x4(r3)
lfs f19,0x8(r3)
fdivs f17,f17,f19
lfs f19,0xC(r3)
lfs f20,0x10(r3)
fmuls f19,f19,f20
fdivs f17,f17,f19
fmuls f18,f18,f17
lwz r3,0x14(r31)
stw r18,0x14(r31)
mtlr r17
lwz r19,0x18(r31)
li r18,1
blr

<Set_Vertical_FOV> ALL
mflr r17
cmpwi r18,1
bne Disabled
bl <Get_Perspective_Values>
mflr r18
lfs f19,0xC(r18)
lfs f20,0x10(r18)
fmuls f19,f19,f20
fdivs f4,f4,f19
lfs f17,0(r18)
lfs f18,0x8(r18)
fcmpu cr0,f17,f18
bge Widescreen
fdivs f18,f18,f17
fdivs f4,f4,f18
stfs f4, 0x0014 (r31)
fmuls f4,f4,f18
li r18,0
b Vertical_FOV
Widescreen:
stfs f4, 0x0014 (r31)
fmuls f4,f4,f19
b Vertical_FOV
Disabled:
stfs f4, 0x0014 (r31)
Vertical_FOV:
mtlr r17
blr

PAL 1.00 ---- 0x80367D1C ---- C05B0044 -> Branch

li r18,0
lfs f2, 0x0044 (r30)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80343034 ---- D09F0014 -> Branch

bl <Set_Vertical_FOV>
.long 0x00000000

------------- 0x80367B1C ---- C0450044 -> Branch

li r18,0
lfs f2, 0x0044 (r5)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x801CEC74 ---- C05C0044 -> Branch

lfs f2, 0x0044 (r28)
li r18,1
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80342DA8 ---- D03F0014 -> Branch

stfs f4, 0x0018 (r31)
fmr f4,f1
bl <Set_Vertical_FOV>
lfs f4, 0x0018 (r31)
.long 0x00000000

------------- 0x80391014 ---- 80630028 -> Branch

lwz r3, 0x0028 (r3)
li r18,1
.long 0x00000000

------------- 0x80367B80 ---- 7FE3FB78 -> Branch

mr r3, r31
cmpwi r3, 1
bne NotOrthographicProjection
cmpwi r18, 1
bne NoOrthographicAspectChange
bl <Set_Aspect>
lfs f0,0(r4)
fmuls f0,f0,f18
stfs f0,0(r4)
lfs f0,0xC(r4)
fmuls f0,f0,f18
stfs f0,0xC(r4)
bl <Get_Perspective_Values>
mflr r17
lwz r0, 0x001C (sp)
lfs f17,0x8(r17)
lfs f19,0(r17)
fcmpu cr0,f19,f17
ble NonWidescreen
fmr f19,f17
NonWidescreen:
fdivs f17,f17,f19
lfs f19,0xC(r17)
lfs f18,0x10(r17)
fmuls f19,f19,f18
fmuls f17,f17,f19
lfs f0,0x14(r4)
fdivs f0,f0,f17
stfs f0,0x14(r4)
lfs f0,0x1C(r4)
fdivs f0,f0,f17
stfs f0,0x1C(r4)
li r18, 0
NotOrthographicProjection:
NoOrthographicAspectChange:
.long 0x00000000

------------- 0x80367D80 ---- 389C0000 -> Branch

cmpwi r31,1
bne NotOrthgraphicProjection
lis r4,0x4400
lwz r3,0x004C(r30)
cmpw r3,r4
ble NoOrthographicAspectChange
bl <Get_Perspective_Values>
mflr r17
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
lfs f17,0x4(r17)
lfs f18,0(r17)
bge Widescreen
lfs f18,0x8(r17)
Widescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x001C(sp)
fmuls f0,f1,f0
stfs f0,0x001C(sp)
lfs f0,0x0028(sp)
fmuls f0,f1,f0
stfs f0,0x0028(sp)
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x0030(sp)
fmuls f0,f1,f0
stfs f0,0x0030(sp)
lfs f0,0x0038(sp)
fmuls f0,f1,f0
stfs f0,0x0038(sp)
NotOrthgraphicProjection:
NoOrthographicAspectChange:
addi r4, r31, 0
.long 0x00000000

------------- 0x802FD494 ---- 807E0028 -> Branch

lwz r3, 0x0028 (r30)
li r18,1
.long 0x00000000

------------- 0x80342F4C ---- D0030000 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x4(r17)
lfs f18,0x8(r17)
fdivs f17,f17,f18
lfs f19,0(r17)
fcmpu cr0,f19,f18
blt NonWidescreen
lfs f18,0(r17)
NonWidescreen:
fmuls f18,f18,f17
fdivs f0,f0,f18
stfs f0, 0 (r3)
.long 0x00000000

------------- 0x80342F60 ---- EC6B00F2 -> Branch

fdivs f3,f3,f18
fmuls f3,f11,f3
.long 0x00000000

------------- 0x80342F74 ---- EC4900B2 -> Branch

lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
fmuls f2,f2,f17
fmuls f2,f9,f2
.long 0x00000000

------------- 0x80342F88 ---- D0630014 -> Branch

fmuls f3,f3,f17
stfs f3, 0x0014 (r3)
.long 0x00000000

------------- 0x80342F28 ---- EC011028 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x10(r17)
lfs f18,0xC(r17)
fmuls f18,f18,f17
fdivs f10,f10,f18
fsubs f0,f1,f2
.long 0x00000000

NTSC 1.01 --- 0x80367130 ---- C05E0044 -> Branch

li r18,0
lfs f2, 0x0044 (r30)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80341F84 ---- D09F0014 -> Branch

bl <Set_Vertical_FOV>
.long 0x00000000

------------- 0x80366ECC ---- C0450044 -> Branch

li r18,0
lfs f2, 0x0044 (r5)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x801CC9E4 ---- C05C0044 -> Branch

lfs f2, 0x0044 (r28)
li r18,1
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80341CF8 ---- D03F0014 -> Branch

stfs f4, 0x0018 (r31)
fmr f4,f1
bl <Set_Vertical_FOV>
lfs f4, 0x0018 (r31)
.long 0x00000000

------------- 0x8039040C ---- 80630028 -> Branch

lwz r3, 0x0028 (r3)
li r18,1
.long 0x00000000

------------- 0x80366F30 ---- 7FE3FB78 -> Branch

mr r3, r31
cmpwi r3, 1
bne NotOrthographicProjection
cmpwi r18, 1
bne NoOrthographicAspectChange
bl <Set_Aspect>
lfs f0,0(r4)
fmuls f0,f0,f18
stfs f0,0(r4)
lfs f0,0xC(r4)
fmuls f0,f0,f18
stfs f0,0xC(r4)
bl <Get_Perspective_Values>
mflr r17
lwz r0, 0x001C (sp)
lfs f17,0x8(r17)
lfs f19,0(r17)
fcmpu cr0,f19,f17
ble NonWidescreen
fmr f19,f17
NonWidescreen:
fdivs f17,f17,f19
lfs f19,0xC(r17)
lfs f18,0x10(r17)
fmuls f19,f19,f18
fmuls f17,f17,f19
lfs f0,0x14(r4)
fdivs f0,f0,f17
stfs f0,0x14(r4)
lfs f0,0x1C(r4)
fdivs f0,f0,f17
stfs f0,0x1C(r4)
li r18, 0
NotOrthographicProjection:
NoOrthographicAspectChange:
.long 0x00000000

------------- 0x80367194 ---- 389F0000 -> Branch

cmpwi r31,1
bne NotOrthgraphicProjection
lis r4,0x4400
lwz r3,0x004C(r30)
cmpw r3,r4
ble NoOrthographicAspectChange
bl <Get_Perspective_Values>
mflr r17
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
lfs f17,0x4(r17)
lfs f18,0(r17)
bge Widescreen
lfs f18,0x8(r17)
Widescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x001C(sp)
fmuls f0,f1,f0
stfs f0,0x001C(sp)
lfs f0,0x0028(sp)
fmuls f0,f1,f0
stfs f0,0x0028(sp)
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x0030(sp)
fmuls f0,f1,f0
stfs f0,0x0030(sp)
lfs f0,0x0038(sp)
fmuls f0,f1,f0
stfs f0,0x0038(sp)
NotOrthgraphicProjection:
NoOrthographicAspectChange:
addi r4, r31, 0
.long 0x00000000

------------- 0x802FBEF0 ---- 807E0028 -> Branch

lwz r3, 0x0028 (r30)
li r18,1
.long 0x00000000

------------- 0x80341E9C ---- D0030000 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x4(r17)
lfs f18,0x8(r17)
fdivs f17,f17,f18
lfs f19,0(r17)
fcmpu cr0,f19,f18
blt NonWidescreen
lfs f18,0(r17)
NonWidescreen:
fmuls f18,f18,f17
fdivs f0,f0,f18
stfs f0, 0 (r3)
.long 0x00000000

------------- 0x80341EB0 ---- EC6B00F2 -> Branch

fdivs f3,f3,f18
fmuls f3,f11,f3
.long 0x00000000

------------- 0x80341EC4 ---- EC4900B2 -> Branch

lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
fmuls f2,f2,f17
fmuls f2,f9,f2
.long 0x00000000

------------- 0x80341ED8 ---- D0630014 -> Branch

fmuls f3,f3,f17
stfs f3, 0x0014 (r3)
.long 0x00000000

------------- 0x80341E78 ---- EC011028 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x10(r17)
lfs f18,0xC(r17)
fmuls f18,f18,f17
fdivs f10,f10,f18
fsubs f0,f1,f2
.long 0x00000000

NTSC 1.02 --- 0x80367E10 ---- C05E0044 -> Branch

li r18,0
lfs f2, 0x0044 (r30)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x80342C64 ---- D09F0014 -> Branch

bl <Set_Vertical_FOV>
.long 0x00000000

------------- 0x80367BAC ---- C0450044 -> Branch

li r18,0
lfs f2, 0x0044 (r5)
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x801CD050 ---- C05C0044 -> Branch

lfs f2, 0x0044 (r28)
li r18,1
bl <Set_Aspect>
fdivs f2,f2,f18
.long 0x00000000

------------- 0x803429D8 ---- D03F0014 -> Branch

stfs f4, 0x0018 (r31)
fmr f4,f1
bl <Set_Vertical_FOV>
lfs f4, 0x0018 (r31)
.long 0x00000000

------------- 0x803910EC ---- 80630028 -> Branch

lwz r3, 0x0028 (r3)
li r18,1
.long 0x00000000

------------- 0x80367C10 ---- 7FE3FB78 -> Branch

mr r3, r31
cmpwi r3, 1
bne NotOrthographicProjection
cmpwi r18, 1
bne NoOrthographicAspectChange
bl <Set_Aspect>
lfs f0,0(r4)
fmuls f0,f0,f18
stfs f0,0(r4)
lfs f0,0xC(r4)
fmuls f0,f0,f18
stfs f0,0xC(r4)
bl <Get_Perspective_Values>
mflr r17
lwz r0, 0x001C (sp)
lfs f17,0x8(r17)
lfs f19,0(r17)
fcmpu cr0,f19,f17
ble NonWidescreen
fmr f19,f17
NonWidescreen:
fdivs f17,f17,f19
lfs f19,0xC(r17)
lfs f18,0x10(r17)
fmuls f19,f19,f18
fmuls f17,f17,f19
lfs f0,0x14(r4)
fdivs f0,f0,f17
stfs f0,0x14(r4)
lfs f0,0x1C(r4)
fdivs f0,f0,f17
stfs f0,0x1C(r4)
li r18, 0
NotOrthographicProjection:
NoOrthographicAspectChange:
.long 0x00000000

------------- 0x80367E74 ---- 389F0000 -> Branch

cmpwi r31,1
bne NotOrthgraphicProjection
lis r4,0x4400
lwz r3,0x004C(r30)
cmpw r3,r4
ble NoOrthographicAspectChange
bl <Get_Perspective_Values>
mflr r17
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
lfs f17,0x4(r17)
lfs f18,0(r17)
bge Widescreen
lfs f18,0x8(r17)
Widescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x001C(sp)
fmuls f0,f1,f0
stfs f0,0x001C(sp)
lfs f0,0x0028(sp)
fmuls f0,f1,f0
stfs f0,0x0028(sp)
lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
lfs f18,0xC(r17)
lfs f1,0x10(r17)
fmuls f18,f18,f1
fdivs f17,f17,f18
fmr f1,f17
lfs f0,0x0030(sp)
fmuls f0,f1,f0
stfs f0,0x0030(sp)
lfs f0,0x0038(sp)
fmuls f0,f1,f0
stfs f0,0x0038(sp)
NotOrthgraphicProjection:
NoOrthographicAspectChange:
addi r4, r31, 0
.long 0x00000000

------------- 0x802FCB68 ---- 807E0028 -> Branch

lwz r3, 0x0028 (r30)
li r18,1
.long 0x00000000

------------- 0x80342B7C ---- D0030000 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x4(r17)
lfs f18,0x8(r17)
fdivs f17,f17,f18
lfs f19,0(r17)
fcmpu cr0,f19,f18
blt NonWidescreen
lfs f18,0(r17)
NonWidescreen:
fmuls f18,f18,f17
fdivs f0,f0,f18
stfs f0, 0 (r3)
.long 0x00000000

------------- 0x80342B90 ---- EC6B00F2 -> Branch

fdivs f3,f3,f18
fmuls f3,f11,f3
.long 0x00000000

------------- 0x80342BA4 ---- EC4900B2 -> Branch

lfs f17,0(r17)
lfs f18,0x8(r17)
fcmpu cr0,f17,f18
blt NonWidescreen
fmr f17,f18
NonWidescreen:
fdivs f17,f17,f18
fmuls f2,f2,f17
fmuls f2,f9,f2
.long 0x00000000

------------- 0x80342BB8 ---- D0630014 -> Branch

fmuls f3,f3,f17
stfs f3, 0x0014 (r3)
.long 0x00000000

------------- 0x80342B58 ---- EC011028 -> Branch

mflr r0
bl <Get_Perspective_Values>
mflr f17
mtlr r0
lfs f17,0x10(r17)
lfs f18,0xC(r17)
fmuls f18,f18,f17
fdivs f10,f10,f18
fsubs f0,f1,f2
.long 0x00000000
 

Brandondorf9999

Smash Cadet
Joined
Mar 6, 2012
Messages
71
Made a cleaner fix only for NTSC-U 1.02 for now.
Code:
    -==-


Aspect Ratio + Field of View Adjustment V3
[Brandondorf9999]
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
NTSC 1.02 --- 0x803412C8 ---- C0030000 -> Branch

mflr r0
stw r0,-0xDD8(rtoc)
bl <SetAspect>
lwz r0,-0xDD8(rtoc)
mtlr r0
lfs    f0, 0x08 (r3)
fmuls f0,f0,f17
stfs    f0, 0x08 (r3)
lfs    f0, 0x18 (r3)
fmuls f0,f0,f18
stfs    f0, 0x18 (r3)
lfs    f0, 0x14 (r3)
fmuls f0,f0,f18
stfs    f0, 0x14 (r3)
lfs    f0, 0x0C (r3)
fmuls f0,f0,f17
stfs    f0, 0x0C (r3)
lfs    f0, 0x1C (r3)
fmuls f0,f0,f18
stfs    f0, 0x1C (r3)
lfs    f0, 0 (r3)
fmuls f0,f0,f17
cmpwi    r4, 1
.long 00000000

<SetAspect> NTSC 1.02
mflr r0
bl <GetPerspectiveValues>
mflr r17
lfs f17,0(r17)
lfs f19,0x8(r17)
fmr f18,f17
fdivs f18,f18,f18
fcmpu cr0,f17,f19
bge Widescreen
fdivs f17,f17,f19
fmr f18,f17
fmr f17,f19
Widescreen:
lfs f19,0x4(r17)
fdivs f19,f19,f17
fmr f17,f19
lwz r18,0x14(r17)
cmpwi r18,1
bne SwissWSCorrectionDisabled
lfs f19,0x18(r17)
fmuls f17,f17,f19
SwissWSCorrectionDisabled:
lfs f19,0xC(r17)
lfs f20,0x10(r17)
fmuls f19,f19,f20
lbz r17,-0xDDC(rtoc)
cmpwi r17,1
bne EffectEnabled
fdivs f17,f17,f17
fdivs f18,f18,f18
fdivs f19,f19,f19
li r17,0
stb r17,-0xDDC(rtoc)
EffectEnabled:
fdivs f17,f17,f19
fdivs f18,f18,f19
mtlr r0
blr

<GetPerspectiveValues> NTSC 1.02
blrl
.float 1.7777777777777778 # Aspect Ratio (Default: 1.3333333333333333)
.float 1.3333333333333333 # Aspect Divisor (Do not modify)
.float 1.7777777777777778 # Aspect Limit Check
.float 75 # Field of View (Default: 75)
.float 0.0133333333333333 # Field of View Multiplier (Do not modify)
.int 1 # Straightening mode (Default: 1)
.float 0.912598 # Swiss/Dolphin aspect correction mode X-FOV, (do not modify)

------------- 0x80342984 ---- FFA02090 -> Branch

li r17,0
stb r17,-0xDDC(rtoc)
bl <SetAspect>
fdivs f27,f27,f17
fmuls f4,f4,f18
fmr    f29, f4
.long 00000000

------------- 0x8037F830 ---- 28000000 -> Branch

cmplwi    r0, 0
beq NotUsingOrtho
li r17,1
stb r17,-0xDDC(rtoc)
NotUsingOrtho:
cmplwi    r0, 0
.long 00000000

------------- 0x80013698 ---- 83DE001C -> Branch

li r17,1
stb r17,-0xDDC(rtoc)
lwz    r30, 0x001C (r30)
.long 00000000

------------- 0x80314548 ---- 38C00000 -> Branch

li    r6, 0
li     r17, 1
stb r17,-0xDDC(rtoc)
.long 00000000

------------- 0x803677CC ---- FF60E050 -> Branch

lbz r17,-0xDDC(rtoc)
cmpwi r17,1
beq NotModifyingScreenshader
bl <SetAspect>
fdivs   f28,f28,f18
fdivs   f0,f0,f17
NotModifyingScreenshader:
xor r17,r17,r17
stb r17,-0xDDC(rtoc)
fneg    f27,f28
.long 00000000

------------- 0x801D2F00 ---- 387D0000 -> Branch

li     r17, 1
stb r17,-0xDDC(rtoc)
addi    r3, r29, 0
.long 00000000

------------- 0x802FBA6C ---- C022E168 -> Branch

li     r17, 1
stb r17,-0xDDC(rtoc)
lfs    f1, -0x1E98 (rtoc)
.long 00000000

------------- 0x802FBDB4 ---- 7F03C378 -> Branch

mr    r3, r24
li     r17, 1
stb r17,-0xDDC(rtoc)
.long 00000000

------------- 0x803BB05C ---- 3FAAAAAA -> 3FAAAAAE
------------- 0x80367BAC ---- C0450044 -> Branch

lwz    r17, 0x0044 (r5)
lis     r18,0x3FAA
ori     r18,r18,0xAAAE
cmpw r17,r18
bne NotFullscreenShader
subi r17,r17,0x4
subi sp,sp,8
stw r17,0(sp)
lfs f2,0(sp)
addi sp,sp,8
li     r17, 1
stb r17,-0xDDC(rtoc)
b FullscreenShader
NotFullscreenShader:
lfs    f2, 0x0044 (r5)
FullscreenShader:
.long 00000000

------------- 0x8000E34C ---- C05B0044 -> Branch

lwz    r17, 0x0044 (r27)
lis     r18,0x3FAA
ori     r18,r18,0xAAAE
cmpw r17,r18
bne NotFullscreenShader
subi r17,r17,0x4
subi sp,sp,8
stw r17,0(sp)
lfs f2,0(sp)
addi sp,sp,8
li     r17, 1
stb r17,-0xDDC(rtoc)
b FullscreenShader
NotFullscreenShader:
lfs    f2, 0x0044 (r27)
FullscreenShader:
.long 00000000

------------- 0x80367E10 ---- C05E0044 -> Branch

lwz    r17, 0x0044 (r30)
lis     r18,0x3FAA
ori     r18,r18,0xAAAE
cmpw r17,r18
bne NotFullscreenShader
subi r17,r17,0x4
subi sp,sp,8
stw r17,0(sp)
lfs f2,0(sp)
addi sp,sp,8
li     r17, 1
stb r17,-0xDDC(rtoc)
b FullscreenShader
NotFullscreenShader:
lfs    f2, 0x0044 (r30)
FullscreenShader:
.long 00000000

------------- 0x80179A28 ---- 7F43D378 -> Branch

li     r17, 1
stb r17,-0xDDC(rtoc)
mr    r3, r26
.long 00000000

------------- 0x80030BF8 ---- 387F0000 -> Branch

addi    r3, r31, 0
li     r17, 2
stb r17,-0xDDC(rtoc)
.long 00000000

------------- 0x8000E370 ---- C02100C0 -> Branch

stfs    f0, 0x0098 (sp)
lfs     f0, 0x0094 (sp)
lfs    f1, 0x00C0 (sp)
lbz r17,-0xDDC(rtoc)
cmpwi r17,2
bne NotClipping
bl <SetAspect>
fmuls f0,f0,f17
fmuls f1,f1,f18
NotClipping:
li     r17, 0
stb r17,-0xDDC(rtoc)
stfs f0,0x0094 (sp)
lfs f0,0x0098 (sp)
.long 00000000

------------- 0x801A6A64 ---- 80630028 -> Branch

li     r17, 1
stb r17,-0xDDC(rtoc)
lwz    r3, 0x0028 (r3)
.long 00000000

------------- 0x801A6A78 ---- 389F0000 -> Branch

li     r17, 1
stb r17,-0xDDC(rtoc)
addi    r4, r31, 0
.long 00000000

------------- 0x801A71A0 ---- 3B630000 -> Branch

addi    r27, r3, 0
li     r17, 1
stb r17,-0xDDC(rtoc)
.long 00000000

------------- 0x803A5740 ---- 888DC1AB -> Branch

lbz    r4, -0x3E55 (r13)
lbz    r17, -0x0DDC (rtoc)
cmpwi    r17, 1
bne NotTrailEffect
lis    r17, 0x5472
ori    r17, r17, 0x6169
stw    r17, 0x0048 (r3)
li    r17, 0
stb    r17, -0x0DDC (rtoc)
NotTrailEffect:
.long 00000000

------------- 0x80367E60 ---- C07E0048 -> Branch

lis r18,0x5472
ori r18,r18,0x6169
lwz r17, 0x0048 (r30)
cmpw r17,r18
bne NotTrailEffect
xor r17,r17,r17
subi sp,sp,8
stw r17,0(sp)
lfs f3,0(sp)
addi sp,sp,8
li r17,1
stb r17,-0xDDC(rtoc)
b TrailEffect
NotTrailEffect:
lfs    f3, 0x0048 (r30)
TrailEffect:
.long 00000000
 
Last edited:
Top Bottom