#include "sgl.h" Uint16 mode; Uint16 size; void *addr_A; Bool slInitBitMap( mode, size, addr_A ); Bool slInitBitMapNbg0( size, addr_A ); Bool slInitBitMapNbg1( size, addr_A ); Bool slInitBitMapRbg0( size, addr_A );
Uint16 mode - Screen to draw (described later).
Uint16 size - Screen size (described later).
void *addr_A - Start (absolute) address of VRAM used as bitmap (described below).
Bool - Error code (described below).
slInitSystem ( TV_320x224 , NULL , 1 ); slInitBitMap ( bmNBG1 , BM_512x256 , ( void * )0x25e00000 ); slScrAutoDisp ( NBG0ON | NBG1ON | NBG2OFF | NBG3OFF );
slBitMapNbg0 | slBitMapNbg1 | slBitMapRbg0 |
#include "sgl.h" Sint16 pos_x; Sint16 pos_y; void slBitMapBase( pos_x, pos_y );
Sint16 pos_x - X coordinate of the bitmap screen origin.
Sint16 pos_y - Y coordinate of the origin of the bitmap screen.
void - returns nothing.
Set the center coordinates to the center and bottom of the screen.
slInitSystem ( TV_320x224 , NULL , 1 ); slInitBitMap ( bmNBG1 , BM_512x256 , ( void * )0x25e00000 ); slBitMapBase ( 160, 224 );
slInitBitMap |
#include "sgl.h" Sint16 pos_x; Sint16 pos_y; Sint8 *slLocateBitMap( pos_x, pos_y );
Sint16 pos_x - X coordinate of the position for which you want the address.
Sint16 pos_y - Y coordinate of the position you want to find the address for.
Sint8 * - VRAM (absolute) address of the specified location.
Block transfer data to the address obtained with slLocateBitMap .
addr = slLocateBitMap ( 10, 10 ); slDMACopy ( addr, dest, size );
#include "sgl.h" Sint8 col; void slClearBitMap( col );
Sint8 col - Palette number.
void - returns nothing.
slClearBitMap ( 6 );
#include "sgl.h" Sint16 pos_x; Sint16 pos_y; Sint8 col; Bool slBMPset( pos_x, pos_y, col );
Sint16 pos_x - X coordinate of the position you want to draw.
Sint16 pos_y - Y coordinate of the position you want to draw.
Sint8 col;
Bool - Error code (described below).
Point a dot at (10,10).
if ( slBMPset ( 10, 10, 3 ) == FALSE ) { slPrint ( "Error occurred.", slLocate ( 9, 2 ) ); }
slBMPoint | slBMCircle | slBMLine | slBMBox |
slBMBoxFill |
#include "sgl.h" Sint16 pos_x; Sint16 pos_y; Sint8 slBMPoint( pos_x, pos_y );
Sint16 pos_x - X coordinate of the position for which you want to know the palette code.
Sint16 pos_y - Y coordinate of the position for which you want to know the palette code.
Sint8 palette code
Reads the point at the specified position and returns the palette code.
If it is off-screen, 0 is returned.
Know the RGB code of dot (10,5).
rgb = *( Uint16 * )( 0x25f00000 + slBMPoint ( 10, 5 ) );
slBMPoint | slBMCircle | slBMBox | slBMBoxFill |
slBMPset |
#include "sgl.h" Sint16 pos_x; Sint16 pos_y; Sint16 size; Sint8 col; void slBMCircle( pos_x, pos_y, size, col );
Sint16 pos_x - X coordinate of the position you want to display.
Sint16 pos_y - Y coordinate of the position you want to display.
Sint16 size - radius of the circle.
Sint8 col - Palette code of the color you want to display.
void - returns nothing.
Draw a circle with radius 20 centered at the origin.
slBMCircle ( 0, 0, 20, 120 );
slBMPoint | slBMPset | slBMLine | slBMBox |
slBMBoxFill |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 col; Bool slBMLine( pos_s_x, pos_s_y, pos_e_x, pos_e_y, col );
Sint16 pos_s_x - X coordinate of the starting point of the line.
Sint16 pos_s_y - Y coordinate of the starting point of the line.
Sint16 pos_e_x - X coordinate of the end point of the line.
Sint16 pos_e_y - Y coordinate of the end point of the line
Sint8 col - Palette code.
Bool - Error code (described below).
Draw a line starting at (10,54) and ending at (-3,35).
slBMLine ( 10, 54, -3, 35 );
slBMPoint | slBMCircle | slBMPset | slBMBox |
slBMBoxFill |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 col; Bool slBMBox( pos_s_x, pos_s_y, pos_e_x, pos_e_y, col );
Sint16 pos_s_x - X coordinate of the upper left point of the rectangle to draw.
Sint16 pos_s_y - Y coordinate of the upper left point of the rectangle to draw.
Sint16 pos_e_x - X coordinate of the lower right point of the rectangle to draw.
Sint16 pos_e_y - Y coordinate of the lower right point of the rectangle to draw.
Sint8 col - Palette code for the color to draw.
Bool - Error code (described below).
Draw a rectangle with top left (120,35) and bottom right (47,100).
slBMBox ( 120, 35, 47, 100, 1 );
slBMPoint | slBMCircle | slBMLine | slBMPset |
slBMBox |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 col; Bool slBMBoxFill( pos_s_x, pos_s_y, pos_e_x, pos_e_y, col );
Sint16 pos_s_x - X coordinate of the upper left point of the rectangle to draw.
Sint16 pos_s_y - Y coordinate of the upper left point of the rectangle to draw.
Sint16 pos_e_x - X coordinate of the lower right point of the rectangle to draw.
Sint16 pos_e_y - Y coordinate of the lower right point of the rectangle to draw.
Sint8 col - Palette code for the color to draw.
Bool - Error code (described below).
Draw a rectangle with the upper left (120,35) and lower right (47,100) and fill it in.
slBMBoxFill ( 120, 35, 47, 100, 1 );
slBMPoint | slBMCircle | slBMLine | slBMPset |
slBMBox |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 addr_A; Bool slBMGet( pos_s_x, pos_s_y, pos_e_x, pos_e_y, addr_A );
Sint16 pos_s_x - X coordinate of the top left point of the rectangle to retrieve.
Sint16 pos_s_y - Y coordinate of the top left point of the rectangle to retrieve.
Sint16 pos_e_x - X coordinate of the lower right point of the rectangle to retrieve.
Sint16 pos_e_y - Y coordinate of the lower right point of the rectangle to retrieve.
Sint8 addr_A - Address of the buffer that will hold the area's data.
Bool - Error code (described below).
Uint8 buffer[ 10 * 30 ]; stores the inside of the rectangle with upper left (20,20) and lower right (30,50) as a buffer; slBMGet ( 20, 20, 30, 50, buffer );
slBMPut | slBMSprPut |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 *addr_A; Bool slBMPut( pos_s_x, pos_s_y, pos_e_x, pos_e_y, addr_A );
Sint16 pos_s_x - X coordinate of the upper left point of the rectangle to draw.
Sint16 pos_s_y - Y coordinate of the upper left point of the rectangle to draw.
Sint16 pos_e_x - X coordinate of the lower right point of the rectangle to draw.
Sint16 pos_e_y - Y coordinate of the lower right point of the rectangle to draw.
Sint8 *addr_A - Address where the original data is located.
Bool - Error code (described below).
Uint8 buffer[ 50 * 50 ]; slDMACopy ( buffer, dest, 50 * 50 ); slBMPut ( 34, 56, 84, 106, buffer );
slBMGet | slBMSprPut |
#include "sgl.h" Sint16 pos_s_x; Sint16 pos_s_y; Sint16 pos_e_x; Sint16 pos_e_y; Sint8 *addr_A; Bool slBMSprPut( pos_s_x, pos_s_y, pos_e_x, pos_e_y, addr_A );
Sint16 pos_s_x - X coordinate of the upper left point of the rectangle to draw.
Sint16 pos_s_y - Y coordinate of the upper left point of the rectangle to draw.
Sint16 pos_e_x - X coordinate of the lower right point of the rectangle to draw.
Sint16 pos_e_y - Y coordinate of the lower right point of the rectangle to draw.
Sint8 *addr_A - Address where the original data is located.
Bool - Error code (described below).
Uint8 buffer[ 50 * 50 ]; slDMACopy ( buffer, dest, 50 * 50 ); slBMPut ( 34, 56, 84, 106, buffer );
slBMGet | slBMPut |