home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / progrmng / stk110.lzh / STKSRC.COM / HERCULES.DEF < prev    next >
Encoding:
Text File  |  1991-02-25  |  2.6 KB  |  65 lines

  1. /**********************************************************************
  2. * hercules.def
  3. *
  4. * The hardware dependent parts of the sprite support for HERCULES
  5. *
  6. * The dependent parts, like the screen segment address, address 
  7. * calculation and increment address to next scan line are defined
  8. * as macros.
  9. *
  10. * If you add new display types, you might have to define new
  11. * macros (for example to change color map). Be sure to define
  12. * something reasonable for the existing displays types, too.
  13. *
  14. **********************************************************************
  15.                     This file is part of
  16.  
  17.           STK -- The sprite toolkit -- version 1.1
  18.  
  19.               Copyright (C) Jari Karjala 1991
  20.  
  21. The sprite toolkit (STK) is a FreeWare toolkit for creating high
  22. resolution sprite graphics with PCompatible hardware. This toolkit 
  23. is provided as is without any warranty or such thing. See the file
  24. COPYING for further information.
  25.  
  26. **********************************************************************/
  27.  
  28.  
  29. /**********************************************************************
  30. * Define hardware dependent macros for Hercules graphics card 
  31. **********************************************************************/
  32.  
  33. /**********************************************************************
  34. * Increment the given address to the next scanline - w (sprite width). 
  35. **********************************************************************/
  36. #define NEXT_SCAN_LINE(adr,w) \
  37.         (WORD)adr += 0x2000-w;      \
  38.         if ((int)adr<0) (WORD)adr -= 0x8000-90;
  39.  
  40. /**********************************************************************
  41. * Increment the given address to the next scanline.
  42. * No width fixup needed in the assembler version.
  43. **********************************************************************/
  44. #define ASM_NEXT_SCAN_LINE(reg)     \
  45.         asm add  reg, 0x2000;       \
  46.         asm jns  NO_FIX;            \
  47.         asm sub  reg, 0x8000-90;    \
  48.         NO_FIX:
  49.  
  50. /**********************************************************************
  51. * Return offset to the byte at x,y in the screen buffer.
  52. **********************************************************************/
  53. #define SCR_OFS(x,y) (((y&3)<<13) + (y>>2)*90 + (x>>3))
  54.  
  55. /**********************************************************************
  56. * Screen segment.
  57. **********************************************************************/
  58. #define SCR_SEG 0xB000
  59.  
  60. /**********************************************************************
  61. * The segment difference to the start of the second page
  62. **********************************************************************/
  63. #define SCR_PAGE_2_SEG 0x800
  64.  
  65.