chiark / gitweb /
95fbe32777d078d051b9a96eb1300266aa8c575d
[trains.git] / detpic / variables.asm
1 ;======================================================================
2
3   include pindata.inc
4
5   udata_acs
6 picno           res     1       ; from first idlocs byte
7
8 idloc1          res     1       ; from 2nd idlocs byte; bit 7 is master:
9 idloc1_master           equ 7
10 idloc1_boarddet         equ 6
11
12 acknmra         res     1       ; must tell host about NMRA buffer state
13 flags           res     1       ; miscellaneous state flags
14 flags_polarising        equ 6
15
16 t               res     1       ; general temporary
17 u               res     1       ; general temporary (another)
18 v               res     1       ; general temporary (another)
19 t_dolocal       res     1       ; temporary for <foo>_local_do
20 outmsg_end      res     1       ; first empty byte in outbuf
21 outmsg_begin    res     1       ; first full byte in outbuf
22
23 isr_low_save_w          res     1 ; see {enter,return}_interrupt_low
24 isr_low_save_status     res     1 ;  in common.inc
25 isr_low_save_stkptr     res     1 ;
26
27 isr_high_save_fsr0      res     2 ; for isrh_fsr0_{save,restore}
28
29 xdebug                  res     8
30
31 cwslave                 res     1 ; slave we're currently actually writing to
32                                   ; undefined except in <something>_needwrite
33
34 ;----------------------------------------------------------------------
35 ; NON-ACCESS-BANK SECTIONS (TABLES)
36
37 outbuf_section udata 0x200
38 outbuf_szln2    equ     7
39 outbuf_size     equ     (1<<outbuf_szln2)
40 outbuf          res     outbuf_size
41
42 bitnum2bit_section udata 0x0f8
43 bitnum2bit      res     8       ; bitnum2bit[x] = 1<<x
44
45 slavetable equ 0x400
46 slavetable_section udata slavetable
47 ; each board actually present has an entry in this table
48 ste_szln2       equ     3
49 ste_size        equ     (1<<ste_szln2)
50   res maxpics * ste_size
51
52 ; each entry is a number of bytes, at these offsets:
53 ste_slave       equ 0 ; Gk slave number
54 ste_flags       equ 1 ; ** flags (stf_...), see below
55 ste_detbasel    equ 2 ; dk added to 11111bbb to make 0SSSSSSS; ie first-0xf8
56 ste_lastd0      equ 3 ; d  } [o0]*  ie every bit is either 0 (for an
57 ste_lastd2      equ 4 ; d  }        previously seen detection data bit
58 ste_lastd1      equ 6 ; d  }        irrelevant bit) or o, meaning the
59 ste_detmsgh     equ 7 ; dk 1 001 1 000 being 1 001 Y SSS
60 ;             offset^   ^which module(s) use this data:
61 ;                         G     global - for use by any code
62 ;                         d     for master detection, see mascan.asm
63 ;                         *     varies per bit
64 ;                         .k    entry is constant, created during init'n
65 ; flags in ste_flags:
66 stf_detect      equ 7 ; Gk  this is a detectors board
67 stf_sentinel    equ 6 ; Gk  sentinel slot at end of table
68
69   include final.inc
70
71 ;======================================================================