PA_Mode7.h

00001 #ifndef PA_MODE7
00002 #define PA_MODE7
00003 
00004 #include "PA_Tile.h"
00005 
00006 
00007 // Mode 7 functions !!
00008 
00009 void hbl_mode7(void);
00010 
00011 extern const s32 DIV[160];
00012 extern const s16 _sinLUT[512];
00013 #define lut_sin(x)   _sinLUT[x]
00014 #define lut_cos(x)   _sinLUT[(x+128) & 511]
00015 
00016 
00017 #define X0    256<<8
00018 #define Y0     32<<8  // Default camera height -> 8192
00019 #define Z0    256<<8
00020 
00021 // DRV
00022 extern u8 PA_currentmode;
00023 
00024 
00025 
00026 
00027 // === GLOBALS ========================================================
00028 // DRV
00029 extern s32 mode7cam_x, mode7cam_y, mode7cam_z, mode7alpha;
00030 // DRV
00031 extern s32 mode7cos, mode7sin;     // temporaries for cos and sin alpha
00032 // DRV
00033 extern s16 mode7_distance;
00034 
00035 
00036 
00051 void PA_InitMode7(u8 bg_select);
00052 
00053 
00063 extern inline void PA_Mode7Angle(s16 angle){
00064     mode7alpha = angle&511;
00065        mode7cos = PA_Cos(mode7alpha);
00066        mode7sin = PA_Sin(mode7alpha);
00067 }
00068 
00069 
00070 
00080 extern inline void PA_Mode7MoveLeftRight(s16 x_deplac){
00081               mode7cam_x += x_deplac*mode7cos;
00082               mode7cam_z += x_deplac*mode7sin;
00083 }
00084 
00085 
00095 extern inline void PA_Mode7MoveForwardBack(s16 z_deplac){
00096               mode7cam_x += z_deplac*mode7cos;
00097               mode7cam_z += z_deplac*mode7sin;
00098 }
00099 
00100 
00101 
00111 extern inline void PA_Mode7X(s16 mode7x){
00112               mode7cam_x = mode7x;
00113 }
00114 
00115 
00125 extern inline void PA_Mode7Z(s16 mode7z){
00126               mode7cam_z = mode7z;
00127 }
00128 
00129 
00130 
00142 extern inline void PA_Mode7SetPointXZ(s16 mode7x, s16 mode7z){
00143               mode7cam_x = mode7x;
00144               mode7cam_z = mode7z;
00145 }
00146 
00147 
00157 extern inline void PA_Mode7Height(s16 mode7y){
00158               mode7cam_y = mode7y;
00159 }
00160 
00161 
00162  // end of Mode7
00164 
00165 
00166 #endif
00167 
00168 

Généré le Tue Nov 8 13:19:53 2005 pour PAlib par  doxygen 1.3.9.1