X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fsound%2Fym2612.c;h=4b74826c8406d259e12c9f80e6901068e92ed544;hb=4936aac1cac5db9c8a0bec2d743d05be5c799f1f;hp=144c334f60a3ae1fa22bc8ede83483a75804a79b;hpb=dca310c413517d278898b967cfe610574310acd8;p=picodrive.git diff --git a/Pico/sound/ym2612.c b/Pico/sound/ym2612.c index 144c334..4b74826 100644 --- a/Pico/sound/ym2612.c +++ b/Pico/sound/ym2612.c @@ -116,7 +116,7 @@ #ifndef EXTERNAL_YM2612 #include // let it be 1 global to simplify things -static YM2612 ym2612; +YM2612 ym2612; #else extern YM2612 *ym2612_940; @@ -1584,11 +1584,6 @@ static int OPNWriteReg(int r, int v) /* YM2612 local section */ /*******************************************************************************/ -int *ym2612_dacen; -INT32 *ym2612_dacout; -FM_ST *ym2612_st; - - /* Generate samples for YM2612 */ int YM2612UpdateOne_(int *buffer, int length, int stereo, int is_buf_empty) { @@ -1653,11 +1648,6 @@ int YM2612UpdateOne_(int *buffer, int length, int stereo, int is_buf_empty) /* initialize YM2612 emulator */ void YM2612Init_(int clock, int rate) { - // notaz - ym2612_dacen = &ym2612.dacen; - ym2612_dacout = &ym2612.dacout; - ym2612_st = &ym2612.OPN.ST; - memset(&ym2612, 0, sizeof(ym2612)); init_tables(); @@ -1728,9 +1718,6 @@ int YM2612Write_(unsigned int a, unsigned int v) } addr = ym2612.OPN.ST.address; -#ifndef EXTERNAL_YM2612 - ym2612.REGS[addr] = v; -#endif switch( addr & 0xf0 ) { @@ -1747,6 +1734,7 @@ int YM2612Write_(unsigned int a, unsigned int v) ym2612.OPN.lfo_inc = 0; } break; +#if 0 // handled elsewhere case 0x24: { // timer A High 8 int TAnew = (ym2612.OPN.ST.TA & 0x03)|(((int)v)<<2); if(ym2612.OPN.ST.TA != TAnew) { @@ -1781,6 +1769,7 @@ int YM2612Write_(unsigned int a, unsigned int v) set_timers( v ); ret=0; break; +#endif case 0x28: /* key on / off */ { UINT8 c; @@ -1794,6 +1783,7 @@ int YM2612Write_(unsigned int a, unsigned int v) if(v&0x80) FM_KEYON(c,SLOT4); else FM_KEYOFF(c,SLOT4); break; } +#if 0 case 0x2a: /* DAC data (YM2612) */ ym2612.dacout = ((int)v - 0x80) << 6; /* level unknown (notaz: 8 seems to be too much) */ ret=0; @@ -1803,6 +1793,7 @@ int YM2612Write_(unsigned int a, unsigned int v) ym2612.dacen = v & 0x80; ret=0; break; +#endif default: break; } @@ -1826,9 +1817,6 @@ int YM2612Write_(unsigned int a, unsigned int v) } addr = ym2612.OPN.ST.address | 0x100; -#ifndef EXTERNAL_YM2612 - ym2612.REGS[addr] = v; -#endif ret = OPNWriteReg(addr, v); break; @@ -1875,26 +1863,7 @@ int YM2612PicoTick_(int n) void YM2612PicoStateLoad_(void) { -#ifndef EXTERNAL_YM2612 - int i, real_A1 = ym2612.addr_A1; - - reset_channels( &ym2612.CH[0] ); - - // feed all the registers and update internal state - for(i = 0; i < 0x100; i++) { - YM2612Write_(0, i); - YM2612Write_(1, ym2612.REGS[i]); - } - - for(i = 0; i < 0x100; i++) { - YM2612Write_(2, i); - YM2612Write_(3, ym2612.REGS[i|0x100]); - } - - ym2612.addr_A1 = real_A1; -#else reset_channels( &ym2612.CH[0] ); -#endif } #ifndef EXTERNAL_YM2612