Guest User

3DS calculate 3D state algo

a guest
Feb 6th, 2014
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. //u8 state_3d
  2. //u8 off3D
  3. void Check_3D() {
  4.     if(state_3d != *(u8*)0x10144000) //If 3D slider state changed
  5.     {
  6.         u8 temp_3d = (*(u8*)0x10144000) * 5 / 255; //We calculate new 3D data
  7.         if(temp_3d != off3D) { // We check if's different from the old
  8.             off3D = temp_3d; //Change 3D offset with new value
  9.             ClearScreen(0, 1); //Clear upper screen to redraw
  10.         }
  11.     }
  12. }
  13. /*...*/
  14. void main() {
  15.     /*...*/
  16.     state_3d = 0;
  17.     off3D = 0;
  18.     Check_3D();
  19.     /*...*/
  20.     while(game_loop) {
  21.         Check_3D();
  22.         /*...*/
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment