Subversion Repositories svn.mios

Rev

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