annotate defs/l51.defs @ 3226:9749d0dfc4a2

Changed a puls PC to rts to save cycles
author David Ladd <drencor-xeen@users.sourceforge.net>
date Sat, 20 Jan 2018 19:32:22 -0600
parents 1317b044e8bf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 * miscellaneous definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 HResMaxX equ 639 high resolution X limit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 HResMaxY equ 191 high resolution Y limit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 MousData equ $0008 arbitrary choice for mouse data area ($0008-$000F)
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
5 *PcktSize equ 5 wrong for M$, Logitek mice
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
6 PcktSize equ 4 number of bytes in mouse data packet, wrong. max 4, usually 3
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
7 *SyncData equ %10000000 initial mouse data byte pattern- wrong
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
8 SyncData equ %01000000 initial mouse data byte pattern, d7 is NOT used
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
9 *SyncMask equ %11111000 mask for initial mouse data byte pattern-wrong
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
10 SyncMask equ %01111000 mask for initial mouse data byte pattern
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 * 6551 register definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 org 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 DataReg rmb 1 receive/transmit data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 StatReg rmb 1 IRQ/DSR/DCD/error status (read only)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 PRstReg equ StatReg programmed reset (write only)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 CmdReg rmb 1 command (parity/echo/Tx IRQ/Rx IRQ/DTR)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 CtrlReg rmb 1 control (stop bits/word length/Rx clock/baud rate)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 * Status bit definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 Stat.IRQ equ %10000000 IRQ occurred
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 Stat.DSR equ %01000000 current DSR input level (0=enabled, 1=disabled)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 Stat.DCD equ %00100000 current DCD input level (0=enabled, 1=disabled)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 Stat.TxE equ %00010000 Tx register empty
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 Stat.RxF equ %00001000 Rx register full
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 Stat.Ovn equ %00000100 overrun error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 Stat.Frm equ %00000010 framing error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 Stat.Par equ %00000001 parity error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 Stat.Err equ Stat.Ovn!Stat.Frm!Stat.Par status error bits
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 Stat.Flp equ $00 all status bits active when set
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 Stat.Msk equ Stat.RxF!Stat.Ovn!Stat.Frm!Stat.Par active IRQ bits
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 * Command bit definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 Cmd.Par equ %11100000 see parity table below
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 Cmd.Echo equ %00010000 Rx echo (0=disabled, 1=enabled)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 Cmd.TxIC equ %00001100 see Tx IRQ control table below
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 Cmd.RxIE equ %00000010 Rx IRQ enable (0=enabled, 1=disabled)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 Cmd.DTR equ %00000001 DTR output (0=disabled, 1=enabled)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 * parity table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 Par.None equ %00000000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 Par.Odd equ %00100000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 Par.Even equ %01100000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 Par.Mark equ %10100000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 Par.Spac equ %11100000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 * Tx IRQ control table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 TIC.Off equ %00000000 RTS disabled, Tx IRQ disabled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 TIC.On equ %00000100 RTS enabled, Tx IRQ enabled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 TIC.RTS equ %00001000 RTS enabled, Tx IRQ disabled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 TIC.Brk equ %00001100 RTS enabled, Tx line break
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 * Control bit definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 Ctl.Stop equ %10000000 stop bits (clear=1, set=2)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 Ctl.DBit equ %01100000 see data bit table below
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 Ctl.RClk equ %00010000 Rx clock source (0=external, 1=internal)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 Ctl.Baud equ %00001111 see baud rate table below
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 * data bit table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 DB.5 equ %01100000 five data bits per character
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 DB.6 equ %01000000 six data bits per character
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 DB.7 equ %00100000 seven data bits per character
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 DB.8 equ %00000000 eight data bits per character
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
64 * GH 28/06/2008 Note, data format is only 7 bits
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
65 * but most mice send 8 bits with the last bit,
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
66 * MSB set which=extra stop bit, so use DB.7
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 * baud rate table
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 org 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 BR.ExClk rmb 1 16x external clock
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 BR.00050 rmb 1 50 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 BR.00075 rmb 1 75 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 BR.00110 rmb 1 109.92 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 BR.00135 rmb 1 134.58 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 BR.00150 rmb 1 150 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 BR.00300 rmb 1 300 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 BR.00600 rmb 1 600 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 BR.01200 rmb 1 1200 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 BR.01800 rmb 1 1800 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 BR.02400 rmb 1 2400 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 BR.03600 rmb 1 3600 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 BR.04800 rmb 1 4800 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 BR.07200 rmb 1 7200 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 BR.09600 rmb 1 9600 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 BR.19200 rmb 1 19200 baud
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 * Btn.Cntr bit definitions
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
87 BC.ButnL equ %00100000 button #1 (left, 1 = pressed=$20)
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
88 BC.ButnR equ %00010000 button #2 (right, 1 = pressed=$10)
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
89 BC.ButnC equ %00001000 button #3 (center, 1 = pressed=$08)
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
90 BC.RxCnt equ %00000111 Rx data byte count
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
91 BC.Butns equ BC.ButnL!BC.ButnR!BC.ButnC mask for all buttons
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
93 * added 06/21/2008 GH some defines for button up
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
94 BU.ButnL equ %00011111 to clear button #1 left
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
95 BU.ButnR equ %00101111 to clear button #2 right
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
96 BU.ButnC equ %00110111 to clear button #3 center
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
98 * Added 06/21/2008 GH more possibly handy defines
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
99 * here is a good place to define mouse buttons
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
100 * as the mouse output data delivers them to us
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
101 MD.Sync equ %01000000 never set unless sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
102 MD.ButnL equ %00100000 left, in first 'sync' byte of logitek mouse
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
103 MD.ButnR equ %00010000 right, in first 'sync' byte of logitek mouse
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
104 MD.ButnC equ %00100000 center, but in 4th byte only
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
105 MskYYXX equ %11000000 for use after shifted to msbits
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 * mouse static data area definitions
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 org 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 Btn.Cntr rmb 1 mouse button status and Rx data counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 Buffer rmb 3 Rx buffer for 1st 3 bytes of XY mouse data (must start at 1,u)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 CrntXPos rmb 2 mouse X position (0 to HResMaxX)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 CrntYPos rmb 2 mouse Y position (0 to HResMaxY*2)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112
2371
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
113 * added, may, may not be usefull, GH
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
114 * logitek mouse data defs, almost same as M$, bit D7 of any byte is don't care
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
115 * BECAUSE THE MOUSE IS A 7N1 MOUSE!
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
116 * Assume Btn.Cntr will be inc'd as last processing op of each byte rx'd here.
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
117 LkMsMask equ %01111111 d7 ignored
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
118 LkMsSync equ %01000000 only set for first byte of packet, set Btn.Cntr=0
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
119 LkMsLBtn equ %00100000 if left button pushed, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
120 LkMsRbtn equ %00010000 if right button pushed, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
121 * except this one in 4th byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
122 LgtkCBtn equ %00100000 if center button pushed, and Btn.Cntr=3
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
123 * sign bits
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
124 LkMsYSgn equ %00001000 direction of current move, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
125 LkMsXSgn equ %00000010 direction of current move, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
126 * direction since last packet bits
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
127 LkMsYMsb equ %00000100 MSB of current Y move, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
128 LkMsXMsb equ %00000001 MSB of current X move, in sync byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
129 LkMsXMov equ %00111111 the rest of an 7 bit value, when Btn.Cntr=1 (second byte)
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
130 LkMsYMov equ %00111111 the rest of an 7 bit value, when Btn.Cntr=2
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
131
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
132 * Microsoft sends the center button down as a no data packet
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
133 * sync bit only in first byte
1317b044e8bf *** empty log message ***
gheskett
parents: 0
diff changeset
134 * ANYTHING else is a center button up event.