Subversion Repositories svn.mios

Rev

Rev 302 | Rev 362 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 tk 1
;
2
; Specific Defines and variables of MIOS Application
3
;
4
; ==========================================================================
5
;
6
;  Copyright 1998-2007 Thorsten Klose (tk@midibox.org)
7
;  Licensed for personal non-commercial use only.
8
;  All other rights reserved.
9
;
10
; ==========================================================================
11
 
12
#define SID_STAT_ENGINE_DISABLE     0 ; if set, SID tick and SID interrupt will not be processed
13
#define SID_STAT_ENGINE_DISABLE_LEVEL0  1 ; same as flag 0, but used during startup to overcome a wdt timeout issue when no LCD is connected
14
#define SID_STAT_SIDPLAYER      2 ; exclusive access for SID player
15
#define SID_STAT_SIDPLAYER_CS_DISABLE   3 ; set if CS buttons/encoders should be ignored
16
#define SID_STAT_CLK_SLAVE      4 ; if set, clock generator in slave mode (flag should be outside erasable SID_BASE structure)
17
#define SID_STAT_SE_CYCLE       5 ; switches between first and second engine cycle
18
 
19
;; ==========================================================================
20
 
21
    ;; patch
22
#define BANKSTICK_MAGIC0    0xf3 ; magic numbers - if they don't exists in bankstick at BANK_MAGIC_ADDRESS, 
23
#define BANKSTICK_MAGIC1    0x8b ; the stick will be ignored until it has been formatted
24
 
25
    ;; ensemble
26
#define BANKSTICK_E_MAGIC0  0xa9 ; this name has been selected intentionally ;)
27
#define BANKSTICK_E_MAGIC1  0x4e
28
 
29
;; ==========================================================================
30
 
31
#define CS_STAT_SID_AVAILABLE       0   ; flag 0: for MBNET: edits not possible when slave not available
32
#define CS_STAT_DISPLAY_INIT_REQ    1   ; flag 1: request a display initialization
33
#define CS_STAT_DISPLAY_UPDATE_REQ  2   ; flag 2: request a display update
34
#define CS_STAT_CURSOR_FLASH        3   ; flag 3: handled by cs_menu_timer.inc
35
#define CS_STAT_MODIFY_PARAMETER    4   ; flag 4: modify parameter if set, else select parameter
36
#define CS_STAT_MODIFY_NAME     5   ; flag 5: modify name if set, else modify parameter
37
#define CS_STAT_PAGE_MSG        6   ; flag 6: the page message is print on screen - don't update screen
38
#define CS_STAT_BIG_MSG         7   ; flag 7: e.g. for temporary print parameter name
39
 
40
#define CS_STAT2_WT_DEC_VIEW        0   ; flag 0: decimal view in WTC and WTE page
41
#define CS_STAT2_EDIT_UPDATE_REQ    1   ; flag 1: requests edit buffer update
42
#define CS_STAT2_COPY_BUFFER_FILLED 2   ; flag 2: set if copy buffer filled
43
#define CS_STAT2_LEVEL_METERS       3   ; flag 3: show level meters on LED matrix
44
#define CS_STAT2_PLAY_SID1      4   ; SIDx/Menu button combination: toggles play state
45
#define CS_STAT2_PLAY_SID2      5   ; DON'T CHANGE THE BIT NUMBERS!!!
46
#define CS_STAT2_PLAY_SID3      6   ; 
47
#define CS_STAT2_PLAY_SID4      7   ;
48
 
49
#define CS_STAT3_MODIFY_SEQ     0   ; flag 0: edit drum sequence
50
#define CS_STAT3_MODIFY_SEQ_ROTATE  1   ; flag 1: activate rotate function in drum editor
296 tk 51
#define CS_STAT3_SHIFT_PAGE     2   ; flag 2: show SHIFT page
1 tk 52
 
53
#define CS_MENU_MODE_SHIFT_PRESSED  0   ; flag 0: Shift Button pressed
54
#define CS_MENU_MODE_CC         1   ; flag 1: CC mode
55
#define CS_MENU_MODE_EDIT       2   ; flag 2: edit mode
56
#define CS_MENU_MODE_EDIT_NOTIFIER  3   ; flag 3: notifies when any value has been changed (can also be mapped to a LED)
57
#define CS_MENU_MODE_EDIT_FLASHED   4   ; flag 4: the flashed version of the edit button
58
#define CS_MENU_MODE_MATRIX_METER   5   ; flag 5: alternative meter mode for modulation sources
59
#define CS_MENU_MODE_MATRIX_METER_DISP  6   ; flag 6: used in cs_menu_matrix.inc to decide if meters should be displayed
60
#define CS_MENU_MODE_MENU_PRESSED   7   ; flag 7: Menu Button pressed
61
 
62
 
63
;; ==========================================================================
64
 
65
;; ==========================================================================
66
;;  General SID Control Variables in ACCESS page
67
;;  These variables are not cleared on a patch change!
68
;; ==========================================================================
69
SID_STAT        EQU 0x010
70
SID_ENSEMBLE        EQU 0x011
71
SID_MIDI_DEVICE     EQU 0x012
72
SID_PATCH       EQU 0x013
73
SID_BANK        EQU 0x014
74
SID_BANKSTICK_CHK_CTR   EQU 0x015
75
SID_BANKSTICK_STATUS    EQU 0x016   ; 8 flags for 8 BankSticks, 1=available
76
SID_BANKSTICK_SIZE  EQU 0x017   ; 8 flags for 8 BankSticks, 0=32k, 1=64k
77
 
78
;; ==========================================================================
79
;;  Variables used by the control surface
80
;; ==========================================================================
81
CS_MENU_PARAMETER_L EQU 0x018   ; contains low-byte of current parameter value, must be located to an even address!!!
82
CS_MENU_PARAMETER_H EQU 0x019   ; contains high-byte of current parameter value
83
CS_MENU_PARAMETER_MAX_L EQU 0x01a   ; contains max value of current parameter, must be located to an even address!!!
84
CS_MENU_PARAMETER_MAX_H EQU 0x01b   ; contains max value of current parameter
85
CS_STAT         EQU 0x01c   ; control surface status
86
CS_STAT2        EQU 0x01d   ; control surface status
87
CS_STAT3        EQU 0x01e   ; control surface status
88
CS_MENU         EQU 0x01f   ; menu page
89
CS_MENU_TABLE_0_L   EQU 0x020   ; pointer to first table entry, low-byte
90
CS_MENU_TABLE_0_H   EQU 0x021   ; pointer to first table entry, high-byte
91
CS_MENU_PAGE_OFFSET EQU 0x022   ; page offset to first displayed entry
92
CS_MENU_CURSOR_POS  EQU 0x023   ; cursor position
93
CS_MENU_ENTRIES     EQU 0x024   ; number of menu entries
94
CS_MENU_TIMER_CTR   EQU 0x025   ; used by cs_menu_timer.inc
95
CS_CURSOR_CTR       EQU 0x026   ; used by cs_menu_timer.inc
96
CS_SELECT_CTR       EQU 0x027   ; used by cs_menu.inc, counted by cs_menu_timer.inc
97
CS_MENU_REFRESH_ITEM_CTR EQU    0x028   ; used by cs_menu.inc to count through the displayed items
98
CS_MENU_ENTRY_TBLPTRL   EQU 0x029   ; used by cs_menu.inc
99
CS_MENU_ENTRY_TBLPTRH   EQU 0x02a   ; used by cs_menu.inc
100
CS_MENU_MODE        EQU 0x02b   ; control mode flags (Link/CC/Edit mode)
101
CS_MENU_WT_POS      EQU 0x02c   ; contains the current WT pos
102
CS_MENU_WT_SEQ      EQU 0x02d   ; contains the current WT sequence (used in bassline/drum mode)
103
CS_MENU_SAVE_ENS    EQU 0x02e   ; contains the ensemble number for save function
104
CS_MENU_SAVE_PATCH  EQU 0x02f   ; contains the patch number for save function
105
CS_MENU_SAVE_BANK   EQU 0x030   ; contains the bank number for save function
106
CS_MENU_REINIT_CFG_CTR  EQU 0x031   ; reinit configuration if counter == 1
107
CS_MENU_NAME_POS    EQU 0x032   ; for the "edit name" mode
108
CS_MENU_SID     EQU 0x033   ; number of SID which is currently handled
360 tk 109
CS_MENU_PARAMETER_IX    EQU 0x034   ; the parameter index (offset within Ix record) which is modified
110
CS_MENU_USED_ENCODER    EQU 0x035   ; used by cs_menu_enc.inc for FAST function
111
CS_MENU_ENC_INCREMENTER EQU     0x036   ; allows to determine the incrementer value of the encoder which modified the item
112
CS_MENU_GET_PATCH_ADDR_L EQU    0x037   ; used by cs_menu_mbnet.inc to fetch a patch stepwise
113
CS_MENU_GET_PATCH_ADDR_H EQU    0x038   ; used by cs_menu_mbnet.inc to fetch a patch stepwise
114
CS_MENU_MATRIX_CTR  EQU 0x039   ; counter used by CS_MENU_MATRIX_Handler
115
CS_MENU_MATRIX_FLASH_CTR EQU    0x03a   ; counter used by CS_MENU_MATRIX_Handler
116
CS_MENU_MATRIX_SELECTED_ROW EQU 0x03b   ; selected matrix row (every button has one flag)
117
CS_MENU_MATRIX_SELECTED_COL EQU 0x03c   ; selected matrix column (every button has one flag)
118
CS_MENU_EDIT_BUFFER_SID EQU 0x03d   ; reference to SID patch which is stored in edit buffer
119
CS_MENU_SELECTED_SID_FLAGS EQU  0x03e   ; every flag stays for one SID
120
CS_MENU_SELECTED_SID_LR EQU 0x03f   ; selected SID L/R
121
CS_MENU_SELECTED_INS    EQU 0x040   ; the selected ensemble
122
CS_MENU_SELECTED_OSC    EQU 0x041   ; the selected oscillator
123
CS_MENU_SELECTED_OSC_FLAGS EQU  0x042   ; every flag stays for one oscillator
124
CS_MENU_SELECTED_OSC_CTRL EQU   0x043   ; selects Env/Misc and Assign
125
CS_MENU_SELECTED_LFO    EQU 0x044   ; the selected LFO
126
CS_MENU_SELECTED_ENV    EQU 0x045   ; the selected envelope
127
CS_MENU_SELECTED_ENV_CTRL EQU   0x046   ; selects Env/Assign
128
CS_MENU_SELECTED_MOD    EQU 0x047   ; the selected mod entry
129
CS_MENU_SELECTED_MOD_SRC EQU    0x048   ; the selected mod source entry
130
CS_MENU_SELECTED_MOD_TARG EQU   0x049   ; the selected mod target entry
131
CS_MENU_SELECTED_TRG    EQU 0x04a   ; the selected trigger entry
1 tk 132
CS_MENU_SELECTED_TRK    EQU CS_MENU_SELECTED_TRG    ; only for drum engine: selected sequencer track
360 tk 133
CS_MENU_SELECTED_KNOB   EQU 0x04b   ; the selected knob entry
134
CS_MENU_SELECTED_WT EQU 0x04c   ; the selected wavetable
135
SAVED_CS_MENU       EQU 0x04d   ; used by cs_menu.inc::CS_MENU_ButtonInc
1 tk 136
SAVED_CS_ENGINE     EQU SAVED_CS_MENU ;  used by cs_menu_buttons.inc::CS_MENU_SID, can be overlayed
360 tk 137
SAVED_CS_MENU_PAGE_OFFSET EQU   0x04e   ; used by cs_menu.inc::CS_MENU_ButtonInc
138
SAVED_CS_MENU_CURSOR_POS EQU    0x04f   ; used by cs_menu.inc::CS_MENU_ButtonInc
139
CS_MENU_LASTPAGE_ENG_0  EQU 0x050   ; last selected page of lead engine (used in cs_menu_buttons.inc, see comments there)
140
CS_MENU_LASTPAGE_ENG_1  EQU 0x051   ; last selected page of bassline engine (don't change offset to _0 entry)
141
CS_MENU_LASTPAGE_ENG_2  EQU 0x052   ; last selected page of drum engine (don't change offset to _0 entry)
142
CS_MENU_LASTPAGE_ENG_3  EQU 0x053   ; last selected page of multi engine (don't change offset to _0 entry)
143
CS_MENU_METER_BAR_CTR   EQU 0x054   ; cs_menu.inc: used for meter bar at lower LCD line
144
CS_MENU_METER_BAR_VALUE EQU 0x055   ; cs_menu.inc: value of this meter
145
CS_MENU_DELAYED_UPDATE_CTR EQU  0x056   ; cs_menu.inc: used to delay LCD update by some mS
146
CS_MENU_LABEL       EQU 0x057   ; label ID of current menu page
147
CS_MENU_LABEL_CTR   EQU 0x058   ; counter for printing label piecewise
1 tk 148
 
360 tk 149
    ;; free: 0x59-0x5f
1 tk 150
 
151
;; ==========================================================================
152
;; NOTE for PIC18F4685: 0x60-0x7f NOT directly accessible via ACCESS bank!
153
;; ==========================================================================
154
CS_MENU_MATRIX_BEGIN    EQU 0x060   ; content of modulation matrix (8 entries)
155
CS_MENU_MATRIX_END  EQU 0x067
156
 
360 tk 157
CS_MENU_SID_M_PATCH EQU 0x068   ; patch number of master    ;(don't change the order of these 4 registers)
158
CS_MENU_SID_S1_PATCH    EQU 0x069   ; patch number of first slave
159
CS_MENU_SID_S2_PATCH    EQU 0x06a   ; patch number of second slave
160
CS_MENU_SID_S3_PATCH    EQU 0x06b   ; patch number of third slave
161
CS_MENU_SID_M_BANK  EQU 0x06c   ; bank number of master         ;(don't change the order of these 4 registers)
162
CS_MENU_SID_S1_BANK EQU 0x06d   ; bank number of first slave
163
CS_MENU_SID_S2_BANK EQU 0x06e   ; bank number of second slave
164
CS_MENU_SID_S3_BANK EQU 0x06f   ; bank number of third slave
165
CS_MENU_SID_M_CHN   EQU 0x070   ; MIDI channel of master    ;(don't change the order of these 4 registers)
166
CS_MENU_SID_S1_CHN  EQU 0x071   ; MIDI channel of first slave
167
CS_MENU_SID_S2_CHN  EQU 0x072   ; MIDI channel of second slave
168
CS_MENU_SID_S3_CHN  EQU 0x073   ; MIDI channel of third slave
169
CS_MENU_TX_M_CTR    EQU 0x074   ; transmit counter master, if > 0, patch tx will be delayed
170
CS_MENU_TX_S1_CTR   EQU 0x075   ; transmit counter master, if > 0, patch tx will be delayed
171
CS_MENU_TX_S2_CTR   EQU 0x076   ; transmit counter master, if > 0, patch tx will be delayed
172
CS_MENU_TX_S3_CTR   EQU 0x077   ; transmit counter master, if > 0, patch tx will be delayed
1 tk 173
 
360 tk 174
SRM_COL_CTR     EQU 0x078   ; used by "cs_menu_matrix.inc" (button handler)
1 tk 175
 
360 tk 176
SYX_SID_SELECTION   EQU 0x079   ; used by sid_sysex.inc, we have to store it outside patch range, so that it won't be erased during patch init
1 tk 177
 
178
 
179
TIMER0_RELOAD_L     EQU 0x07a   ; used by sid_bpm.inc
180
TIMER0_RELOAD_H     EQU 0x07b   ; used by sid_bpm.inc
181
 
182
SAVED_FSR0L     EQU 0x07c   ; used by sid_se.inc
183
SAVED_FSR0H     EQU 0x07d   ; used by sid_se.inc
184
SAVED_PRODL     EQU 0x07e   ; used by sid_se.inc
185
SAVED_PRODH     EQU 0x07f   ; used by sid_se.inc
186
 
187
;; ==========================================================================
188
;; ensemble edit buffer (for a single SID)
189
;; only used by CS
190
SID_ENS_BUFFER      EQU 0x080;..0x0bf
191
 
192
SID_ENSx_BANK       EQU 0x00    ; [2:0] selected bank
193
SID_ENSx_PATCH      EQU 0x01    ; [6:0] selected patch
194
SID_ENSx_CTRL1      EQU 0x02    ; [1:0] clock master/slave/auto, [6] mono
195
SID_ENSx_CTRL2      EQU 0x03    ; [0] F2A, [1] V2A, [3] P2A, [4] K2A, [5] O2A
196
SID_ENSx_RESERVED1  EQU 0x04    ; was global clock divider --- not used anymore, replaced by BPM!
197
SID_ENSx_BPM        EQU 0x05    ; global BPM
198
SID_ENSx_SUPERPOLY_CTRL EQU 0x06    ; [2:0] number of used voices (0..4)
199
SID_ENSx_AOUT_INVERTED  EQU 0x07    ; inversion flags for AOUT Channel 1..8
200
 
201
SID_ENSx_CALI_FIL1_MIN_L EQU    0x08    ; filter calibration values
202
SID_ENSx_CALI_FIL1_MIN_H EQU    0x09    ; filter calibration values
203
SID_ENSx_CALI_FIL1_MAX_L EQU    0x0a    ; filter calibration values
204
SID_ENSx_CALI_FIL1_MAX_H EQU    0x0b    ; filter calibration values
205
SID_ENSx_CALI_FIL2_MIN_L EQU    0x0c    ; filter calibration values
206
SID_ENSx_CALI_FIL2_MIN_H EQU    0x0d    ; filter calibration values
207
SID_ENSx_CALI_FIL2_MAX_L EQU    0x0e    ; filter calibration values
208
SID_ENSx_CALI_FIL2_MAX_H EQU    0x0f    ; filter calibration values
209
 
210
SID_ENSx_I1_BASE    EQU 0x10    ; base address within SID section of instrument 1
211
SID_ENSx_I2_BASE    EQU 0x18    ; base address within SID section of instrument 2
212
SID_ENSx_I3_BASE    EQU 0x20    ; base address within SID section of instrument 3
213
SID_ENSx_I4_BASE    EQU 0x28    ; base address within SID section of instrument 4
214
SID_ENSx_I5_BASE    EQU 0x30    ; base address within SID section of instrument 5
215
SID_ENSx_I6_BASE    EQU 0x38    ; base address within SID section of instrument 6
216
 
217
SID_ENSx_Ix_RECORD_LEN  EQU 0x08
218
 
219
SID_ENSx_Ix_CHN     EQU 0x00    ; [3:0] MIDI channel, [4] disable channel
220
SID_ENSx_Ix_SPLIT_L EQU 0x01    ; lower split point
221
SID_ENSx_Ix_SPLIT_U EQU 0x02    ; upper split point
222
SID_ENSx_Ix_TRN     EQU 0x03    ; transpose
223
SID_ENSx_Ix_RESERVED1   EQU 0x04    ; reserved
224
SID_ENSx_Ix_RESERVED2   EQU 0x05    ; reserved
225
SID_ENSx_Ix_RESERVED3   EQU 0x06    ; reserved
226
SID_ENSx_Ix_RESERVED4   EQU 0x07    ; reserved
227
 
228
;; ==========================================================================
229
 
230
;; global ENS settings - reserved RAM area: 0x0c0-0x0cf (0x10 bytes)
231
;; preloaded from environment
232
 
233
SID_LOCAL_ENS       EQU 0x0c0;..0x0cf
234
;; offsets identical with SID_ENSx_* from 0x00-0x0f
235
 
236
;; ==========================================================================
237
 
238
BM_ROW0_VALUES      EQU 0x0d0   ; used for button matrix - current values
239
BM_ROW1_VALUES      EQU 0x0d1
240
BM_ROW2_VALUES      EQU 0x0d2
241
BM_ROW3_VALUES      EQU 0x0d3
242
BM_ROW4_VALUES      EQU 0x0d4
243
BM_ROW5_VALUES      EQU 0x0d5
244
BM_ROW6_VALUES      EQU 0x0d6
245
BM_ROW7_VALUES      EQU 0x0d7
246
 
247
BM_ROW0_CHANGED     EQU 0x0d8   ; used for button matrix - change flags
248
BM_ROW1_CHANGED     EQU 0x0d9
249
BM_ROW2_CHANGED     EQU 0x0da
250
BM_ROW3_CHANGED     EQU 0x0db
251
BM_ROW4_CHANGED     EQU 0x0dc
252
BM_ROW5_CHANGED     EQU 0x0dd
253
BM_ROW6_CHANGED     EQU 0x0de
254
BM_ROW7_CHANGED     EQU 0x0df
255
 
256
LM_ROW0_VALUES      EQU 0x0e0   ; used for LED matrix - current values
257
LM_ROW1_VALUES      EQU 0x0e1
258
LM_ROW2_VALUES      EQU 0x0e2
259
LM_ROW3_VALUES      EQU 0x0e3
260
LM_ROW4_VALUES      EQU 0x0e4
261
LM_ROW5_VALUES      EQU 0x0e5
262
LM_ROW6_VALUES      EQU 0x0e6
263
LM_ROW7_VALUES      EQU 0x0e7
264
 
265
;; ==========================================================================
266
 
267
    ;; alternative view of mod matrix: meters
268
METER_VALUES0       EQU 0x0e8
269
METER_VALUES1       EQU 0x0e9
270
METER_VALUES2       EQU 0x0ea
271
METER_VALUES3       EQU 0x0eb
272
METER_VALUES4       EQU 0x0ec
273
METER_VALUES5       EQU 0x0ed
274
METER_VALUES6       EQU 0x0ee
275
METER_VALUES7       EQU 0x0ef
276
 
277
;; ==========================================================================
278
    ;; SID player (some variables could be shared - SID player works exclusively)
279
 
280
SIDPLAY_STATE       EQU 0x0f0   ; used by sidplay.inc: the SysEx state
281
SIDPLAY_CMD     EQU 0x0f1   ; used by sidplay.inc: the SysEx command
282
SIDPLAY_DATA_CTR    EQU 0x0f2   ; used by sidplay.inc: the SysEx Data counter
283
SIDPLAY_REG_CTR     EQU 0x0f3   ; used by sidplay.inc: the SID register counter
284
SIDPLAY_BUFFER      EQU 0x0f4   ; used by sidplay.inc: the mask/msb buffer (8 bytes)
285
SIDPLAY_BUFFER_END  EQU 0x0fb
286
 
287
;; ==========================================================================
288
 
289
;; used by superpoly mode in sid_midi_l.inc
290
SID_SUPERPOLY_VOICE_NOTE_TAB EQU 0x0fc  ;  4 bytes used
291
 
292
;; ==========================================================================
293
;;  a lot of SID control variables in BANKED page
294
;; ==========================================================================
295
SID_BASE        EQU 0x100       ; address space of registers which are directly accessed via BANKED
296
SIDSE_CLEAR_BEGIN   EQU 0x100       ; used to initialize the whole SIDSE memory
297
SIDSE_CLEAR_128B_BLOCKS EQU 5       ; number of 128 byte blocks which should be cleared (here: 2 = 0x100..0x37f)
298
 
299
;; ==========================================================================
300
SID_CURRENT_MIDIVOICE   EQU 0x100   ; selects the currently handled MIDI voice
301
SID_CURRENT_VOICE   EQU 0x101   ; selects the currently handled SID voice
302
SID_CURRENT_VOICE_ASSG  EQU 0x102   ; contains the current voice assignment [2:0] and the number of voices [6:4]
303
SID_CURRENT_CHANNEL EQU 0x103   ; used in sid_midi.inc
304
SID_MIDI_PARAMETER1 EQU 0x104   ; used in sid_midi.inc
305
SID_MIDI_PARAMETER2 EQU 0x105   ; used in sid_midi.inc
306
SID_MIDI_FLAGS      EQU 0x106   ; used in sid_midi.inc
307
SID_MIDIVOICE_SUSTAIN   EQU 0x107   ; used in sid_midi.inc - each voice has a sustain flag, which is controlled via CC#64
308
SID_PAR_IX      EQU 0x108   ; parameter index
309
 
310
;; ==========================================================================
311
SID_KNOB_NUM        EQU 0x109   ; temporary used in sid_knob.inc
312
SID_KNOB_VALUE_L    EQU 0x10a   ; temporary used in sid_knob.inc
313
SID_KNOB_VALUE_H    EQU 0x10b   ; temporary used in sid_knob.inc
314
 
315
;; ==========================================================================
316
SID_RANDOM_SEED_L   EQU 0x10c   ; used in sid_rnd.inc
317
SID_RANDOM_SEED_H   EQU 0x10d   ; used in sid_rnd.inc
318
 
319
;; ==========================================================================
320
SID_SYSEX_STATE     EQU 0x10e   ; used by sid_sysex.inc
321
SID_SYSEX_STATE2    EQU 0x10f   ; used by sid_sysex.inc
302 tk 322
SID_SYSEX_IN        EQU 0x110   ; used by sid_sysex.inc
323
SID_SYSEX_CHECKSUM  EQU 0x111   ; used by sid_sysex.inc
324
SID_SYSEX_DATA      EQU 0x112   ; used by sid_sysex.inc
325
SID_SYSEX_ADDRESS_L EQU 0x113   ; used by sid_sysex.inc
326
SID_SYSEX_ADDRESS_H EQU 0x114   ; used by sid_sysex.inc
327
SID_SYSEX_TYPE      EQU 0x115   ; used by sid_sysex.inc
1 tk 328
 
329
;; ==========================================================================
302 tk 330
MUL_A_L         EQU 0x116   ; used by math_mul16_16.inc, should be located in SID_BASE bank
331
MUL_A_H         EQU 0x117   ; note: used by sid_se.inc (interrupt handler)
332
MUL_B_L         EQU 0x118   ; interrupts must be disabled if used in main task
333
MUL_B_H         EQU 0x119
334
MUL_R_0         EQU 0x11a
335
MUL_R_1         EQU 0x11b
336
MUL_R_2         EQU 0x11c
337
MUL_R_3         EQU 0x11d
1 tk 338
 
339
;; ==========================================================================
302 tk 340
SID_SE_STATE        EQU 0x11e   ; used in sid_se*.inc
341
SID_SE_ELEMENT_NUM  EQU 0x11f   ; used in sid_se*.inc
342
SID_SE_INS_EXCLUSIVE    EQU 0x120   ; used in sid_se*.inc
343
SID_SE_FRQ_L        EQU 0x121   ; used in sid_se*.inc
344
SID_SE_FRQ_H        EQU 0x122   ; used in sid_se*.inc
345
SID_SE_TARGET_FRQ_L EQU 0x123   ; used in sid_se*.inc
346
SID_SE_TARGET_FRQ_H EQU 0x124   ; used in sid_se*.inc
347
SID_SE_TRANSPOSED_NOTE  EQU 0x125   ; used in sid_se*.inc
348
SID_SE_MOD_TRANSITION   EQU 0x126   ; used in sid_se*.inc
349
SID_SE_MOD_SRC1_L   EQU 0x127   ; used in sid_se*.inc
350
SID_SE_MOD_SRC1_H   EQU 0x128   ; used in sid_se*.inc
351
SID_SE_MOD_SRC2_L   EQU 0x129   ; used in sid_se*.inc
352
SID_SE_MOD_SRC2_H   EQU 0x12a   ; used in sid_se*.inc
353
SID_SE_MOD_RES1_L   EQU 0x12b   ; used in sid_se*.inc
354
SID_SE_MOD_RES1_H   EQU 0x12c   ; used in sid_se*.inc
355
SID_SE_MOD_RES1_U   EQU 0x12d   ; used in sid_se*.inc
356
SID_SE_MOD_RES2_L   EQU 0x12e   ; used in sid_se*.inc
357
SID_SE_MOD_RES2_H   EQU 0x12f   ; used in sid_se*.inc
358
SID_SE_MOD_RES2_U   EQU 0x130   ; used in sid_se*.inc
359
SID_SE_LFO_OVERRUN  EQU 0x131   ; used in sid_se*.inc
360
SID_SE_GLOBAL_CLK_CTR   EQU 0x132   ; used in sid_se*.inc
361
SID_SE_TRG_EVNT_L   EQU 0x133   ; used in sid_se*.inc
362
SID_SE_TRG_EVNT_H   EQU 0x134   ; used in sid_se*.inc
363
SID_SE_TRG_EVNT_U   EQU 0x135   ; used in sid_se*.inc
1 tk 364
SID_SE_TRG_EVNT_ENVA    EQU 0x136   ; used in sid_se_m.inc
365
SID_SE_TRG_EVNT_ENVR    EQU 0x137   ; used in sid_se_m.inc
302 tk 366
SID_SE_PHASE_SYNC_REQ   EQU 0x138   ; used in sid_se*.inc and sid_sr.inc
367
SID_SE_SR_UPDATE_SYNC   EQU 0x139   ; used in sid_se*.inc and sid_sr.inc
368
SID_SE_EXT_ALLOCATED    EQU 0x13a   ; used in sid_se*.inc
1 tk 369
 
370
;; ==========================================================================
371
SID_CLK_REQ_CTR     EQU 0x13b   ; used by MIDI clock handler to quadruple clock
372
SID_INCOMING_CLK_DELAY  EQU 0x13c   ;
373
SID_INCOMING_CLK_CTR    EQU 0x13d   ;
374
SID_SENT_CLK_DELAY  EQU 0x13e   ;
375
SID_SENT_CLK_CTR    EQU 0x13f   ;
376
 
377
;; ==========================================================================
378
;;  Modulation Sources
379
;; ==========================================================================
380
SID_MOD_SRC_NUM     EQU 30
381
SID_MOD_SRC_BASE    EQU 0x140
382
 
383
;; lead engine
384
SID_MOD_SRC_L_ENV1_L    EQU 0x140
385
SID_MOD_SRC_L_ENV1_H    EQU 0x141
386
SID_MOD_SRC_L_ENV2_L    EQU 0x142
387
SID_MOD_SRC_L_ENV2_H    EQU 0x143
388
SID_MOD_SRC_L_LFO1_L    EQU 0x144
389
SID_MOD_SRC_L_LFO1_H    EQU 0x145
390
SID_MOD_SRC_L_LFO2_L    EQU 0x146
391
SID_MOD_SRC_L_LFO2_H    EQU 0x147
392
SID_MOD_SRC_L_LFO3_L    EQU 0x148
393
SID_MOD_SRC_L_LFO3_H    EQU 0x149
394
SID_MOD_SRC_L_LFO4_L    EQU 0x14a
395
SID_MOD_SRC_L_LFO4_H    EQU 0x14b
396
SID_MOD_SRC_L_LFO5_L    EQU 0x14c
397
SID_MOD_SRC_L_LFO5_H    EQU 0x14d
398
SID_MOD_SRC_L_LFO6_L    EQU 0x14e
399
SID_MOD_SRC_L_LFO6_H    EQU 0x14f
400
SID_MOD_SRC_L_MOD1_L    EQU 0x150
401
SID_MOD_SRC_L_MOD1_H    EQU 0x151
402
SID_MOD_SRC_L_MOD2_L    EQU 0x152
403
SID_MOD_SRC_L_MOD2_H    EQU 0x153
404
SID_MOD_SRC_L_MOD3_L    EQU 0x154
405
SID_MOD_SRC_L_MOD3_H    EQU 0x155
406
SID_MOD_SRC_L_MOD4_L    EQU 0x156
407
SID_MOD_SRC_L_MOD4_H    EQU 0x157
408
SID_MOD_SRC_L_MOD5_L    EQU 0x158
409
SID_MOD_SRC_L_MOD5_H    EQU 0x159
410
SID_MOD_SRC_L_MOD6_L    EQU 0x15a
411
SID_MOD_SRC_L_MOD6_H    EQU 0x15b
412
SID_MOD_SRC_L_MOD7_L    EQU 0x15c
413
SID_MOD_SRC_L_MOD7_H    EQU 0x15d
414
SID_MOD_SRC_L_MOD8_L    EQU 0x15e
415
SID_MOD_SRC_L_MOD8_H    EQU 0x15f
416
SID_MOD_SRC_L_MDW_L EQU 0x160
417
SID_MOD_SRC_L_MDW_H EQU 0x161
418
SID_MOD_SRC_L_KEY_L EQU 0x162
419
SID_MOD_SRC_L_KEY_H EQU 0x163
420
SID_MOD_SRC_L_KNOB1_L   EQU 0x164
421
SID_MOD_SRC_L_KNOB1_H   EQU 0x165
422
SID_MOD_SRC_L_KNOB2_L   EQU 0x166
423
SID_MOD_SRC_L_KNOB2_H   EQU 0x167
424
SID_MOD_SRC_L_KNOB3_L   EQU 0x168
425
SID_MOD_SRC_L_KNOB3_H   EQU 0x169
426
SID_MOD_SRC_L_KNOB4_L   EQU 0x16a
427
SID_MOD_SRC_L_KNOB4_H   EQU 0x16b
428
SID_MOD_SRC_L_KNOB5_L   EQU 0x16c
429
SID_MOD_SRC_L_KNOB5_H   EQU 0x16d
430
SID_MOD_SRC_L_VEL_L EQU 0x16e
431
SID_MOD_SRC_L_VEL_H EQU 0x16f
432
SID_MOD_SRC_L_PBN_L EQU 0x170
433
SID_MOD_SRC_L_PBN_H EQU 0x171
434
SID_MOD_SRC_L_ATH_L EQU 0x172
435
SID_MOD_SRC_L_ATH_H EQU 0x173
436
SID_MOD_SRC_L_WT1_L EQU 0x174
437
SID_MOD_SRC_L_WT1_H EQU 0x175
438
SID_MOD_SRC_L_WT2_L EQU 0x176
439
SID_MOD_SRC_L_WT2_H EQU 0x177
440
SID_MOD_SRC_L_WT3_L EQU 0x178
441
SID_MOD_SRC_L_WT3_H EQU 0x179
442
SID_MOD_SRC_L_WT4_L EQU 0x17a
443
SID_MOD_SRC_L_WT4_H EQU 0x17b
444
 
445
 
446
 
447
;; ==========================================================================
448
;;  Modulation Targets
449
;; ==========================================================================
450
SID_MOD_TARG_NUM    EQU 40
451
SID_MOD_TARG_BASE   EQU 0x180
452
SID_MOD_TARG_PITCH1_L   EQU 0x180
453
SID_MOD_TARG_PITCH1_H   EQU 0x181
454
SID_MOD_TARG_PITCH1_U   EQU 0x182
455
SID_MOD_TARG_PITCH2_L   EQU 0x183
456
SID_MOD_TARG_PITCH2_H   EQU 0x184
457
SID_MOD_TARG_PITCH2_U   EQU 0x185
458
SID_MOD_TARG_PITCH3_L   EQU 0x186
459
SID_MOD_TARG_PITCH3_H   EQU 0x187
460
SID_MOD_TARG_PITCH3_U   EQU 0x188
461
SID_MOD_TARG_PITCH4_L   EQU 0x189
462
SID_MOD_TARG_PITCH4_H   EQU 0x18a
463
SID_MOD_TARG_PITCH4_U   EQU 0x18b
464
SID_MOD_TARG_PITCH5_L   EQU 0x18c
465
SID_MOD_TARG_PITCH5_H   EQU 0x18d
466
SID_MOD_TARG_PITCH5_U   EQU 0x18e
467
SID_MOD_TARG_PITCH6_L   EQU 0x18f
468
SID_MOD_TARG_PITCH6_H   EQU 0x190
469
SID_MOD_TARG_PITCH6_U   EQU 0x191
470
SID_MOD_TARG_PW1_L  EQU 0x192
471
SID_MOD_TARG_PW1_H  EQU 0x193
472
SID_MOD_TARG_PW1_U  EQU 0x194
473
SID_MOD_TARG_PW2_L  EQU 0x195
474
SID_MOD_TARG_PW2_H  EQU 0x196
475
SID_MOD_TARG_PW2_U  EQU 0x197
476
SID_MOD_TARG_PW3_L  EQU 0x198
477
SID_MOD_TARG_PW3_H  EQU 0x199
478
SID_MOD_TARG_PW3_U  EQU 0x19a
479
SID_MOD_TARG_PW4_L  EQU 0x19b
480
SID_MOD_TARG_PW4_H  EQU 0x19c
481
SID_MOD_TARG_PW4_U  EQU 0x19d
482
SID_MOD_TARG_PW5_L  EQU 0x19e
483
SID_MOD_TARG_PW5_H  EQU 0x19f
484
SID_MOD_TARG_PW5_U  EQU 0x1a0
485
SID_MOD_TARG_PW6_L  EQU 0x1a1
486
SID_MOD_TARG_PW6_H  EQU 0x1a2
487
SID_MOD_TARG_PW6_U  EQU 0x1a3
488
SID_MOD_TARG_FIL1_L EQU 0x1a4
489
SID_MOD_TARG_FIL1_H EQU 0x1a5
490
SID_MOD_TARG_FIL1_U EQU 0x1a6
491
SID_MOD_TARG_FIL2_L EQU 0x1a7
492
SID_MOD_TARG_FIL2_H EQU 0x1a8
493
SID_MOD_TARG_FIL2_U EQU 0x1a9
494
SID_MOD_TARG_VOL1_L EQU 0x1aa
495
SID_MOD_TARG_VOL1_H EQU 0x1ab
496
SID_MOD_TARG_VOL1_U EQU 0x1ac
497
SID_MOD_TARG_VOL2_L EQU 0x1ad
498
SID_MOD_TARG_VOL2_H EQU 0x1ae
499
SID_MOD_TARG_VOL2_U EQU 0x1af
500
SID_MOD_TARG_LD1_L  EQU 0x1b0
501
SID_MOD_TARG_LD1_H  EQU 0x1b1
502
SID_MOD_TARG_LD1_U  EQU 0x1b2
503
SID_MOD_TARG_LD2_L  EQU 0x1b3
504
SID_MOD_TARG_LD2_H  EQU 0x1b4
505
SID_MOD_TARG_LD2_U  EQU 0x1b5
506
SID_MOD_TARG_LD3_L  EQU 0x1b6
507
SID_MOD_TARG_LD3_H  EQU 0x1b7
508
SID_MOD_TARG_LD3_U  EQU 0x1b8
509
SID_MOD_TARG_LD4_L  EQU 0x1b9
510
SID_MOD_TARG_LD4_H  EQU 0x1ba
511
SID_MOD_TARG_LD4_U  EQU 0x1bb
512
SID_MOD_TARG_LD5_L  EQU 0x1bc
513
SID_MOD_TARG_LD5_H  EQU 0x1bd
514
SID_MOD_TARG_LD5_U  EQU 0x1be
515
SID_MOD_TARG_LD6_L  EQU 0x1bf
516
SID_MOD_TARG_LD6_H  EQU 0x1c0
517
SID_MOD_TARG_LD6_U  EQU 0x1c1
518
SID_MOD_TARG_LR1_L  EQU 0x1c2
519
SID_MOD_TARG_LR1_H  EQU 0x1c3
520
SID_MOD_TARG_LR1_U  EQU 0x1c4
521
SID_MOD_TARG_LR2_L  EQU 0x1c5
522
SID_MOD_TARG_LR2_H  EQU 0x1c6
523
SID_MOD_TARG_LR2_U  EQU 0x1c7
524
SID_MOD_TARG_LR3_L  EQU 0x1c8
525
SID_MOD_TARG_LR3_H  EQU 0x1c9
526
SID_MOD_TARG_LR3_U  EQU 0x1ca
527
SID_MOD_TARG_LR4_L  EQU 0x1cb
528
SID_MOD_TARG_LR4_H  EQU 0x1cc
529
SID_MOD_TARG_LR4_U  EQU 0x1cd
530
SID_MOD_TARG_LR5_L  EQU 0x1ce
531
SID_MOD_TARG_LR5_H  EQU 0x1cf
532
SID_MOD_TARG_LR5_U  EQU 0x1d0
533
SID_MOD_TARG_LR6_L  EQU 0x1d1
534
SID_MOD_TARG_LR6_H  EQU 0x1d2
535
SID_MOD_TARG_LR6_U  EQU 0x1d3
536
SID_MOD_TARG_EXT1_L EQU 0x1d4
537
SID_MOD_TARG_EXT1_H EQU 0x1d5
538
SID_MOD_TARG_EXT1_U EQU 0x1d6
539
SID_MOD_TARG_EXT2_L EQU 0x1d7
540
SID_MOD_TARG_EXT2_H EQU 0x1d8
541
SID_MOD_TARG_EXT2_U EQU 0x1d9
542
SID_MOD_TARG_EXT3_L EQU 0x1da
543
SID_MOD_TARG_EXT3_H EQU 0x1db
544
SID_MOD_TARG_EXT3_U EQU 0x1dc
545
SID_MOD_TARG_EXT4_L EQU 0x1dd
546
SID_MOD_TARG_EXT4_H EQU 0x1de
547
SID_MOD_TARG_EXT4_U EQU 0x1df
548
SID_MOD_TARG_EXT5_L EQU 0x1e0
549
SID_MOD_TARG_EXT5_H EQU 0x1e1
550
SID_MOD_TARG_EXT5_U EQU 0x1e2
551
SID_MOD_TARG_EXT6_L EQU 0x1e3
552
SID_MOD_TARG_EXT6_H EQU 0x1e4
553
SID_MOD_TARG_EXT6_U EQU 0x1e5
554
SID_MOD_TARG_EXT7_L EQU 0x1e6
555
SID_MOD_TARG_EXT7_H EQU 0x1e7
556
SID_MOD_TARG_EXT7_U EQU 0x1e8
557
SID_MOD_TARG_EXT8_L EQU 0x1e9
558
SID_MOD_TARG_EXT8_H EQU 0x1ea
559
SID_MOD_TARG_EXT8_U EQU 0x1eb
560
SID_MOD_TARG_WT1_L  EQU 0x1ec
561
SID_MOD_TARG_WT1_H  EQU 0x1ed
562
SID_MOD_TARG_WT1_U  EQU 0x1ee
563
SID_MOD_TARG_WT2_L  EQU 0x1ef
564
SID_MOD_TARG_WT2_H  EQU 0x1f0
565
SID_MOD_TARG_WT2_U  EQU 0x1f1
566
SID_MOD_TARG_WT3_L  EQU 0x1f2
567
SID_MOD_TARG_WT3_H  EQU 0x1f3
568
SID_MOD_TARG_WT3_U  EQU 0x1f4
569
SID_MOD_TARG_WT4_L  EQU 0x1f5
570
SID_MOD_TARG_WT4_H  EQU 0x1f6
571
SID_MOD_TARG_WT4_U  EQU 0x1f7
572
 
573
;; define memory area which should be cleared before calculating new results
574
SID_MOD_TARG_CLEAR_BEGIN EQU    SID_MOD_TARG_BASE
575
SID_MOD_TARG_CLEAR_END   EQU    0x1ff
576
 
577
;; ==========================================================================
578
;;  Voice records
579
;; ==========================================================================
580
SID_Vx_NUM      EQU 6
581
SID_Vx_RECORD_LEN   EQU 0x18
582
 
583
SID_Vx_ASSIGNED_MV  EQU 0x00
584
SID_Vx_STATE        EQU 0x01
248 tk 585
SID_Vx_STATE2       EQU 0x02
586
SID_Vx_NOTE     EQU 0x03
587
SID_Vx_ARP_NOTE     EQU 0x04
588
SID_Vx_PLAYED_NOTE  EQU 0x05
589
SID_Vx_TRANSP_NOTE  EQU 0x06
590
SID_Vx_OLD_TRANSP_NOTE  EQU 0x07
591
SID_Vx_PITCHBENDER  EQU 0x08
592
SID_Vx_TARGET_FRQ_L EQU 0x09
593
SID_Vx_TARGET_FRQ_H EQU 0x0a
594
SID_Vx_OLD_TARGET_FRQ_L EQU 0x0b
595
SID_Vx_OLD_TARGET_FRQ_H EQU 0x0c
596
SID_Vx_PORTA_FRQ_L  EQU 0x0d
597
SID_Vx_PORTA_FRQ_H  EQU 0x0e
598
SID_Vx_PORTA_CTR_L  EQU 0x0f
599
SID_Vx_PORTA_CTR_H  EQU 0x10
600
SID_Vx_SET_DELAY_CTR_L  EQU 0x11
601
SID_Vx_SET_DELAY_CTR_H  EQU 0x12
602
SID_Vx_CLR_DELAY_CTR_L  EQU 0x13
603
SID_Vx_CLR_DELAY_CTR_H  EQU 0x14
604
    ;; free offsets: 0x15-0x17 (take care: 0x14 temporary allocated by SID_Vx_D_MODEL_PAR3)
1 tk 605
 
606
    ;; drum engine uses some of these registers on a different way
607
SID_Vx_DRUM     EQU SID_Vx_NOTE     ; drum number
608
SID_Vx_D_MODEL_TBLPTRL  EQU SID_Vx_PORTA_FRQ_L  ; pointer to drum model (-> sid_dmodel.inc)
609
SID_Vx_D_MODEL_TBLPTRH  EQU SID_Vx_PORTA_FRQ_H
610
SID_Vx_D_MODEL_TYPE EQU SID_Vx_PORTA_CTR_L
611
SID_Vx_D_MODEL_BASENOTE EQU SID_Vx_PLAYED_NOTE
612
SID_Vx_D_MODEL_GATELENGTH EQU   SID_Vx_PORTA_CTR_H
613
SID_Vx_D_MODEL_WAVEFORM EQU SID_Vx_OLD_TARGET_FRQ_L
614
SID_Vx_D_MODEL_PULSEWIDTH EQU   SID_Vx_OLD_TARGET_FRQ_H
615
SID_Vx_D_MODEL_WT_SPEED EQU SID_Vx_ARP_NOTE
616
SID_Vx_D_MODEL_WT_END   EQU SID_Vx_TRANSP_NOTE
617
SID_Vx_D_MODEL_WT_LOOP  EQU SID_Vx_OLD_TRANSP_NOTE
248 tk 618
SID_Vx_D_MODEL_PAR3 EQU 0x15; temporary in voice array
1 tk 619
 
620
 
621
SIDL_V1_BASE        EQU 0x200;..0x217
622
SIDL_V2_BASE        EQU 0x218;..0x22f
623
SIDL_V3_BASE        EQU 0x230;..0x247
624
SIDR_V1_BASE        EQU 0x248;..0x25f
625
SIDR_V2_BASE        EQU 0x260;..0x277
626
SIDR_V3_BASE        EQU 0x278;..0x29f
627
 
628
;; ==========================================================================
629
;;  LFO records
630
;; ==========================================================================
631
SID_LFOx_NUM        EQU 12
632
SID_LFOx_RECORD_LEN EQU 4
633
 
634
SID_LFOx_CTR_L      EQU 0x00    ; MUST be located at offset 0
635
SID_LFOx_CTR_H      EQU 0x01    ; MUST be located at offset 1
636
SID_LFOx_DELAY_CTR_L    EQU 0x02
637
SID_LFOx_DELAY_CTR_H    EQU 0x03
638
 
639
SID_LFO1_BASE       EQU 0x2a0;..0x2a3
640
SID_LFO2_BASE       EQU 0x2a4;..0x2a7
641
SID_LFO3_BASE       EQU 0x2a8;..0x2ab
642
SID_LFO4_BASE       EQU 0x2ac;..0x2af
643
SID_LFO5_BASE       EQU 0x2b0;..0x2b3
644
SID_LFO6_BASE       EQU 0x2b4;..0x2b7
645
SID_LFO7_BASE       EQU 0x2b8;..0x2bb
646
SID_LFO8_BASE       EQU 0x2bc;..0x2bf
647
SID_LFO9_BASE       EQU 0x2c0;..0x2c3
648
SID_LFO10_BASE      EQU 0x2c4;..0x2c7
649
SID_LFO11_BASE      EQU 0x2c8;..0x2cb
650
SID_LFO12_BASE      EQU 0x2cc;..0x2cf
651
 
652
;; ==========================================================================
653
;;  Envelope records
654
;; ==========================================================================
655
SID_ENVx_NUM        EQU 6   ; (prepared for multi engine)
656
SID_ENVx_RECORD_LEN EQU 6
657
 
658
SID_ENVx_CTR_L      EQU 0x00    ; MUST be located at offset 0
659
SID_ENVx_CTR_H      EQU 0x01    ; MUST be located at offset 1
660
SID_ENVx_DELAY_CTR_L    EQU 0x02
661
SID_ENVx_DELAY_CTR_H    EQU 0x03
662
SID_ENVx_STATE      EQU 0x04
663
 
664
SID_ENV1_BASE       EQU 0x2d0;..0x2d4
665
SID_ENV2_BASE       EQU 0x2d5;..0x2d9
666
SID_ENV3_BASE       EQU 0x2da;..0x2de
667
SID_ENV4_BASE       EQU 0x2df;..0x2e3
668
SID_ENV5_BASE       EQU 0x2e4;..0x2e8
669
SID_ENV6_BASE       EQU 0x2e9;..0x2ed
670
 
671
;; ==========================================================================
672
;;  Wavetable records
673
;; ==========================================================================
674
SID_WTx_NUM     EQU 6
675
SID_WTx_RECORD_LEN  EQU 2
676
 
677
SID_WTx_POS     EQU 0x00
678
SID_WTx_DIV_CTR     EQU 0x01
679
 
680
SID_WT1_BASE        EQU 0x2ee;..0x2ef
681
SID_WT2_BASE        EQU 0x2f0;..0x2f1
682
SID_WT3_BASE        EQU 0x2f2;..0x2f3
683
SID_WT4_BASE        EQU 0x2f4;..0x2f5
684
SID_WT5_BASE        EQU 0x2f6;..0x2f7
685
SID_WT6_BASE        EQU 0x2f8;..0x2f9
686
 
687
;; ==========================================================================
688
;;  Bassline/Drum Sequencer records
689
;; ==========================================================================
690
SID_SEQx_NUM        EQU 2
691
SID_SEQx_RECORD_LEN EQU 3
692
 
693
SID_SEQx_POS        EQU 0x00
694
SID_SEQx_DIV_CTR    EQU 0x01
695
SID_SEQx_MISC       EQU 0x02    ; [2:0] subctr, [3] SEQ On, [4] sequencer running
696
 
697
SID_SEQ1_BASE       EQU 0x2ea;..0x2fc
698
SID_SEQ2_BASE       EQU 0x2fd;..0x2ff
699
 
700
 
701
;; ==========================================================================
702
;;  SID L/R register file + shadow (used in sid_sr.inc)
703
;; ==========================================================================
704
SIDL_BASE       EQU 0x300;..0x31f
705
SIDL_SHADOW_BASE    EQU 0x320;..0x33f
706
SIDR_BASE       EQU 0x340;..0x35f
707
SIDR_SHADOW_BASE    EQU 0x360;..0x37f
708
 
709
    ;; SID register offsets
710
SIDx_V1_FRQ_L       EQU 0x00
711
SIDx_V1_FRQ_H       EQU 0x01
712
SIDx_V1_PW_L        EQU 0x02
713
SIDx_V1_PW_H        EQU 0x03
714
SIDx_V1_CTRL        EQU 0x04
715
SIDx_V1_ENV_AD      EQU 0x05
716
SIDx_V1_ENV_SR      EQU 0x06
717
 
718
SIDx_V2_FRQ_L       EQU 0x07
719
SIDx_V2_FRQ_H       EQU 0x08
720
SIDx_V2_PW_L        EQU 0x09
721
SIDx_V2_PW_H        EQU 0x0a
722
SIDx_V2_CTRL        EQU 0x0b
723
SIDx_V2_ENV_AD      EQU 0x0c
724
SIDx_V2_ENV_SR      EQU 0x0d
725
 
726
SIDx_V3_FRQ_L       EQU 0x0e
727
SIDx_V3_FRQ_H       EQU 0x0f
728
SIDx_V3_PW_L        EQU 0x10
729
SIDx_V3_PW_H        EQU 0x11
730
SIDx_V3_CTRL        EQU 0x12
731
SIDx_V3_ENV_AD      EQU 0x13
732
SIDx_V3_ENV_SR      EQU 0x14
733
 
734
SIDx_FC_L       EQU 0x15
735
SIDx_FC_H       EQU 0x16
736
SIDx_RES_FCHN       EQU 0x17
737
SIDx_MODE_VOL       EQU 0x18
738
 
739
SIDx_SWINSID_V1_PHASE   EQU 0x1a
740
SIDx_SWINSID_V2_PHASE   EQU 0x1b
741
SIDx_SWINSID_V3_PHASE   EQU 0x1c
742
SIDx_SWINSID_V1_MODE    EQU 0x1d
743
SIDx_SWINSID_V2_MODE    EQU 0x1e
744
SIDx_SWINSID_V3_MODE    EQU 0x1f
745
 
746
 
747
;; ==========================================================================
748
;;  AIN RAM area not used
749
;; ==========================================================================
750
 
751
;; ==========================================================================
752
;;  Sequencer Copy/Paste Buffer
753
;;  (located in AIN RAM area - we have our own AIN handler)
754
;; ==========================================================================
755
CS_COPY_PASTE_BUFFER_BEGIN  EQU 0x380   ; 32 bytes
756
CS_COPY_PASTE_BUFFER_END    EQU 0x39f
757
 
758
;; ==========================================================================
759
;;  NRPN arrays (each MIDI channel has an own entry)
760
;; ==========================================================================
761
NRPN_ADDRESS_LSB        EQU 0x3a0   ; ..0x3af for all 16 channels
762
NRPN_ADDRESS_MSB        EQU 0x3b0   ; ..0x3bf for all 16 channels
763
NRPN_DATA_LSB           EQU 0x3c0   ; ..0x3cf for all 16 channels
764
 
765
;; ==========================================================================
766
;;  Filter Interpolation
767
;; ==========================================================================
768
FIP1_BASE       EQU 0x3d0 ; - 0x3d5
769
FIP2_BASE       EQU 0x3d6 ; - 0x3dd
770
 
771
FIPx_TARGET_VALUE_L EQU 0x00
772
FIPx_TARGET_VALUE_H EQU 0x01
773
FIPx_VALUE_L        EQU 0x02
774
FIPx_VALUE_H        EQU 0x03
775
FIPx_DIV_VALUE_L    EQU 0x04
776
FIPx_DIV_VALUE_H    EQU 0x05
777
 
778
;; ==========================================================================
779
    ;; free: 0x3de-0x3e2
780
 
781
;; ==========================================================================
782
;;  AIN registers
783
;;  (located in AIN RAM area - we have our own AIN handler)
784
;; ==========================================================================
136 tk 785
AIN_INPUT_CTR       EQU 0x3e0
786
AIN_INPUT_CHANGED   EQU 0x3e1
787
AIN_INPUT_CHANGED_TMP   EQU 0x3e2
788
AIN_VALUE_0     EQU 0x3e3
789
AIN_VALUE_1     EQU 0x3e4
790
AIN_VALUE_2     EQU 0x3e5
791
AIN_VALUE_3     EQU 0x3e6
792
AIN_VALUE_4     EQU 0x3e7
793
AIN_VALUE_5     EQU 0x3e8
794
AIN_VALUE_6     EQU 0x3e9
795
AIN_VALUE_7     EQU 0x3ea
1 tk 796
 
797
;; ==========================================================================
136 tk 798
;;  Gate registers
1 tk 799
;;  (located in AIN RAM area - we have our own AIN handler)
800
;; ==========================================================================
136 tk 801
GATES           EQU 0x3eb
802
GATES_LAST      EQU 0x3ec
1 tk 803
 
804
;; ==========================================================================
136 tk 805
;;  AOUT registers (used in $MIOS_PATH/modules/aout.inc)
806
;;  (located in AIN RAM area - we have our own AIN handler)
807
;; ==========================================================================
808
AOUT_INVERTED       EQU 0x3ee
809
AOUT_UPDATE_REQ     EQU 0x3ef
810
AOUT_VALUES     EQU 0x3f0  ; ..0x37f (8 * 16bit words)
811
 
812
;; ==========================================================================
1 tk 813
;;  Patch Record Structure
814
;;  Note: on each byte/bit assignment change, the tables under
815
;;  doc/mbsidv2_sysex_implementation.txt have to be adapted as well!
816
;; ==========================================================================
817
 
818
SID_Ix_NAME_x       EQU 0x000; 0x00-0x0f
819
 
820
;; === general parameters, structure identical for each engine ===
821
SID_Ix_ENGINE       EQU 0x010   ; [1:0] engine (Lead/Bassline/Drum/Multi), [7:2]: reserved
822
SID_Ix_HW_FLAGS     EQU 0x011   ; hardware info flags: [1:0] 0=no SID restriction, 1=6581, 2=6582/8580, 3=SwinSID; [3]: stereo, [7:4] caps: 0=470pF, 1=1nF, 2=2.2nF, 3=4.7nF, 4=6.8nF, 5=10nF, 6=22nF, 7=47nF, 8=100nF
823
SID_Ix_OPT1_FLAGS   EQU 0x012   ; [0] ABW, [7:1] reserved for future engine options
824
SID_Ix_OPT2_FLAGS   EQU 0x013   ; reserved for future engine options
825
 
826
SID_Ix_CUSTOM_SW    EQU 0x014   ; custom switch flags #1-8
827
    ;; free: 0x015-0x17
828
 
829
SID_Ix_Px_ASSIGN1   EQU 0x00    ; Knob Parameter assignment #1
830
SID_Ix_Px_ASSIGN2   EQU 0x01    ; Knob Parameter assignment #2
831
SID_Ix_Px_VALUE     EQU 0x02    ; Knob initial value
832
SID_Ix_Px_MIN       EQU 0x03    ; Knob min value
833
SID_Ix_Px_MAX       EQU 0x04    ; Knob max value
834
SID_Ix_P_K1_BASE    EQU 0x018;-0x1c Knob #1
835
SID_Ix_P_K2_BASE    EQU 0x01d;-0x21 Knob #2
836
SID_Ix_P_K3_BASE    EQU 0x022;-0x26 Knob #3
837
SID_Ix_P_K4_BASE    EQU 0x027;-0x2b Knob #4
838
SID_Ix_P_K5_BASE    EQU 0x02c;-0x30 Knob #5
839
SID_Ix_P_KV_BASE    EQU 0x031;-0x35 Velocity
840
SID_Ix_P_KP_BASE    EQU 0x036;-0x3a Pitch Bender
841
SID_Ix_P_KA_BASE    EQU 0x03b;-0x3f     Aftertouch
842
 
843
SID_Ix_EXT_PAR1_L   EQU 0x040   ; external parameter #1 (e.g. for AOUT)
844
SID_Ix_EXT_PAR1_H   EQU 0x041
845
SID_Ix_EXT_PAR2_L   EQU 0x042   ; external parameter #2
846
SID_Ix_EXT_PAR2_H   EQU 0x043
847
SID_Ix_EXT_PAR3_L   EQU 0x044   ; external parameter #3
848
SID_Ix_EXT_PAR3_H   EQU 0x045
849
SID_Ix_EXT_PAR4_L   EQU 0x046   ; external parameter #4
850
SID_Ix_EXT_PAR4_H   EQU 0x047
851
SID_Ix_EXT_PAR5_L   EQU 0x048   ; external parameter #5
852
SID_Ix_EXT_PAR5_H   EQU 0x049
853
SID_Ix_EXT_PAR6_L   EQU 0x04a   ; external parameter #6
854
SID_Ix_EXT_PAR6_H   EQU 0x04b
855
SID_Ix_EXT_PAR7_L   EQU 0x04c   ; external parameter #7
856
SID_Ix_EXT_PAR7_H   EQU 0x04d
857
SID_Ix_EXT_PAR8_L   EQU 0x04e   ; external parameter #8
858
SID_Ix_EXT_PAR8_H   EQU 0x04f
859
 
860
;; === engine specific parameters ===
861
 
862
;; --- Lead ---
863
 
864
;; general flags
865
SID_Ix_L_FLAGS1     EQU 0x050   ; mono/legato [0], WTO [1], SusKey [2]
866
SID_Ix_L_OSC_DETUNE EQU 0x051   ; detune left/right oscillators
867
SID_Ix_L_VOLUME     EQU 0x052   ; 7 bit value, only 4 bit used
868
SID_Ix_L_OSC_PHASE  EQU 0x053   ; oscillator phase offset
869
 
870
;; filter sections (uses SID_Ix_L_Fx_* offsets)
871
SID_Ix_L_S1F_BASE   EQU 0x054;..0x059
872
SID_Ix_L_S2F_BASE   EQU 0x05a;..0x05f
873
 
874
;; oscillator sections (uses SID_Ix_Vx_* offsets)
875
SID_Ix_L_S1V1_BASE  EQU 0x060;..0x06f    SID1 Voice1
876
SID_Ix_L_S1V2_BASE  EQU 0x070;..0x07f    SID1 Voice2
877
SID_Ix_L_S1V3_BASE  EQU 0x080;..0x08f    SID1 Voice3
878
SID_Ix_L_S2V1_BASE  EQU 0x090;..0x09f    SID2 Voice1
879
SID_Ix_L_S2V2_BASE  EQU 0x0a0;..0x0af    SID2 Voice2
880
SID_Ix_L_S2V3_BASE  EQU 0x0b0;..0x0bf    SID2 Voice3
881
 
882
;; LFO sections (uses SID_Ix_LFOx_* offsets)
883
SID_Ix_L_LFO1_BASE  EQU 0x0c0;..0x0c4    LFO1
884
SID_Ix_L_LFO2_BASE  EQU 0x0c5;..0x0c9    LFO2
885
SID_Ix_L_LFO3_BASE  EQU 0x0ca;..0x0ce    LFO3
886
SID_Ix_L_LFO4_BASE  EQU 0x0cf;..0x0d3    LFO4
887
SID_Ix_L_LFO5_BASE  EQU 0x0d4;..0x0d8    LFO5
888
SID_Ix_L_LFO6_BASE  EQU 0x0d9;..0x0dd    LFO6
889
 
890
;; free: 0xde and 0xdf
891
 
892
;; ENV sections (uses SID_Ix_ENVx_* offsets)
893
SID_Ix_L_ENV1_BASE  EQU 0x0e0;..0x0ef    ENV1
894
SID_Ix_L_ENV2_BASE  EQU 0x0f0;..0x0ff    ENV2
895
 
896
;; MOD sections (uses SID_Ix_MODx_* offsets)
897
SID_Ix_L_MOD1_BASE  EQU 0x100;..0x107   Modulator1
898
SID_Ix_L_MOD2_BASE  EQU 0x108;..0x10f   Modulator2
899
SID_Ix_L_MOD3_BASE  EQU 0x110;..0x117   Modulator3
900
SID_Ix_L_MOD4_BASE  EQU 0x118;..0x11f   Modulator4
901
SID_Ix_L_MOD5_BASE  EQU 0x120;..0x127   Modulator5
902
SID_Ix_L_MOD6_BASE  EQU 0x128;..0x12f   Modulator6
903
SID_Ix_L_MOD7_BASE  EQU 0x130;..0x137   Modulator7
904
SID_Ix_L_MOD8_BASE  EQU 0x138;..0x13f   Modulator8
905
 
906
;; TRG sections
907
SID_Ix_L_TRG_BASE   EQU 0x140;..0x16f
908
SID_Ix_L_TRG_NOn_BASE   EQU 0x140;..0x142   Note On
909
SID_Ix_L_TRG_NOf_BASE   EQU 0x143;..0x145   Note Off
910
SID_Ix_L_TRG_E1S_BASE   EQU 0x146;..0x148   ENV1 Sustain Phase
911
SID_Ix_L_TRG_E2S_BASE   EQU 0x149;..0x14b   ENV2 Sustain Phase
912
SID_Ix_L_TRG_L1P_BASE   EQU 0x14c;..0x14e   LFO1 Period
913
SID_Ix_L_TRG_L2P_BASE   EQU 0x14f;..0x151   LFO2 Period
914
SID_Ix_L_TRG_L3P_BASE   EQU 0x152;..0x154   LFO3 Period
915
SID_Ix_L_TRG_L4P_BASE   EQU 0x155;..0x157   LFO4 Period
916
SID_Ix_L_TRG_L5P_BASE   EQU 0x158;..0x15a   LFO5 Period
917
SID_Ix_L_TRG_L6P_BASE   EQU 0x15b;..0x15d   LFO6 Period
918
SID_Ix_L_TRG_Clk_BASE   EQU 0x15e;..0x160   Clock
248 tk 919
SID_Ix_L_TRG_Cl6_BASE   EQU 0x161;..0x163   Clock/6
920
SID_Ix_L_TRG_C24_BASE   EQU 0x164;..0x166   Clock/24
1 tk 921
SID_Ix_L_TRG_MSt_BASE   EQU 0x167;..0x169   MIDI Clock Start
922
 
923
;; free: 0x6a-0x6b
924
 
925
;; WT sections (uses SID_Ix_WTx_* offsets)
926
SID_Ix_L_WT1_BASE   EQU 0x16c;..0x170
927
SID_Ix_L_WT2_BASE   EQU 0x171;..0x175
928
SID_Ix_L_WT3_BASE   EQU 0x176;..0x17a
929
SID_Ix_L_WT4_BASE   EQU 0x17b;..0x17f
930
 
931
 
932
;; --- offset definitions ---
933
SID_Ix_L_Fx_CHN_MODE    EQU 0x0 ; [2:0] assigned oscillators, [3] Ext. Input, [6:4] filter mode, [7] OSC3 off
934
SID_Ix_L_Fx_CUTOFF_L    EQU 0x1 ; cut-off frequency (12 bit, 11 bit used)
935
SID_Ix_L_Fx_CUTOFF_H    EQU 0x2     ; bit [7] contols FIP (interpolation option)
936
SID_Ix_L_Fx_RESONANCE   EQU 0x3 ; resonance (8bit, 4 bit used)
937
SID_Ix_L_Fx_KEYTRACK    EQU 0x4 ; keytracking
938
SID_Ix_L_Fx_RESERVED2   EQU 0x5 ; reserved for future expansions
939
 
940
SID_Ix_Vx_FLAGS1    EQU 0x00    ; [1:0] portamento (0), constant time glide (1), glissando (2), [2] GAE (gate always enabled)
941
SID_Ix_Vx_WAVEFORM  EQU 0x01    ; [3:0] waveform, [4] voice off, [5] sync, [6] ring, [7] reserved
942
SID_Ix_Vx_AD        EQU 0x02    ; 2*4bit value for attack [7:4] and decay [3:0]
943
SID_Ix_Vx_SR        EQU 0x03    ; 2*4bit value for sustain [7:4] and sustain [3:0]
944
SID_Ix_Vx_PULSEWIDTH_L  EQU 0x04    ; [7:0] low byte
945
SID_Ix_Vx_PULSEWIDTH_H  EQU 0x05    ; [3:0] high nibble, [7:4] reserved
946
SID_Ix_Vx_ACCENT    EQU 0x06    ; not used by lead engine, could be replaced by something else
947
SID_Ix_Vx_SWINSID_PHASE EQU 0x06    ; used by lead engine of SwinSID option enabled
948
SID_Ix_Vx_DELAY     EQU 0x07    ; 8bit
949
SID_Ix_Vx_TRANSPOSE EQU 0x08    ; 7bit
950
SID_Ix_Vx_FINETUNE  EQU 0x09    ; 8bit
951
SID_Ix_Vx_PITCHRANGE    EQU 0x0a    ; 7bit
952
SID_Ix_Vx_PORTAMENTO    EQU 0x0b    ; 8bit
953
SID_Ix_Vx_ARP_MODE  EQU 0x0c    ; [0] enable, [2:1] dir up/down/U&D/D&U, [3] random, [4] sorted, [5] hold, [6] sync, [7] CAC
954
SID_Ix_Vx_ARP_SPEED_DIV EQU 0x0d    ; [7] oneshot, [6] reserved, [5:0] own speed or derived from global clock (dividable)
955
SID_Ix_Vx_ARP_GL_RNG    EQU 0x0e    ; [4:0] gatelength [7:5] arp octave range (seperate for each voice)
956
SID_Ix_Vx_SWINSID_MODE  EQU 0x0f    ; [3:0] waveform of second OSC, [4] enable 2nd OSC, [5] x2 pitch, [6] reverse waveform
957
 
958
SID_Ix_LFOx_MODE    EQU 0x00    ; [0] enable, [2] clksync, [3] oneshot, [7:4] waveform
959
SID_Ix_LFOx_DEPTH   EQU 0x01    ; LFO depth (8 bit instead of 7 like MBSID V1!)
960
SID_Ix_LFOx_RATE    EQU 0x02    ; LFO rate (8 bit instead of 7 like MBSID V1!)
961
SID_Ix_LFOx_DELAY   EQU 0x03    ; LFO depth (8 bit instead of 7 like MBSID V1!)
962
SID_Ix_LFOx_PHASE   EQU 0x04    ; LFO phase
963
 
964
SID_Ix_L_ENVx_MODE  EQU 0x00    ; ENV mode ([2:0] loop begin, [3] reserved, [6:4] loop end, [7] BPM sync)
965
SID_Ix_L_ENVx_DEPTH EQU 0x01    ; 8bit value
966
SID_Ix_L_ENVx_DELAY EQU 0x02    ; 8bit value
967
SID_Ix_L_ENVx_ATTACK1   EQU 0x03    ; 8bit value
968
SID_Ix_L_ENVx_ATTLVL    EQU 0x04    ; 8bit value
969
SID_Ix_L_ENVx_ATTACK2   EQU 0x05    ; 8bit value
970
SID_Ix_L_ENVx_DECAY1    EQU 0x06    ; 8bit value
971
SID_Ix_L_ENVx_DECLVL    EQU 0x07    ; 8bit value
972
SID_Ix_L_ENVx_DECAY2    EQU 0x08    ; 8bit value
973
SID_Ix_L_ENVx_SUSTAIN   EQU 0x09    ; 8bit value
974
SID_Ix_L_ENVx_RELEASE1  EQU 0x0a    ; 8bit value
975
SID_Ix_L_ENVx_RELLVL    EQU 0x0b    ; 8bit value
976
SID_Ix_L_ENVx_RELEASE2  EQU 0x0c    ; 8bit value
977
SID_Ix_L_ENVx_ATT_CURVE EQU 0x0d    ; 8bit value
978
SID_Ix_L_ENVx_DEC_CURVE EQU 0x0e    ; 8bit value
979
SID_Ix_L_ENVx_REL_CURVE EQU 0x0f    ; 8bit value
980
 
981
SID_Ix_MODx_SRC1    EQU 0x00    ; modulation source #1 - LFO, ENV, Analog In, Velocity, Modwheel, Aftertouch, PitchBend, Keynumber, Knob #1-5
982
SID_Ix_MODx_SRC2    EQU 0x01    ; modulation source #2
983
SID_Ix_MODx_OP      EQU 0x02    ; [7] invert target 1/L [6] invert target 2/R [5:4] reserved [3:0] modulation operation (SRC1 only, SRC2 only, SRC1+SRC2, SRC1-SRC2, SRC1*SRC2, XOR, OR, AND, Min, Max)
984
SID_Ix_MODx_DEPTH   EQU 0x03    ; 8bit value (-128..+127)
985
SID_Ix_MODx_TARG_L  EQU 0x04    ; modulation target SIDL [2:0] Pitch Voice 1/2/3, [5:3] PW Voice 1/2/3, [6] Filter, [7] Volume
986
SID_Ix_MODx_TARG_R  EQU 0x05    ; modulation target SIDR [2:0] Pitch Voice 1/2/3, [5:3] PW Voice 1/2/3, [6] Filter, [7] Volume
987
SID_Ix_MODx_TARG_X1 EQU 0x06    ; additional selectable target #1
988
SID_Ix_MODx_TARG_X2 EQU 0x07    ; additional selectable target #2
989
 
990
SID_Ix_WTx_SPEED    EQU 0x00    ; [5:0] clock divider, [6] channel target SIDL, [7] channel target SIDR
991
SID_Ix_WTx_ASSGN    EQU 0x01    ; parameter assignment
992
SID_Ix_WTx_BEGIN    EQU 0x02    ; [6:0] start position in wavetable, [7] position controlled by MOD
993
SID_Ix_WTx_END      EQU 0x03    ; [6:0] end position in wavetable
994
SID_Ix_WTx_LOOP     EQU 0x04    ; [6:0] loop position in wavetable, [7] one shot
995
 
996
SID_Ix_WAVETABLE    EQU 0x180;..0x1ff
997
 
998
;; --------------------------------------------------------------------------
999
 
1000
;; --- Multi ---
1001
 
1002
;; general flags
1003
SID_Ix_M_FLAGS1     EQU 0x050   ; not used - FLAGS1 is available for each instrument seperately (SID_Ix_M_Vx_FLAGS1)
1004
    ;; free: 0x51
1005
SID_Ix_M_VOLUME     EQU 0x052   ; 7 bit value, only 4 bit used
1006
    ;; free: 0x53
1007
 
1008
SID_Ix_M_S1F_BASE   EQU 0x054;..0x059
1009
SID_Ix_M_S2F_BASE   EQU 0x05a;..0x05f
1010
 
1011
SID_Ix_M_I1_BASE    EQU 0x060;..0x08f    Multi Instrument #1
1012
SID_Ix_M_I2_BASE    EQU 0x090;..0x0bf    Multi Instrument #2
1013
SID_Ix_M_I3_BASE    EQU 0x0c0;..0x0ef    Multi Instrument #3
1014
SID_Ix_M_I4_BASE    EQU 0x0f0;..0x11f    Multi Instrument #4
1015
SID_Ix_M_I5_BASE    EQU 0x120;..0x14f    Multi Instrument #5
1016
SID_Ix_M_I6_BASE    EQU 0x150;..0x17f    Multi Instrument #6
1017
 
1018
;; enhancement of SID_Ix_Vx_* structure (re-used from lead engine)
1019
SID_Ix_M_Vx_FLAGS2  EQU 0x10    ; mono/legato [0], WTO [1], SusKey [2], Poly [3]
1020
SID_Ix_M_Vx_VOICE_ASSGN EQU 0x11    ; [3:0] voice assignment, [7:4] reserved
1021
SID_Ix_M_Vx_VELOCITY_ASSGN EQU  0x12    ; velocity assignment
1022
SID_Ix_M_Vx_PITCHBENDER_ASSGN EQU 0x13  ; pitchbender assignment
1023
 
1024
SID_Ix_M_Vx_LFO1_MODE   EQU 0x14    ; same as SID_Ix_LFOx_MODE
1025
SID_Ix_M_Vx_LFO1_DEPTH_P EQU    0x15    ; 8bit, depth of pitch modulation
1026
SID_Ix_M_Vx_LFO1_RATE   EQU 0x16    ; same as SID_Ix_LFOx_RATE
1027
SID_Ix_M_Vx_LFO1_DELAY  EQU 0x17    ; same as SID_Ix_LFOx_DELAY
1028
SID_Ix_M_Vx_LFO1_PHASE  EQU 0x18    ; same as SID_Ix_LFOx_PHASE
1029
SID_Ix_M_Vx_LFO1_DEPTH_PW EQU   0x19    ; 8bit, depth of pulsewidth modulation
1030
SID_Ix_M_Vx_LFO1_DEPTH_F EQU    0x1a    ; 8bit, depth of cutoff modulation
1031
SID_Ix_M_Vx_LFO2_MODE   EQU 0x1b    ; same as SID_Ix_LFOx_MODE
1032
SID_Ix_M_Vx_LFO2_DEPTH_P EQU    0x1c    ; 8bit, depth of pitch modulation
1033
SID_Ix_M_Vx_LFO2_RATE   EQU 0x1d    ; same as SID_Ix_LFOx_RATE
1034
SID_Ix_M_Vx_LFO2_DELAY  EQU 0x1e    ; same as SID_Ix_LFOx_DELAY
1035
SID_Ix_M_Vx_LFO2_PHASE  EQU 0x1f    ; same as SID_Ix_LFOx_PHASE
1036
SID_Ix_M_Vx_LFO2_DEPTH_PW EQU   0x20    ; 8bit, depth of pulsewidth modulation
1037
SID_Ix_M_Vx_LFO2_DEPTH_F EQU    0x21    ; 8bit, depth of cutoff modulation
1038
 
1039
SID_Ix_M_Vx_ENV_MODE    EQU 0x22    ; same as SID_Ix_ENVx_MODE, but [6:4] control the curve assignments
1040
SID_Ix_M_Vx_ENV_DEPTH_P EQU 0x23    ; 8bit, depth of pitch modulation
1041
SID_Ix_M_Vx_ENV_DEPTH_PW EQU    0x24    ; 8bit, depth of pulsewidth modulation
1042
SID_Ix_M_Vx_ENV_DEPTH_F EQU 0x25    ; 8bit, depth of cutoff modulation
1043
SID_Ix_M_Vx_ENV_ATTACK  EQU 0x26    ; same as SID_Ix_ENVx_ATTACK1
1044
SID_Ix_M_Vx_ENV_DECAY   EQU 0x27    ; same as SID_Ix_ENVx_DECAY2
1045
SID_Ix_M_Vx_ENV_SUSTAIN EQU 0x28    ; same as SID_Ix_ENVx_SUSTAIN
1046
SID_Ix_M_Vx_ENV_RELEASE EQU 0x29    ; same as SID_Ix_ENVx_RELEASE
1047
SID_Ix_M_Vx_ENV_CURVE EQU   0x2a    ; 8bit value, assignments in SID_Ix_ENVx_MODE[6:4]
1048
 
1049
SID_Ix_M_Vx_WT_SPEED    EQU 0x2b    ; same as SID_Ix_WTx_SPEED
1050
SID_Ix_M_Vx_WT_ASSGN    EQU 0x2c    ; same as SID_Ix_WTx_ASSGN
1051
SID_Ix_M_Vx_WT_BEGIN    EQU 0x2d    ; same as SID_Ix_WTx_BEGIN
1052
SID_Ix_M_Vx_WT_END  EQU 0x2e    ; same as SID_Ix_WTx_END
1053
SID_Ix_M_Vx_WT_LOOP EQU 0x2f    ; same as SID_Ix_WTx_LOOP
1054
 
1055
;; --------------------------------------------------------------------------
1056
 
1057
;; --- Bassline ---
1058
 
1059
;; general flags
1060
SID_Ix_B_FLAGS1     EQU 0x050   ; not used - FLAGS1 is available for each instrument seperately (SID_Ix_B_Vx_FLAGS1)
1061
    ;; free: 0x51
1062
SID_Ix_B_VOLUME     EQU 0x052   ; 7 bit value, only 4 bit used
1063
    ;; free: 0x53
1064
 
1065
SID_Ix_B_S1F_BASE   EQU 0x054;..0x059
1066
SID_Ix_B_S2F_BASE   EQU 0x05a;..0x05f
1067
 
1068
SID_Ix_B_S1V1_BASE  EQU 0x060;..0x0af    SID1 Voice1
1069
SID_Ix_B_S2V1_BASE  EQU 0x0b0;..0x0ff    SID2 Voice1
1070
 
1071
;; enhancement of SID_Ix_Vx_* structure (re-used from lead engine)
1072
SID_Ix_B_Vx_RESERVED1   EQU 0x2c
1073
SID_Ix_B_Vx_RESERVED2   EQU 0x2d
1074
SID_Ix_B_Vx_RESERVED3   EQU 0x2e
1075
SID_Ix_B_Vx_RESERVED4   EQU 0x2f
1076
 
1077
SID_Ix_B_Vx_FLAGS2  EQU 0x10    ; mono/legato [0], WTO [1], SusKey [2], OSC Phase Sync [3]
1078
;; 0x11..0x13 not used (dedicated voice/PB/vel assignments)
1079
 
1080
SID_Ix_B_Vx_LFO1_MODE   EQU 0x14    ; same as SID_Ix_LFOx_MODE
1081
SID_Ix_B_Vx_LFO1_DEPTH_P EQU    0x15    ; 8bit, depth of pitch modulation
1082
SID_Ix_B_Vx_LFO1_RATE   EQU 0x16    ; same as SID_Ix_LFOx_RATE
1083
SID_Ix_B_Vx_LFO1_DELAY  EQU 0x17    ; same as SID_Ix_LFOx_DELAY
1084
SID_Ix_B_Vx_LFO1_PHASE  EQU 0x18    ; same as SID_Ix_LFOx_PHASE
1085
SID_Ix_B_Vx_LFO1_DEPTH_PW EQU   0x19    ; 8bit, depth of pulsewidth modulation
1086
SID_Ix_B_Vx_LFO1_DEPTH_F EQU    0x1a    ; 8bit, depth of cutoff modulation
1087
SID_Ix_B_Vx_LFO2_MODE   EQU 0x1b    ; same as SID_Ix_LFOx_MODE
1088
SID_Ix_B_Vx_LFO2_DEPTH_P EQU    0x1c    ; 8bit, depth of pitch modulation
1089
SID_Ix_B_Vx_LFO2_RATE   EQU 0x1d    ; same as SID_Ix_LFOx_RATE
1090
SID_Ix_B_Vx_LFO2_DELAY  EQU 0x1e    ; same as SID_Ix_LFOx_DELAY
1091
SID_Ix_B_Vx_LFO2_PHASE  EQU 0x1f    ; same as SID_Ix_LFOx_PHASE
1092
SID_Ix_B_Vx_LFO2_DEPTH_PW EQU   0x20    ; 8bit, depth of pulsewidth modulation
1093
SID_Ix_B_Vx_LFO2_DEPTH_F EQU    0x21    ; 8bit, depth of cutoff modulation
1094
 
1095
SID_Ix_B_Vx_ENV_MODE    EQU 0x22    ; same as SID_Ix_ENVx_MODE, but [6:4] control the curve assignments
1096
SID_Ix_B_Vx_ENV_DEPTH_P EQU 0x23    ; 8bit, depth of pitch modulation
1097
SID_Ix_B_Vx_ENV_DEPTH_PW EQU    0x24    ; 8bit, depth of pulsewidth modulation
1098
SID_Ix_B_Vx_ENV_DEPTH_F EQU 0x25    ; 8bit, depth of cutoff modulation
1099
SID_Ix_B_Vx_ENV_ATTACK  EQU 0x26    ; same as SID_Ix_ENVx_ATTACK1
1100
SID_Ix_B_Vx_ENV_DECAY   EQU 0x27    ; same as SID_Ix_ENVx_DECAY2
1101
SID_Ix_B_Vx_ENV_SUSTAIN EQU 0x28    ; same as SID_Ix_ENVx_SUSTAIN
1102
SID_Ix_B_Vx_ENV_RELEASE EQU 0x29    ; same as SID_Ix_ENVx_RELEASE
1103
SID_Ix_B_Vx_ENV_CURVE EQU   0x2a    ; 8bit value, assignments in SID_Ix_ENVx_MODE[6:4]
1104
 
1105
SID_Ix_B_Vx_SEQ_SPEED   EQU 0x2b    ; [5:0] sequencer speed, [6] reserved, [7] 16step sync (sync to measure)
1106
SID_Ix_B_Vx_SEQ_NUM EQU 0x2c    ; [3:0] sequence number (0-8, 8=disabled)
1107
SID_Ix_B_Vx_SEQ_LENGTH  EQU 0x2d    ; [3:0] steps (0-15)
1108
SID_Ix_B_Vx_SEQ_ASSGN   EQU 0x2e    ; same as SID_Ix_WTx_ASSGN
1109
SID_Ix_B_Vx_SEQ_RESERVED2 EQU   0x2f
1110
 
1111
SID_Ix_B_Vx_ENV_DECAY_A EQU 0x030   ; ENV decay used on accented notes
1112
 
1113
    ;; free offsets: 0x31..0x4f
1114
 
1115
SID_Ix_B_SEQUENCES  EQU 0x100;..0x1ff
1116
    ;; structure: 2 bytes for each step (selected with address bit #7)
1117
    ;;              lower byte: note/octave/glide/gate flags
1118
    ;;              upper byte: accent and assignable parameter
1119
    ;;            16 steps per sequence
1120
    ;;            8 sequences
1121
 
1122
;; --------------------------------------------------------------------------
1123
 
1124
;; --- Drums ---
1125
 
1126
;; general flags
1127
SID_Ix_D_SEQ_SPEED  EQU 0x050   ; [5:0] sequencer speed, [6] sequencer on, [7] 16step sync
1128
SID_Ix_D_SEQ_NUM    EQU 0x051   ; sequence number (0-8, 8=disabled)
1129
SID_Ix_D_VOLUME     EQU 0x052   ; 7 bit value, only 4 bit used
1130
SID_Ix_D_SEQ_LENGTH EQU 0x053   ; steps (0-15)
1131
 
1132
SID_Ix_D_S1F_BASE   EQU 0x054;..0x059
1133
SID_Ix_D_S2F_BASE   EQU 0x05a;..0x05f
1134
 
1135
SID_Ix_D_I1_BASE    EQU 0x060;..0x069    Drum Instrument #1
1136
SID_Ix_D_I2_BASE    EQU 0x06a;..0x073    Drum Instrument #2
1137
SID_Ix_D_I3_BASE    EQU 0x074;..0x07d    Drum Instrument #3
1138
SID_Ix_D_I4_BASE    EQU 0x07e;..0x087    Drum Instrument #4
1139
SID_Ix_D_I5_BASE    EQU 0x088;..0x091    Drum Instrument #5
1140
SID_Ix_D_I6_BASE    EQU 0x092;..0x09b    Drum Instrument #6
1141
SID_Ix_D_I7_BASE    EQU 0x09c;..0x0a5    Drum Instrument #7
1142
SID_Ix_D_I8_BASE    EQU 0x0a6;..0x0af    Drum Instrument #8
1143
SID_Ix_D_I9_BASE    EQU 0x0b0;..0x0b9    Drum Instrument #9
1144
SID_Ix_D_I10_BASE   EQU 0x0ba;..0x0c3    Drum Instrument #10
1145
SID_Ix_D_I11_BASE   EQU 0x0c4;..0x0cd    Drum Instrument #11
1146
SID_Ix_D_I12_BASE   EQU 0x0ce;..0x0d7    Drum Instrument #12
1147
SID_Ix_D_I13_BASE   EQU 0x0d8;..0x0e1    Drum Instrument #13
1148
SID_Ix_D_I14_BASE   EQU 0x0e2;..0x0eb    Drum Instrument #14
1149
SID_Ix_D_I15_BASE   EQU 0x0ec;..0x0f5    Drum Instrument #15
1150
SID_Ix_D_I16_BASE   EQU 0x0f6;..0x0ff    Drum Instrument #16
1151
 
1152
SID_Ix_Dx_FLAGS1    EQU 0x00    ; [7:4] voice assignment, [3:0] reserved
1153
SID_Ix_Dx_MODEL     EQU 0x01    ; drum model
1154
SID_Ix_Dx_AD        EQU 0x02    ; 2*4bit value for attack [7:4] and decay [3:0]
1155
SID_Ix_Dx_SR        EQU 0x03    ; 2*4bit value for sustain [7:4] and sustain [3:0]
1156
SID_Ix_Dx_TUNE      EQU 0x04    ; 8bit
1157
SID_Ix_Dx_PAR1      EQU 0x05    ; 8bit
1158
SID_Ix_Dx_PAR2      EQU 0x06    ; 8bit
1159
SID_Ix_Dx_PAR3      EQU 0x07    ; 8bit
1160
SID_Ix_Dx_VELOCITY_ASSGN EQU    0x08    ; velocity assignment
1161
SID_Ix_Dx_RESERVED1 EQU 0x09    ; reserved for future extensions
1162
 
1163
SID_Ix_D_SEQUENCES  EQU 0x100;..0x1ff
1164
    ;; structure: 4 bytes for 16 steps
1165
    ;;              two bytes for gate, two bytes for accent
1166
    ;;            8 tracks per sequence
1167
    ;;            8 sequences
1168
 
1169
;; ==========================================================================
1170
 
1171
MBNET_BASE      EQU 0x600   ; used for SET_BSR
1172
 
1173
MBNET_STATE     EQU 0x600
1174
MBNET_RX_BUFFER_PTR_L   EQU 0x601
1175
MBNET_RX_BUFFER_PTR_H   EQU 0x602
1176
MBNET_MY_ID     EQU 0x603
1177
MBNET_MASTER_ID     EQU 0x604
1178
MBNET_SLAVE_ID      EQU 0x605
1179
MBNET_TOS       EQU 0x606
1180
MBNET_EID_L     EQU 0x607
1181
MBNET_EID_H     EQU 0x608
1182
MBNET_NODE_AVAIL    EQU 0x609
1183
MBNET_NODE_INCOMPATIBLE EQU 0x60a
1184
MBNET_TIMEOUT_CTR_L EQU 0x60b
1185
MBNET_TIMEOUT_CTR_H EQU 0x60c
1186
MBNET_LOOP_CTR      EQU 0x60d
1187
MBNET_RETRY_WAIT_CTR    EQU 0x60e
1188
MBNET_RETRY_NODE    EQU 0x60f
1189
 
1190
MBNET_RETRY_NODE_CTR_BEGIN EQU  0x610   ; ..0x617
1191
 
1192
MBNET_NODE_INFO_BEGIN   EQU 0x620   ; ..0x65f  ; (8*8 bytes)
1193
 
1194
MBNET_CLONE_BUFFER  EQU 0x700   ; 64 bytes, must be aligned, can be any free address since chip will be reset after cloning
1195
 
1196
 
1197
;; ==========================================================================
1198
;;  MIDI Voice records
1199
;; ==========================================================================
1200
SID_MVx_NUM     EQU 6   ; note: changing this value could lead to troubles in sid_ens.inc (ensemble structure...)
1201
SID_MVx_RECORD_LEN  EQU 0x18
1202
 
1203
SID_MVx_MIDI_CHANNEL    EQU 0x00    ; from ensemble
1204
SID_MVx_SPLIT_LOWER EQU 0x01    ; from ensemble
1205
SID_MVx_SPLIT_UPPER EQU 0x02    ; from ensemble
1206
SID_MVx_TRANSPOSE   EQU 0x03    ; from ensemble
1207
SID_MVx_PITCHBENDER EQU 0x04    ; only for Multi Engine ----- we will clear on patch changes from here, see sid_patch.inc
1208
SID_MVx_LAST_VOICE  EQU 0x05    ; only for Multi Engine
1209
SID_MVx_ARP_STATE   EQU 0x06    ; arp variables
1210
SID_MVx_ARP_DIV_CTR EQU 0x07
1211
SID_MVx_ARP_GL_CTR  EQU 0x08
1212
SID_MVx_ARP_NOTE_CTR    EQU 0x09
1213
SID_MVx_ARP_OCT_CTR EQU 0x0a
1214
 
1215
SID_MVx_WT_STACK_0  EQU 0x0b    ; special sorted note stack for WT sequencer (Arp note feature)
1216
SID_MVx_WT_STACK_1  EQU 0x0c
1217
SID_MVx_WT_STACK_2  EQU 0x0d
1218
SID_MVx_WT_STACK_3  EQU 0x0e
1219
 
1220
SID_MVx_NOTE_STACK_PTR  EQU 0x0f    ; the note stack
1221
SID_MVx_NOTE_STACK_0    EQU 0x10
1222
SID_MVx_NOTE_STACK_1    EQU 0x11
1223
SID_MVx_NOTE_STACK_2    EQU 0x12
1224
SID_MVx_NOTE_STACK_3    EQU 0x13
1225
SID_MVx_NOTE_STACK_4    EQU 0x14
1226
SID_MVx_NOTE_STACK_5    EQU 0x15
1227
SID_MVx_NOTE_STACK_6    EQU 0x16
1228
SID_MVx_NOTE_STACK_7    EQU 0x17
1229
 
1230
SID_MV1_BASE        EQU 0x660;..0x677
1231
SID_MV2_BASE        EQU 0x678;..0x68f
1232
SID_MV3_BASE        EQU 0x690;..0x6a7
1233
SID_MV4_BASE        EQU 0x6a8;..0x6bf
1234
SID_MV5_BASE        EQU 0x6c0;..0x6d7
1235
SID_MV6_BASE        EQU 0x6d8;..0x6ef
1236
 
1237
SID_MVx_NOTE_STACK_LEN  EQU SID_MVx_NOTE_STACK_7 - SID_MVx_NOTE_STACK_0 + 1
1238
 
1239
 
1240
;; ==========================================================================
1241
;;  Voice Queue
1242
;; ==========================================================================
1243
 
1244
SID_VOICE_QUEUE_0   EQU 0x6f0
1245
SID_VOICE_QUEUE_5   EQU 0x6f5
1246
SID_VOICE_QUEUE_LEN EQU SID_VOICE_QUEUE_5 - SID_VOICE_QUEUE_0 + 1
1247
 
1248
SID_VOICE_INSTR_0   EQU 0x6f6
1249
SID_VOICE_INSTR_5   EQU 0x6fb
1250
SID_VOICE_INSTR_OFFSET  EQU SID_VOICE_INSTR_0 - SID_VOICE_QUEUE_0
1251
 
1252
    ;; free: 0x6fc-0x6ff
1253
 
1254
;; ==========================================================================
1255
 
1256
;; patch buffer of the MBSID engine
1257
SID_PATCH_BUFFER    EQU 0x700   ; ..0x8ff
1258
 
1259
;; shadowed patch buffer of the MBSID engine (used in sid_se.inc for non-destructive modulations)
1260
SID_PATCH_BUFFER_SHADOW EQU 0x900   ; ..0xbff
1261
;; note: if some memory is required, 0xa80-0xaff could be used, because the wavetable only needs to exist once
1262
 
1263
;; patch buffer of the MBSID engine, which is edited with the CS
1264
SID_EDIT_BUFFER     EQU 0xb00   ; ..0xcff