PS2DEV network    

  > HOME
  > ABOUT

  > FORUMS
  > VIEW SVN
  > MAILING LIST
  > WIKI
  > QUOTES
  > DOCS

 PS2
  > TUTORIALS
  > LOADERS
  > TOOLS
  > SAMPLE CODE
  > DEMOS
  > PROJECTS

 PSP
  > TUTORIALS
  > TOOLS
  > DEMOS
  > PROJECTS

 PS3
  > LINKS
  > TUTORIALS
  > TOOLS
  > DEMOS
  > PROJECTS

   RSS


 USER ID (register)
 
 PASSWORD
 



 
  Set Video Mode
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


  > Locked
  > Edit Topic
  > Add Topic
  > Add Link
  > Add File
  > Move Topic
  > Delete Topic
  > Order Topics
  > Versions

Owned by gmenhorn
last updated by gmenhorn on Tue Jul 10 00:00:00 GMT 2001
 
Site Content Copyright 2001-2007 © Authors. Read Legal Statement for Information
LiveKnowledge Software by Live Media