;***************** ADEBUG.VAR ******************
;     fichier de configuration pour ADEBUG
;***********************************************

-d+
ligne,ro='ros\ligne.ro
blalloc,ro='blalloc.ro
blfree,ro='blfree.ro
cls,ro='cls.ro
linea,ro='linea.ro
mediac,ro='mediach.ro
reset,ro='reset.ro
bios_init,ro='b_init.ro
xbios_init,ro='xb_init.ro
dorest,ro='dorest.ro
desa,ro='desa6301.ro

;dummy
;i,eq=0

cartridge,la=fa0000

;some interrupt vectors
vblvec,la=70
timercvec,la=114
ikbdvec,la=118

; --- --- BIOS Variables --- ---

; --- BOMBS ---
;$12345678 if valid
proc_lives,la=380
;registers save area for bombs
proc_regs,la=384
;where it crashed
proc_pc,la=3c4
;usp
proc_usp,la=3c8
;ssp
proc_stk,la=3cc

; --- PAGE IV ---
; vector for timer interrupt chain
etv_timer,la=400
; vector for critical error chain
etv_critic,la=404
; vector for process terminate
etv_term,la=408
; 5 reserved vectors
etv_xtra,la=40c
; indicates system state on RESET
memvalid,la=420
; mem controller config nibble
memcntrl,la=424
; validates 'resvector'
resvalid,la=426
; [RESET] bailout vector
resvector,la=42a
; physical top of RAM
phystop,la=42e
; bottom of available memory;
_membot,la=432
; top of available memory;
_memtop,la=436
; validates 'memcntrl' and 'memconf'
memval2,la=43a
; floppy disk/FIFO lock variable
flock,la=43e
; default floppy seek rate
seekrate,la=440
; system timer calibration (in ms)
_timr_ms,la=442
; nonzero: verify on floppy write
_fverify,la=444
; default boot device
_bootdev,la=446
; nonzero ==> PAL mode
palmode,la=448
; default video rez (first byte)
defshiftmd,la=44a
; shadow for 'shiftmd' register
sshiftmd,la=44c

; pointer to base of screen memory
_v_bas_ad,la=44e
_v_bas_adm,la=44f
_v_bas_adl,la=450

; semaphore to enforce mutex in vbl
vblsem,la=452
; number of deferred vectors
nvbls,la=454
; pointer to vector of deferred vfuncs
_vblqueue,la=456
; pointer to palette setup (or NULL)
colorptr,la=45a
; pointer to screen base setup (|NULL)
screenpt,la=45e
; count of unblocked vblanks
_vbclock,la=462
; count of every vblank
_frclock,la=466
; hard disk initialization
hdv_init,la=46a
; video change-resolution bailout
swv_vec,la=46e
; disk 'get BPB'
hdv_bpb,la=472
; disk read/write
hdv_rw,la=476
; disk 'get boot sector'
hdv_boot,la=47a
; disk media change detect
hdv_mediach,la=47e
; nonzero: load COMMAND.COM from boot
_cmdload,la=482
; console/vt52 bitSwitches (%%0..%%2)
conterm,la=484
; saved return addr for _trap14
trp14ret,la=486
; saved return addr for _critic
criticret,la=48a
; memory descriptor (MD)
themd,la=48e
; (more MD)
_____md,la=49e
; pointer to register save area
savptr,la=4a2
; number of disks attached (0, 1+)
_nflops,la=4a6
; state of conout() parser
con_state,la=4a8
; saved row# for cursor X-Y addressing
save_row,la=4ac
; pointer to saved processor context
sav_context,la=4ae
; two buffer-list headers
_bufl,la=4b2
; 200hz raw system timer tick
_hz_200,la=4ba
; bit vector of 'live' block devices
_drvbits,la=4c2
; pointer to common disk buffer
_dskbufp,la=4c6
; pointer to autoexec path (or NULL)
_autopath,la=4ca
; initial _vblqueue (to 4ee)
_vbl_list,la=4ce
; screen-dump flag
_dumpflg,la=4ee
; printer abort flag
_prtabt,la=4f0
; -> base of OS
_sysbase,la=4f2
; -> global shell info
_shell_p,la=4f6
; -> end of OS memory usage
end_os,la=4fa
; -> address of shell to exec on startup
exec_os,la=4fe
; -> screen dump code
scr_dump,la=502

; -> _lstostat()
prv_lsto,la=506
; -> _lstout()
prv_lst,la=50a
; -> _auxostat()
prv_auxo,la=50e
; -> _auxout()
prv_aux,la=512

memval3,la=51a

;TOS 1.04 1.06 3.00
; -> _bconstat (8 L)
prv_cons,la=51e
; -> _bconin (8 L)
prv_conin,la=53e
; -> _bcostat (8 L)
prv_cos,la=55e
; -> _bconout (8 L)
prv_conout,la=57e

;--- Exception vectors ---
berr,eq=2*4
adderr,eq=3*4
illerr,eq=4*4
div0,eq=5*4
chktrap,eq=6*4
trapvtrap,eq=7*4
supererr,eq=8*4
tracetrap,eq=9*4
lineatrap,eq=a*4
lineftrap,eq=b*4
;30-38=reserved
parasite,eq=f*4
;40-5c=reserved
berrberr,eq=\24*4

ipl1,eq=\25*4
ipl2,eq=ipl1+4
ipl3,eq=ipl1+4*2
ipl4,eq=ipl1+4*3
ipl5,eq=ipl1+4*4
ipl6,eq=ipl1+4*5
ipl7,eq=ipl1+4*6

trap0,eq=80
trap1,eq=trap0+4
trap2,eq=trap0+8
trap3,eq=trap0+\12
trap4,eq=trap0+\16
trap5,eq=trap0+\20
trap6,eq=trap0+\24
trap7,eq=trap0+\28
trap8,eq=trap0+\32
trap9,eq=trap0+\36
trap10,eq=trap0+\40
trap11,eq=trap0+\44
trap12,eq=trap0+\48
trap13,eq=trap0+\52
trap14,eq=trap0+\56
trap15,eq=trap0+\60

; Ligne A
-o-
linea_table,la=linea
tmp,la=d0
LINEA_INIT,la={tmp}
PUTPIX,la={tmp+4}
GETPIX,la={tmp+8}
ABLINE,la={tmp+c}
HABLINE,la={tmp+10}
RECTFILL,la={tmp+14}
POLYFILL,la={tmp+18}
BITBLT,la={tmp+1c}
TEXTBLT,la={tmp+20}
SHOWCUR,la={tmp+24}
HIDECUR,la={tmp+28}
CHGCUR,la={tmp+2c}
DRSPRITE,la={tmp+30}
UNSPRITE,la={tmp+34}
COPYRSTR,la={tmp+38}
SEEDFILL,la={tmp+3c}

VPLANES,la=linea_table
        ;non-official variables
CUR_FONT,la=VPLANES-\906
MMAX_X,la=VPLANES-2170+1EBC
MMAX_Y,la=VPLANES-2170+1EBC+2

M_POS_HX,la=VPLANES-\856
M_POS_HY,la=VPLANES-\856+2

M_PLANES,la=VPLANES-\852
M_CDB_BG,la=VPLANES-\850
M_CDB_FG,la=VPLANES-\848
MASK_FORM,la=VPLANES-\846

INQ_TAB,la=VPLANES-\782
DEV_TAB,la=VPLANES-\692

M_X,la=VPLANES-\602
M_Y,la=VPLANES-\602+2
;TOS 1.0/1.2 only:
M_HID_CT,la=VPLANES-\598
M_BUT,la=VPLANES-\596
REC_COL,la=VPLANES-\594
SIZ_TAB,la=VPLANES-\498
CUR_WORK,la=VPLANES-\464
DEF_FONT,la=VPLANES-\460
FONT_RING,la=VPLANES-\456
FONT_COUNT,la=VPLANES-\440
CUR_MS_STAT,la=VPLANES-\348
V_HID_CNT,la=VPLANES-\346
CUR_X,la=VPLANES-\344
CUR_Y,la=VPLANES-\344+2
CUR_FLAG,la=VPLANES-\340
MOUSE_FLAG,la=VPLANES-\339
V_SAV_X,la=VPLANES-\334
V_SAV_Y,la=VPLANES-\334+2
SAVE_LEN,la=VPLANES-\330
SAVE_ADR,la=VPLANES-\328
SAVE_STAT,la=VPLANES-\324
SAVE_AREA,la=VPLANES-\322

USER_TIM,la=VPLANES-\66
NEXT_TIM,la=VPLANES-\62
USER_BUT,la=VPLANES-\58
USER_CUR,la=VPLANES-\54
USER_MOT,la=VPLANES-\50
PIXEL_HEIGHT,la=VPLANES-\46
MAX_CELL_X,la=VPLANES-\44
MAX_CELL_Y,la=VPLANES-\42
NEXT_CELL_OFFSET,la=VPLANES-\40
BG_COLOUR,la=VPLANES-\38
FG_COLOUR,la=VPLANES-\36
CURSOR_ADDR,la=VPLANES-\34
FIRST_CELL_OFFSET,la=VPLANES-\30
CURSOR_X,la=VPLANES-\28
CURSOR_Y,la=VPLANES-\26
CURSOR_FLASH,la=VPLANES-\24
CURSOR_TIMER,la=VPLANES-\23
MONO_FONT,la=VPLANES-\22
LAST_ASCII,la=VPLANES-\18
FIRST_ASCII,la=VPLANES-\16
FONT_WIDTH,la=VPLANES-\14
MAX_X,la=VPLANES-\12
FONT_ADDR,la=VPLANES-\10
ALPHA_STATUS,la=VPLANES-6
MAX_Y,la=VPLANES-4
BYTES_LN,la=VPLANES-2
        ;official variables
VWRAP,la=VPLANES+2
CONTRL,la=VPLANES+4
INTIN,la=VPLANES+8
PTSIN,la=VPLANES+\12
INTOUT,la=VPLANES+\16
PTSOUT,la=VPLANES+\20
COLBIT0,la=VPLANES+\24
COLBIT1,la=VPLANES+\26
COLBIT2,la=VPLANES+\28
COLBIT3,la=VPLANES+\30
LSTLIN,la=VPLANES+\32
LNMASK,la=VPLANES+\34
WMODE,la=VPLANES+\36
X1,la=VPLANES+\38
Y1,la=VPLANES+\40
X2,la=VPLANES+\42
Y2,la=VPLANES+\44
PATPTR,la=VPLANES+\46
PATMSK,la=VPLANES+\50
MFILL,la=VPLANES+\52
CLIP,la=VPLANES+\54
XMINCL,la=VPLANES+\56
YMINCL,la=VPLANES+\58
XMAXCL,la=VPLANES+\60
YMAXCL,la=VPLANES+\62
XDDA,la=VPLANES+\64
DDAINC,la=VPLANES+\66
SCALDIR,la=VPLANES+\68
MONO,la=VPLANES+\70
SRCX,la=VPLANES+\72
SRCY,la=VPLANES+\74
DSTX,la=VPLANES+\76
DSTY,la=VPLANES+\78
DELX,la=VPLANES+\80
DELY,la=VPLANES+\82
FBASE,la=VPLANES+\84
FWIDTH,la=VPLANES+\88
STYLE,la=VPLANES+\90
LITEMSK,la=VPLANES+\92
SKEWMSK,la=VPLANES+\94
WEIGHT,la=VPLANES+\96
ROFF,la=VPLANES+\98
LOFF,la=VPLANES+\100
SCALE,la=VPLANES+\102
CHUP,la=VPLANES+\104
TEXTFG,la=VPLANES+\106
SCRTCHP,la=VPLANES+\108
SCRPT2,la=VPLANES+\112
TEXTBG,la=VPLANES+\114
COPYTRAN,la=VPLANES+\116
SEEDABORT,la=VPLANES+\118

;processor type (1 W) (680x0)
proc_type,la=59e
;click sound routine (1 L)
prv_clk,la=5ac

;--- Some (useful) LR ---
count200,lr={_hz_200}
physbase,lr=({dbaseh}<<8+{dbasem})<<8
stephysbase,lr=({dbaseh}<<8+{dbasem})<<8+{dbasel}
logbase,lr={_v_bas_ad}

;basepage offsets
BPTEXTSZ,ex=c-$100
BPDATASZ,ex=14-$100
BPBSSSZ,ex=1c-$100
BPDTA,ex=20-$100
BPPARENT,ex=24-$100
BPENVIR,ex=2c-$100
BPCMDLINE,ex=80-$100

; BIOS
-o-
bios_table,la=bios_init
getmpb,la={bios_table}
bconstat,la={bios_table+4}
bconin,la={bios_table+8}
bconout,la={bios_table+c}
rwabs,la={bios_table+10}
setexc,la={bios_table+14}
tickcal,la={bios_table+18}
getbpb,la={bios_table+1c}
bcostat,la={bios_table+20}
mediach,la={bios_table+24}
drvmap,la={bios_table+28}
kbshift,la={bios_table+2c}

; XBIOS
xbios_table,la=xbios_init
initmous,la={xbios_table}
ssbrk,la={xbios_table+4}
_physbase,la={xbios_table+8}
_logbase,la={xbios_table+c}
_getrez,la={xbios_table+10}
_setscreen,la={xbios_table+14}
_setpalette,la={xbios_table+18}
_setcolor,la={xbios_table+1c}
_floprd,la={xbios_table+20}
_flopwr,la={xbios_table+24}
_flopfmt,la={xbios_table+28}
getdsb,la={xbios_table+2c}
midiws,la={xbios_table+30}
_mfpint,la={xbios_table+34}
iorec,la={xbios_table+38}
rsconf,la={xbios_table+3c}
keytbl,la={xbios_table+40}
_random,la={xbios_table+44}
_protobt,la={xbios_table+48}
_flopver,la={xbios_table+4c}
scrdmp,la={xbios_table+50}
cursconf,la={xbios_table+54}
settime,la={xbios_table+58}
gettime,la={xbios_table+5c}
bioskey,la={xbios_table+60}
ikbdws,la={xbios_table+64}
jdisint,la={xbios_table+68}
jenabint,la={xbios_table+6c}
giacess,la={xbios_table+70}
offgibit,la={xbios_table+74}
ongibit,la={xbios_table+78}
xbtimer,la={xbios_table+7c}
dosound,la={xbios_table+80}
setprt,la={xbios_table+84}
kbdvbase,la={xbios_table+88}
kbrate,la={xbios_table+8c}
_prtblk,la={xbios_table+90}
vsync,la={xbios_table+94}
supexec,la={xbios_table+98}
puntaes,la={xbios_table+9c}
floprate,la={xbios_table+$a0}
blitmode,la={xbios_table+100}
-o+
; Absolute TT Rom routines:
Fread,la=e120c6
strncpy,la=e122dc
-o-
