OldSchool Library
Debug console

Debugging features. More...

Macros

#define oslPrintf(format ...)   ({ char __str[1000]; sprintf(__str, ## format); oslConsolePrint(__str); })
 Prints formatted text to the current position of the cursor.
 
#define oslPrintf_xy(x, y, str, format ...)   ({ osl_consolePosX = x; osl_consolePosY = y; oslPrintf(str, ## format); })
 Prints formatted text at a specific position on the screen.
 
#define oslCls()   (oslClearScreen(0), oslMoveTo(0, 0))
 Clears the screen (to black) and resets the cursor to the top-left corner of the screen.
 
#define oslMoveTo(x, y)   (osl_consolePosX = x * osl_sceFont->charWidths['0'], osl_consolePosY = y * osl_sceFont->charHeight)
 Moves the cursor to a place on the screen.
 

Detailed Description

Debugging features.

This section includes functions and macros for debugging, such as printing formatted text to the screen and controlling the debug console.

Macro Definition Documentation

◆ oslPrintf

#define oslPrintf (   format ...)    ({ char __str[1000]; sprintf(__str, ## format); oslConsolePrint(__str); })

Prints formatted text to the current position of the cursor.

This macro uses a format string similar to printf.

Parameters
formatFormatted text.

◆ oslPrintf_xy

#define oslPrintf_xy (   x,
  y,
  str,
  format ... 
)    ({ osl_consolePosX = x; osl_consolePosY = y; oslPrintf(str, ## format); })

Prints formatted text at a specific position on the screen.

This macro prints formatted text at the specified screen coordinates.

Parameters
xX-coordinate (in characters).
yY-coordinate (in characters).
strFormatted string.
formatAdditional formatted text.

◆ oslCls

#define oslCls ( )    (oslClearScreen(0), oslMoveTo(0, 0))

Clears the screen (to black) and resets the cursor to the top-left corner of the screen.

This macro clears the screen and moves the cursor to the origin.

◆ oslMoveTo

#define oslMoveTo (   x,
 
)    (osl_consolePosX = x * osl_sceFont->charWidths['0'], osl_consolePosY = y * osl_sceFont->charHeight)

Moves the cursor to a place on the screen.

This macro moves the cursor to the specified screen coordinates, using character units.

Parameters
xX-coordinate (in characters).
yY-coordinate (in characters).