-==-
ASM - Orthographic Stage Camera - Concept 1
- Sets stage camera to orthographic mode
- Forces "eye" level WObj XY to be orthogonal to the "interest" WObj
- Creates a fake "zoom" camera effect to compensate no perspective
- Allows projected frame scale to be adjusted with custom values
- Modifies some camera tracking settings to smooth out character tracking
[Punkline]
<orthoStageCamera_data>
.float /* You may change these values to whatever you like.
*/ 0.05, /* top ratio - these summarize new projection unit size
*/ -0.064, /* bot ratio
*/ -0.05, /* left ratio
*/ 0.05, /* right ratio
*/ 10.00, /* zoom padding
*/ 1.25, /* character tracking size
*/ 0.50, /* character tracking zoom speed?
*/ 0.66, /* character tracking speed - these help smooth out the zoom
*/ 125.00 /* character min zoom
*/
NTSC 1.02 ----- 800301fc --- 4bffa2b1 -> Branch
rData = 31; rCObj = 30; rGObj = 29; rIntr = 11; rEye = 12
fTB = 1; fLR = 2; fZoom = 3;
bl 0x8002a4ac # default WObj update
# at this point, WObjs may be intercepted before they are used this draw frame
lis r0, <<orthoStageCamera_data>>@h
ori rData, r0, <<orthoStageCamera_data>>@l
li r0, 3
lwz rCObj, 0x28(rGObj)
stb r0, 0x50(rCObj)
# set type to orthographic projection
psq_l fTB, 0x0(rData), 0, 0
psq_l f0, 0x18(rCObj), 1, 0
ps_muls0 fTB, fTB, f0
lwz rIntr, 0x28(rCObj)
psq_l fLR, 0x8(rData), 0, 0
psq_l f0, 0x10(rCObj), 1, 0
ps_muls0 fLR, fLR, f0
lwz rEye, 0x24(rCObj)
lis r0, 0x8049E6F0@h
ori r3, r0, 0x8049E6F0@l
lfs f0, 0x2C(r3)
ps_div fTB, fTB, f0
ps_div fLR, fLR, f0
# fTB and fLR = projection units
psq_l fZoom, 0x14(rEye), 1, 0
psq_l f0, 0x14(rIntr), 1, 0
ps_sub fZoom, fZoom, f0
psq_l f0, 0x10(rData), 1, 0
ps_add fZoom, fZoom, f0
ps_muls0 fTB, fTB, fZoom
ps_muls0 fLR, fLR, fZoom
# fTB and fLR = scaled dimensions
lfs f0, -0x7B84(rtoc) # 1000.0
psq_st fTB, 0x40(rCObj), 0, 0
stfs f0, 0x14(rEye) # prevent Z depth from culling geometry
psq_l f0, 0xC(rIntr), 0, 0
addi r4, rData, 0x14
psq_st fLR, 0x48(rCObj), 0, 0
lswi r5, r4, 0x10
psq_st f0, 0xC(rEye), 0, 0
stswi r5, r3, 0x10
# all values have been updated
_return:
.long 0