// Registers seem to range from 0x00 to around 0x3C but they are not understood
Currently we only know 1 bit out of all these registers ... The rest are totally unknown.
I had suggested before they they correspond to this data structure in the dev kit
- Code: Select all
typedef struct
{
unsigned long data_valid : 1;
unsigned long floatm1 :31;
} range_data;
typedef union
{
range_data rangem1;
float range;
} range_return;
typedef struct
{
unsigned long tot_clks :23;
unsigned long rend_done : 1;
unsigned long update_done : 1;
unsigned long ping_pong : 1;
unsigned long dp_done : 1;
unsigned long gp_done : 1;
unsigned long spare1 : 4;
unsigned long vpt0_clks :23;
unsigned long spare2 : 9;
unsigned long vpt1_clks :23;
unsigned long spare3 : 9;
unsigned long vpt2_clks :23;
unsigned long spare4 : 9;
unsigned long vpt3_clks :23;
unsigned long spare5 : 9;
range_return ranges[4];
unsigned long ls_cycle;
Hw_Config hw_config;
unsigned long words_buf_to_host;
unsigned long null0;
unsigned long null1;
} Stat_Pckt ;
The range return stuff is what is used by the line of sight command. It returns 4 possible values, one value for each priority layer (4). Well the hardware has to be returning these values somewhere .. it must be here.
Before I couldn't figure out the logic to make the line of sight to work correctly. It was drawing lens flair when it shouldn't. Anyway in the code I tried just return 0 for the rest of the registers.
This is the result
Returning 0xffffffff gives:

Returning 0 gives:

Uh, so giving the HW zero here tells the game that the line of sight test wasn't successful and not to draw lens flair ..
Importantly that means this real3d 'status bit' is actually the unsigned long ping_pong : 1;
bit :p
So my best guess is these registers correspond 100% to what is in the dev kit ..