home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / video.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  1.8 KB  |  59 lines

  1.  
  2. #include "centry.h"
  3.  
  4. /*    A list of these structs is created by the vdp.c "redrawXXXX" routines. 
  5.     vdp.c knows exactly what needs to be updated on the screen.  All
  6.     a module must do is draw it.  */
  7.  
  8. /*    Each updateblock represents an 8x8 block that needs to be redrawn.
  9.     'data' points into a global bitmap (updarea) which contains the
  10.     fully rendered screen in bytes, with values 0..15 corresponding
  11.     to typical TI colors, and 16 representing the foreground color
  12.     for a text screen.  
  13.     
  14.     The row size if UPDROWSIZE bytes.  'r' and 'c' are the coordinates 
  15.     of the block (0,0 top-left).
  16.  
  17.     For advanced use, 'pattern' points to the monochrome pattern to
  18.     apply to the block, and 'fg' and 'bg' give the colors to use
  19.     for a simple block (only two colors); or, if non-NULL, 'colors' 
  20.     gives the color list for complex blocks, where each byte is
  21.     (foreground<<16)|background.
  22.     
  23.     If 'pattern' is NULL, the block is obscured by a sprite and
  24.     cannot be drawn directly.
  25. */
  26.  
  27. // distance between rows in updateblock->data
  28. #define UPDATEBLOCK_ROW_STRIDE (256+64)
  29.  
  30. typedef struct updateblock
  31. {
  32.     u8    *data;            // byte pointer into preformatted bitmap
  33.     u32 r,c;            // row and column, 0..191 and 0..255
  34.     
  35.     u8  *pattern;        // pointer to 8 bytes for 8x8 pattern of block
  36.     u8     *colors, fg,bg;    // colors to apply
  37. }    updateblock;
  38.  
  39. /*
  40.  *    Tell if an updateblock can be drawn with one color
  41.  *
  42.  *    If collapse is true, treat color 0 as vdpfg and 16 and vdpbg;
  43.  *    this may cause problems on palettized displays when these values
  44.  *    change.
  45.  */
  46. bool video_block_is_solid(updateblock *ptr, bool collapse, u8 *color);
  47.  
  48. #define VIDEO(x,y) do { \
  49.     vmModule *ptr = vmVideo; \
  50.     while (ptr && ((ptr->runtimeflags & vmRTUnselected) || !(ptr->runtimeflags & vmRTEnabledOnce))) \
  51.         ptr = ptr->next; \
  52.     if (ptr) ptr->m.video->x y; \
  53.     } while (0)
  54.  
  55. extern int video_restart(void);
  56. extern void video_restop(void);
  57.  
  58. #include "cexit.h"
  59.