home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI09.ARJ / ictari.09 / ASSEMBLY / MACROS / MACRO_2 / EQUATES.I < prev    next >
Text File  |  1993-12-20  |  20KB  |  643 lines

  1. *  OFFSETS and EQUATES  *
  2. *    by S.H.Rigby       *
  3. *      Version 1.01     *
  4. *************************
  5.  
  6. * GENERAL NAMES
  7. ***************
  8. LEAVE    EQU    -1
  9.  
  10. * SYNC CODES
  11. ************
  12. EXT_CLOCK    EQU    1
  13. EXT_VSYNC    EQU    2
  14. EXT_HSYNC    EQU    4
  15.  
  16. * SCREEN MODECODES
  17. ******************
  18. * to be AND'ed with value
  19. NUMCOLS        EQU    7    ;gives bps value
  20. * to be OR'ed together
  21. VERTFLAG    EQU    256    ;INTERLACE ON
  22. STMODES        EQU    128
  23. OVERSCAN    EQU    64
  24. PAL        EQU    32
  25. NTSC        EQU    0
  26. VGA        EQU    16
  27. TV        EQU    0
  28. COL80        EQU    8
  29. COL40        EQU    0
  30. BPS1        EQU    0    ;2   COLOURS
  31. BPS2        EQU    1    ;4   COLOURS
  32. BPS4        EQU    2    ;16  COLOURS
  33. BPS8        EQU    3    ;256 COLOURS
  34. BPS16        EQU    4    ;TRUE COLOUR
  35.  
  36. * VT52 ESCAPE CODES
  37. *******************
  38. VT_UP    EQU    'A'    ;if on top line, no action
  39. VT_DOWN    EQU    'B'    ;if on bottom line, no action
  40. VT_RIGHT    EQU    'C'    ;if far right, no action
  41. VT_LEFT    EQU    'D'    ;if far left, no action - non-destructive
  42. VT_CLS    EQU    'E'    ;clear screen and home cursor
  43. VT_HOME    EQU    'H'    ;cursor to top left only
  44. VT_SCROLL_UP    EQU    'I'    ;scroll down if at top of screen
  45. VT_CLR_EOS    EQU    'J'    ;erase all from cursor (incl) to end of screen
  46. VT_CLR_EOL    EQU    'K'    ;erase all from cursor to end of line
  47. VT_INSERT    EQU    'L'    ;insert blank line at cursor, all below move down
  48. VT_DELETE    EQU    'M'    ;delete current line, move all below up one, blank at bottom
  49. VT_GOTO    EQU    'Y'    ROW+32,COL+32 (rows and cols start at 1)
  50. VT_TEXT_COL    EQU    'b'    REGISTER (0-15)
  51. VT_BACK_COL    EQU    'c'    REGISTER (0-15)
  52. VT_CLR_BOS    EQU    'd'    ;erase all from top of screen to cursor (incl)
  53. VT_CURS_ON    EQU    'e'    ;hide cursor
  54. VT_CURS_OFF    EQU    'f'    ;show cusor
  55. VT_GET_CURS    EQU    'j'    ;save current cursor position
  56. VT_SET_CURS    EQU    'k'    ;restore cursor to saved position
  57. VT_CLR_LINE    EQU    'l'    ;erase current line and move cursor to start of line
  58. VT_CLR_BOL    EQU    'o'    ;erase from start of curent line to cursor (incl)
  59. VT_INVERT_ON    EQU    'p'    ;reverse video on
  60. VT_INVERT_OFF    EQU    'q'    ;reverse video off
  61. VT_WRAP_ON    EQU    'v'    ;if at end of line, start new line - scrolls up if at last line
  62. VT_WRAP_OFF    EQU    'w'    ;if at end of line, overwrite char
  63. BELL    EQU    07
  64. BACKSPACE    EQU    08
  65. TAB    EQU    09
  66. LF    EQU    10
  67. HT    EQU    11
  68. CLS    EQU    12
  69. CR    EQU    13
  70. ESC    EQU    27
  71.  
  72. * TEXT CURSOR MODES
  73. *******************
  74. CURS_HIDE    EQU    0
  75. CURS_SHOW    EQU    1
  76. CURS_BLINK    EQU    2
  77. CURS_STEADY    EQU    3
  78. CURS_SET_RATE    EQU    4
  79. CURS_GET_RATE    EQU    5
  80.  
  81. * DEVICES
  82. *********
  83. PRN    EQU    0
  84. LST    EQU    0
  85. AUX    EQU    1
  86. CON    EQU    2
  87. MIDI    EQU    3
  88. KBD    EQU    4
  89. RAW    EQU    5
  90. MODEM_1    EQU    6    ;TT/MEGA_STE/FALCON
  91. MODEM_2    EQU    7    ;TT/MEGA_STE (SCC CHANNEL B)
  92. SERIAL_1    EQU    8    ;TT (3-WIRE MFP)/MEGA_STE (SCC CHANNEL A)
  93. SERIAL_2    EQU    9    ;TT (SCC CHANNEL A)
  94.  
  95. * PRINTER CONFIGURATION BITS
  96. ****************************
  97. P_DOT    EQU    0
  98. P_MONO    EQU    0        ;Some show colour as 0
  99. P_ATARI    EQU    0
  100. P_DRAFT    EQU    0
  101. P_PARALLEL    EQU    0
  102. P_FORM    EQU    0
  103. P_DAISY    EQU    1
  104. P_COLOUR    EQU    2    ;Some show mono as 2
  105. P_EPSON    EQU    4
  106. P_LQ    EQU    8
  107. P_RS232    EQU    16
  108. P_SHEET    EQU    32
  109.  
  110. * SHIFTCODE VALUES
  111. ******************
  112. R_SHIFT    EQU    1    ;BIT 0
  113. L_SHIFT    EQU    2
  114. CTRL    EQU    4
  115. ALT    EQU    8
  116. CAPS_LOCK    EQU    16
  117. ALT_HOME    EQU    32
  118. ALT_INSERT    EQU    64    ;BIT 6
  119.  
  120. * KEY TABLE STRUCTURE
  121. *********************
  122.     RSRESET
  123. Unshift    rs.l    1    ;pointers to scancode-to-ascii table
  124. Shift    rs.l    1    ;128 bytes in length
  125. Capslock    rs.l    1
  126.  
  127. * INPUT/OUTPUT RECORD STRUCTURE
  128. *******************************
  129.     RSRESET
  130. Ibuf    rs.l    1    ;pointer to buffer
  131. Ibufsiz    rs.w    1    ;buffer size
  132. Ibufhd    rs.w    1    ;Index to head
  133. Ibuftl    rs.w    1    ;Index to tail
  134. Ibuflow    rs.w    1    ;Low water mark
  135. Ibufhi    rs.w    1    ;High water mark
  136. Obuf    rs.l    1    ;pointer to buffer
  137. Obufsiz    rs.w    1    ;buffer size
  138. Obufhd    rs.w    1    ;Index to head
  139. Obuftl    rs.w    1    ;Index to tail
  140. Obuflow    rs.w    1    ;Low water mark
  141. Obufhi    rs.w    1    ;High water mark
  142.  
  143. * BAUD RATES
  144. ************
  145. BAUD19200    EQU    0
  146. BAUD9600    EQU    1
  147. BAUD4800    EQU    2
  148. BAUD3600    EQU    3
  149. BAUD2400    EQU    4
  150. BAUD2000    EQU    5
  151. BAUD1800    EQU    6
  152. BAUD1200    EQU    7
  153. BAUD600        EQU    8
  154. BAUD300        EQU    9
  155. BAUD200        EQU    10
  156. BAUD150        EQU    11
  157. BAUD134        EQU    12
  158. BAUD110        EQU    13
  159. BAUD75        EQU    14
  160. BAUD50        EQU    15
  161.  
  162. * FLOW CONTROL
  163. **************
  164. FLOW_OFF    EQU    0
  165. FLOW_SOFT    EQU    1
  166. FLOW_HARD    EQU    2    ;rts/cts non functional in pre-blitter roms
  167. FLOW_BOTH    EQU    3
  168.  
  169. * UCR - RS232 CONTROL
  170. *********************
  171. PARITY_ODD    EQU    0    ;BIT 1
  172. PARITY_EVEN1    EQU    2
  173. PARITY_OFF    EQU    0    ;BIT 2
  174. PARITY_ON    EQU    4
  175. STOP_BIT_0    EQU    0    ;BITS 3 & 4
  176. STOP_BIT_1    EQU    8
  177. STOP_BIT_15    EQU    16
  178. STOP_BIT_2    EQU    24
  179. DATA_BIT_8    EQU    0    ;BITS 5 & 6
  180. DATA_BIT_7    EQU    32
  181. DATA_BIT_6    EQU    64
  182. DATA_BIT_5    EQU    96
  183. UCR_CLK_16    EQU    128    ;BIT 7 - DIVIDE CLOCK BY 16
  184. UCR_CLK_SYNC    EQU    0
  185.  
  186. * BIOS PARAMETER BLOCK
  187. **********************
  188.     RSRESET
  189. Recsiz    rs.w    1    ;bytes/sector (512)
  190. Clsiz    rs.w    1    ;sectors/cluster (2)
  191. Clsizb    rs.w    1    ;bytes/cluster (1024)
  192. Rdlen    rs.w    1    ;Number of Root Dir Sectors
  193. Fsiz    rs.w    1    ;Fat size in sectors/FAT
  194. Fatrec    rs.w    1    ;Start sector of 2nd FAT
  195. Datrec    rs.w    1    ;Start sector of 1st Data Cluster
  196. Numcl    rs.w    1    ;Number of Data Clusters on Disk
  197. Bflags    rs.w    1    ;0=12bit FAT
  198.             ;1=16bit FAT
  199. * DISK TYPES
  200. ************
  201. SSSD    EQU    0    ;40 TRACK - SINGLE SIDED SINGLE DENSITY 
  202. DSSD    EQU    1    ;40 TRACK - DOUBLE SIDED SINGLE DENSITY
  203. SSDD    EQU    2    ;80 TRACK - SINGLE SIDED DOUBLE DENSITY
  204. DSDD    EQU    3    ;80 TRACK - DOUBLE SIDED DOUBLE DENSITY
  205.  
  206. RANDOM_BT    EQU    $01000000    ;RANDOM DISK SERIAL NUMBER
  207.  
  208. * FREE SPACE TABLE
  209. ******************
  210.     RSRESET
  211. Free_space    rs.l    1    ;free drive space in bytes
  212. Free_cl    rs.l    1    ;available clusters
  213. Sector_size    rs.l    1    ;sector size in bytes
  214. Cl_size    rs.l    1    ;Cluster size in sectors
  215.  
  216. * MEMORY TYPES (FOR M_XALLOC)
  217. **************
  218. SYS_RAM    EQU    0    ;system ram only
  219. ALT_RAM    EQU    1    ;alternate ram only
  220. SYS_OR_ALT    EQU    2    ;system ram preferred
  221. ALT_OR_SYS    EQU    3    ;alternate ram preferred
  222.  
  223. * MEMORY PARAMETER BLOCK
  224. ************************
  225.     RSRESET
  226. Mpb_mfl    rs.l    1    ;Memory Free List Pointer
  227. Mpb_mal    rs.l    1    ;Memory Allocated List Pointer
  228. Mpb_rover    rs.l    1    ;Roving Pointer
  229.  
  230. * MEMORY DESCRIPTOR - pointed to by Mp_mfl,Mp_mal,Mp_rover
  231. *******************
  232.     RSRESET
  233. Md_link    rs.l    1    ;Pointer to next Memory Descriptor (or NULL)
  234. Md_start    rs.l    1    ;Start Address of Memory Block
  235. Md_length    rs.l    1    ;Length of Memory Block in bytes
  236. Md_own    rs.l    1    ;Pointer to Owner's Process Descriptor
  237.  
  238. * MOUSE MODES
  239. *************
  240. M_DISABLE    EQU    0    ;disable mouse
  241. M_RELATIVE    EQU    1    ;enable mouse in relative mode
  242. M_ABSOLUTE    EQU    2    ;enable mouse in absolute mode
  243. M_KEYCODE    EQU    4    ;enable mouse in keycode mode
  244.  
  245. * MOUSE PARAMETER BLOCK
  246. ***********************
  247.     RSRESET
  248. M_topmode    rs.b    1    ;0 if Y=0 at bottom
  249.             ;1 if Y=0 at top
  250. M_buttons    rs.b    1    ;see set mouse buttons keyboard command
  251. M_xparam    rs.b    1    ;threshold,scale or delta factors, depending on mode
  252. M_yparam    rs.b    1
  253. M_xmax        rs.w    1    ;abs mode only - max x & y positions
  254. M_ymax        rs.w    1
  255. M_xinitial    rs.w    1    ;abs mode only - Initial x & y positions
  256. M_yinitial    rs.w    1    
  257.  
  258. * RWABS MODES
  259. *************
  260. READ    EQU    0    ;BIT 0
  261. WRITE    EQU    1
  262. NO_MEDIACH    EQU    2    ;BIT 1
  263. NO_RETRY    EQU    4    ;BIT 2 (AHDI 3.00)
  264. PHYSICAL    EQU    8    ;BIT 3 (AHDI 3.00)
  265.  
  266. * MEDIACH STATUS
  267. ****************
  268. NO_CHANGE    EQU    0
  269. MAYBE_CHANGED    EQU    1
  270. CHANGED    EQU    2
  271.  
  272. * FILE DTA TABLE
  273. ****************
  274.     RSRESET
  275. DTA_RESERVED    RS.B    21    ;Reserved for internal use
  276. DTA_ATTRIB    RS.B    1    ;file attributes
  277. DTA_TIME    RS.W    1    ;file modified time
  278. DTA_DATE    RS.W    1    ;file modified date
  279. DTA_SIZE    RS.L    1    ;File size
  280. DTA_NAME    RS.L    14    ;Filename
  281.  
  282. * FILE ATTRIBUTES
  283. *****************
  284. READ_ONLY    EQU    01
  285. HIDDEN    EQU    02
  286. SYSTEM    EQU    04
  287. VOLUME    EQU    08
  288. DIRECTORY    EQU    16
  289. ARCHIVE    EQU    32    ;WRITTEN & CLOSED
  290.  
  291. * FILE OPEN MODES
  292. *****************
  293. OPEN_READ    EQU    0
  294. OPEN_WRITE    EQU    1
  295. OPEN_RW    EQU    2
  296.  
  297. * FILE SEEK FROM
  298. ****************
  299. BOF    EQU    0    ;BEGINNING OF FILE
  300. CURRENT    EQU    1    ;CURRENT POSITION
  301. EOF    EQU    2    ;END OF FILE
  302.  
  303. * BUFFER CONTROL BLOCK
  304. **********************
  305.     RSRESET
  306. B_link    rs.l    1    ;pointer to next BCB
  307. B_bufdrv    rs.w    1    ;drive number or -1
  308. B_buftype    rs.w    1    ;buffer type
  309. B_bufrec    rs.w    1    ;record number cached in this block
  310. B_dirty    rs.w    1    ;dirty flag
  311. B_dm    rs.l    1    ;pointer to drive media descriptor table
  312. B_bufr    rs.l    1    ;pointer to buffer itself
  313.  
  314. * P_EXEC LOAD MODES
  315. *******************
  316. LOAD_GO    EQU    0    ;Load & Execute - return exit code
  317. LOAD    EQU    3    ;Load only - return basepage address of prg
  318. GO    EQU    4    ;Execute basepage
  319. MAKE_BASEPAGE    EQU    5    ;create basepage
  320. GO_FREE    EQU    6    ;Execute then free (Gemdos >v0.21)
  321. MAKE_PAGE2    EQU    7    ;Create basepage (Gemdos >v0.25)
  322.  
  323. * EXECUTABLE FILE HEADER STRUCTURE
  324. **********************************
  325. * see exec_str.txt for more details
  326.     RSRESET
  327. PRG_magic    rs.w    1    ;magic number - $601a
  328. PRG_tsize    rs.l    1    ;size of text segment
  329. PRG_dsize    rs.l    1    ;size of data segment
  330. PRG_bsize    rs.l    1    ;size of bss segment
  331. PRG_ssize    rs.l    1    ;symbol segment size
  332. PRG_res1    rs.l    1    ;reserved
  333. PRGFLAGS    rs.l    1    ;
  334. ABSFLAG    rs.w    1    ;
  335.  
  336. * BASEPAGE LAYOUT
  337. *****************
  338. * pointed to by 4(sp) when program starts
  339.     RSRESET
  340. P_lowtpa    rs.l    1    ;Base Address of TPA
  341. P_hitpa    rs.l    1    ;End of TPA (+1) - unusable above here
  342. P_tbase    rs.l    1    ;Start of TEXT Section
  343. P_tlen    rs.l    1    ;Length of TEXT Section
  344. P_dbase    rs.l    1    ;Start of DATA Section
  345. P_dlen    rs.l    1    ;Length of DATA Section
  346. P_bbase    rs.l    1    ;Start of BSS Section
  347. P_blen    rs.l    1    ;Length of BSS Section
  348. P_dta    rs.l    1    ;Pointer to DTA
  349. P_parent    rs.l    1    ;Pointer to Parent Basepage
  350.             ;0 if Desk Accessory
  351. P_reserved    rs.l    1
  352. P_env    rs.l    1    ;Pointer to Environment String
  353.     RSSET    $80
  354. P_cmdlin    rs.l    1    ;Pointer to Command Line
  355.             ;Length byte, String, {0.b - maybe!}
  356.  
  357. * CRITICAL ERROR NUMBERS
  358. ************************
  359. Abort    equ    -$1    ;or any negative number
  360. Retry    equ    $10000
  361. Ignore    equ    $0
  362.  
  363. * PRINT SCREEN BLOCK TABLE - PRTABLE
  364. ************************************
  365.         RSRESET
  366. Pr_blkprt    rs.l    1    ;Pointer to Screen Address
  367. Pr_offset    rs.w    1    ;Offset from Start Address (in bits,0-7)
  368. Pr_width    rs.w    1    ;Screen Width (in bytes)
  369. Pr_height    rs.w    1    ;Screen Height
  370. Pr_left        rs.w    1    ;Screen Dump Left Margin
  371. Pr_right    rs.w    1    ;Screen Dump Right Margin
  372. Pr_scrres    rs.w    1    ;Screen Resolution (0,1,2)
  373. Pr_dstres    rs.w    1    ;Printer res (0=960,1=1280)
  374. Pr_colpal    rs.w    1    ;Pointer to Colour Palette
  375. Pr_type        rs.w    1    ;Printer Type    0=Atari Mono Dot
  376.                 ;        1=Atari Mono Daisy
  377.                 ;        2=Atari Colour Dot
  378.                 ;        4=Epson Mono Dot
  379. Pr_port        rs.w    1    ;Printer Port (0=parallel,1=RS-232)
  380. Pr_masks    rs.l    1    ;Pointer to half-tone mask table
  381.                 ;Use 0 for ROM table
  382.  
  383. * SOUND MATRIX VALUES
  384. *********************
  385. DMA_Play    equ    0    ;actual number
  386. DSP_Tx        equ    1
  387. EXT_In        equ    2
  388. ADC        equ    3
  389. DMA_Rec        equ    1    ;numbers to OR together
  390. DSP_Rx        equ    2
  391. EXT_Out        equ    4
  392. DAC        equ    8
  393.  
  394. * SOUND CLOCKS
  395. **************
  396. CLK25M    EQU    0
  397. CLKEXT    EQU    1
  398. CLK32M    EQU    2
  399.  
  400. * PRESCALE CLOCKS
  401. *****************
  402. CLK50K    EQU    1
  403. CLK33K    EQU    2
  404. CLK25K    EQU    3
  405. CLK20K    EQU    4
  406. CLK16K    EQU    5
  407. CLK14K    EQU    6    *=NOT ALLOWED WITH CODEC
  408. CLK12K    EQU    7
  409. CLK11K    EQU    8    *
  410. CLK10K    EQU    9
  411. CLK9K    EQU    10    *
  412. CLK8K    EQU    11
  413.  
  414. * SOUND BUFFER MODES
  415. ********************
  416. Play_Enable    equ    0    ;bit numbers
  417. Play_Repeat    equ    1
  418. Record_Enable    equ    2
  419. Record_Repeat    equ    3
  420.  
  421. * SOUND BUFFER TABLE
  422. ********************
  423.     RSRESET
  424. Play_Ptr    rs.l    1    ;current play position
  425. Record_Ptr    rs.l    1    ;current record position
  426. Snd_Reserved    rs.l    2    ;not used
  427.  
  428. * MFP 68901 TIMER MODES
  429. ***********************
  430. *    Clock is 245700Hz
  431. TIMER_OFF    EQU    0
  432. DELAY_4        EQU    1    ;Clock divided by _x generates Int
  433. DELAY_10    EQU    2
  434. DELAY_16    EQU    3
  435. DELAY_50    EQU    4
  436. DELAY_64    EQU    5
  437. DELAY_100    EQU    6
  438. DELAY_200    EQU    7
  439. EVENT_COUNT    EQU    8    ;Counts down 1 for each input pulse
  440. PULSE_4        EQU    9    ;Clock divided by _x will time pulse width
  441. PULSE_10    EQU    10    ;i.e. input turns clock on/off
  442. PULSE_16    EQU    11
  443. PULSE_50    EQU    12
  444. PULSE_64    EQU    13
  445. PULSE_100    EQU    14
  446. PULSE_200    EQU    15
  447.  
  448. * DEVICE VECTOR TABLE
  449. *********************
  450. * Used by Kbdvbase()
  451.     RSRESET
  452. Midivec        rs.l    1    ;midi input - normally points to buffer in bios
  453.             ;d0.b will contain char from midi port
  454. Vkbderr        rs.l    1    ;keyboard error - overrun
  455. Vmiderr        rs.l    1    ;midi error - overrun
  456.                 ;
  457. Statvec        rs.l    1    ;ikbd status packet
  458. Mousevec    rs.l    1    ;mouse packet - used by gem
  459.                 ;rts after use - <1ms in routine
  460. Clockvec    rs.l    1    ;clock packet - used by system
  461. Joyvec        rs.l    1    ;joystick packet
  462. *<all packets>            ;POINTER TO PACKET IN A0 AND ON STACK
  463.                 ;rts after use - <1ms in routine
  464.                 ;save registers used
  465.  
  466. Midisys        rs.l    1    ;system midi vector from ACIA
  467. Ikbdsys        rs.l    1    ;system ikbd vector from ACIA - used by system
  468. *<master vectors>        ;6850 char ready causes ints for kbd & midi
  469.                 ;this normally calls system vectors above
  470.                 ;which call packet vectors above
  471.                 ;do not use 6850 char ready - use other vectors above
  472.  
  473. * VECTOR NUMBERS FOR GEMDOS SETEXEC
  474. ***********************************
  475. * $00-$FF are for 68000 Vectors
  476.  
  477. * $100-$1ff are for Gemdos use
  478. etv_timer    equ    $100    ;System Timer
  479. * for date/time and housekeeping - +4(sp) is number of milliseconds since last call
  480. * branch to old vector after use - d0-d7/a0-a6 are saved before call and restored after
  481. etv_critic    equ    $101    ;Critical Error Handler
  482. * 4(sp) contains error number - return d0 as result code
  483. * $000100 is retry, $0 is ignore, -$XX is error code - default is -1
  484. * Preserve d3-d7/a3-a6 in your routine
  485. etv_term    equ    $102    ;Process terminate handler (& ^C)
  486. * normally an rts - jump to somewhere if want to recover or restart
  487.  
  488. * $200-$2ff are for AES use and cannot be changed by Setexec
  489.  
  490. * POST MORTEM DUMP AREA
  491. ***********************
  492. * processor state saved here after crash
  493. * NOT WRITTEN OVER ON SYSTEM RESET!
  494. proc_lives    equ    $380    ;$12345678 if valid data
  495. proc_dregs    equ    $384    ;d0-d7
  496. proc_aregs    equ    $3a4    ;a0-a6, SSP (super stack pointer)
  497. proc_enum    equ    $3c4    ;1st byte is exception number
  498. proc_usp    equ    $3c8    ;user stack pointer
  499. proc_stk    equ    $3cc    ;16 words of super stack
  500.  
  501. * TOS TABLE
  502. ***********
  503. etv_timer    equ    $400 l    ;see above
  504. etv_critic    equ    $404 l    ;see above
  505. etv_term    equ    $408 l    ;see above
  506. etv_103        equ    $40c l    ;reserved
  507. etv_104        equ    $410 l    ;reserved
  508. etv_105        equ    $414 l    ;reserved
  509. etv_106        equ    $418 l    ;reserved
  510. etv_107        equ    $41c l    ;reserved
  511. memvalid    equ    $420 l    ;$752019f3 for good coldstart and valid memory config
  512. memcntlr    equ    $424 b    ;memory controller config nibble
  513. resvalid    equ    $426 l    ;$31415926 to jump through resvector on RESET
  514. resvector    equ    $42a l    ;if resvalid, called after reset but before any hardware
  515.                 ;setup. return address in a6. Both stacks are invalid! 
  516. phystop        equ    $42e l    ;1st address above RAM = size of RAM
  517. _membot        equ    $432 l    ;bottom of AVAILABLE memory - used by Gemdos Getmpb
  518.                 ;as start of Gemdos TPA
  519. _memtop        equ    $436 l    ;top of AVAILABLE memory - used by Gemdos Getmpb as
  520.                 ;end of Gemdos TPA
  521. memval2        equ    $43a l    ;$237698AA for good coldstart and valid memory config
  522. flock        equ    $43e w    ;zero locks DMA access - non-zero means can use DMA
  523. seekrate    equ    $440 w    ;0=6ms/1=12ms/2=2ms/3=3ms - only used at boot time
  524. _timr_ms    equ    $442 w    ;system timer calibration - should be 20(ms)
  525.                 ;since timer handoff vector called at 50Hz
  526.                 ;this value returned by tickcal and passed on stack
  527.                 ;to timer handoff vector
  528. _fverify    equ    $444 w    ;if zero, don't verify floppy writes, default DO verify
  529.                 ;used by BIOS Rwabs call
  530. _bootdev    equ    $446 w    ;device number system booted from
  531.             ;used by AES for default env.path
  532. palmode        equ    $448 w    ;zero=NTSC 60Hz, none zero default=PAL 50Hz
  533. defshiftmd    equ    $44a b    ;default video resolution (on startup)
  534. sshiftmd    equ    $44c b    ;current video resolution
  535. _v_bas_ad    equ    $44e l    ;Logical Screen address - see Logbase()
  536. vblsem        equ    $452 w    ;1 enables vblank processes - 0 if already in vblank routine
  537. nvbls        equ    $454 w    ;number of vertical blank vector slots (normally 8)
  538. _vblqueue    equ    $456 l    ;address of vblank vector list
  539. colorptr    equ    $45a l    ;ptr to 16 words of colour info to load next vblank or zero
  540.                 ;zeroed after use by vblank
  541. screenptr    equ    $45e l    ;ptr to new physical screen to change to on next vblank
  542.                 ;does not zero after use - ZERO IF NO CHANGE
  543. _vbclock    equ    $462 l    ;vblank interrupt counter
  544. _frclock    equ    $466 l    ;vblank processed counter
  545. hdv_init    equ    $46a l    ;hard disk init vector
  546. swv_vec        equ    $46e l    ;vector for change on mono monitor detect i/p
  547. hdv_bpb        equ    $472 l    ;Get Bios Parameter Block vector for Hard Disk
  548.                 ;same parameters on stack as in BIOS call
  549. hdv_rw        equ    $476 l    ;hard disk read/write vector
  550.                 ;same parameters on stack as in Rwabs
  551. hdv_boot    equ    $47a l    ;hard disk boot vector
  552. hdv_mediach    equ    $47e l    ;hard disk media change vector
  553.                 ;same parameters on stack as in BIOS floppy call
  554. _cmdload    equ    $482 w    ;attempt to load COMMAND.PRG if non-zero after loading boot sector
  555. conterm        equ    $484 w    ;set bit 0 for key click
  556.                 ;set bit 1 for key repeat
  557.                 ;set bit 2 for bell on ^G from console
  558.                 ;set bit 3 for shift status reporting in Bconin & Cconin
  559.                 ;in bits 24-31 of d0.l
  560. themd        equ    $48e l    ;Gemdos startup TPA size
  561. savptr        equ    $4a2 l    ;pointer to BIOS register save area
  562. _nflops        equ    $4a6 w    ;number of floppies physically attached
  563. sav_context    equ    $4ae l    ;pointer to saved processor context
  564. _bufl        equ    $4b2 l    ;pointer to data and FAT/dir Buffer Control Blocks
  565.                 ;see BCB structure
  566. _hz_200        equ    $4ba l    ;vector for 200Hz system timer tick, 
  567.                 ;normally divides by four for 50Hz system timer
  568. the_env        equ    $4be 4b    ;the default environment string (e.g. "A:\",0)
  569. _drvbits    equ    $4c4 w    ;drivemap of logical drives (as in Drvmap)
  570. _dskbufp    equ    $4c6 l    ;pointer to 1K buffer used for disk & GSX graphics
  571.                 ;do not use in interrupt routines
  572. ;??? gap ???    
  573. _prt_cnt    equ    $4ee w    ;-1 normally, 0 for screen dump, >0 to abort
  574. _sysbase    equ    $4f2 l    ;Pointer to OS header block
  575. _shell_p    equ    $4f6 l    ;Points to shell specific context?
  576. end_os        equ    $4fa l    ;Points to last byte of low ram used by OS
  577.                 ;copied into _membot at start up
  578. exec_os        equ    $4fe l    ;Start of AES or any code to start after system init
  579. *         >= TOS V1.2
  580. scr_dump    equ    $502 l    ;pointer to screen dump code
  581. prv_lsto    equ    $506 l    ;pointer to output device status for screen dump to PRN
  582.                 ;-1 for printer ready, 0 for busy
  583. prv_lst        equ    $50a l    ;pointer to char output for screen dump to PRN
  584.                 ;character to be printed is on stack
  585. prv_auxo    equ    $50e l    ;pointer to output device status for screen dump to AUX
  586.                 ;-1 for printer ready, 0 for busy
  587. prv_aux        equ    $512 l    ;pointer to char output for screen dump to AUX
  588.                 ;character to be printed is on stack
  589. pun_ptr        equ    $516 l    ;pointer to hard disk driver data structure
  590. memval3        equ    $51a l    ;memory validation value to check for cold boots
  591. xconstat    equ    $51e 8l    ;console input status vectors for standard devices 0-5 (7?)
  592.                 ;note: 3 is KBD not MIDI, and vice versa
  593. xconin        equ    $53e 8l    ;console input vectors for standard devices 0-5 (7?)
  594. xcostat        equ    $55e 8l    ;console output status vectors for standard devices 0-5 (7?)
  595. xconout        equ    $57e 8l    ;console output vectors for standard devices 0-5 (7?)
  596. *        > TOS V1.2
  597. _longframe    equ    $59e w    ;zero if 68000 exception stack frames, 
  598.                 ;non-zero for long exception stack frames
  599. _p_cookies    equ    $5a0 l    ;pointer to cookie jar or zero for none
  600.  
  601. * SYSBASE TABLE - OS HEADER BLOCK
  602. *********************************
  603. * If _sysbase address > phystop then TOS is ROM based
  604.     RSRESET
  605. OS_branch    rs.w    1    ;branch to RESET handler
  606. OS_version    rs.b    2    ;version & release number of TOS
  607.             ;blitter support starts at $0102
  608. OS_reset    rs.l    1    ;pointer to RESET handler
  609. OS_base    rs.l    1    ;pointer to base of OS
  610. OS_ramtop    rs.l    1    ;pointer to top of OS Ram
  611. OS_reserved    rs.l    1    ;not used
  612. OS_magic    rs.l    1    ;pointer to GEM memory usage parameter block
  613. OS_date    rs.l    1    ;build date as YYYYMMDD
  614. OS_config    rs.w    1    ;configuration bits
  615.             ;bit 0 is 1 for PAL, 0 for NTSC
  616.             ;TV scan rate setup accordingly
  617.             ;bits 1 & 2 are for the country
  618.             ;0=USA,1=Germany,2=France,3=UK
  619.             ;4=Spain,5=?,6=Sweden
  620.             ;7 & 8=Switzerland (French & German)
  621.             ;9=Turkey
  622. OS_dos_date    rs.l    1    ;build date in Disk format (GEMDOS)
  623. OS_mem_ptr    rs.l    1    ;internal memory pointer to OS_POOL
  624.             ;used by FOLDERXXX.PRG
  625.             ;TOS v1.02 or greater
  626. OS_shift_state    rs.l    1    ;ptr to KBD shift state bits
  627.             ;updated at interrupt level
  628.             ;TOS v1.02 or greater
  629. OS_process_addr    rs.l    1    ;pointer to app being executed
  630.             ;TOS v1.02 or greater
  631.  
  632. * THE MAGIC - GEM MEMORY USAGE PARAMETER BLOCK
  633. **********************************************
  634. * GEM only starts up if the Magic_magic is $87654321
  635. * If the magic is not valid, the RAM normally used by GEM is freed
  636. * Puntaes() returns if the magic is not valid or is in ROM,
  637. * otherwise it zeroes the Magic_magic and jumps to the RESET handler.
  638.  
  639.     RSRESET
  640. Magic_magic    rs.l    1    ;$87654321
  641. Magic_os_end    rs.l    1    ;end of OS+GEM BSS
  642. Magic_gemstart    rs.l    1    ;GEM execution start address
  643. ə