Debug mode: Difference between revisions

m
no edit summary
(→‎Classic Debug Display: Missing image being removed)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 436: Line 436:
While the ‘classic display’ shows some variable on a fixed position, there is also a whole system for automatically laying out debug text. The state is stored in a struct:
While the ‘classic display’ shows some variable on a fixed position, there is also a whole system for automatically laying out debug text. The state is stored in a struct:


<syntaxhighlight lang="c">
     typedef struct  
     typedef struct  
     {
     {
Line 445: Line 446:
     short line_y_offset, //0x0A equals -15 (top aligned) or +15 (bottom aligned)
     short line_y_offset, //0x0A equals -15 (top aligned) or +15 (bottom aligned)
     } DprintState;
     } DprintState;
</syntaxhighlight>


There are two of these states, one in the top left corner growing down, and one in the bottom right corner growing up. Note that (0, 0) is the bottom left corner and (320, 240) is the top right corner. Now whenever the developers wanted to show a certain variable, they would call a function that automatically ensures it doesn’t overlap with other variables.
There are two of these states, one in the top left corner growing down, and one in the bottom right corner growing up. Note that (0, 0) is the bottom left corner and (320, 240) is the top right corner. Now whenever the developers wanted to show a certain variable, they would call a function that automatically ensures it doesn’t overlap with other variables.
confirmed_editors
16

edits