User Tools

Site Tools


vendor:yamaha:opl2

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vendor:yamaha:opl2 [2019/12/23 12:53] – add note about LFSR being reset to 1s by test bit 1 lord_nightmarevendor:yamaha:opl2 [2019/12/30 18:27] (current) – clarify notes about ym2413 instrument rom source lord_nightmare
Line 23: Line 23:
 ===== YM2413/VRC7 ======= ===== 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. 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. 
- 
 === YM2413 D0/D1 debug state === === YM2413 D0/D1 debug state ===
 from Nuke.YKT's notes at https://pastebin.com/H5s4WQQ8 : from Nuke.YKT's notes at https://pastebin.com/H5s4WQQ8 :
Line 67: Line 64:
  
 <nukeykt> For all configs A13(pin 2)=1, M2(pin 47)=0, P15=0, [...] For config 0: /CS=1, /WR=1, A0=1, for config 1: /CS=1, /WR=1, A0=0, etc. <nukeykt> For all configs A13(pin 2)=1, M2(pin 47)=0, P15=0, [...] For config 0: /CS=1, /WR=1, A0=1, for config 1: /CS=1, /WR=1, A0=0, etc.
 +
 +==== YM2413 Instrument ROM ====
 +These values were initially created using hardware tests by nukeykt, but later were corrected by crosschecking data with the visible bits on the fhb013 (presumably ym2413b) die shot, located at [[https://siliconpr0n.org/archive/doku.php?id=digshadow:yamaha:fhb013]] .
 +<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_ym2413[opll_patch_max] = {
 +    { 0x1e, 0x01, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x07 },{ 0x00, 0x08 },{ 0x00, 0x01 },{ 0x00, 0x07 } },
 +    { 0x1a, 0x00, 0x01, 0x05,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x0f },{ 0x08, 0x07 },{ 0x02, 0x01 },{ 0x03, 0x03 } },
 +    { 0x19, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0c },{ 0x02, 0x04 },{ 0x01, 0x02 },{ 0x01, 0x03 } },
 +    { 0x0e, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x07, 0x02 },{ 0x00, 0x07 } },
 +    { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x00, 0x06 },{ 0x00, 0x02 },{ 0x00, 0x08 } },
 +    { 0x16, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x02 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x08 } },
 +    { 0x1d, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x07 } },
 +    { 0x2d, 0x01, 0x00, 0x04,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x07 },{ 0x02, 0x02 },{ 0x00, 0x00 },{ 0x00, 0x07 } },
 +    { 0x1b, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x06, 0x06 },{ 0x04, 0x05 },{ 0x01, 0x01 },{ 0x00, 0x07 } },
 +    { 0x0b, 0x01, 0x01, 0x00,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x0f },{ 0x05, 0x07 },{ 0x07, 0x00 },{ 0x01, 0x07 } },
 +    { 0x03, 0x01, 0x00, 0x01,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0e },{ 0x0a, 0x04 },{ 0x01, 0x00 },{ 0x00, 0x04 } },
 +    { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x02, 0x02 } },
 +    { 0x0c, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x0f },{ 0x02, 0x05 },{ 0x02, 0x04 },{ 0x00, 0x02 } },
 +    { 0x15, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x0c, 0x09 },{ 0x09, 0x05 },{ 0x00, 0x00 },{ 0x03, 0x02 } },
 +    { 0x09, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0e },{ 0x01, 0x04 },{ 0x04, 0x01 },{ 0x00, 0x03 } },
 +
 +    { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x04 },{ 0x00, 0x08 } },
 +    { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } }
 +};
 +</code>
 +
 +This translates into a patchset of:
 +<code>
 +0: user patch (irrelevant)
 +1: $71 $61 $1E $17 $D0 $78 $00 $17
 +2: $13 $41 $1A $0D $D8 $F7 $23 $13
 +3: $13 $01 $99 $00 $F2 $C4 $11 $23
 +4: $31 $61 $0E $07 $A8 $64 $70 $27
 +5: $32 $21 $1E $06 $E0 $76 $00 $28
 +6: $31 $22 $16 $05 $E0 $71 $00 $18
 +7: $21 $61 $1D $07 $82 $81 $10 $07
 +8: $23 $21 $2D $14 $A2 $72 $00 $07
 +9: $61 $61 $1B $06 $64 $65 $10 $17
 +A: $41 $61 $0B $18 $85 $F7 $71 $07
 +B: $13 $01 $83 $11 $FA $E4 $10 $04
 +C: $17 $C1 $24 $07 $F8 $F8 $22 $12
 +D: $61 $50 $0C $05 $C2 $F5 $20 $42
 +E: $01 $01 $55 $03 $C9 $95 $03 $02
 +F: $61 $41 $89 $03 $F1 $E4 $40 $13
 +
 +Drums
 +BD   : $01 $01 $18 $0F $DF $F8 $6A $6D
 +SD/HH: $01 $01 $00 $00 $C8 $D8 $A7 $48
 +TM/TC: $05 $01 $00 $00 $F8 $AA $59 $55
 +</code>
  
 ==== VRC7 Instrument ROM Dump ==== ==== VRC7 Instrument ROM Dump ====
vendor/yamaha/opl2.1577105594.txt.gz · Last modified: 2019/12/23 12:53 by lord_nightmare