-
Difference between revisions of "LIBRARIES PUBLIC DOCUMENT ESGFXLIB V9938"
From HI-TECH C for CP/M Fan WIKI(EN)
(Created page with "ESGFXLIB_V9938_en V9938 Graphic Library for HI-TECH C version0.6 (c) 2002 Airam Rodriguez Rodriguez (airan@vanaga.es) ==About== This is a new library for the MS-DOS Hi-Tech...") |
(No difference)
|
Latest revision as of 13:31, 2 September 2017
ESGFXLIB_V9938_en V9938 Graphic Library for HI-TECH C version0.6
(c) 2002 Airam Rodriguez Rodriguez (airan@vanaga.es)
Contents
About
This is a new library for the MS-DOS Hi-Tech C crosscompiler. The use of these libraries closely resembles BASIC graphic commands so they are very easy to use. Just by changing the #include "v9938.h" to #include "v9990.h" the program will work directly on GFX9000 without further changes.
USE CONDITIONS
The library v9938 is freeware, it is free to be distributed without changes regarding the original, but if you use these libraries in your programs you must:
- For personal use: Make mention of the use of this library and its author somewhere in the Program, as well as the number of version enpleado.
- For commercial use: (to be distributed free or for payment) you must send me a copy of your program. For any advice, questions, comments or faults found in these libraries, please write to: <airan@vanaga.es>.
Definition and macros
- #define vdp (int)0x98
- #define outreg(x) (outp (vdp + 3, x))
- #define c_abort (int)0x00
- #define c_point (int)0x40
- #define c_pset (int)0x50
- #define c_srch (int)0x60
- #define c_line (int)0x70
- #define c_lmmv (int)0x80
- #define c_lmmm (int)0x90
- #define c_lmcm (int)0xa0
- #define c_lmmc (int)0xb0
- #define c_hmmv (int)0xc0
- #define c_hmmm (int)0xd0
- #define c_ymmm (int)0xe0
- #define c_hmmc (int)0xf0
LOGOP
- #define PSET (int)0x0
- #define AND (int)0x1
- #define OR (int)0x2
- #define XOR (int)0x3
- #define PRESET (int)0x4
- #define BIT2 4
- Up to 4 colors
- #define BIT4 16
- Up to 16 colors
- #define BIT8 256
- Up to 256 colors
Arrays to use with sprites
- extern unsigned char sprite_data[];
- extern unsigned char sprite_colour[];
Color number in screen
- extern int nColors;
Functions
- void vsync(void);
- vsync - Wait for the vertical screen refresh.
- Variables:
- Ninguna.
- void setreg (unsigned char reg);
- setreg - Sets the register in which to write.
- Variables:
- reg - Register number.
- void regvdp (unsigned char reg, unsigned char data);
- regvdp - sends a data to a specified vdp register.
- Variables:
- reg - Register number.
- data - Data to send.
- unsigned char regStatus (unsigned char reg);
- regStatus - Returns the value of the specified status register.
- Variables:
- reg - Status register number
- void setBgColor (unsigned char color);
- setBgColor - Sets the background color.
- Variables:
- color - Color index in color palette.
- void setAddress (unsigned address);
- setAddress - Sets the pointer in a given direction with auto increment
- Variables:
- color - Color index in color palette.
- void vpoke (unsigned address, unsigned char data);
- vpoke - Sets the value of a VRAM memory address.
- Variables:
- address - Memory address.
- data - Bytes to send.
- unsigned char vpeek (unsigned address);
- vpeek - Gets the value of a particular VRAM memory address
- Variables:
- address - Memory adress.
- void scroll (unsigned char line);
- scroll - Sets the upper display line
- Variables:
- line - Actual number of the top line.
- void setLogop(unsigned char logop);
- setLogop - Sets the default logical operation.
- Variables:
- logop - Logical operation(PSET, AND, OR, XOR, PRESET)
- void outcmd (int command);
- outcmd - Execute a VDP command.
- Variables:
- command - Number of command.
- void pset (unsigned x, unsigned y, unsigned char color);
- pset - Illuminates a point on the screen
- Variables:
- x, y - Coordinate of the point.
- color - Color index of the point in the color palette.
- Basic:
- pset (x,y),color
- unsigned char point (int x, int y);
- point - Gets the color of a point on the screen.
- Variables:
- x, y - Coordinates of the point.
- Basic:
- color = point (x,y)
- void line (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned char color);
- line - Draw a line between two points.
- Variables:
- x, y - Coordinates of the initial point.
- xd, yd - Coordinates of the final point.
- color - Color index of the point in the color palette.
- Basic:
- line (x,y)-(xd,yd),color
- void box (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned char color);
- box - Draw a rectangle between two points.
- Variables:
- x, y - Coordinates of the initial vertex.
- xd, yd - Coordinates of the final vertex.
- color - Color index of the line in the color palette.
- Basic:
- line (x,y)-(xd,yd),color,b
- void copy (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned sp, unsigned x, unsigned y, unsigned dp);
- copy - Copy a rectangular area given by a coordinate from a particular screen point.
- Variables:
- sx, sy - Coordinates of the initial vertex.
- dx, dy - Coordinates of the final vertex.
- sp - Image source page.
- x, y - Starting Area Coordinates.
- dp - Image destination page.
- - Coordinates related to screen ([256 | 512] x 212)
- Basic:
- copy (sx,sy)-(dx,dy),sp to (x,y),dp
- void copyAbs (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned x, unsigned y) ;
- copyAbs - Copy a rectangular area given by a coordinate from a given point on the screen.
- Variables:
- sx, sy - Coordinates of the initial vertex.
- dx, dy - Coordinates of the final vertex.
- sp - Image source page.
- x, y - Starting Area Coordinates.
- dp - Image destination page.
- - Absolute coordinates to memory ([256 | 512] x 1024) (128 kb VRAM)
- Basic:
- copy (sx,sy)-(dx,dy),sp to (x,y),dp
- void paint (unsigned sx, unsigned sy, unsigned dx, unsigned dy, unsigned char color);
- paint - fills a rectangular surface of a certain color.
- Variables:
- sx, sy - Coordinates of the initial vertex.
- dx, dy - Coordinates of the final vertex.
- color - Color index of the point in the color palette.
- Basic:
- line (sx,sy)-(dx,dy),color,bf
- void setAdjust (int x, int y);
- setAdjust - Establece el inicio del area de visualizacion de pantalla.
- Variables:
- x, y - Initial coordinates of the screen start area.
- Basic:
- set adjust x, y
- void setColor (unsigned char color, unsigned char red, unsigned char green,unsigned char blue);
setColor - Sets the RGB components of an index of the color palette.
- Variables:
- color - Color index in color palette.
- red - Value of the red component.
- green - Value of the green component.
- blue - Value of the blue component.
- color - Color index in color palette.
- Basic:
- set color (color,red,green,blue)
- void setNextColor (unsigned char red, unsigned char green, unsigned char blue);
- setNextColor - Sets the RGB components of an index of the color palette.
- - Before you had to use the set_color function to set the index of the first color.
- Variables:
- red - Value of the red component.
- green - Value of the green component.
- blue - Value of the blue component.
- void setWorkPage (unsigned char num_page);
- setWorkPage - Sets the active work page.
- Variables:
- num_page: Page number. (Depends on Screen used and VRAM)
- Basic:
- set page,numpage
- void setDisplayPage (unsigned char num_page);
- setDisplayPage - Sets the active viewing page.
- Variables:
- num_page: Page number. (Depends on Screen used and VRAM)
- Basic:
- set page numpage
- void setPage (unsigned char display_page, unsigned char work_page);
- setPage - Set the active work and display page.
- Variables:
- display_page: Display page number.
- work_page: Working page number.
- - Depends on Screen used and VRAM.
- Basic:
- set page display_page,work_page
- void screen (unsigned char mode);
- screen - Sets the display mode to use.
- Variables:
- mode: Screen mode (0 - 8)
- Basic:
- screen mode
- void cpu2vdp (unsigned x, unsigned y, unsigned xd, unsigned yd, unsigned dir);
- cpu2vdp - transfer of a ram block to vdp
- Variables:
- x,y,xd,yd : final coordenates.
- dir: start RAM address.
- Basic:
- ninguna -- not tested
- void setSpat (unsigned dir);
- setSpat - sets the sprite attribute table
- Variables:
- dir: start RAM address.
- void setSpgt (unsigned dir);
- setSpgt - sets the sprite generate table
- Variables:
- dir: start RAM address.
- void putSprite (unsigned char num_sprite, unsigned char x, unsigned char y, unsigned char pattern);
- putSprite - sets a sprite at the specified coordinates
- Variables:
- num_sprite: sprite number.
- x, y: position of the screen.
- pattern: pattern that must have the sprite.
- void setSpriteColour (unsigned char num_sprite);
- setSpriteColour - set sprite colors with sprite_colour data []
- Variables:
- num_sprite: sprite to which the color plot is to be set
- void setSprite (unsigned char num_sprite);
- setSprite - set the sprite with the values set in sprite_data []
- Variables:
- num_sprite: sprite to which the pattern will be set
- num_sprite: sprite to which the pattern will be set