Japanese
PROGRAMMER'S GUIDEDebug support library
Back | ■
Debug support library/2.Reference

2.2 Function specifications


one
View
table
 Title
function specification
 Function
Initializing the debug environment
 Function name
DBG_Initial
 No
1
Format
void DBG_Initial (Uint16 *PadData, Rgb16 charColor, Rgb16 backColor)

input

apPadData: Pointer to dedicated pad data
Please specify the pad data area to set the pad data acquired using the peripheral library in the V-Blank user routine.
Also, please set the pad data by inverting 0 and 1.

charColor: Specify the display font color in 16-bit RGB.
backColor: Specify the color of the display back screen in 16-bit RGB. If you specify 0, the color will be transparent.

Setting Example
=== V blank interrupt routine (pad data acquisition) ===
    PerDgtInfo *pad;
        Uint16 PadData1;

    PadData1 = pad[0].data ^ 0xffff;

=== DBG_Initial calling routine ===
        extern Uint16 PadData1;

        DBG_Initial(&PadData1, ...);
output
none
function value
none
function
Initialize the debug support library and set the program error display routine entry in the program exception interrupt vector below.
When an error occurs, the program error display routine displays the cause of the error, current register contents, and stack area contents, and passes control to the simple monitor.
remarks
Library users must run it first.

one
View
table
 Title

function specification

 Function

Display debug screen ON

 Function name

DBG_DisplayOn

 No

2

Format
void DBG_DisplayOn(void)
input
none
output
none
function value
none
function
Display the debug screen.

one
View
table
 Title

function specification

 Function

Debug screen display OFF

 Function name

DBG_DisplayOff

 No

3

Format
void DBG_DisplayOff(void)
input
none
output
none
function value
none
function
Does not display the debug screen.

one
View
table
 Title

function specification

 Function

Clear debug screen

 Function name

DBG_ClearScreen

 No

4

Format
void DBG_ClearScreen(void)
input
none
output
none
function value
none
function
Erases the data written on the debug screen.

one
View
table
 Title

function specification

 Function

Debug screen cursor set

 Function name

DBG_SetCursol

 No

5

Format
void DBG_SetCursol(Uint16 x,Uint16 y)
input
 x
 :X coordinate
 y
 :Y coordinate
output
none
function value
none
function
Specifies the cursor position.

one
View
table
 Title

function specification

 Function

Display string on debug screen

 Function name

DBG_Printf

 No

6

Format
void DBG_Printf(const char *control, ...)
input
 control
 : Pointer to a string indicating the format
 ...
 : argument list
output
none
function value
none
function
Write a string to the debug screen. It is used in the same way as printf().
example
sample()
        {
            DBG_Printf(“%s\n”,“SEGA”);
        }

one
View
table
 Title

function specification

 Function

via software keyboard
Key input processing

 Function name

DBG_GetKeyStr

 No

7

Format
char *DBG_GetKeyStr(char *keyStr)
input
keyStr: Pointer to input key string return area.
output
keyStr: Input key string data.
function value
Pointer to the specified input key string return area
function
Display the software keyboard on the debug screen and import the string.
keypad operation
 R
 : Move key selection cursor to the right
 L
 : Move key selection cursor to the left
 U
 :Move key selection cursor up
 D
 :Move key selection cursor down
 B+R
 :Key window right movement
 B+L
 :Key window left movement
 B + U
 :Move key window up
 B+D
 :Move key window down
 A
 : Enter the character at the key selection cursor position
 C
 :Delete input characters (backspace)
 START
 : End of input (return)
 X
 :Hide/display sprite screen
 Y
 :Hide/display scroll (other than normal 0) screen 

one
View
table
 Title

function specification

 Function

Simple debugging process

 Function name

DBG_Monitor

 No

8

Format
void DBG_Monitor(void)
input
none
output
none
function value
none
function
Enter the following command to change the display of memory contents, etc.

Items in brackets [] can be omitted, and please select one for /.

  1. Displaying memory contents
  2. D fromAddr [toAddr/@size] [;B/W/L]< RTN>
     fromAddr
     :Dump start address
     toAddr
     :Dump end address
     @size
     :Dump size (HEX)
     B
     :Byte (8 bit) display specification
     W
     : Word (16 bit) display specification
     L
     : Long (32 bit) display specification
    In the command input after the D command,< RTN> If only the key is pressed in, the memory dump will continue.

  3. Changing memory contents

  4. D to Addr [data] [;B/W/L]< RTN>
     toAddr
     :Memory address
     data
     : Change data (HEX)
     B
     : Byte (8 bit) data specification
     W
     : Word (16 bit) data specification
     L
     :Long (32 bit) data specification
    If data is omitted, a prompt to change data will be displayed starting from the specified address, so enter the data one by one. At this time, if you enter ^, the changed address will be minus,< RTN> If you enter , the change address will be added. Also, enter . to finish changing the memory.

  5. Displaying register contents

  6. R
    Valid only when called from a program's exception handling routine.

  7. End of simple debugging process

  8. Q
    Returns to the calling source of this routine. However, it has no effect when called from a program's exception handling routine.

  9. Display command help

  10. H


Back | ■
PROGRAMMER'S GUIDEDebug support library
Copyright SEGA ENTERPRISES, LTD., 1997