Previous 15994 Revisions Next

r4478 Saturday 11th April, 2009 at 00:30:05 UTC by Barry Rodewald
[X68000] Fixed ADPCM output in software that supports non-standard controllers.
[src/mess/drivers]x68k.c

src/mess/drivers/x68k.c
r4477r4478
680680}
681681
682682// Megadrive 3 button gamepad
683// Multiplexer is controlled by bit 0 in the PPI control port
684683// According to XM6, bits 4 and 7 are always 1 (is this correct?)
684// Bits 4 and 5 of PPI port C control each controller's multiplexer
685// Button inputs (Start, A, B and C) are read in bits 5 and 6 (rather than 4
686// and 5 like on a Megadrive)
687
685688static UINT8 md_3button_r(const device_config* device, int port)
686689{
687690   if(port == 1)
r4477r4478
712715}
713716
714717// Megadrive 6 button gamepad
715// Multiplexer is controlled by bit 0 in the PPI control port
716718static TIMER_CALLBACK(md_6button_port1_timeout)
717719{
718720   x68k_sys.mdctrl.seq1 = 0;
r4477r4478
864866   const device_config *oki = devtag_get_device(device->machine, "okim6258");
865867   static UINT16 prev1;
866868   static UINT16 prev2;
869   static UINT16 prevA;
867870   
868871   ppi_port[2] = data;
869   x68k_sys.adpcm.pan = data & 0x03;
870   x68k_sys.adpcm.rate = data & 0x0c;
871   x68k_set_adpcm(device->machine);
872   okim6258_set_divider(oki, (data >> 2) & 3);
873
872   if((data & 0x0f) != (prevA & 0x0f))
873   {
874      x68k_sys.adpcm.pan = data & 0x03;
875      x68k_sys.adpcm.rate = data & 0x0c;
876      x68k_set_adpcm(device->machine);
877      okim6258_set_divider(oki, (data >> 2) & 3);
878   }
879   prevA = data & 0x0f;
880   
874881   // The joystick enable bits also handle the multiplexer for various controllers
875882   x68k_sys.joy.joy1_enable = data & 0x10;
876883   x68k_sys.mdctrl.mux1 = data & 0x10;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team