summaryrefslogtreecommitdiffstats
path: root/oncology/dpfhack_display/reverse/common.in
blob: 8b64196caab8a1f1eb04163e3fea6ea3b98a001b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
; ---- END USER DEFINED ----
; Common stuff: seems mostly common to all firmware. No guarantee
; about correctness of the global variables for all firmwares.
; Routines in ROM:

l 001e rom_001e

; might not exist:
l 0911 rom_0911 

; Likely some JPEG decoding
l 0a27 rom_0a27
l 0a85 rom_0a85
l 0add rom_0add 
l 0d38 rom_0d38
l 0d65 rom_0d65
l 0e02 rom_0e02
l 0f5c rom_0f5c
l 0fa9 rom_0fa9

l 0c0a rom_bootload

; Called from IRQ routines:
l 0e1a rom_0e1a
l 0e72 rom_0e72
l 0ef4 rom_0ef4
l 0f16 rom_0f16

; Writes a byte to the LCD port p3
l 0f25 rom_lcdwrite
; Probably alternative write function
l 0f34 rom_0f34

; Called from bank switching code:
l 0fae rom_0fae

s 0e00 common_xdata_0e00
s 0e40 common_xdata_0e40
s 0e80 common_xdata_0e80
s 1600 common_xdata_0e00_cseg
; s 1640 common_xdata_0e40_cseg
; s 1680 common_xdata_0e80_cseg

; Common functions that seem to be called from all modules:

l 124a g_var0
l 1280 lcd_setcontext

; Those might differ between different DPF firmware
s 1800 common_usb_1800
s 1818 common_usb_resume_1818

; Most important: module loader trampoline
l 1934 tramp_return
l 1938 tramp_jsr
l 193a tramp_jmp
l 193e tramp_dyn

; Global register variables(flags):
; _oi: Probably initialized in OTP
; G_: Very likely global over all modules (not overlayed)
; g_: Global (shared) among some modules, may be overlayed
; i_: Accessed from IRQ handler
r 0f G_ptr0_oi
r 10 G_count0
r 11 G_adcbufadr
r 12 G_count1
r 13 G_curp_l
r 14 G_curp_h
r 19 G_seconds?
r 1b G_internal
r 1d G_var
r 1e G_button
r 1f G_bankno
r 20 i_G_f
r 21 G_adc_flags
r 22 G_irqh6_flags
r 25 G_usbflg
r 26 g_sector_h
r 27 g_sector_m
r 28 g_sector_l
r 29 flags_29
r 2a flags_2a
r 2b flags_2b
r 2c flags_2c
r 2d flags_2d
r 2e flags_2e
r 2f flags_2f
r 73 G_language
; The following registers denote the LCD controller context area
; See lcd_setcontext()
r 77 G_lcd_cxL
r 78 G_lcd_cxH
r 79 G_lcd_cyL
r 7a G_lcd_cyH
r 7b G_lcd_dxL
r 7c G_lcd_dxH
r 7d G_lcd_dyL
r 7e G_lcd_dyH

; AX206 SFRs

f 86 dpcon
f 87 pcon

f 91 _mulres0
f 92 _mulres1
f 93 _mulres2
f 94 _mulres3
f 9a _wkpnd
f 9b _wken
f 9c _wkedg
f a4 _pie
f a5 _ckcon
f a8 _ien0
f b0 _p3
f b1 _tmr0con
f b3 _tmr0cnt
f b4 _tmr0pr
f b5 _tmr0psr
f b8 _ip
f bb _wdtcon
f c0 _p4
f c1 _tmr2con
f c2 _tmr2cntl
f c3 _tmr2cnth
f c4 _tmr2perl
f c5 _tmr2perh
f c6 _tmr2pwml
f c7 _tmr2pwmh
f c8 _usbcon0
f c9 _usbdata
f ca _usbaddr
f d1 _rtcnt
f d2 _adccon
f d3 _adcbaud
f d4 _adcbufh
f d6 _spibaud
f d7 _spibuf
f d8 _spicon
f dc _adcbufl
f e1 _tmr1con
f e2 _tmr1cntl
f e3 _tmr1cnth
f e4 _tmr1perl
f e5 _tmr1perh
f e6 _tmr1pwml
f e7 _tmr1pwmh
f e8 _eif0
f e9 _p0dir
f ea _p1dir
f eb _p2dir
f ec _p3dir
f ed _p4dir
f f1 _uartsta
f f2 _uartcon
f f3 _uartbaud
f f4 _uartbuf
f f8 _tmr3con
f f9 _p0up
f fa _p1up
f fb _p2up
f fc _p3up
f fd _p4up

; Addressable bits:
m 00 i_G_f.0
m 01 i_G_f.1
m 02 i_G_f.adcready
m 03 i_G_f.usbon
m 04 i_G_f.usbact
m 05 i_G_f.wkup
m 06 i_G_f.6
m 07 i_G_f.7
m 0f G_rtc2_flags.7
m 10 sflags.0
m 11 i_G_flag.1
m 12 g_sflags.2
m 13 sflags.3
m 14 sflags.4
m 15 sflags.5
m 16 sflags.6
m 17 sflags.7
m 18 G_flags23.0
m 19 G_flags23.1
m 1a G_flags23.2
m 20 bit_24.0
m 21 bit_24.1
m 22 bit_24.2
m 23 bit_24.3
m 24 bit_24.4
m 25 bit_24.5
m 26 bit_24.6
m 27 bit_24.7
m 28 G_usbflg.0
m 29 G_usbflg.1
m 2a G_usbflg.2
m 2b G_usbflg.3
m 2c G_usbflg.4
m 2d G_usbflg.5

; I/O mappings:
k 86 _BUT_MENU
k 90 _LCD_RST
k 91 _LCD_WR
k 92 _LCD_RD
k 94 _LCD_A0
k a0 _SPI_CS
k a1 _LCD_CS
k ce _USB_DONE
k df _SPIPND
k fb _T3CP
k e8 _T0P