PVcollib  1.5.0
A devkit for ColecoVision
Macros | Functions
video.h File Reference

contains the basic definitions for controlling the video hardware. More...

#include <coleco/coltypes.h>

Go to the source code of this file.

Macros

#define vdp_blocknmi()   { __asm__("\tpush hl\n\tld hl,#_no_nmi\n\tset 0,(hl)\n\tpop hl"); }
 set no_nmi flag to avoid nmi
 
#define vdp_releasenmi()   { __asm__("\tpush hl\n\tld hl,#_no_nmi\n\tbit 7,(hl)\n\tjp z,.+6\n\tcall _nmi_direct\n\tres 0,(hl)\n\tpop hl"); }
 reset no_nmi flag to allow nmi
 

Functions

void vdp_dan2vram (void *dandata, unsigned offset)
 Put data in VRAM with some DAN1 compressed data. More...
 
void vdp_disablenmi (void)
 Disable NMI interruption.
 
void vdp_disablescr (void)
 Disallows VDP to work and NMI to occur.
 
void vdp_disablevdp (void)
 Disallows VDP to work (so screen is not active)
 
void vdp_duplicatevram (void)
 Put 1st area of pattern vram to the 2nd and 3rd one.
 
void vdp_enablenmi (void)
 Enable NMI interruption. More...
 
void vdp_enablescr (void)
 Allows VDP to work and NMI to be catch.
 
void vdp_enablevdp (void)
 Allows VDP to work (so screen is now active)
 
void vdp_fillvram (u16 offset, u8 value, u16 count)
 Change VRAM with a specific value. More...
 
void vdp_getarea (void *table, u8 x, u8 y, u8 width, u8 height)
 Get an area of chars from screen. More...
 
u8 vdp_getchar (u8 x, u8 y)
 Get a single char from screen. More...
 
void vdp_ple2vram (void *pledata, unsigned offset)
 Put data in VRAM with some Pletter compressed data. More...
 
void vdp_putarea (void *table, u8 x, u8 y, u8 width, u8 height)
 Put an area of chars to screen. More...
 
void vdp_putchar (u8 x, u8 y, char value)
 Put a single char on screen. More...
 
void vdp_putstring (u8 x, u8 y, char *text)
 Put a string on screen at coordinates x,y. More...
 
void vdp_putvram (unsigned offset, void *data, unsigned count)
 Fill the VRAM with some non compressed data. More...
 
void vdp_putvram_repeat (unsigned offset, void *table, u8 count, u8 times)
 Repeat n times an area of chars to screen. More...
 
void * vdp_rle2vram (void *rledata, unsigned offset)
 Fill the VRAM with some RLE compressed data. More...
 
void vdp_setcharex (u8 first, u8 count, unsigned offset, u8 flags)
 Put some chars of default font. More...
 
void vdp_setdefaultchar (u8 flags)
 Put default font. More...
 
void vdp_setmode1txt (void)
 Activate mode 1 in text mode
Activate Mode 1 of TMS in text mode, 16K of VRAM, sprites 16x16
1 VRAM (duplicated each for 8 lines) that can be populate
CHRGEN is located at $0000, COLTAB is located at $2000

 
void vdp_setmode2bmp (void)
 Activate mode 2 in bitmap mode
Activate Mode 2 of TMS in bitmap mode, 16K of VRAM, sprites 16x16
1 VRAM area (complete screen of 24 lines) that can be populate

 
void vdp_setmode2txt (void)
 Activate mode 2 in text mode
Activate Mode 2 of TMS in text mode, 16K of VRAM, sprites 16x16
3 VRAM areas (each for 8 lines) that can be populate

 
void vdp_setreg (u8 reg, u8 val)
 Set a value to a TMS9918 register. More...
 
void vdp_waitvblank (u16 numtime)
 Waits for a vertical blank interrupt a number of time. More...
 

Detailed Description

contains the basic definitions for controlling the video hardware.

This unit provides generic features related to video management.

Here is the list of features:

Function Documentation

◆ vdp_dan2vram()

void vdp_dan2vram ( void *  dandata,
unsigned  offset 
)

Put data in VRAM with some DAN1 compressed data.

Parameters
dandataaddress of data to use
offsetaddress in VRAM of 1st data to fill
Examples:
graphics/backgrounds/dancompress/grafdancomp.c, and megacart/megacart.c.

◆ vdp_enablenmi()

void vdp_enablenmi ( void  )

Enable NMI interruption.

Examples:
games/diamond/diamond.c.

◆ vdp_fillvram()

void vdp_fillvram ( u16  offset,
u8  value,
u16  count 
)

◆ vdp_getarea()

void vdp_getarea ( void *  table,
u8  x,
u8  y,
u8  width,
u8  height 
)

Get an area of chars from screen.

Parameters
tablearea in ram to save chars
xcolumn of the chars
yline of the chars
widthlength of x chars to get
heightlength of y chars to get

◆ vdp_getchar()

u8 vdp_getchar ( u8  x,
u8  y 
)

Get a single char from screen.

Parameters
xcolumn of the char
yline of the char
Returns
char value from screen

◆ vdp_ple2vram()

void vdp_ple2vram ( void *  pledata,
unsigned  offset 
)

Put data in VRAM with some Pletter compressed data.

Parameters
pledataaddress of data to use
offsetaddress in VRAM of 1st data to fill
Examples:
graphics/backgrounds/plecompress/grafplecomp.c, graphics/f18a/f18abitmap1/f18abitmap1.c, and graphics/f18a/f18aecm3/f18aecm3.c.

◆ vdp_putarea()

void vdp_putarea ( void *  table,
u8  x,
u8  y,
u8  width,
u8  height 
)

Put an area of chars to screen.

Parameters
tablearea in ram to load chars
xcolumn of the chars
yline of the chars
widthlength of x chars to put
heightlength of y chars to put

◆ vdp_putchar()

void vdp_putchar ( u8  x,
u8  y,
char  value 
)

Put a single char on screen.

Parameters
xcolum to print
yline to print
valueascii value of char to print

◆ vdp_putstring()

void vdp_putstring ( u8  x,
u8  y,
char *  text 
)

◆ vdp_putvram()

void vdp_putvram ( unsigned  offset,
void *  data,
unsigned  count 
)

Fill the VRAM with some non compressed data.

Get from VRAM to a RAM pointer with some non compressed data.

Parameters
offsetaddress in VRAM of 1st data to fill
dataaddress of data to use
countnumber of data
offsetaddress in VRAM of 1st data to get
dataaddress of RAM to use
countnumber of data
Examples:
graphics/backgrounds/notcompress/grafnocomp.c, graphics/sprites/animatedsprite/animatedsprite.c, and graphics/sprites/simplesprite/simplesprite.c.

◆ vdp_putvram_repeat()

void vdp_putvram_repeat ( unsigned  offset,
void *  table,
u8  count,
u8  times 
)

Repeat n times an area of chars to screen.

Parameters
offsetaddress in VRAM
tablearea in ram to load chars
countnumber of chars to repeat
timesnumber of time we set chars

◆ vdp_rle2vram()

void * vdp_rle2vram ( void *  rledata,
unsigned  offset 
)

Fill the VRAM with some RLE compressed data.

Parameters
rledataaddress of data to use
offsetaddress in VRAM of 1st data to fill
Examples:
graphics/backgrounds/rlecompress/grafrlecomp.c.

◆ vdp_setcharex()

void vdp_setcharex ( u8  first,
u8  count,
unsigned  offset,
u8  flags 
)

Put some chars of default font.

Parameters
first1st char to put
countnumber of chars
offsetaddress location in video memory for the chararter patterns
flagstype of font
FNTNORMAL for the normal font
FNTITALIC for the italic font
FNTBOLD for the bold font
FNTBOLD_ITALIC fot both italic and bold font

◆ vdp_setdefaultchar()

void vdp_setdefaultchar ( u8  flags)

Put default font.

Parameters
flagscharacter format
FNTNORMAL for the normal font
FNTITALIC for the italic font
FNTBOLD for the bold font
FNTBOLD_ITALIC fot both italic and bold font
Examples:
audio/music/music.c, audio/simplesound/ssound.c, graphics/f18a/f18abitmap1/f18abitmap1.c, graphics/f18a/f18aecm3/f18aecm3.c, graphics/f18a/f18atest/f18atest.c, graphics/sprites/animatedsprite/animatedsprite.c, graphics/sprites/simplesprite/simplesprite.c, helloworld/helloworld.c, input/input.c, palntsc/palntsc.c, random/randvalue.c, and scoring/scoring.c.

◆ vdp_setreg()

void vdp_setreg ( u8  reg,
u8  val 
)

Set a value to a TMS9918 register.

Parameters
regregister number
valvalue to assign
Examples:
graphics/f18a/f18aecm3/f18aecm3.c.

◆ vdp_waitvblank()

void vdp_waitvblank ( u16  numtime)