@nataliapc/mcp-openmsx 1.1.13 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,688 @@
1
+ ===============================================================================
2
+ MoonSound technical documentation
3
+ ===============================================================================
4
+
5
+ This document describes the MoonSound and especially the main component, the
6
+ Yamaha OPL4 chip. It is a copy of the official documentation from Yamaha with
7
+ some additional notes made by me where I thought that the original descriptions
8
+ were not very clear. Note that this document does not describe the FM (OPL3)
9
+ part of the OPL4. You can find that information in a seperate text file. All
10
+ diagrams are drawn with ASCII characters to enable easy viewing and printing
11
+ of this document on MSX as well as on PC.
12
+
13
+ Included with this document are three small GIF files. These are scans of some
14
+ pictures in the original document. Two more GIFs of the hardware pin assignment
15
+ are also available but not included here because of their size and their very
16
+ limited use for the average programmer.
17
+
18
+ I would like to thank Marcel Delorme for typing and scanning most of the
19
+ original document.
20
+
21
+ Remco Schrijvers
22
+
23
+ -------------------------------------------------------------------------------
24
+
25
+ I replaced the three scans with a single GIF file that contains all the
26
+ envelope diagrams. The image quality is better and it takes less disk space.
27
+
28
+ Maarten ter Huurne
29
+
30
+
31
+ -------------------------------------------------------------------------------
32
+ MoonSound description
33
+ -------------------------------------------------------------------------------
34
+
35
+ The MoonSound cartridge has 3 important components:
36
+ - The OPL4 (YMF278B).
37
+ - The Yamaha YRW801 2MB ROM with samples for the OPL4.
38
+ - 128K SRAM to enable you to use your own samples.
39
+
40
+ The I/O of the OPL4 can be done on the following I/O ports:
41
+
42
+ 07Eh wave register
43
+ 07Fh wave data
44
+ 0C4h FM bank 1 register
45
+ 0C5h FM data
46
+ 0C6h FM bank 2 register
47
+
48
+ 0C7h is a mirror of the FM data register but use of 0C5h is preferred.
49
+
50
+ The status register is also located at 0C4h at all times.
51
+
52
+ The OPL4 is 100% compatible with the OPL3 which is described in a seperate
53
+ document and meets the OPL(tm) standard. OPL(tm) is a trademark of Yamaha
54
+ Corporation which represents a full register compatibility with Yamaha YMF3812
55
+ (OPL2).
56
+
57
+ Important: To enable access to the Wave registers and the extra bit in the
58
+ status register, you have to set bit D0 and D1 in register 5 of FM bank 2.
59
+ In basic this would look like this:
60
+ OUT &HC6,5
61
+ OUT &HC5,&B11
62
+
63
+ There is no documentation available about the contents of the ROM chip. If you
64
+ want to use these for (e.g. your own music editor or replayer) you can contact
65
+ me and I can give you some of the info I found in the two weeks of long hard and
66
+ boring work I spent on it.
67
+
68
+ -------------------------------------------------------------------------------
69
+ OPL4 Overview
70
+ -------------------------------------------------------------------------------
71
+
72
+ + FM synthesizer Unit (same as YMF262)
73
+
74
+ 1. Sound Generation Modes
75
+
76
+ * 2-operator mode
77
+
78
+ 2-operator mode with eighteen sounds are produced at the same time. Or
79
+ 2-operator with fiftheen sounds, and five rhythm sounds are produced at
80
+ the same time.
81
+
82
+ * 4-operator mode
83
+
84
+ 4-operator mode with six sounds and 2-operator mode with six sounds are
85
+ produced at the same time. Or 4-operator mode with six sounds, 2-operator
86
+ mode with three sounds and five rhythm sounds are produced at the same
87
+ time.
88
+
89
+ 2. Eight types of waves.
90
+
91
+ 3. Stereo output.
92
+
93
+
94
+ + PCM synthesizer Unit
95
+
96
+ 1. Simultaneous generation of 24 sounds.
97
+
98
+ 2. Voice output data sampling frequency of 44.1 Khz.
99
+
100
+ 3. Waveform data length: 8 bits, 12 bits and 16 bits.
101
+
102
+ 4. Stereo output (16-level pan can be specified for each sound)
103
+
104
+ + Wave Data for PCM Synthesizer Unit
105
+
106
+ 1. Maximum of 4M-byte external memory can be conected.
107
+
108
+ 2. Maximum of 512 tones.
109
+
110
+ 3. External ROM or SRAM memory. If SRAM is connected, wave data can be
111
+ downloaded from CPU.
112
+
113
+ 4. Chip select signals for memory can be output: 128K bytes, 512K bytes,
114
+ 1M bytes and 2M bytes.
115
+
116
+ + Miscellaneous
117
+
118
+ 1. YMF278 has six channels for sound output, and can be connected to the
119
+ YAC513.
120
+
121
+ 2. YMF278 can be connected to the YSS225(EP) witch gives various effects
122
+ to sound data.
123
+
124
+ 3. YMF278 can read all registers.
125
+
126
+ 4. Pack contains 80-pin QFP.
127
+
128
+
129
+ -------------------------------------------------------------------------------
130
+ CPU INTERFACE
131
+ -------------------------------------------------------------------------------
132
+
133
+ Sound generation control for the YMF278 is performed by writing data into
134
+ registers. An 8-bit parallel CPU interface is provided to write data into
135
+ and read status form each register. D0-D7 are bi-directional data buses, and
136
+ /CS,/RD,/WR,/WR,A0,A1,A2 are data bus control signal input.
137
+ The data buses are set as shown below by the data control signal:
138
+
139
+ +-------------------------------------------------------------------+
140
+ | | /CS | /RD | /WR | /A0 | /A1 | /A2 | MODE |
141
+ +-----+-----+-----+-----+-----+-----+-----+-------------------------+
142
+ | | H | X | X | X | X | X | Inactive mode |
143
+ | | L | L | H | L | L | L | Status read mode |
144
+ +-----+-----+-----+-----+-----+-----+-----+-------------------------+
145
+ | | L | H | L | L | L/H | L | Address write mode |
146
+ | FM | L | H | L | H | X | L | Data write mode |
147
+ | | L | L | H | H | X | L | Data read mode |
148
+ +-----+-----+-----+-----+-----+-----+-----+-------------------------+
149
+ | | L | H | L | L | L | H | Address write mode |
150
+ | PCM | L | H | L | H | L | H | Data wrtie mode |
151
+ | | L | L | H | H | L | H | Data read mode |
152
+ +-----+-----+-----+-----+-----+-----+-----+-------------------------+
153
+ X: Don't Care
154
+
155
+ (a) Inactive Mode
156
+
157
+ Data buses D0-D7 are set to high impedance when /CS is H
158
+
159
+ (b) Address Write Mode
160
+
161
+ This mode specifies the write address. Output the address data of the
162
+ register to be written to the data bus. Then, setting data is written
163
+ in data write mode. However, a wait period of 17 cycles of the master
164
+ clock is required during this period. To specify register array 0 with
165
+ FM, set A1 = L. To use register array 1, set A1 = H.
166
+
167
+ (c) Data Write Mode
168
+
169
+ This mode writes data at the address which is set in address write mode
170
+ immediately before. Output setting data to the datat bus. A wait period
171
+ of 56 master-clock cycles is required for FM, and a wait period of 88
172
+ master-clock cycles is required for PCM until the next address write or
173
+ data write.
174
+
175
+ (d) Data Read Mode
176
+
177
+ This mode reads data at the address which is set in address write mode
178
+ immediately before.
179
+
180
+ (e) Status Read Mode
181
+
182
+ This mode outputs the status of the YMF278 to the data bus.
183
+
184
+
185
+ ------------------------------------------------------------------------------
186
+ PCM SYNTHESIZER AND MIX UNIT REGISTER
187
+ ------------------------------------------------------------------------------
188
+
189
+ +-----+----+----+----+----+----+----+----+----+
190
+ | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
191
+ +-----+----+----+----+----+----+----+----+----+
192
+ | 00H | TEST |
193
+ | 01H | |
194
+ +-----+--------------+----+----+----+----+----+
195
+ | | | Tone header | | | MT = Memory type
196
+ | 02H | DeviceID | 2 1 0 | MT | MA | MA = Memory access
197
+ +-----+----+----+----+----+----+----+----+----+
198
+ | | |Memory address register high |
199
+ | 03H | --------|MA21 MA20 MA19 MA18 MA17 MA16|
200
+ +-----+---------+----+----+----+----+----+----+
201
+ | | Memory address register mid. |
202
+ | 04H |MA15 MA14 MA13 MA12 MA11 MA10 MA9 MA8 |
203
+ +-----+----+----+----+----+----+----+----+----+
204
+ | | Memory address register low |
205
+ | 05H |MA7 MA6 MA5 MA4 MA3 MA2 MA1 MA0 |
206
+ +-----+----+----+----+----+----+----+----+----+
207
+ | | Memory data register |
208
+ | 06H | 7 6 5 4 3 2 1 0 |
209
+ +-----+----+----+----+----+----+----+----+----+
210
+ | | |
211
+ | 07H | ------------------------------------- |
212
+ +-----+---------------------------------------+
213
+ | 08H-| Tone number |
214
+ | 1FH| 7 6 5 4 3 2 1 0 |
215
+ +-----+----+----+----+----+----+----+----+----+
216
+ | 20H-| F-NUM Tone no|
217
+ | 37H| F6 F5 F4 F3 F2 F1 F0 8 |
218
+ +-----+----+----+----+----+----+----+----+----+
219
+ | 38H | Octave pseudo F-NUM |
220
+ | 4FH| O3 O2 O1 O0 reverb F9 F8 F7 |
221
+ +-----+----+----+----+----+----+----+----+----+
222
+ | 50H-| Total level Level|
223
+ | 67H| 6 5 4 3 2 1 0 direct|
224
+ +-----+----+----+----+----+----+----+----+----+
225
+ | 68H | Key damp LFO CH Pan pot |
226
+ | 7FH| on RES 3 2 1 0 |
227
+ +-----+----+----+----+----+----+----+----+----+
228
+ | 80H-| LFO VIB |
229
+ | 97H| -------- S2 S1 S0 V2 V1 V0 |
230
+ +-----+---------+----+----+----+----+----+----+
231
+ | 98H-| AR D1R |
232
+ | AFH| 3 2 1 0 3 2 1 0 |
233
+ +-----+----+----+----+----+----+----+----+----+
234
+ | B0H-| DL D2R |
235
+ | C7H| 3 2 1 0 3 2 1 0 |
236
+ +-----+----+----+----+----+----+----+----+----+
237
+ | C8H-| Rate compensaton RR |
238
+ | DFH| 3 2 1 0 3 2 1 0 |
239
+ +-----+----+----+----+----+----+----+----+----+
240
+ | E0H-| AM |
241
+ | F7H| ----------------------- 2 1 0 |
242
+ +-----+------------------------+----+----+----+
243
+ | | Mix control Mix control |
244
+ | | (FM-R) (FM-L) |
245
+ | F8H | -------- 2 1 0 2 1 0 |
246
+ +-----+---------+----+----+----+----+----+----+
247
+ | | Mix control Mix control |
248
+ | | (PCM-R) (PCM-L) |
249
+ | F9H | -------- 2 1 0 2 1 0 |
250
+ +-----+---------+----+----+----+----+----+----+
251
+
252
+ Notes) 1. Be sure to set unused bits and TEST registers to 0.
253
+ 2. Mix control registers (FM-R, FM-L) of F8h are set to 3 (-9dB), other
254
+ registers are set to '0' by initial clear.
255
+
256
+
257
+ ------------------------------------------------------------------------------
258
+ REGISTERS
259
+ ------------------------------------------------------------------------------
260
+
261
+ In the (OPL4), a sound which is output is called a channel. In the PCM
262
+ synthesizer unit, 1-24 channels can be output simultaneosly. 08H-F7H of
263
+ registers are grouped into 24-byte units, and each group corresponds to 1-24
264
+ channels sequentially.
265
+
266
+ + 00H-01H TEST
267
+
268
+ This register is used for testing LSI. set
269
+ this registers to "0" for normal use.
270
+
271
+ +-----+----+----+----+----+----+----+----+----+
272
+ | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
273
+ | 00- +----+----+----+----+----+----+----+----+
274
+ | 01H | TEST |
275
+ +-----+---------------------------------------+
276
+
277
+ + 02H MEMORY ACCESS
278
+
279
+ 0: Normal sound generation mode
280
+
281
+ 1: CPU reads and writes the
282
+ external memory. Sound +-----+----+----+----+----+----+----+----+----+
283
+ generation cannot be | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
284
+ performed in this mode. | 02H +----+----+----+----+----+----+----+----+
285
+ | | | MA |
286
+ +-----+----------------------------------+----+
287
+
288
+ + 02H MEMORY TYPE
289
+
290
+ Specify the connection method of the external memory
291
+
292
+ 0: ROM (always on MoonSound)
293
+
294
+ 1: SRAM and ROM
295
+ +-----+----+----+----+----+----+----+----+----+
296
+ Refer to the Chip select | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
297
+ Signals of External Memory | 02H +----+----+----+----+----+----+----+----+
298
+ for details. | | | MT | |
299
+ +-----+-----------------------------+----+----+
300
+
301
+ Important: When you are using the MoonSound, always select the ROM mode. Even
302
+ if you are using SRAM and ROM!!
303
+
304
+
305
+ + 02H TONE HEADER
306
+
307
+ This register sets the range of setting in every 512K byte unit for the
308
+ 128-tone header (no.384-no.511 out of 512 tones)
309
+
310
+ +-----+----+----+----+----+----+----+----+----+
311
+ If D2-D4 = 0, set headers | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
312
+ for 512 tones starting with | 02H +----+----+----+----+----+----+----+----+
313
+ addres 0 in the external | | | Tone header | |
314
+ memory. +-----+--------------+--------------+---------+
315
+
316
+ In the MoonSound the last 128 headers will be located after the 2MB ROM.
317
+ Since this is 4*512, the tone header value must be 4 (100b).
318
+
319
+
320
+ + 02H DEVICE ID
321
+
322
+ +-----+----+----+----+----+----+----+----+----+
323
+ Used for ID register, no | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
324
+ further information | 02H +----+----+----+----+----+----+----+----+
325
+ available. | | DevicdID | |
326
+ +-----+--------------+------------------------+
327
+
328
+ This is probably used to identify what kind of chip you are using. My guess
329
+ is that it will have the following values:
330
+ 0 = not used
331
+ 1 = OPL4
332
+ 2 = future OPL5?
333
+
334
+
335
+ + 03H-5H MEMORY ADDRESS REGISTER
336
+
337
+ These registers set the ex- +-----+----+----+----+----+----+----+----+----+
338
+ ternal memory addresses when | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
339
+ data is written into or read | 03H +----+----+----+----+----+----+----+----+
340
+ from the external memory. | | ------- | MA21-MA16 |
341
+ +-----+---------+-----------------------------+
342
+
343
+ Set from the highest address +-----+----+----+----+----+----+----+----+----+
344
+ in sequence because address | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
345
+ setting for MA21-MA0 comple- | 04H +----+----+----+----+----+----+----+----+
346
+ tes by the setting of 05H. | | MA15-MA8 |
347
+ +-----+---------------------------------------+
348
+
349
+ Addresses are automatically +-----+----+----+----+----+----+----+----+----+
350
+ incremented by data write or | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
351
+ data read from the external | 05H +----+----+----+----+----+----+----+----+
352
+ memory. | | MA7-MA0 |
353
+ +-----+---------------------------------------+
354
+
355
+
356
+ + 06H MEMORY DATA REGISTER
357
+
358
+ By writing into this reg, +-----+----+----+----+----+----+----+----+----+
359
+ the data at the external | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
360
+ memory address which is | 03H +----+----+----+----+----+----+----+----+
361
+ currently set can be written.| | ------- | MA21-MA16 |
362
+ +-----+---------+-----------------------------+
363
+ A wait period of 28 master-clock cycles
364
+ is required until the next data write.
365
+
366
+ By reading this register, the data at the external memory address which is
367
+ currently set can be read.
368
+
369
+ A wait period of 38 master-clock cycles is required until the next data
370
+ read.
371
+
372
+
373
+ + 08H-1FH TONE NUMBER
374
+
375
+ The OPL4 supports a maximum of 512 tones. Select the
376
+ number of the tone to be +-----+----+----+----+----+----+----+----+----+
377
+ produced from 512 tones, and | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
378
+ set the selected number in | 08- +----+----+----+----+----+----+----+----+
379
+ the tone number register | 1FH | Tone number |
380
+ of the channel from which +-----+---------------------------------------+
381
+ tone is to be produced.
382
+ The tone header is then internally loaded automaticlly.
383
+
384
+ The loading time is approxi- +-----+----+----+----+----+----+----+----+----+
385
+ mately 300 msec from the | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
386
+ setting of the tone number | 20- +----+----+----+----+----+----+----+----+
387
+ in the register. Do not | 37H | |no8.|
388
+ access the tone number, LFO, +-----+----------------------------------+----+
389
+ V1B,AR,D1R,DL,D2R, rate
390
+ compensation, RR and AM register of the channel during loading.
391
+ However, access can be made to other register even when the tone header is
392
+ being loaded.
393
+
394
+ The flag which indicates loading is located at bit D1 of the status
395
+ register.
396
+
397
+ Always set the tone numbers (7-0) after the tone number (8) because tone
398
+ number setting completes by the setting of the tone numbers (7-0).
399
+
400
+
401
+ + 20H-4FH F-NUM AND OCTAVE
402
+
403
+ The F-NUM and octave reg. +-----+----+----+----+----+----+----+----+----+
404
+ control sound generation | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
405
+ pitch. | 20- +----+----+----+----+----+----+----+----+
406
+ | 37H | F-Number | |
407
+ Set positive integers from +-----+----------------------------------+----+
408
+ 0-1023 in the F-NUM registers,
409
+ and set two's complement +-----+----+----+----+----+----+----+----+----+
410
+ from -7 to 7 in the octave | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
411
+ register. | 38- +----+----+----+----+----+----+----+----+
412
+ | 4FH | | F-Number |
413
+ Always set F-NUM (f6-f0) +-----+-------------------+-------------------+
414
+ after F-NUM (f9-f7) because
415
+ F-NUm setting completes by +-----+----+----+----+----+----+----+----+----+
416
+ setting of F-NUM (f6-f0). | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
417
+ | 38- +----+----+----+----+----+----+----+----+
418
+ If F-NUM is 0 and octave is | 4FH | Octave | |
419
+ 1, waveform data will be +-----+-------------------+-------------------+
420
+ regenerated in sequence at
421
+ 44.1 Khz. This is used as the reference (F(c) = 0).
422
+
423
+ The formula to obtain the pitch variation for the reference is as follows:
424
+
425
+ F (c) = 1200 * (octave-1) + 1200 * log2 [(1024 + F-NUM) /1024 ]
426
+
427
+ Where 1 octave = 1200 c
428
+
429
+ + 38H-4FH PSEUDOREVERB
430
+
431
+ Set the reverb rate (RevR) +-----+----+----+----+----+----+----+----+----+
432
+ to 5 when the envelope beco- | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
433
+ mes smaller than 18 dB so | 38- +----+----+----+----+----+----+----+----+
434
+ that pseudoreverb effect is | 4FH | | ps | |
435
+ on. +-----+-------------------+----+--------------+
436
+
437
+ 0: Pseudoreverb off ps = Pseudoreverb
438
+
439
+ 1: Pseudoreverb on
440
+
441
+ Refer to the "Envelopes" for details.
442
+
443
+
444
+ + 50H-67H TOTAL LEVEL
445
+
446
+ +-----+----+----+----+----+----+----+----+----+
447
+ Set the total level. The | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
448
+ table shown below shows the | 50- +----+----+----+----+----+----+----+----+
449
+ correspondence of each bit | 67H | Total level | |
450
+ of the total level. +-----+----------------------------------+----+
451
+
452
+ +---------+-----+-----+-----+-----+-----+-----+------+
453
+ | Bit No. | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
454
+ +---------+-----+-----+-----+-----+-----+-----+------+
455
+ | ATT.(dB)| -24 | -12 | -6 | -3 | -1.5|-0,75|-0,375|
456
+ +---------+-----+-----+-----+-----+-----+-----+------+
457
+
458
+
459
+ + 50H-67H LEVEL DIRECT
460
+
461
+ Select the method of change +-----+----+----+----+----+----+----+----+----+
462
+ when the total level is | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
463
+ changed. | 50- +----+----+----+----+----+----+----+----+
464
+ | 67H | | LD |
465
+ 0: Changes while the total +-----+----------------------------------+----+
466
+ level interpolates
467
+
468
+ 1: The total level is immediately used as the current value.
469
+
470
+ If interpolation is performed, the time required for the sound volume to
471
+ change from the minimum to the maximum is ?? msec, and the time required
472
+ to change from the maximum to the minimum is ?? msec.
473
+
474
+
475
+ + 68H-7FH KEY ON
476
+
477
+ 0: Key off +-----+----+----+----+----+----+----+----+----+
478
+ | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
479
+ 1: Key on | 68- +----+----+----+----+----+----+----+----+
480
+ | 7FH |KEY | |
481
+ +-----+----+----------------------------------+
482
+
483
+
484
+ + 68H-7FH DAMP
485
+
486
+ Forced damp starts by setting+-----+----+----+----+----+----+----+----+----+
487
+ D6 of this register to 1: | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
488
+ | 68- +----+----+----+----+----+----+----+----+
489
+ 0: Normal rate is valid | 7FH | |Damp| |
490
+ +-----+----+----+-----------------------------+
491
+ 1: Damp rate is valid
492
+
493
+ Damp is performed as shown in the table below at the time elapses:
494
+
495
+ +-----------+-----+-----+-----+-----+
496
+ | Time(msec)| 5.8 | 8.0 | 9.4 | 10.9|
497
+ +-----------+-----+-----+-----+-----+
498
+ | ATT.(dB) | -12 | -48 | -72 | -96 |
499
+ +-----------+-----+-----+-----+-----+
500
+
501
+
502
+ + 68H-7FH LFO RES
503
+
504
+ The operation of LFO is as +-----+----+----+----+----+----+----+----+----+
505
+ follows: | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
506
+ | 68- +----+----+----+----+----+----+----+----+
507
+ 0: Start operation | 7FH | |LFOR| |
508
+ +-----+---------+----+------------------------+
509
+ 1: Stops operation and resets
510
+
511
+
512
+ + 68H-7FH CH
513
+
514
+ Output channel: +-----+----+----+----+----+----+----+----+----+
515
+ | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
516
+ 0: Outputs to MIX | 68- +----+----+----+----+----+----+----+----+
517
+ | 7FH | | CH | |
518
+ 1: Outputs to PCM-EXT +-----+--------------+----+-------------------+
519
+
520
+ For the MoonSound all channels need to be set to PCM-EXT.
521
+
522
+
523
+ + 68H-7FH PAN POT
524
+
525
+ Set the pan pot. The pan pot +-----+----+----+----+----+----+----+----+----+
526
+ changes as shown in the table| | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
527
+ below according to the value | 68- +----+----+----+----+----+----+----+----+
528
+ to be written: | 7FH | | Pan Pot |
529
+ +-----+-------------------+-------------------+
530
+
531
+ +-----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
532
+ | Bit No. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15|
533
+ +-----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
534
+ | ATT.(dB) L| 0 |-3 |-6 |-9 |-12|-15|-18| oo| oo| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
535
+ +-----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
536
+ | ATT.(dB) R| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | oo| oo|-18|-15|-12|-9 |-6 |-3 |
537
+ +-----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
538
+
539
+
540
+ + 80H-97H LFO
541
+
542
+ Set the speed for LFO. The +-----+----+----+----+----+----+----+----+----+
543
+ speed changes as shown in the| | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
544
+ table below according to the | 80- +----+----+----+----+----+----+----+----+
545
+ value to be written: | 97H | ------- | LFO | |
546
+ +-----+---------+--------------+--------------+
547
+
548
+ +--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
549
+ | Value | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
550
+ +--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
551
+ | LFO Frequency (Hz) |0.168|2.019|3.196|4.206|5.215|5.888|6.224|7.066|
552
+ +--------------------+-----+-----+-----+-----+-----+-----+-----+-----+
553
+
554
+
555
+ + F8H FM MIXING CONTROL
556
+
557
+ Sets the output level of the +-----+----+----+----+----+----+----+----+----+
558
+ FM channels. 0 means maximum | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
559
+ output. Initial value is 3 | +----+----+----+----+----+----+----+----+
560
+ (-9 dB). | F8H | ------- | FM-R | FM-L |
561
+ +-----+---------+--------------+--------------+
562
+
563
+
564
+ + F9H WAVE MIXING CONTROL
565
+
566
+ Sets the output level of the +-----+----+----+----+----+----+----+----+----+
567
+ PCM channels. 0 means | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
568
+ maximum output. Initial | +----+----+----+----+----+----+----+----+
569
+ value is 0. | F9H | ------- | PCM-R | PCM-L |
570
+ +-----+---------+--------------+--------------+
571
+
572
+
573
+ -------------------------------------------------------------------------------
574
+ STATUS REGISTER
575
+ -------------------------------------------------------------------------------
576
+
577
+ +------+------+------+------+------+------+------+------+------+
578
+ | | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
579
+ |------+------+------+------+------+------+------+------+------+
580
+ |Status| IRQ | FT1 | FT2 | ------------------ | LD | BUSY |
581
+ +------+------+------+------+------+------+------+------+------+
582
+
583
+ See the OPL3 document for more info on IRQ, FT1 and FT2.
584
+
585
+ BUSY: The BUSY flag is valid while NEW2=1. This flag becomes 1 while writing
586
+ address and data. BUSY flag automatically returns to 0 when writing is
587
+ completed.
588
+
589
+ LD : Indicates that a Wave Table header is loaded. Returns to 0 when loading
590
+ is completed. See reg. 8 for more info.
591
+
592
+ Although there is no info in the manual about this I think that the BUSY flag
593
+ is not only for writing, but also for reading. It works for FM, Wave and Wave
594
+ data transfer! On the Z80A waiting for the BUSY flag is never neccessary, but
595
+ on the 7Mhz Z80 or the R800 it is neccessary. Not always, but on unpredictable
596
+ moments so it MUST be used if you are making something and you are planning to
597
+ use it for R800 or 7Mhz. The disadvantage for Z80 is that it takes some time
598
+ to check this every time and the Z80 needs all the speed it can get.
599
+
600
+ -------------------------------------------------------------------------------
601
+ ENVELOPES
602
+ -------------------------------------------------------------------------------
603
+
604
+ + Envelope Graphs
605
+
606
+ The envelopes are shown in the GIF file.
607
+ To produce continuous sound, set D2R = 0 (RATE = 0, real time = inf).
608
+
609
+ + Pseudoreverb effect
610
+
611
+ When the pseudoreverb in 38H-4FH is set to "1", pseudoreverb effect can be
612
+ applied. The envelope when pseudoreverb effect is applied is shown in the
613
+ GIF file. When the envelope decreases below -18 dB, D1R, D2R and RR are
614
+ disregarded,and RevR (fixed at 5) is set. Pseudoreverb can also be applied
615
+ to continuous at below -18 dB in the same manner.
616
+
617
+
618
+ -------------------------------------------------------------------------------
619
+ WAVE DATA IN EXTERNAL MEMORY
620
+ -------------------------------------------------------------------------------
621
+
622
+ +----+----+----+----+----+----+----+----+
623
+ Address | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
624
+ +----+----+----+----+----+----+----+----+ -------------------------
625
+ 0 | Data bit| Start address | D1-D0 = 0 for 8 bit data
626
+ | D1 D0 | S21 S20 S19| S18 S17 S16| D1-D0 = 1 for 12 bit data
627
+ +----+----+----+----+----+----+----+----+ D1-D0 = 2 for 16 bit data
628
+ 1 | Start address |
629
+ | S15 S14 S13 S12 S11 S10 S9 S8 |
630
+ +----+----+----+----+----+----+----+----+
631
+ 2 | Start address | Header for tone No.0
632
+ | S7 S6 S5 S4 S3 S2 S1 S0 |
633
+ +----+----+----+----+----+----+----+----+
634
+ 3 | Loop address |
635
+ | L15 L14 L13 L12 L11 L10 L9 L8 |
636
+ +----+----+----+----+----+----+----+----+
637
+ 4 | Loop address |
638
+ | L7 L6 L5 L4 L3 L2 L1 L0 |
639
+ +----+----+----+----+----+----+----+----+
640
+ 5 | End address | End address must be
641
+ | E15 E14 E13 E12 E11 E10 E9 E8 | inverted!
642
+ +----+----+----+----+----+----+----+----+
643
+ 6 | End address |
644
+ | E7 E6 E5 E4 E3 E2 E1 E0 |
645
+ +----+----+----+----+----+----+----+----+
646
+ 7 | | LFO speed | VIB |
647
+ | ------- | S2 S1 S0 | V2 V1 V0 |
648
+ +---------+----+----+----+----+----+----+
649
+ 8 | Attack rate (AR) | 1st decay (D1R) |
650
+ | 3 2 1 0 | 3 2 1 0 |
651
+ +---------+----+----+----+----+----+----+
652
+ 9 | Decay level (DL) | 2st decay (D2R) |
653
+ | 3 2 1 0 | 3 2 1 0 |
654
+ +---------+----+----+----+----+----+----+
655
+ 10 | Rate compensation | Release rate (RR) |
656
+ | 3 2 1 0 | 3 2 1 0 |
657
+ +----+----+----+----+----+----+----+----+
658
+ 11 | | AM |
659
+ | ---------------------- | A2 A1 A0 |
660
+ +------------------------+----+----+----+ -------------------------
661
+ | | Header for tone No.1
662
+ | |
663
+ | | -------------------------
664
+ |The following is the waveform data for | Header for tone No.2-283
665
+ |tone numbers 0-383 |
666
+ +---------------------------------------+ -------------------------
667
+ | |
668
+ | D15 D14 D13 D12 D11 D10 D9 D8 |
669
+ +----+----+----+----+----+----+----+----+ For 16 bit data
670
+ | |
671
+ | D7 D6 D5 D4 D3 D2 D1 D0 |
672
+ +----+----+----+----+----+----+----+----+ -------------------------
673
+ | 1st data |
674
+ | D11 D10 D9 D8 D7 D6 D5 D4 |
675
+ +----+----+----+----+----+----+----+----+
676
+ | 1st data | 2nd data |
677
+ | D3 D2 D1 D0 | D3 D2 D1 D0 | For 12 bit data
678
+ +----+----+----+----+----+----+----+----+
679
+ | 2nd data |
680
+ | D7 D6 D5 D4 D3 D2 D1 D0 |
681
+ +----+----+----+----+----+----+----+----+ -------------------------
682
+ | |
683
+ | D7 D6 D5 D4 D3 D2 D1 D0 | For 8 bit data
684
+ +----+----+----+----+----+----+----+----+ -------------------------
685
+
686
+ Note that the end and loop addresses are NOT in bytes but indicate the number
687
+ of samples! This means that the maximum size for a 8-bit sample is 64K, for
688
+ a 12-bit sample 96K and for a 16-bit sample 128K.