Mockbird
Interface Libarary and Synthesizer Setup Tool for Mockingbird-OTTO
Loading...
Searching...
No Matches
sndpriv.h
1// ODIE port offsets
2#define PRIM_CHANNEL 0 // primary communication channel (0, 1)
3#define SEC_CHANNEL 2 // secondary communication channel (2, 3)
4
5#define PRIM_MPU_DATA 0 // MIDI data for primary port in MPU mode
6#define PRIM_MPU_CMD 1 // MPU command for primary port
7#define PRIM_MPU_STATUS 1 // MPU status bits for primary port
8
9#define CFG_INDEX 4
10#define CFG_DATA 5
11
12// ODIE configuration registers
13#define CFG_INDEX_MASTERCTL 9 // Host Master Control Register
14#define MASTERCTL_SUBSYSCTL 0xC0// Mask for "master subsystem control" bits
15#define SUBSYSCTL_RESET i 0x00
16#define SUBSYSCTL_NORMALOPERATION 0x40
17#define SUBSYSCTL_FWDOWNLOAD 0x80
18#define SUBSYSCTL_FWBOOT 0xC0
19
20// secondary port in MPU mode is not recommended by the data sheet,
21// defines for SEC_MPU_DATA, SEC_MPU_CMD, SEC_MPU_STATUS omitted.
22// MPU/6850 mode is controlled by firmware, and we don't expect any
23// firmware to have the secondary port operating in MPU mode.
24// Quote:
25// "When in MPU-401 emulation mode, RxRDY interrupts are ALWAYS enabled.
26// For maximum compatibility when operating in MPU-401 emulation mode,
27// the Host Interrupt Configuration register should be programmed to
28// provide a separate interrupt for the MIDI Emulation, otherwise all
29// other interrupts can be blocked by ill-behaved applications software.
30// Because of this, MPU-401 mode may not generally be usable on the HOST
31// interface, but is provided there purely for the sake of symmetry."
32// "HOST interface" refers to the secondary port. The idea behind this
33// paragraph is the model of having a basic SoundScape driver that handles
34// basic SoundScape functionality (like mixer and wave via synth), but
35// hands out an emulated MIDI port to an application that interfaces directly
36// to an MPU401-like interface. If an application causes the MPU401 to
37// provide a byte (like an ACK to various commands), and doesn't read it,
38// the MPU401 interrupt is stuck active. If the driver operates on the same
39// IRQ, it is unable to receive low-level IRQs while the MPU401 rx byte is
40// pending.
41
42
43#define SNDSCAPE_EVT_ACK 0x80
44#define SNDSCAPE_EVT_WAVEA 0x90
45#define SNDSCAPE_EVT_WAVEB 0x91
46#define SNDSCAPE_EVT_ERROR 0xFF
47
48// Basic synth interface
49#define SNDSCAPE_CMD_LOAD_WAVEFORM 0x80
50#define SNDSCAPE_CMD_RESET_WAVEMEM 0x81
51#define SNDSCAPE_CMD_SET_WAVEMAP 0x82
52#define SNDSCAPE_CMD_ALIAS_WAVEFORM 0x83
53#define SNDSCAPE_CMD_FREE_WAVEFORM 0x84
54#define SNDSCAPE_CMD_GET_WAVEMEM 0x85
55#define SNDSCAPE_CMD_SET_PATCH 0x86
56#define SNDSCAPE_CMD_SET_MELODIC 0x87
57#define SNDSCAPE_CMD_SET_MIXER 0x88
58#define MIXER_CHANNEL_MASTER_PLAYBACK 0 // S-1000 only
59#define MIXER_CHANNEL_MASTER_RECORD 1 // S-1000 only
60#define MIXER_CHANNEL_MICorLINE 2 // S-1000 only?
61#define MIXER_CHANNEL_LMC385CTL 3 // unknown, S-1000 only
62#define MIXER_CHANNEL_SYNTH 4
63#define MIXER_CHANNEL_WAVE_A 5
64#define MIXER_CHANNEL_WAVE_A_PAN 6
65#define MIXER_CHANNEL_WAVE_B 7
66#define MIXER_CHANNEL_WAVE_B_PAN 8
67#define MIXER_CHANNEL_OTTO_LEFT_PLAYBACK 9 // S-1000 only
68#define MIXER_CHANNEL_OTTO_RIGHT_PLAYBACK 10 // S-1000 only
69#define MIXER_CHANNEL_CD_LEFT_PLAYBACK 11 // S-1000 only
70#define MIXER_CHANNEL_CD_RIGHT_PLAYBACK 12 // S-1000 only
71#define MIXER_CHANNEL_LINE_LEFT_PLAYBACK 13 // S-1000 only
72#define MIXER_CHANNEL_LINE_RIGHT_PLAYBACK 14 // S-1000 only
73#define MIXER_CHANNEL_MIC_LEFT_PLAYBACK 15 // S-1000 only
74#define MIXER_CHANNEL_MIC_RIGHT_PLAYBACK 16 // S-1000 only
75#define MIXER_CHANNEL_OTTO_LEFT_RECORD 17 // S-1000 only
76#define MIXER_CHANNEL_OTTO_RIGHT_RECORD 18 // S-1000 only
77#define MIXER_CHANNEL_CD_LEFT_RECORD 19 // S-1000 only
78#define MIXER_CHANNEL_CD_RIGHT_RECORD 20 // S-1000 only
79#define MIXER_CHANNEL_LINE_LEFT_RECORD 21 // S-1000 only
80#define MIXER_CHANNEL_LINE_RIGHT_RECORD 22 // S-1000 only
81#define MIXER_CHANNEL_BASS 23 // SC600 only
82#define MIXER_CHANNEL_TREBLE 24 // SC600 only
83#define MIXER_CHANNEL_STEREOFX 25 // SC600 only
84#define MIXER_CHANNEL_MUTE 26 // SC600 only
85#define SNDSCAPE_CMD_GET_MIXER 0x89
86#define SNDSCAPE_CMD_GET_POLYPHONY 0x8A
87
88// basic wave interface
89#define SNDSCAPE_CMD_START_WAVE 0x8B
90#define SNDSCAPE_CMD_PAUSE_WAVE 0x8C
91#define SNDSCAPE_CMD_STOP_WAVE 0x8D
92
93// advanced wave interface
94#define SNDSCAPE_CMD_WAVE_A_TAILSIZE 0x90
95#define SNDSCAPE_CMD_WAVE_B_TAILSIZE 0x91
96// diagnostics
97#define SNDSCAPE_CMD_PEEK_OBP 0x92
98#define SNDSCAPE_CMD_POKE_OBP 0x93
99// effect processor support
100#define SNDSCAPE_CMD_ASSIGN_WAVE 0x94
101
102// advanced synth setup
103#define SNDSCAPE_CMD_SET_MIDI_PORT_MODE 0x98
104#define MIDI_PORT_MODE_6850 0
105#define MIDI_PORT_MODE_MPU401 1
106#define SNDSCAPE_CMD_GET_MIDI_PORT_MODE 0x99
107#define SNDSCAPE_CMD_GET_MIDI_MASK 0x9A
108#define SNDSCAPE_CMD_SET_MIDI_MASK 0x9B
109#define SNDSCAPE_CMD_send_some_data 0x9C
110#define SNDSCAPE_CMD_SET_MIDIIN_SYNTH 0x9D
111#define SNDSCAPE_CMD_GET_MIDIIN_SYNTH 0x9E
112#define SNDSCAPE_CMD_GET_INFO 0x9F
113#define SNDSCAPE_CMD_GET_WAVEFORM_COUNT 0xA0
114#define SNDSCAPE_CMD_SET_DRUM_CHANNEL 0xA1
115#define SNDSCAPE_CMD_NO_DRUM_CHANNEL 0xA2
116#define SNDSCAPE_CMD_GET_PATCH 0xA3
117#define SNDSCAPE_CMD_GET_MELODIC 0xA4
118#define SNDSCAPE_CMD_GET_DRUM_CHANNEL 0xA5
119#define SNDSCAPE_CMD_SET_TUNING 0xA6
120#define SNDSCAPE_CMD_GET_TUNING 0xA7
121#define SNDSCAPE_CMD_EDIT_WAVE_INFO 0xA8
122#define SNDSCAPE_CMD_GET_WAVE_INFO 0xA9
123#define SNDSCAPE_CMD_GET_WAVEMAP 0xAA
124#define SNDSCAPE_CMD_GET_ALIAS_TARGET 0xAB
125#define SNDSCAPE_CMD_GET_WAVEFORM_INFO 0xAC
126#define SNDSCAPE_CMD_DEFRAG 0xAD
127#define SNDSCAPE_CMD_SET_DRUM 0xAE
128#define SNDSCAPE_CMD_GET_DRUM 0xAF
129#define SNDSCAPE_CMD_SET_something 0xB0 // S-1000 maybe?
130#define SNDSCAPE_CMD_GET_something 0xB1 // always 0 on SC600 and newer
131#define SNDSCAPE_CMD_SET_SC_COMPAT 0xB2
132#define SNDSCAPE_CMD_GET_SC_COMPAT 0xB3
133#define SNDSCAPE_CMD_SET_CHANNEL_PRIO 0xB4
134#define SNDSCAPE_CMD_GET_CHANNEL_PRIO 0xB5
135
136// advanced host interface
137#define SNDSCAPE_CMD_SET_WAVE_RATE 0xB6
138#define SNDSCAPE_CMD_GET_WAVE_RATE 0xB7
139#define SNDSCAPE_CMD_SET_MIDI_CLOCK 0xB8
140#define SNDSCAPE_CMD_GET_MIDI_CLOCK 0xB9
141#define SNDSCAPE_CMD_CONTINUE_WAVE 0xBA
142#define SNDSCAPE_CMD_GET_FW_TYPE 0xBB
143#define FWTYPE_MIDI 0
144#define FWTYPE_FM 1
145#define SNDSCAPE_CMD_GET_LIBRARY_ID 0xBC
146#define SNDSCAPE_CMD_SET_LIBRARY_ID 0xBD
147