chiark / gitweb /
less of an unsightly wiggle over bridge
[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_lh_save_fsr0        res     2 ; for intrlh_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 debug_intrdiag          res     1 ; used only for debugging, interrupt
35                                   ;  source recording
36
37 ;----------------------------------------------------------------------
38 ; NON-ACCESS-BANK SECTIONS (TABLES)
39
40 outbuf_section udata 0x200
41 outbuf_szln2    equ     7
42 outbuf_size     equ     (1<<outbuf_szln2)
43 outbuf          res     outbuf_size
44
45 bitnum2bit_section udata 0x0f8
46 bitnum2bit      res     8       ; bitnum2bit[x] = 1<<x
47
48 slavetable equ 0x400
49 slavetable_section udata slavetable
50 ; each board actually present has an entry in this table
51 ste_szln2       equ     3
52 ste_size        equ     (1<<ste_szln2)
53   res maxpics * ste_size
54
55 ; each entry is a number of bytes, at these offsets:
56 ste_slave       equ 0 ; Gk slave number
57 ste_flags       equ 1 ; ** flags (stf_...), see below
58 ste_detbasel    equ 2 ; dk added to 11111bbb to make 0SSSSSSS; ie first-0xf8
59 ste_lastd0      equ 3 ; d  } [o0]*  ie every bit is either 0 (for an
60 ste_lastd2      equ 4 ; d  }        irrelevant bit) or o, meaning the
61 ste_lastd1      equ 6 ; d  }        previously seen detection data bit
62 ste_detmsgh     equ 7 ; dk 1 001 1 000 being 1 001 Y SSS
63 ;             offset^   ^which module(s) use this data:
64 ;                         G     global - for use by any code
65 ;                         d     for master detection, see mascan.asm
66 ;                         *     varies per bit
67 ;                         .k    entry is constant, created during init'n
68 ; flags in ste_flags:
69 stf_detect      equ 7 ; Gk  this is a detectors board
70 stf_sentinel    equ 6 ; Gk  sentinel slot at end of table
71 stf_responding  equ 5 ; G   board has ack'd i2c addressing at least once
72
73   include final.inc
74
75 ;======================================================================