This code will adjust Melee’s FOV to 16:9. There are several options depending on whether you’re using an LCD TV, a gaming monitor, or Dolphin. If you are using Dolphin, set your Aspect Ratio to “Force 16:9” and make sure “Widescreen Hack” is OFF.
16:9 Widescreen Support (v1.02) [InternetExplorer]
C2021ABC 00000002
39C00001 38600006
60000000 00000000
C236A4A8 00000007
C03F0034 2C0E0001
41820024 3C00XXXX
90010030 3C00YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 00000000
16:9 Widescreen Support (v1.00) [InternetExplorer]
C2021A3C 00000002
39C00001 38600006
60000000 00000000
C23685F4 00000007
C03F0034 2C0E0001
41820024 3C00XXXX
90010030 3C00YYYY
90010034 C0010030
EC210032 C0010034
EC210024 39C00000
281E0000 00000000
16:9 for Dolphin: XXXX = 42B8, YYYY = 427C
16:9 for Monitor: XXXX = 4438, YYYY = 440E
16:9 for LCD TV: XXXX = 4080, YYYY = 4040
4:3 for Dolphin: XXXX = 41B8, YYYY = 41A8
(Thank you /u/mirrorbender for this contribution)
Using r14 as a flag is actually really messy and unsafe. Please don’t do this in your code; find a safe place in memory to store your flags.
--80021ABC--
li r3,6 #original line
li r14,1 #set ‘fullscreen shader’ flag to 1
--8036A4A8--
lfs f1,0x0034(r31) #load FOV to f1 (original line)
cmpwi r14,1 #is this the fullscreen shader?
beq END #if so, skip over it (don’t modify)
lis r0,0x4080 #load float value for ‘4’ and store to stack
stw r0,0x30(sp)
lis r0,0x4040 #load float value for ‘3’ and store to stack
stw r0,0x34(sp)
lfs f0,0x30(sp) #load ‘4’ to f0
fmuls f1,f1,f0 #multiply FOV by 4
lfs f0,0x34(sp) #load ‘3’ to f0
fdivs f1,f1,f0 #divide FOV by 3
END:
li r14,0 #set ‘fullscreen shader’ flag back to 0