home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / BDSC / BDSC-1 / HWARE50.H < prev    next >
Text File  |  2000-06-30  |  2KB  |  56 lines

  1. /*
  2.  * This header file contains hardware-dependent definitions for C programs.
  3.  * Most of this stuff used to be in <BDSCIO.H>, but was moved out of there
  4.  * to localize system-dependent values.
  5.  */
  6.  
  7. /*
  8.  * Some console (video) terminal characteristics:
  9.  *    (pre-configured for H19/Z19/H89/Z89)
  10.  */
  11.  
  12. #define TWIDTH    80    /* # of columns    */
  13. #define TLENGTH    24    /* # of lines    */
  14. #define CLEARS    "\033E"    /* String to clear screen on console    */
  15. #define INTOREV    "\033p"    /* String to switch console into reverse video    */
  16. #define OUTAREV "\033q"    /* String to switch console OUT of reverse video  */
  17. #define CURSOROFF "\033x5"    /* String to turn cursor off    */
  18. #define CURSORON "\033y5"    /* String to turn cursor on    */
  19. #define ESC    '\033'    /* Standard ASCII 'escape' character    */
  20.  
  21.  
  22. /*
  23.     The following definitions provide a portable low-level interface
  24.     for direct I/O to the  console and modem devices. The values
  25.     used here are only for example; be certain to go in and customize
  26.     them for your system! Note that only one of the two sections
  27.     (status driven vs. memory mapped) will be needed for your system,
  28.     so feel free to edit the unused section out of the file and remove
  29.     the conditional compilation lines around the section you end up
  30.     using.
  31. */
  32.  
  33. #define STATUS_DRIVEN    1    /* change to 0 if I/O is memory-mapped */
  34.  
  35. #if STATUS_DRIVEN        /* this section for status-driven I/O only */
  36. #define CON_TBE        (inp(0x00) & 0x80)    /* Console */
  37. #define CON_RDA        (inp(0x00) & 0x40)
  38. #define CON_TDATA(byte)    (outp(0x01, byte))
  39. #define CON_RDATA    (inp(0x01))
  40. #define    MOD_TBE        (inp(0x08) & 0x80)    /* Modem */
  41. #define MOD_RDA        (inp(0x08) & 0x40)
  42. #define    MOD_TDATA(byte)    (outp(0x09, byte))
  43. #define    MOD_RDATA    (inp(0x09))
  44.  
  45. #else                /* this section for memory-mappped I/O only */
  46. #define CON_TBE        (peek(FOO) & BAR)    /* Console */
  47. #define CON_RDA        (peek(FOO) & BAR)
  48. #define CON_TDATA(byte)    (poke(FOO, BAR))
  49. #define CON_RDATA    (peek(FOO))
  50.  
  51. #define    MOD_TBE        (peek(FOO) & BAR)    /* Modem */
  52. #define    MOD_RDA        (peek(FOO) & BAR)
  53. #define    MOD_TDATA(byte)    (poke(FOO, byte))
  54. #define    MOD_RDATA    (peek(FOO))
  55. #endif
  56.