|
Noticed in Duke's sample source the SetVideoMode proc:
SetVideoMode:
addiu $sp,$sp,-64
sd $31,0($sp)
lui $2,0x1200
lui $3,0
dsll32 $3,$3,0
ori $3,$3,0xFF62
sd $3,0($2)
addiu $3,$0,2
sd $3,0x20($2)
addiu $3,$0,0x1400 <--
sd $3,0x90($2)
lui $3,0x000D
ori $3,$3,0xF9FF
dsll $3,$3,16
ori $3,$3,0x0182
dsll $3,$3,16
ori $3,$3,0x4290
sd $3,0xA0($2)
ld $31,0($sp)
jr $31
addiu $sp,$sp,64
The magic numbers sparked my interest and I decided to investigate. Here is what I found so far:
The 0x1400 specifies the screen width and is calculated as follows :
((screen_width + 0x3F) >> 0x6) & 0x3F) << 0x9
Plugging 640 into this gives us the 0x1400 in duke's sample.
gmenhorn
|