http://hi-tech.msx.click/en/index.php?title=Special:NewPages&feed=atom&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter=HI-TECH C for CP/M Fan WIKI(EN) - New pages [en]2024-03-29T06:26:01ZFrom HI-TECH C for CP/M Fan WIKI(EN)MediaWiki 1.28.2http://hi-tech.msx.click/en/index.php?title=LIBRARIES_PUBLIC_DOCUMENT_ESGFXLIB_V9990LIBRARIES PUBLIC DOCUMENT ESGFXLIB V99902018-04-19T08:56:35Z<p>Kumokosi: </p>
<hr />
<div>ESGFXLIB_V9990_en<br />
V9990 Graphic Library for HI-TECH C version0.3<br />
<br />
(c) 2002 Airam Rodriguez Rodriguez (airan@vanaga.es)<br />
<br />
==USE CONDITIONS==<br />
<br />
This is not the complete library for the control of the v9990, the full version has the use of the sprite and cursor features in the bitmap modes.<br />
These functions are implemented but have not been sufficiently tested so they have not been included in this version.<br />
<br />
The library v9990 is freeware (free), it is free to be distributed without<br />
changes with respect to the original, but if you use these libraries in your programs.<br />
<br />
You should:<br />
<br />
:For personal use: Make mention of the use of this library and its author in any part of the program, as well as the version number in use.<br />
<br />
:For commercial use: (to be distributed free or for payment) you must send me a copy of your program.<br />
<br />
For any advice, question, comment or failure you find in these libraries, please write to: <airan@vanaga.es>.<br />
<br />
<br />
<br />
==xxxxx==<br />
<br />
;<nowiki>#define</nowiki> vdp (int)0x60<br />
<br />
;<nowiki>#define</nowiki> outreg(x) (outp (vdp + 3, x))<br />
<br />
;<nowiki>#define</nowiki> setreg(x) (outp (vdp + 4, x))<br />
<br />
;<nowiki>#define</nowiki> c_abort (int)0x00<br />
<br />
;<nowiki>#define</nowiki> c_lmmc (int)0x10<br />
<br />
;<nowiki>#define</nowiki> c_lmmv (int)0x20<br />
<br />
;<nowiki>#define</nowiki> c_lmcm (int)0x30<br />
<br />
;<nowiki>#define</nowiki> c_lmmm (int)0x40<br />
<br />
;<nowiki>#define</nowiki> c_cmmc (int)0x50<br />
<br />
;<nowiki>#define</nowiki> c_cmmk (int)0x60<br />
<br />
;<nowiki>#define</nowiki> c_cmmm (int)0x70<br />
<br />
;<nowiki>#define</nowiki> c_bmxl (int)0x80<br />
<br />
;<nowiki>#define</nowiki> c_bmlx (int)0x90<br />
<br />
;<nowiki>#define</nowiki> c_bmll (int)0xa0<br />
<br />
;<nowiki>#define</nowiki> c_line (int)0xb0<br />
<br />
;<nowiki>#define</nowiki> c_srch (int)0xc0<br />
<br />
;<nowiki>#define</nowiki> c_point (int)0xd0<br />
<br />
;<nowiki>#define</nowiki> c_pset (int)0xe0<br />
<br />
;<nowiki>#define</nowiki> c_advance (int)0xf0<br />
<br />
==V9990 SCREEN MODES==<br />
<br />
;<nowiki>#define</nowiki> P1 1<br />
;<nowiki>#define</nowiki> P2 2<br />
;<nowiki>#define</nowiki> B1 3<br />
;<nowiki>#define</nowiki> B2 4<br />
;<nowiki>#define</nowiki> B3 5<br />
;<nowiki>#define</nowiki> B4 6<br />
;<nowiki>#define</nowiki> B5 7<br />
;<nowiki>#define</nowiki> B6 8<br />
<br />
==LOGOP==<br />
<br />
;<nowiki>#define</nowiki> PSET (int)0x0c<br />
<br />
;<nowiki>#define</nowiki> PRESET (int)0x03<br />
<br />
;<nowiki>#define</nowiki> AND (int)0x08<br />
<br />
;<nowiki>#define</nowiki> OR (int)0x0e<br />
<br />
;<nowiki>#define</nowiki> XOR (int)0x06<br />
<br />
== SCREEN DATA - IMAGE SPACE (DOTS) ==<br />
<br />
;<nowiki>#define</nowiki> D256 0<br />
::256 Dots in X direction<br />
<br />
;<nowiki>#define</nowiki> D512 4<br />
::512 Dots in X direction<br />
<br />
;<nowiki>#define</nowiki> D1024 8<br />
::1024 Dots in X direction<br />
<br />
;<nowiki>#define</nowiki> D2048 12<br />
::2048 Dots in X direction<br />
<br />
;<nowiki>#define</nowiki> BIT2 4<br />
::Up to 4 colors<br />
<br />
;<nowiki>#define</nowiki> BIT4 16<br />
::Up to 16 colors<br />
<br />
;<nowiki>#define</nowiki> BIT8 256<br />
::Up to 256 colors<br />
<br />
<br />
== Arrays for use with sprites. Not tested yet==<br />
<br />
<br />
<br />
typedef struct {<br />
unsigned red, green, blue;<br />
} colors;<br />
<br />
typedef struct {<br />
unsigned char ncolors;<br />
colors data[63];<br />
} palettes;<br />
<br />
<br />
==Number of colors on screen==<br />
<br />
;extern int nColors;<br />
<br />
;extern palettes palette;<br />
<br />
<br />
<br />
==Functions==<br />
<br />
;void vsync(void);<br />
:vsync - Wait for the vertical screen refresh.<br />
:Variables:<br />
::Any.<br />
<br />
;void setreg (unsigned char reg);<br />
:setreg - Sets the register in which to write.<br />
:Variables:<br />
::reg - Register number.<br />
<br />
;void regvdp (unsigned char reg, unsigned char data);<br />
:regvdp - sends a data to a specified vdp register.<br />
:Variables:<br />
::reg - Register number.<br />
::data - Data to send.<br />
<br />
;unsigned char regStatus (unsigned char reg);<br />
:regStatus - Returns the value of the specified status register.<br />
:Variables:<br />
::reg - Status register number<br />
<br />
;void setBgColor (unsigned char color);<br />
:setBgColor - Sets the background color.<br />
:Variables:<br />
::color - Color index in color palette.<br />
<br />
;void setAddress (unsigned address);<br />
:setAddress - Sets the pointer in a given direction with auto increment<br />
:Variables:<br />
::color - Color index in color palette.<br />
<br />
;void vpoke (unsigned address, unsigned char data);<br />
:vpoke - Sets the value of a VRAM memory address.<br />
:Variables:<br />
::address - Memory address.<br />
::data - Bytes to send.<br />
<br />
;unsigned char vpeek (unsigned address);<br />
:vpeek - Gets the value of a particular VRAM memory address<br />
:Variables:<br />
::address - Memory adress.<br />
<br />
;void v9scroll (unsigned scax, unsigned scay, unsigned scbx, unsigned scby, unsigned roll);<br />
:v9scroll - Generate scrolls on screen A and B.<br />
:Variables:<br />
<br />
::scax - Line on the x axis of the screen A<br />
::scay - Line on the y axis of the screen A<br />
::scbx - Line on the x axis of the screen B<br />
::scby - Line on the y axis of the screen B<br />
::roll - Image roll (<br />
<br />
;void scroll (unsigned char line);<br />
:scroll - Sets the upper display line<br />
:Variables:<br />
::line - Actual number of the top line.<br />
<br />
;void setLogop(unsigned char logop);<br />
:setLogop - Sets the default logical operation (PSET).<br />
:Variables:<br />
::logop - Logical operation(PSET, AND, OR, XOR, PRESET)<br />
<br />
;void setMasks (unsigned char mask0, unsigned char mask1);<br />
:Set masks to command for default (0xFF,0xFF)<br />
:Variables:<br />
::mask0 - mask 0<br />
::mask1 - mask 1<br />
<br />
;void outcmd (int command);<br />
:outcmd - Execute a VDP command.<br />
:Variables:<br />
::command - Number of command.<br />
<br />
;void pset (unsigned x, unsigned y, unsigned char color);<br />
:pset - Illuminates a point on the screen<br />
:Variables:<br />
::x, y - Coordinate of the point.<br />
::color - Color index of the point in the color palette.<br />
:Basic:<br />
::pset (x,y),color<br />
<br />
;unsigned char point (int x, int y);<br />
:point - Gets the color of a point on the screen.<br />
:Variables:<br />
::x, y - Coordinates of the point.<br />
:Basic:<br />
::color = point (x,y)<br />
<br />
;void line (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned char color);<br />
:line - Draw a line between two points.<br />
:Variables:<br />
::x, y - Coordinates of the initial point.<br />
::xd, yd - Coordinates of the final point.<br />
::color - Color index of the point in the color palette.<br />
:Basic:<br />
::line (x,y)-(xd,yd),color<br />
<br />
;void box (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned char color);<br />
:box - Draw a rectangle between two points.<br />
:Variables:<br />
::x, y - Coordinates of the initial vertex.<br />
::xd, yd - Coordinates of the final vertex.<br />
::color - Color index of the line in the color palette.<br />
:Basic:<br />
::line (x,y)-(xd,yd),color,b<br />
<br />
;void copy (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned sp, unsigned x, unsigned y, unsigned dp);<br />
:copy - Copy a rectangular area given by a coordinate from a particular screen point.<br />
:Variables:<br />
::sx, sy - Coordinates of the initial vertex.<br />
::dx, dy - Coordinates of the final vertex.<br />
::sp - Image source page.<br />
::x, y - Starting Area Coordinates.<br />
::dp - Image destination page.<br />
:::- Coordinates related to screen ([256 | 512] x 212)<br />
:Basic:<br />
::copy (sx,sy)-(dx,dy),sp to (x,y),dp<br />
<br />
;void copyAbs (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned x, unsigned y) ; <br />
:copyAbs - Copy a rectangular area given by a coordinate from a given point on the screen.<br />
:Variables:<br />
::sx, sy - Coordinates of the initial vertex.<br />
::dx, dy - Coordinates of the final vertex.<br />
::sp - Image source page.<br />
::x, y - Starting Area Coordinates.<br />
::dp - Image destination page.<br />
:::- Absolute coordinates to memory ([256 | 512] x 1024) (128 kb VRAM)<br />
:Basic:<br />
::copy (sx,sy)-(dx,dy),sp to (x,y),dp<br />
<br />
;void paint (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned char color);<br />
:paint - fills a rectangular surface of a certain color.<br />
:Variables:<br />
::sx, sy - Coordinates of the initial vertex.<br />
::dx, dy - Coordinates of the final vertex.<br />
::color - Color index of the point in the color palette.<br />
:Basic:<br />
::line (sx,sy)-(dx,dy),color,bf<br />
<br />
;void setAdjust (int x, int y);<br />
:setAdjust - set initial of visualized area of the screen<br />
:Variables:<br />
::x, y - Initial coordinates of the screen start area.<br />
:Basic:<br />
::set adjust x, y<br />
<br />
;void setPalette (palettes *pal);<br />
:setPalette - set specified color palette<br />
:Variables:<br />
::pal - palettes of palettes type. <br />
<br />
;void setColor (unsigned char color, unsigned char red, unsigned char green,unsigned char blue);<br />
setColor - Sets the RGB components of an index of the color palette.<br />
:Variables:<br />
::color - Color index in color palette.<br />
:::red - Value of the red component.<br />
:::green - Value of the green component.<br />
:::blue - Value of the blue component.<br />
:Basic:<br />
::set color (color,red,green,blue)<br />
<br />
;colors getColor (unsigned char ncolor);<br />
:GetColor - Gets the RGB components of an index of the color palette.<br />
:Variables:<br />
::ncolor - Specify the color of color palettes<br />
<br />
;void v9screen (unsigned char nscreen, unsigned char wide, unsigned char ncolors);<br />
:v9screen - Initialize determined v9990 graphic mode<br />
:Variables:<br />
::nscreen: Number of screen (P1 - B6)<br />
::wide: virtual screen width (D256, D512, D1024)<br />
::ncolors: depth of color (BIT2 - BIT16)<br />
::Note: See v9990 datasheets for different possibilities.<br />
<br />
;void screen (unsigned char mode);<br />
:screen - Initialize the graphic mode compatible with MSX(V9938/9958).<br />
:Variables:<br />
::mode: Screen mode (4 - 12)<br />
<br />
;void cpu2vdp (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned dir);<br />
:cpu2vdp - transfer of a ram block to vdp<br />
:Variables:<br />
::x,y,xd,yd : final coordenates.<br />
::dir: start RAM address.<br />
:Basic:<br />
::Any -- not tested<br />
<br />
;unsigned char v9Detect(void);<br />
:v9Detect - detect connection of gfx9000<br />
::1 - Yes, connected.<br />
::0 - No, not connected.</div>Kumokosihttp://hi-tech.msx.click/en/index.php?title=LIBRARIES_PUBLIC_ESGFXLIB_V9990LIBRARIES PUBLIC ESGFXLIB V99902018-04-19T08:56:11Z<p>Kumokosi: Created page with "==LibraryName== V9990 Graphic Library for HI-TECH C version0.3 ==About== This is not the complete library for the control of the v9990, the full version has the use of the s..."</p>
<hr />
<div>==LibraryName==<br />
V9990 Graphic Library for HI-TECH C version0.3<br />
<br />
==About==<br />
<br />
This is not the complete library for the control of the v9990, the full version has the use of the sprite and cursor features in the bitmap modes.<br />
These functions are implemented but have not been sufficiently tested so they have not been included in this version.<br />
<br />
==Author==<br />
Airam Rodriguez Rodriguez<br />
<br />
==Document==<br />
[[LIBRARIES_PUBLIC_DOCUMENT_ESGFXLIB_V9990]]<br />
<br />
==TranslationLevel==<br />
Edited translation from Spanish<br />
<br />
==DestributionSite==<br />
Redistribution at this WIKI<br />
http://msx.click/wp-content/uploads/2017/09/esgfxlib.zip<br />
<br />
==Package==<br />
ESGFXLIB<br />
<br />
==Version==<br />
0.3<br />
<br />
==License==<br />
The library v9990 is freeware (free), it is free to be distributed without<br />
changes with respect to the original, but if you use these libraries in your programs.<br />
<br />
You should:<br />
<br />
:For personal use: Make mention of the use of this library and its author in any part of the program, as well as the version number in use.<br />
<br />
:For commercial use: (to be distributed free or for payment) you must send me a copy of your program.<br />
<br />
For any advice, question, comment or failure you find in these libraries, please write to: <airan@vanaga.es>.<br />
<br />
==Prerequisite==<br />
<br />
<br />
==Notes==<br />
<br />
Added chapter "About" section by editor of WIKI. This is cited from author's old blog.</div>Kumokosi