#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 (see below).
void * addr_A --The start (absolute) address of VRAM to use as a bitmap (see below).
Bool --Error code (see below).
Set the bitmap screen in 256-color mode.
The screen is not cleared.
In mode,
bmNBG0 , bmNBG1 , bmRBG0
For any size,
BM_512x256 , BM_512x512 , BM_1024x256 , BM_1024x512
Specify one of.
addr_A must be 20000H boundary.
In this function, slBitMapNbg0 , slBitMapNbg1 ,
slBitMapRbg0 is executed.
The center position of the screen is set to the origin.
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 origin of the bitmap screen.
Sint16 pos_y --Y coordinate of the origin of the bitmap screen.
void --Nothing is returned.
Set the origin position of the bitmap screen.
Specify the upper left corner of the screen as (0,0).
Set the center coordinates to the bottom center 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 where you want to find the address.
Sint16 pos_y --Y coordinate of the position where you want to find the address.
Sint8 * --VRAM (absolute) address at the specified location.
Returns the address in VRAM at the specified location.
Returns NULL if it was off the screen.
Block transfer data to the address acquired by slLocateBitMap.
addr = slLocateBitMap (10, 10);
slDMACopy (addr, dest, size);
#include "sgl.h"
Sint8 col;
void slClearBitMap (col);
Sint8 col --Palette number.
void --Nothing is returned.
Clears the bitmap screen with the specified color.
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 (see below).
Draws a point at the specified position.
Returns FALSE if off-screen.
Dot (10,10).
if ( slBMPset (10, 10, 3) == FALSE ) {
slPrint ("Error occurred.", SlLocate (9, 2));
}
slBMPoint | slBM Circle | 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 where you want to know the palette code.
Sint16 pos_y --Y coordinate of the position where 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 the screen, 0 is returned.
Know the RGB code of the dot (10,5).
rgb = * ( Uint16 *) (0x25f00000 + slBMPoint (10, 5));
slBMPoint | slBM Circle | 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-The radius of the circle.
Sint8 col --Palette code for the color you want to display.
void --Nothing is returned.
Draws a circle centered on the specified position.
Draw a circle with a radius of 20 centered on 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 (see below).
Draws a straight line connecting the two specified points.
Returns FALSE if off-screen.
Draw a line starting at (10,54) and ending at (-3,35).
slBMLine (10, 54, -3, 35);
slBMPoint | slBM Circle | 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 colors to draw.
Bool --Error code (see below).
Draws a rectangle with the specified points as two vertices.
Returns FALSE if off-screen.
Draw a rectangle with the upper left (120,35) and the lower right (47,100).
slBMBox (120, 35, 47, 100, 1);
slBMPoint | slBM Circle | 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 colors to draw.
Bool --Error code (see below).
Draws a rectangle with the specified points as two vertices.
It also draws the inside of the rectangle.
Returns FALSE if off-screen.
Fill the inside by drawing a rectangle with the upper left (120,35) and the lower right (47,100).
slBMBoxFill (120, 35, 47, 100, 1);
slBMPoint | slBM Circle | 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 upper left point of the rectangle to get.
Sint16 pos_s_y --Y coordinate of the upper left point of the rectangle to get.
Sint16 pos_e_x --X coordinate of the lower right point of the rectangle to get.
Sint16 pos_e_y --Y coordinate of the lower right point of the rectangle to get.
Sint8 addr_A --The address of the buffer that holds the data in the area.
Bool --Error code (see below).
Copies the bitmap data in the rectangle with the specified points as two vertices to the buffer. If part of the rectangle is off-screen, that part of the data will not be copied.
Returns FALSE if the entire rectangle is off screen.
Uint8 buffer [10 * 30];
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 with the original data.
Bool --Error code (see below).
Copies the bitmap data in the buffer inside a rectangle with the specified points as two vertices. If part of the rectangle is off-screen, that part of the data will not be copied.
Returns FALSE if the entire rectangle is off screen.
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 with the original data.
Bool --Error code (see below).
Copies the bitmap data in the buffer inside a rectangle with the specified points as two vertices. However, the space part (pallet code 0) is not copied,
If a part of the rectangle is off the screen, the data in that part will not be copied.
Returns FALSE if the entire rectangle is off screen.
Uint8 buffer [50 * 50];
slDMACopy (buffer, dest, 50 * 50);
slBMPut (34, 56, 84, 106, buffer);
slBMGet | slBMPut |