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

2.2 Function specifications


List
 Title
Function specifications
 Function
Initialize debug environment
 Function Name
DBG_Initial
 No
1
Form
void DBG_Initial (Uint16 * PadData, Rgb16 charColor, Rgb16 backColor)

input

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

charColor: Specify the display text color in 16-bit RGB.
backColor: Specify the color of the display back screen in 16-bit RGB. If 0 is specified, 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 Caller 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 following program exception interrupt vector.
When an error occurs, the program error display routine displays the cause of the error, the contents of the current register, and the contents of the stack area, and passes control to the simple monitor.
remarks
Library users must run it first.

List
 Title

Function specifications

 Function

Debug screen display ON

 Function Name

DBG_DisplayOn

 No

2

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

List
 Title

Function specifications

 Function

Debug screen display OFF

 Function Name

DBG_DisplayOff

 No

3

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

List
 Title

Function specifications

 Function

Clear debug screen

 Function Name

DBG_ClearScreen

 No

Four

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

List
 Title

Function specifications

 Function

Debug screen cursor set

 Function Name

DBG_SetCursol

 No

Five

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

List
 Title

Function specifications

 Function

Character string display on debug screen

 Function Name

DBG_Printf

 No

6

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

List
 Title

Function specifications

 Function

Key input processing with software keyboard

 Function Name

DBG_GetKeyStr

 No

7

Form
char * DBG_GetKeyStr (char * keyStr)
input
keyStr: Input keystring A pointer to the return area.
output
keyStr: Input keystring data.
Function value
Pointer to the specified input keystring return area
function
Display the software keyboard on the debug screen and capture the character string.
Keypad operation
 R
 : Move the key selection cursor to the right
 L
 : Move left of key selection cursor
 U
 : Move up the key selection cursor
 D
 : Move down the key selection cursor
 B + R
 : Move right of key window
 B + L
 : Move left of key window
 B + U
 : Move up the key window
 B + D
 : Move down the key window
 A
 : Enter the character at the key selection cursor position
 C
 : Delete input character (backspace)
 START
 : Input end (return)
 X
 : Hide / show sprite screen
 Y
 : Scroll (other than normal 0) Hide / show screen 

List
 Title

Function specifications

 Function

Simple debug process

 Function Name

DBG_Monitor

 No

8

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

The inside of [] is optional, and select one of /.

  1. Display memory contents
    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
    If you key in only <RTN> in the command input after the D command, the memory dump will continue.

  2. Change memory contents
    D toAddr [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 data change prompt will be displayed from the specified address, so enter the data in sequence. At this time, if you enter ^, the change address will be deducted, and if you enter <RTN>, the change address will be added. You can also enter. To end the memory change.

  3. Display of register contents R
    It is valid only when it is called from the exception handling routine of the program.

  4. End of simple debug process Q
    Return to the caller of this routine. However, it is invalid when called from the exception handling routine of the program.

  5. Command help display H


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