The Stats Counters are stored at SHM 0x80. All of the offsets used below are given relative to SHM 0x80.
We maintain two arrays related the Stats Counter Values:
- An array containing each saved Stats Counter value
- An array containing the running total value (summed) of each Stats Counter value (add the value read to the sum each time you read it)
Fetching Stats Counter Values
Read the Stats Counter value from SHM offset 0x80 + the desired offset below
If the value from the SHM is equal the the previous saved value
- Don't do anything more, there's nothing to update, the Stats Counter Value is 0
Subtract the saved Stats Counter Value from the value read in from SHM
- If the result is negative
- Add 0x10000 to the result
- Add the result to the running total Stats Counter value
Save the value read from the SHM to the array containing each saved Stats Counter value
- Return the result value
Known Stats Counter Offsets
When the PeriodicTasks caller updates the statistics, update all of these ofsets (by fetching as above)
Offset |
Usage |
0x00 |
|
0x02 |
|
0x04 |
|
0x06 |
|
0x08 |
|
0x0A |
|
0x0C |
|
0x0E |
|
0x10 |
|
0x12 |
|
0x14 |
|
0x16 |
|
0x18 |
|
0x1A |
|
0x1C |
|
0x1E |
I'm not sure why there's a break here \/ |
0x24 |
I'm not sure why there's a break here /\ |
0x26 |
|
0x28 |
|
0x2A |
|
0x2C |
|
0x2E |
ACI Value |
0x30 |
|
0x32 |
|
0x34 |
|
0x36 |
|
0x38 |
|
0x3A |
|
0x3C |
|
0x3E |
|
0x40 |
|
0x42 |
|
0x44 |
|
0x46 |
|
0x48 |
|
0x4A |
|
0x4C |
|
0x4E |
|
0x50 |
|
0x52 |
|
0x54 |
|
0x56 |
|
0x58 |
|
0x5A |
|
0x5C |
|
0x5E |
|
0x60 |
|
0x62 |
|
0x64 |
|
0x66 |
|
0x68 |
|
0x6A |
|
0x6C |
|
0x6E |
|
0x70 |
|
0x72 |
|
0x74 |
|
0x76 |
|
0x78 |
|