Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vendor:yamaha:opl2 [2019/02/24 18:59]
lord_nightmare add more info and errata about the test register bit 5
vendor:yamaha:opl2 [2019/03/19 00:27] (current)
lord_nightmare some cleanup and give the nukeykt vrc7 patchset in 8-byte raw patch format
Line 3: Line 3:
  
 ======= Official Documentation:​ ======= ======= Official Documentation:​ =======
-===== Datasheets ====+===== Datasheets ​=====
   * The YM3812/OPL2 datasheet can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ym3812_ds.pdf|here]].   * The YM3812/OPL2 datasheet can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ym3812_ds.pdf|here]].
   * The YM3526/OPL datasheet can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ym3526.pdf|here]].   * The YM3526/OPL datasheet can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ym3526.pdf|here]].
Line 14: Line 14:
 ===== Application Manuals ===== ===== Application Manuals =====
   * The YM3526 application manual is not scanned. If you have a copy, please let us know!   * The YM3526 application manual is not scanned. If you have a copy, please let us know!
-  * The YM3812/OPL2 application manual ​is scanned, but it is not posted in a public location yet. It will most likely live on archive.org ​somewhere.+  * The YM3812/OPL2 application manual ​can be found [[https://archive.org/​details/​YamahaYM3812ApplicationManual|here]].
   * The YMF262/OPL3 application manual can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ymf262.pdf|here]].   * The YMF262/OPL3 application manual can be found [[http://​map.grauw.nl/​resources/​sound/​yamaha_ymf262.pdf|here]].
 === Known errata/​omissions:​ === === Known errata/​omissions:​ ===
   * Errata: Table 3-2 on page 12 of the YM3812/OPL2 application manual has the D4 value in the first column incorrect for the second entry from the top: the top entry is 0, and the second entry is listed as 0 but should be 1.   * Errata: Table 3-2 on page 12 of the YM3812/OPL2 application manual has the D4 value in the first column incorrect for the second entry from the top: the top entry is 0, and the second entry is listed as 0 but should be 1.
   * Errata: Bit D5(0x20) 'OPL2 MODE' of the test register(0x01) in the YM3812/OPL2 datasheet is improperly explained on both the datasheet and in the application manual. When bit D5 (0x20) is CLEAR, writes to registers 0xE0-0xF5 are suppressed, but the operation of said registers continues with whatever value was last written to them. This means if you set TEST(0x01) bit D5, write non-zero values to registers 0xE0-0xF5, then clear TEST(0x01) bit D5, the wave generators will continue to use the values previously written to 0xE0-0xF5 even though the chip is technically in 'non OPL2' mode. To work around this, before switching the chip to 'non OPL2' mode, ensure the chip is in '​OPL2'​ mode by writing 0x20 to TEST(0x01), then write values of 0x00 to all registers from 0xE0-0xF5, and finally write 0x00 to TEST(0x01).   * Errata: Bit D5(0x20) 'OPL2 MODE' of the test register(0x01) in the YM3812/OPL2 datasheet is improperly explained on both the datasheet and in the application manual. When bit D5 (0x20) is CLEAR, writes to registers 0xE0-0xF5 are suppressed, but the operation of said registers continues with whatever value was last written to them. This means if you set TEST(0x01) bit D5, write non-zero values to registers 0xE0-0xF5, then clear TEST(0x01) bit D5, the wave generators will continue to use the values previously written to 0xE0-0xF5 even though the chip is technically in 'non OPL2' mode. To work around this, before switching the chip to 'non OPL2' mode, ensure the chip is in '​OPL2'​ mode by writing 0x20 to TEST(0x01), then write values of 0x00 to all registers from 0xE0-0xF5, and finally write 0x00 to TEST(0x01).
 +
 +======= Chip-specific Notes =======
 +===== YM2413/VRC7 =======
 +OPL Light/​Light,​ aka OPLL, is a cost-reduced version of OPL2 that hard-codes 15 preset instruments and allows for 1 custom instrument to be created. The instrument ROM saves silicon die space compared to registers. One nagging problem with OPLL is that up until recently, there was no known way to extract the instrument ROM contents. Thus, emulation of preset instruments was based on empirical approximations.
 +=== YM2413 Instruments ===
 +There is at present no die image of YM2413. In the near future, [[https://​whitequark.org|whitequark]] will provide a die image suitable for RE. It is anticipated that the instruments ROM will be an implant ROM. This implies a delayering or staining to read out its contents.
 +
 +=== VRC7 Debug Mode ===
 +TODO (involves grounding pin 15)
 +
 +==== VRC7 Instrument ROM Dump ====
 +Fellow Yamaha enthusiast [[https://​nukeykt.retrohost.net|NukeYKT]] [[https://​freenode.irclog.whitequark.org/​~h~yamahasynths/​2019-03-15#​24228789;​|dumped]] the instrument table using the aforementioned debug mode. The table is reproduced here (Rhythm instruments have not been dumped yet):
 +<​code>​
 +/* Order of array = { modulator, carrier } */
 +typedef struct {
 +    Bit8u tl;
 +    Bit8u dc;
 +    Bit8u dm;
 +    Bit8u fb;
 +    Bit8u am[2];
 +    Bit8u vib[2];
 +    Bit8u et[2];
 +    Bit8u ksr[2];
 +    Bit8u multi[2];
 +    Bit8u ksl[2];
 +    Bit8u ar[2];
 +    Bit8u dr[2];
 +    Bit8u sl[2];
 +    Bit8u rr[2];
 +} opll_patch_t;​
 +
 +static const opll_patch_t patch_ds1001[opll_patch_max] = {
 +    { 0x05, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x08 },{ 0x08, 0x01 },{ 0x04, 0x02 },{ 0x02, 0x07 } },
 +    { 0x14, 0x00, 0x01, 0x05,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x0f },{ 0x08, 0x06 },{ 0x02, 0x01 },{ 0x03, 0x02 } },
 +    { 0x08, 0x00, 0x01, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0b },{ 0x0a, 0x02 },{ 0x02, 0x01 },{ 0x00, 0x02 } },
 +    { 0x0c, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x06, 0x02 },{ 0x01, 0x07 } },
 +    { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x01, 0x06 },{ 0x00, 0x02 },{ 0x01, 0x08 } },
 +    { 0x06, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0e },{ 0x03, 0x02 },{ 0x0f, 0x0f },{ 0x04, 0x04 } },
 +    { 0x1d, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x07 } },
 +    { 0x22, 0x01, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x07 },{ 0x02, 0x02 },{ 0x00, 0x01 },{ 0x01, 0x07 } },
 +    { 0x25, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x04, 0x07 },{ 0x00, 0x03 },{ 0x07, 0x00 },{ 0x02, 0x01 } },
 +    { 0x0f, 0x00, 0x01, 0x07,{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x00 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0a },{ 0x08, 0x05 },{ 0x05, 0x00 },{ 0x01, 0x02 } },
 +    { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x02, 0x02 } },
 +    { 0x11, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x06, 0x07 },{ 0x05, 0x04 },{ 0x01, 0x01 },{ 0x08, 0x06 } },
 +    { 0x13, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x02 },{ 0x03, 0x00 },{ 0x0c, 0x09 },{ 0x09, 0x05 },{ 0x00, 0x00 },{ 0x03, 0x02 } },
 +    { 0x0c, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x09, 0x0c },{ 0x04, 0x00 },{ 0x03, 0x0f },{ 0x03, 0x06 } },
 +    { 0x0d, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x01, 0x02 },{ 0x00, 0x00 },{ 0x0c, 0x0d },{ 0x01, 0x05 },{ 0x05, 0x00 },{ 0x06, 0x06 } },
 +    /* TODO */
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 } }
 +};
 +</​code>​
 +
 +This translates into a patchset of:
 +<​code>​
 +0: $03 $21 $05 $06 $E8 $81 $42 $27
 +1: $13 $41 $14 $0D $D8 $F6 $23 $12
 +2: $11 $11 $08 $08 $FA $B2 $20 $12
 +3: $31 $61 $0C $07 $A8 $64 $61 $27
 +4: $32 $21 $1E $06 $E1 $76 $01 $28
 +5: $02 $01 $06 $00 $A3 $E2 $F4 $F4
 +6: $21 $61 $1D $07 $82 $81 $11 $07
 +7: $23 $21 $22 $17 $A2 $72 $01 $17
 +8: $35 $11 $25 $00 $40 $73 $72 $01
 +9: $B5 $01 $0F $0F $A8 $A5 $51 $02
 +A: $17 $C1 $24 $07 $F8 $F8 $22 $12
 +B: $71 $23 $11 $06 $65 $74 $18 $16
 +C: $01 $02 $D3 $05 $C9 $95 $03 $02
 +D: $61 $63 $0C $00 $94 $C0 $33 $F6
 +E: $21 $72 $0D $00 $C1 $D5 $56 $06
 +</​code>​
 +
 
vendor/yamaha/opl2.1551052768.txt.gz ยท Last modified: 2019/02/24 18:59 by lord_nightmare
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki