bios.pas 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {
  2. Copyright (c) 2016 by Free Pascal development team
  3. BIOS interface unit for Atari TOS
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. {$PACKRECORDS 2}
  11. unit bios;
  12. interface
  13. const
  14. {* Device codes for Bconin(), Bconout(), Bcostat(), Bconstat() *}
  15. _PRT = 0;
  16. _AUX = 1;
  17. _CON = 2;
  18. _MIDI = 3;
  19. _IKBD = 4;
  20. _RAWCON = 5;
  21. DEV_PRINTER = _PRT;
  22. DEV_AUX = _AUX;
  23. DEV_CONSOLE = _CON;
  24. DEV_MIDI = _MIDI;
  25. DEV_IKBD = _IKBD;
  26. DEV_RAW = _RAWCON;
  27. {* Mode bitmask used in Rwabs() *}
  28. RW_READ = 0;
  29. RW_WRITE = 0;
  30. RW_NOMEDIACH = 1;
  31. RW_NORETRIES = 2;
  32. RW_NOTRANSLATE = 3;
  33. {* Vector numbers used in Setexc() *}
  34. VEC_BUSERROR = $02;
  35. VEC_ADDRESSERROR = $03;
  36. VEC_ILLEGALINSTRUCTION = $04;
  37. VEC_GEMDOS = $21;
  38. VEC_GEM = $22;
  39. VEC_BIOS = $2d;
  40. VEC_XBIOS = $2e;
  41. VEC_TIMER = $100;
  42. VEC_CRITICALERROR = $101;
  43. VEC_CRITICALERR = VEC_CRITICALERROR;
  44. VEC_TERMINATE = $102;
  45. VEC_PROCTERM = VEC_TERMINATE;
  46. VEC_INQUIRE: Pointer = Pointer(-1);
  47. {* Values returned by Mediach() *}
  48. MED_NOCHANGE = 0;
  49. MED_UNKNOWN = 1;
  50. MED_CHANGED = 2;
  51. {* Mode bitmask for Kbshift() *}
  52. K_RSHIFT = $0001;
  53. K_LSHIFT = $0002;
  54. K_SHIFT = $0003;
  55. K_CTRL = $0004;
  56. K_ALT = $0008;
  57. K_CAPSLOCK = $0010;
  58. K_CLRHOME = $0020;
  59. K_INSERT = $0040;
  60. type
  61. PMD = ^TMD;
  62. TMD = record
  63. m_link : PMD;
  64. m_start : Pointer;
  65. m_length : LongInt;
  66. m_own : Pointer; {* to PD *}
  67. end;
  68. PMPB = ^TMPB;
  69. TMPB = record
  70. mp_mfl : PMD;
  71. mp_mal : PMD;
  72. mp_rover : PMD;
  73. end;
  74. PBPB = ^TBPB;
  75. TBPB = record
  76. recsiz : word;
  77. clsiz : word;
  78. clsizb : word;
  79. rdlen : word;
  80. fsiz : word;
  81. fatrec : word;
  82. datrec : word;
  83. numcl : word;
  84. bflags : word;
  85. end;
  86. procedure bios_Getmpb(var p_mpb: TMPB); syscall 13 0;
  87. function bios_Bconstat(dev: smallint): smallint; syscall 13 1;
  88. function bios_Bconin(dev: smallint): LongInt; syscall 13 2;
  89. procedure bios_Bconout(dev, c: smallint); syscall 13 3;
  90. function bios_Rwabs(rwflag: smallint; buf: Pointer; count, recno, dev: smallint; lrecno: LongInt): LongInt; syscall 13 4;
  91. function bios_Setexc(vecnum: smallint; vec: Pointer): Pointer; syscall 13 5;
  92. function bios_Tickcal: LongInt; syscall 13 6;
  93. function bios_Getbpb(dev: smallint): PBPB; syscall 13 7;
  94. function bios_Bcostat(dev: smallint): LongInt; syscall 13 8;
  95. function bios_Mediach(dev: smallint): LongInt; syscall 13 9;
  96. function bios_Drvmap: LongInt; syscall 13 10;
  97. function bios_Kbshift(mode: smallint): LongInt; syscall 13 11;
  98. implementation
  99. end.