From ca96cfadad7bc2bc75becdec76dd3e468d5b6201 Mon Sep 17 00:00:00 2001 From: davidhay Date: Wed, 25 Feb 2009 22:46:15 +0000 Subject: Agemame Integration [James Wallace] (I haven't verified this works, just checking it in for now) --- .gitattributes | 4 + src/mame/drivers/bfm_sc1.c | 1413 +++++++++++++++++++++++++++++ src/mame/drivers/bfm_sc2.c | 83 +- src/mame/drivers/bfmsys85.c | 487 ++++++++++ src/mame/drivers/maygay1b.c | 818 +++++++++++++++++ src/mame/drivers/maygayv1.c | 1106 +++++++++++++++++++++++ src/mame/drivers/mpu4.c | 426 ++++++++- src/mame/drivers/mpu4drvr.c | 5 +- src/mame/drivers/mpu5.c | 3 +- src/mame/layout/bfm_sc1.lay | 2092 +++++++++++++++++++++++++++++++++++++++++++ src/mame/layout/gamball.lay | 2073 ++++++++++++++++++++++++++++++++++++++++++ src/mame/mame.mak | 15 +- src/mame/mamedriv.c | 21 + src/mame/video/awpvid.c | 8 - src/mame/video/bfm_dm01.c | 12 +- 15 files changed, 8459 insertions(+), 107 deletions(-) create mode 100644 src/mame/drivers/bfm_sc1.c create mode 100644 src/mame/drivers/bfmsys85.c create mode 100644 src/mame/drivers/maygay1b.c create mode 100644 src/mame/drivers/maygayv1.c diff --git a/.gitattributes b/.gitattributes index 3c0ea980ea1..a1fd3c9e39c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1283,7 +1283,9 @@ src/mame/drivers/beezer.c svneol=native#text/plain src/mame/drivers/berzerk.c svneol=native#text/plain src/mame/drivers/bestleag.c svneol=native#text/plain src/mame/drivers/bfcobra.c svneol=native#text/plain +src/mame/drivers/bfm_sc1.c svneol=native#text/plain src/mame/drivers/bfm_sc2.c svneol=native#text/plain +src/mame/drivers/bfmsys85.c svneol=native#text/plain src/mame/drivers/big10.c svneol=native#text/plain src/mame/drivers/bigevglf.c svneol=native#text/plain src/mame/drivers/bigfghtr.c svneol=native#text/plain @@ -1708,6 +1710,8 @@ src/mame/drivers/markham.c svneol=native#text/plain src/mame/drivers/mastboy.c svneol=native#text/plain src/mame/drivers/matmania.c svneol=native#text/plain src/mame/drivers/maxaflex.c svneol=native#text/plain +src/mame/drivers/maygay1b.c svneol=native#text/plain +src/mame/drivers/maygayv1.c svneol=native#text/plain src/mame/drivers/mayumi.c svneol=native#text/plain src/mame/drivers/mazerbla.c svneol=native#text/plain src/mame/drivers/mcatadv.c svneol=native#text/plain diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c new file mode 100644 index 00000000000..391e5759522 --- /dev/null +++ b/src/mame/drivers/bfm_sc1.c @@ -0,0 +1,1413 @@ +/***************************************************************************************** + + Bellfruit scorpion1 driver, (under heavy construction !!!) + + A.G.E Code Copyright J. Wallace and the AGEMAME Development Team. + Visit http://www.mameworld.net/agemame/ for more information. + + M.A.M.E Core Copyright Nicola Salmoria and the MAME Team, + used under license from http://mamedev.org + +****************************************************************************************** + + 20-01-2007: J Wallace: Tidy up of coding + 30-12-2006: J Wallace: Fixed init routines. + 07-03-2006: El Condor: Recoded to more accurately represent the hardware setup. + 19-08-2005: Re-Animator + 16-08-2005: Converted to MAME protocol for when Viper board is completed. + 25-08-2005: Added support for adder2 (Toppoker), added support for NEC upd7759 soundcard + +Standard scorpion1 memorymap +___________________________________________________________________________________ + hex |r/w| D D D D D D D D | + location | | 7 6 5 4 3 2 1 0 | function +-----------+---+-----------------+------------------------------------------------- +0000-1FFF |R/W| D D D D D D D D | RAM (8k) battery backed up +-----------+---+-----------------+------------------------------------------------- +2000-21FF | W | D D D D D D D D | Reel 3 + 4 stepper latch +-----------+---+-----------------+------------------------------------------------- +2200-23FF | W | D D D D D D D D | Reel 1 + 2 stepper latch +-----------+---+-----------------+------------------------------------------------- +2400-25FF | W | D D D D D D D D | vfd + coin inhibits +-----------+---+-----------------+------------------------------------------------- +2600-27FF | W | D D D D D D D D | electro mechanical meters +-----------+---+-----------------+------------------------------------------------- +2800-28FF | W | D D D D D D D D | triacs used for payslides/hoppers +-----------+---+-----------------+------------------------------------------------- +2A00 |R/W| D D D D D D D D | MUX1 control reg (IN: mux inputs, OUT:lamps) +-----------+---+-----------------+------------------------------------------------- +2A01 | W | D D D D D D D D | MUX1 low data bits +-----------+---+-----------------+------------------------------------------------- +2A02 | W | D D D D D D D D | MUX1 hi data bits +-----------+---+-----------------+------------------------------------------------- +2E00 | R | ? ? ? ? ? ? D D | IRQ status +-----------+---+-----------------+------------------------------------------------- +3001 | | D D D D D D D D | AY-8912 data +-----------+---+-----------------+------------------------------------------------- +3101 | W | D D D D D D D D | AY-8912 address +-----------+---+-----------------+------------------------------------------------- +3406 |R/W| D D D D D D D D | MC6850 +-----------+---+-----------------+------------------------------------------------- +3407 |R/W| D D D D D D D D | MC6850 +-----------+---+-----------------+------------------------------------------------- +3408 |R/W| D D D D D D D D | MUX2 control reg (IN: reel optos, OUT: lamps) +-----------+---+-----------------+------------------------------------------------- +3409 | W | D D D D D D D D | MUX2 low data bits +-----------+---+-----------------+------------------------------------------------- +340A | W | D D D D D D D D | MUX2 hi data bits +-----------+---+-----------------+------------------------------------------------- +3600 | W | ? ? ? ? ? ? D D | ROM page select (select page 3 after reset) +-----------+---+-----------------+------------------------------------------------- +4000-5FFF | R | D D D D D D D D | ROM (8k) +-----------+---+-----------------+------------------------------------------------- +6000-7FFF | R | D D D D D D D D | Paged ROM (8k) + | | | page 0 : rom area 0x0000 - 0x1FFF + | | | page 1 : rom area 0x2000 - 0x3FFF + | | | page 2 : rom area 0x4000 - 0x5FFF + | | | page 3 : rom area 0x6000 - 0x7FFF +-----------+---+-----------------+------------------------------------------------- +8000-FFFF | R | D D D D D D D D | ROM (32k) +-----------+---+-----------------+------------------------------------------------- + +Optional (on expansion card) (Viper) +-----------+---+-----------------+------------------------------------------------- +3404 | R | D D D D D D D D | Coin acceptor, direct input +-----------+---+-----------------+------------------------------------------------- +3800-38FF |R/W| D D D D D D D D | NEC uPD7759 soundchip W:control R:status + | | | normally 0x3801 is used can conflict with reel5+6 +-----------+---+-----------------+------------------------------------------------- +3800-38FF | W | D D D D D D D D | Reel 5 + 6 stepper latch (normally 0x3800 used) +-----------+---+-----------------+------------------------------------------------- + +***************************************************************************/ + +#include "driver.h" +#include "cpu/m6809/m6809.h" +#include "cpu/z80/z80.h" +#include "video/awpvid.h" +#include "video/bfm_adr2.h" +#include "machine/steppers.h" // stepper motor +#include "machine/bfm_bd1.h" // vfd +#include "machine/meters.h" +#include "sound/ay8910.h" +#include "sound/upd7759.h" +#include "bfm_sc1.lh" +#define VFD_RESET 0x20 +#define VFD_CLOCK1 0x80 +#define VFD_DATA 0x40 + +#define MASTER_CLOCK (XTAL_4MHz) +#define ADDER_CLOCK (XTAL_8MHz) + +// local vars ///////////////////////////////////////////////////////////// + +static int mmtr_latch; // mechanical meter latch +static int triac_latch; // payslide triac latch +static int vfd_latch; // vfd latch +static int irq_status; // custom chip IRQ status +static int optic_pattern; // reel optics +static int acia_status; // MC6850 status +static int locked; // hardware lock/unlock status (0=unlocked) +static int is_timer_enabled; +static int reel_changed; +static int coin_inhibits; +static int mux1_outputlatch; +static int mux1_datalo; +static int mux1_datahi; +static int mux1_input; + +static int mux2_outputlatch; +static int mux2_datalo; +static int mux2_datahi; +static int mux2_input; + +static int watchdog_cnt; +static int watchdog_kicked; + +// user interface stuff /////////////////////////////////////////////////// + +static UINT8 Lamps[256]; // 256 multiplexed lamps +static UINT8 sc1_Inputs[64]; // 64? multiplexed inputs + +/////////////////////////////////////////////////////////////////////////// + +static void Scorpion1_SetSwitchState(int strobe, int data, int state) +{ + if ( state ) sc1_Inputs[strobe] |= (1<machine,1,data & 0x03); +} + +/////////////////////////////////////////////////////////////////////////// + +static INTERRUPT_GEN( timer_irq ) +{ + if ( watchdog_kicked ) + { + watchdog_cnt = 0; + watchdog_kicked = 0; + } + else + { + watchdog_cnt++; + if ( watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine + { // reset board + mame_schedule_soft_reset(device->machine);// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !! + return; + } + } + + if ( is_timer_enabled ) + { + irq_status = 0x01 |0x02; //0xff; + + sc1_Inputs[2] = input_port_read(device->machine,"STROBE0"); + + generic_pulse_irq_line(device->machine->cpu[0], M6809_IRQ_LINE); + } +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( irqlatch_r ) +{ + int result = irq_status | 0x02; + + irq_status = 0; + + return result; +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( reel12_w ) +{ + if ( locked & 0x01 ) + { // hardware is still locked, + if ( data == 0x46 ) locked &= ~0x01; + } + else + { + if ( stepper_update(0, data>>4) ) reel_changed |= 0x01; + if ( stepper_update(1, data ) ) reel_changed |= 0x02; + + if ( stepper_optic_state(0) ) optic_pattern |= 0x01; + else optic_pattern &= ~0x01; + if ( stepper_optic_state(1) ) optic_pattern |= 0x02; + else optic_pattern &= ~0x02; + } + awp_draw_reel(0); + awp_draw_reel(1); +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( reel34_w ) +{ + if ( locked & 0x02 ) + { // hardware is still locked, + if ( data == 0x42 ) locked &= ~0x02; + } + else + { + if ( stepper_update(2, data>>4) ) reel_changed |= 0x04; + if ( stepper_update(3, data ) ) reel_changed |= 0x08; + + if ( stepper_optic_state(2) ) optic_pattern |= 0x04; + else optic_pattern &= ~0x04; + if ( stepper_optic_state(3) ) optic_pattern |= 0x08; + else optic_pattern &= ~0x08; + } + awp_draw_reel(2); + awp_draw_reel(3); +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( reel56_w ) +{ + if ( stepper_update(4, data>>4) ) reel_changed |= 0x10; + if ( stepper_update(5, data ) ) reel_changed |= 0x20; + + if ( stepper_optic_state(4) ) optic_pattern |= 0x10; + else optic_pattern &= ~0x10; + if ( stepper_optic_state(5) ) optic_pattern |= 0x20; + else optic_pattern &= ~0x20; + awp_draw_reel(5); + awp_draw_reel(6); +} + +/////////////////////////////////////////////////////////////////////////// +// mechanical meters ////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mmtr_w ) +{ + int i; + if ( locked & 0x04 ) + { // hardware is still locked, + locked &= ~0x04; + } + else + { + int changed = mmtr_latch ^ data; + UINT64 cycles = cpu_get_total_cycles(space->cpu); + + mmtr_latch = data; + + for (i=0; i<8; i++) + { + if ( changed & (1 << i) ) + { + Mechmtr_update(i, cycles, data & (1 << i) ); + generic_pulse_irq_line(space->machine->cpu[0], M6809_FIRQ_LINE); + } + } + } +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mmtr_r ) +{ + return mmtr_latch; +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( dipcoin_r ) +{ + return input_port_read(space->machine,"STROBE0") & 0x1F; +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_DEVICE_HANDLER( nec_r ) +{ + return 1; +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( vfd_w ) +{ + int changed = vfd_latch ^ data; + + vfd_latch = data; + + if ( changed ) + { + if ( changed & VFD_RESET ) + { // vfd reset line changed + if ( !(data & VFD_RESET) ) + { // reset the vfd + BFM_BD1_reset(0); + BFM_BD1_reset(1); + BFM_BD1_reset(2); + } + } + if ( changed & VFD_CLOCK1 ) + { // clock line changed + if ( !(data & VFD_CLOCK1) && (data & VFD_RESET) ) + { // new data clocked into vfd + BFM_BD1_shift_data(0, data & VFD_DATA ); + } + } + BFM_BD1_draw(0); + BFM_BD1_draw(1); + BFM_BD1_draw(2); + } +} + +///////////////////////////////////////////////////////////////////////////////////// +// input / output multiplexers ////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// + +// conversion table BFM strobe data to internal lamp numbers + +static const UINT8 BFM_strcnv[] = +{ + 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7, + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7, + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7, + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, + 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7, + 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, + + 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, + 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, + 0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, 0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, + 0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, 0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, + 0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, 0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, + 0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, 0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, + 0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, 0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, + 0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, 0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +//ACIA helper functions + +static void send_to_adder(running_machine *machine, int data) +{ + adder2_data_from_sc2 = 1; // set flag, data from scorpion2 board available + adder2_sc2data = data; // store data + + adder2_acia_triggered = 1; // set flag, acia IRQ triggered + cpu_set_input_line(machine->cpu[1], M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ +} + +/////////////////////////////////////////////////////////////////////////// + +static int receive_from_adder(void) +{ + int data = adder2_data; + adder2_data_to_sc2 = 0; // clr flag, data from adder available + + return data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux1latch_r ) +{ + return mux1_input; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux1datlo_r ) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux1dathi_r ) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux1latch_w ) +{ + int changed = mux1_outputlatch ^ data; + static const char *const portnames[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7" }; + mux1_outputlatch = data; + + if ( changed & 0x08 ) + { // clock changed + + int input_strobe = data & 0x07; + if ( !(data & 0x08) ) + { // clock changed to low + int strobe, offset, pattern, i; + + strobe = data & 0x07; + offset = strobe<<4; + pattern = 0x01; + + for ( i = 0; i < 8; i++ ) + { + Lamps[ BFM_strcnv[offset ] ] = mux1_datalo & pattern?1:0; + Lamps[ BFM_strcnv[offset+8] ] = mux1_datahi & pattern?1:0; + pattern<<=1; + offset++; + } + + if (strobe == 0) + { + for ( i = 0; i < 256; i++ ) + { + output_set_lamp_value(i, Lamps[i]); + } + } + } + + if ( !(data & 0x08) ) + { + sc1_Inputs[ input_strobe ] = input_port_read(space->machine,portnames[input_strobe]); + + mux1_input = sc1_Inputs[ input_strobe ]; + } + } +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux1datlo_w ) +{ + mux1_datalo = data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux1dathi_w ) +{ + mux1_datahi = data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux2latch_r ) +{ + return mux2_input; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux2datlo_r ) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mux2dathi_r ) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux2latch_w ) +{ + int changed = mux2_outputlatch ^ data; + + mux2_outputlatch = data; + + if ( changed & 0x08 ) + { // clock changed + + if ( (!data & 0x08) ) + { // clock changed to low + int strobe, offset, pattern, i; + + strobe = data & 0x07; + offset = 128+(strobe<<4); + pattern = 0x01; + + for ( i = 0; i < 8; i++ ) + { + Lamps[ BFM_strcnv[offset ] ] = mux2_datalo & pattern?1:0; + Lamps[ BFM_strcnv[offset+8] ] = mux2_datahi & pattern?1:0; + pattern<<=1; + offset++; + } + } + + if ( !(data & 0x08) ) + { + mux2_input = 0x3F ^ optic_pattern; + } + } +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux2datlo_w ) +{ + mux2_datalo = data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux2dathi_w ) +{ + mux2_datahi = data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( watchdog_w ) +{ + watchdog_kicked = 1; +} + +///////////////////////////////////////////////////////////////////////////////////// +// serial port ////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( aciactrl_w ) +{ +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( aciadata_w ) +{ +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( aciastat_r ) +{ + return acia_status; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( aciadata_r ) +{ + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////// +// payslide triacs ////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( triac_w ) +{ + triac_latch = data; +} + +///////////////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( triac_r ) +{ + return triac_latch; +} + +///////////////////////////////////////////////////////////////////////////////////// +#ifdef UNUSED_FUNCTION +static WRITE8_DEVICE_HANDLER( nec_reset_w ) +{ + upd7759_start_w(device, 0); + upd7759_reset_w(device, data); +} +#endif +///////////////////////////////////////////////////////////////////////////////////// +static WRITE8_DEVICE_HANDLER( nec_latch_w ) +{ + upd7759_port_w (device, 0, data&0x3F); // setup sample + upd7759_start_w(device, 0); + upd7759_start_w(device, 1); // start +} + +///////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( vid_uart_tx_w ) +{ + send_to_adder(space->machine,data); +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( vid_uart_ctrl_w ) +{ +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( vid_uart_rx_r ) +{ + int data = receive_from_adder(); + + return data; +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( vid_uart_ctrl_r ) +{ + int status = 0; + + if ( adder2_data_to_sc2 ) status |= 0x01; // receive buffer full + if ( !adder2_data_from_sc2) status |= 0x02; // transmit buffer empty + + return status; +} + +// scorpion1 board init /////////////////////////////////////////////////// + +static const UINT16 AddressDecode[]= +{ + 0x0800,0x1000,0x0001,0x0004,0x0008,0x0020,0x0080,0x0200, + 0x0100,0x0040,0x0002,0x0010,0x0400,0x2000,0x4000,0x8000, + + 0 +}; + +static const UINT8 DataDecode[]= +{ + 0x02,0x08,0x20,0x40,0x10,0x04,0x01,0x80, + + 0 +}; + +static UINT8 codec_data[256]; + + +static void decode_sc1(running_machine *machine,const char *rom_region) +{ + UINT8 *tmp, *rom; + + rom = memory_region(machine,rom_region); + + tmp = malloc_or_die(0x10000); + + { + int i; + long address; + + memcpy(tmp, rom, 0x10000); + + for ( i = 0; i < 256; i++ ) + { + UINT8 data, pattern, newdata, *tab; + data = i; + + tab = (UINT8*)DataDecode; + pattern = 0x01; + newdata = 0; + + do + { + newdata |= data & pattern ? *tab : 0; + pattern <<= 1; + } while ( *(++tab) ); + + codec_data[i] = newdata; + } + + for ( address = 0; address < 0x10000; address++) + { + int newaddress,pattern; + UINT16 *tab; + + tab = (UINT16*)AddressDecode; + pattern = 0x0001; + newaddress = 0; + do + { + newaddress |= address & pattern ? *tab : 0; + pattern <<= 1; + } while ( *(++tab) ); + + rom[newaddress] = codec_data[ tmp[address] ]; + } + free( tmp ); + } +} +// machine start (called only once) ///////////////////////////////////////////////// + +static MACHINE_RESET( bfm_sc1 ) +{ + BFM_BD1_init(0); + vfd_latch = 0; + mmtr_latch = 0; + triac_latch = 0; + irq_status = 0; + is_timer_enabled = 1; + coin_inhibits = 0; + mux1_outputlatch = 0x08; // clock HIGH + mux1_datalo = 0; + mux1_datahi = 0; + mux1_input = 0; + mux2_outputlatch = 0x08; // clock HIGH + mux2_datalo = 0; + mux2_datahi = 0; + mux2_input = 0; + + BFM_BD1_reset(0); // reset display1 + BFM_BD1_reset(1); // reset display2 + BFM_BD1_reset(2); // reset display3 + +// reset stepper motors ///////////////////////////////////////////////////////////// + { + int pattern =0, i; + + for ( i = 0; i < 6; i++) + { + stepper_reset_position(i); + if ( stepper_optic_state(i) ) pattern |= 1< 2 ) - { - input_override[strobe-8+4] |= (1<<(data+2)); - - if ( state ) sc2_Inputs[strobe-8+4] |= (1<<(data+2)); - else sc2_Inputs[strobe-8+4] &= ~(1<<(data+2)); - } - else - { - input_override[strobe-8] |= (1<<(data+5)); - - if ( state ) sc2_Inputs[strobe-8] |= (1 << (data+5)); - else sc2_Inputs[strobe-8] &= ~(1 << (data+5)); - } - } - } -} - - -extern int Scorpion2_DMGetSwitchState(int strobe, int data) -{ - int state = 0; - - if ( strobe < 11 && data < 8 ) - { - if ( strobe < 8 ) - { - state = (sc2_Inputs[strobe] & (1< 2 ) - { - state = (sc2_Inputs[strobe-8+4] & (1<<(data+2)) ) ? 1 : 0; - } - else - { - state = (sc2_Inputs[strobe-8] & (1 << (data+5)) ) ? 1 : 0; - } - } - } - return state; -} - - /* Reels 1 and 2 */ static WRITE8_HANDLER( reel12_w ) { @@ -2717,8 +2652,8 @@ static WRITE8_HANDLER( reel12_w ) if ( stepper_optic_state(1) ) optic_pattern |= 0x02; else optic_pattern &= ~0x02; - draw_reel((0)); - draw_reel((1)); + awp_draw_reel(0); + awp_draw_reel(1); } diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c new file mode 100644 index 00000000000..bebcced7889 --- /dev/null +++ b/src/mame/drivers/bfmsys85.c @@ -0,0 +1,487 @@ +/*************************************************************************** + + Bellfruit system85 driver, (under heavy construction !!!) + + A.G.E Code Copyright J. Wallace and the AGEMAME Development Team. + Visit http://www.mameworld.net/agemame/ for more information. + + M.A.M.E Core Copyright Nicola Salmoria and the MAME Team, + used under license from http://mamedev.org + + +****************************************************************************************** + + 19-08-2005: Re-Animator + +Standard system85 memorymap +___________________________________________________________________________ + hex |r/w| D D D D D D D D | + location | | 7 6 5 4 3 2 1 0 | function +-----------+---+-----------------+----------------------------------------- +0000-1FFF |R/W| D D D D D D D D | RAM (8k) battery backed up +-----------+---+-----------------+----------------------------------------- +2000-21FF | W | D D D D D D D D | Reel 3 + 4 stepper latch +-----------+---+-----------------+----------------------------------------- +2200-23FF | W | D D D D D D D D | Reel 1 + 2 stepper latch +-----------+---+-----------------+----------------------------------------- +2400-25FF | W | D D D D D D D D | vfd + coin inhibits +-----------+---+-----------------+----------------------------------------- +2600-27FF | W | D D D D D D D D | electro mechanical meters +-----------+---+-----------------+----------------------------------------- +2800-28FF | W | D D D D D D D D | triacs used for payslides/hoppers +-----------+---+-----------------+----------------------------------------- +2A00 |R/W| D D D D D D D D | MUX data +-----------+---+-----------------+----------------------------------------- +2A01 | W | D D D D D D D D | MUX control +-----------+---+-----------------+----------------------------------------- +2E00 | R | ? ? ? ? ? ? D D | IRQ status +-----------+---+-----------------+----------------------------------------- +3000 | W | D D D D D D D D | AY8912 data +-----------+---+-----------------+----------------------------------------- +3200 | W | D D D D D D D D | AY8912 address reg +-----------+---+-----------------+----------------------------------------- +3402 |R/W| D D D D D D D D | MC6850 control reg +-----------+---+-----------------+----------------------------------------- +3403 |R/W| D D D D D D D D | MC6850 data +-----------+---+-----------------+----------------------------------------- +3600 | W | ? ? ? ? ? ? D D | MUX enable +-----------+---+-----------------+----------------------------------------- +4000-5FFF | R | D D D D D D D D | ROM (8k) +-----------+---+-----------------+----------------------------------------- +6000-7FFF | R | D D D D D D D D | ROM (8k) +-----------+---+-----------------+----------------------------------------- +8000-FFFF | R | D D D D D D D D | ROM (32k) +-----------+---+-----------------+----------------------------------------- + + TODO: - change this + +***************************************************************************/ + +#include "driver.h" +#include "cpu/m6809/m6809.h" +#include "video/awpvid.h" +#include "machine/6850acia.h" +#include "machine/meters.h" +#include "machine/roc10937.h" // vfd +#include "machine/steppers.h" // stepper motor +#include "sound/ay8910.h" + +#define VFD_RESET 0x20 +#define VFD_CLOCK1 0x80 +#define VFD_DATA 0x40 + +#define MASTER_CLOCK (XTAL_4MHz) + +// local prototypes /////////////////////////////////////////////////////// + + +// local vars ///////////////////////////////////////////////////////////// + +static int mmtr_latch; // mechanical meter latch +static int triac_latch; // payslide triac latch +static int vfd_latch; // vfd latch +static int irq_status; // custom chip IRQ status +static int optic_pattern; // reel optics +static int locked; // hardware lock/unlock status (0=unlocked) +static int is_timer_enabled; +static int reel_changed; +static int coin_inhibits; +static int mux_output_strobe; +static int mux_input_strobe; +static int mux_input; + +// user interface stuff /////////////////////////////////////////////////// + +static UINT8 Lamps[128]; // 128 multiplexed lamps +static UINT8 Inputs[64]; // ?? multiplexed inputs + +/////////////////////////////////////////////////////////////////////////// +// Serial Communications (Where does this go?) //////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +UINT8 sys85_data_line_r; +UINT8 sys85_data_line_t; + +static READ_LINE_DEVICE_HANDLER( sys85_data_r ) +{ + return sys85_data_line_r; +} + +static WRITE_LINE_DEVICE_HANDLER( sys85_data_w ) +{ + sys85_data_line_t = state; +} + +static ACIA6850_INTERFACE( m6809_acia_if ) +{ + 500000, + 500000, + DEVCB_LINE(sys85_data_r), + DEVCB_LINE(sys85_data_w), + DEVCB_NULL +}; + +/////////////////////////////////////////////////////////////////////////// +// called if board is reset /////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +static MACHINE_RESET( bfm_sys85 ) +{ + vfd_latch = 0; + mmtr_latch = 0; + triac_latch = 0; + irq_status = 0; + is_timer_enabled = 1; + coin_inhibits = 0; + mux_output_strobe = 0; + mux_input_strobe = 0; + mux_input = 0; + + ROC10937_reset(0); // reset display1 + +// reset stepper motors /////////////////////////////////////////////////// + { + int pattern =0, i; + + for ( i = 0; i < 6; i++) + { + stepper_reset_position(i); + if ( stepper_optic_state(i) ) pattern |= 1<>4) ) reel_changed |= 0x01; + if ( stepper_update(1, data ) ) reel_changed |= 0x02; + + if ( stepper_optic_state(0) ) optic_pattern |= 0x01; + else optic_pattern &= ~0x01; + if ( stepper_optic_state(1) ) optic_pattern |= 0x02; + else optic_pattern &= ~0x02; + awp_draw_reel(0); + awp_draw_reel(1); +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( reel34_w ) +{ + if ( stepper_update(2, data>>4) ) reel_changed |= 0x04; + if ( stepper_update(3, data ) ) reel_changed |= 0x08; + + if ( stepper_optic_state(2) ) optic_pattern |= 0x04; + else optic_pattern &= ~0x04; + if ( stepper_optic_state(3) ) optic_pattern |= 0x08; + else optic_pattern &= ~0x08; + awp_draw_reel(2); + awp_draw_reel(3); +} + +/////////////////////////////////////////////////////////////////////////// +// mechanical meters ////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mmtr_w ) +{ + int i; + int changed = mmtr_latch ^ data; + UINT64 cycles = cpu_get_total_cycles(space->cpu); + + mmtr_latch = data; + + for (i=0; i<8; i++) + if ( changed & (1 << i) ) Mechmtr_update(i, cycles, data & (1 << i) ); + + if ( data ) generic_pulse_irq_line(space->machine->cpu[0], M6809_FIRQ_LINE); +} +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( mmtr_r ) +{ + return mmtr_latch; +} +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( vfd_w ) +{ + int changed = vfd_latch ^ data; + + vfd_latch = data; + + if ( changed ) + { + if ( changed & VFD_RESET ) + { // vfd reset line changed + if ( !(data & VFD_RESET) ) + { // reset the vfd + ROC10937_reset(0); + ROC10937_reset(1); + ROC10937_reset(2); + } + } + + if ( changed & VFD_CLOCK1 ) + { // clock line changed + if ( !(data & VFD_CLOCK1) && (data & VFD_RESET) ) + { // new data clocked into vfd ////////////////////////////////////// + ROC10937_shift_data(0, data & VFD_DATA ); + } + } + ROC10937_draw_16seg(0); + } +} + +////////////////////////////////////////////////////////////////////////////////// +// input / output multiplexers /////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// +// conversion table BFM strobe data to internal lamp numbers +static const UINT8 BFM_strcnv85[] = +{ + 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, 0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, 0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, 0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, 0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, + 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, 0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, + 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, + + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, 0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, + 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7, 0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, + 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7, 0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, + 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7, 0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, + 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, 0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, + 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7, 0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, + 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, 0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; + +/////////////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux_ctrl_w ) +{ + switch ( data & 0xF0 ) + { + case 0x10: + //logerror(" sys85 mux: left entry matrix scan %02X\n", data & 0x0F); + break; + + case 0x20: + //logerror(" sys85 mux: set scan rate %02X\n", data & 0x0F); + break; + + case 0x40: + //logerror(" sys85 mux: read strobe"); + mux_input_strobe = data & 0x07; + + if ( mux_input_strobe == 5 ) Inputs[5] = 0xFF ^ optic_pattern; + + mux_input = ~Inputs[mux_input_strobe]; + break; + + case 0x80: + mux_output_strobe = data & 0x0F; + break; + + case 0xC0: + //logerror(" sys85 mux: clear all outputs\n"); + break; + + case 0xE0: // End of interrupt + break; + + } +} + +static READ8_HANDLER( mux_ctrl_r ) +{ + // software waits for bit7 to become low + + return 0; +} + +static WRITE8_HANDLER( mux_data_w ) +{ + int pattern = 0x01, i, + off = mux_output_strobe<<4; + + for ( i = 0; i < 8; i++ ) + { + Lamps[BFM_strcnv85[off]] = data & pattern ? 1 : 0; + pattern <<= 1; + off++; + } + + if (mux_output_strobe == 0) + { + for ( i = 0; i < 128; i++ ) + { + output_set_lamp_value(i, Lamps[i]); + } + } +} + +static READ8_HANDLER( mux_data_r ) +{ + return mux_input; +} + +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( mux_enable_w ) +{ +} + +/////////////////////////////////////////////////////////////////////////// +// payslide triacs //////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +static WRITE8_HANDLER( triac_w ) +{ + triac_latch = data; +} + +/////////////////////////////////////////////////////////////////////////// + +static READ8_HANDLER( triac_r ) +{ + return triac_latch; +} + +// machine start (called only once) //////////////////////////////////////// + +static MACHINE_START( bfm_sys85 ) +{ + int i; + for ( i = 0; i < 4; i++ ) + { + stepper_config(machine, i, &starpoint_interface_48step); + } + + ROC10937_init(0,MSC1937,1);//? + + awp_reel_setup(); +} + +// memory map for bellfruit system85 board //////////////////////////////// + +static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 ) + + AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) //8k RAM + AM_RANGE(0x2000, 0x21FF) AM_WRITE(reel34_w) // reel 3+4 latch + AM_RANGE(0x2200, 0x23FF) AM_WRITE(reel12_w) // reel 1+2 latch + AM_RANGE(0x2400, 0x25FF) AM_WRITE(vfd_w) // vfd latch + + AM_RANGE(0x2600, 0x27FF) AM_READWRITE(mmtr_r,mmtr_w)// mechanical meter latch + AM_RANGE(0x2800, 0x2800) AM_READ(triac_r) // payslide triacs + AM_RANGE(0x2800, 0x29FF) AM_WRITE(triac_w) // triacs + + AM_RANGE(0x2A00, 0x2A00) AM_READWRITE(mux_data_r,mux_data_w)// mux + AM_RANGE(0x2A01, 0x2A01) AM_READWRITE(mux_ctrl_r,mux_ctrl_w)// mux status register + AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r) // irq latch ( MC6850 / timer ) + + AM_RANGE(0x3000, 0x3000) AM_DEVWRITE(SOUND, "ay", ay8910_data_w) + AM_RANGE(0x3001, 0x3001) AM_READNOP //sound latch + AM_RANGE(0x3200, 0x3200) AM_DEVWRITE(SOUND, "ay", ay8910_address_w) + + AM_RANGE(0x3402, 0x3402) AM_DEVWRITE(ACIA6850, "acia6850_0", acia6850_ctrl_w) + AM_RANGE(0x3403, 0x3403) AM_DEVWRITE(ACIA6850, "acia6850_0", acia6850_data_w) + + AM_RANGE(0x3406, 0x3406) AM_DEVREAD(ACIA6850, "acia6850_0", acia6850_stat_r) + AM_RANGE(0x3407, 0x3407) AM_DEVREAD(ACIA6850, "acia6850_0", acia6850_data_r) + + AM_RANGE(0x3600, 0x3600) AM_WRITE(mux_enable_w) // mux enable + + AM_RANGE(0x4000, 0xffff) AM_READ(SMH_ROM) // 48K ROM + AM_RANGE(0x8000, 0xFFFF) AM_WRITE(watchdog_w) // kick watchdog + +ADDRESS_MAP_END + +// machine driver for system85 board ////////////////////////////////////// + +static MACHINE_DRIVER_START( bfmsys85 ) + MDRV_MACHINE_START(bfm_sys85) // main system85 board initialisation + MDRV_MACHINE_RESET(bfm_sys85) + MDRV_CPU_ADD("main", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz + MDRV_CPU_PROGRAM_MAP(memmap,0) // setup read and write memorymap + MDRV_CPU_PERIODIC_INT(timer_irq, 1000 ) // generate 1000 IRQ's per second + + MDRV_ACIA6850_ADD("acia6850_0", m6809_acia_if) + + MDRV_SPEAKER_STANDARD_MONO("mono") + MDRV_SOUND_ADD("ay",AY8912, MASTER_CLOCK/4) // add AY8912 soundchip + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) + + MDRV_NVRAM_HANDLER(generic_0fill) // load/save nv RAM + + MDRV_DEFAULT_LAYOUT(layout_awpvid16) +MACHINE_DRIVER_END + +// input ports for system85 board ///////////////////////////////////////// + +static INPUT_PORTS_START( bfmsys85 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(3) PORT_NAME("Fl 2.50") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(3) PORT_NAME("Fl 1.00") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(3) PORT_NAME("Fl 0.25") + PORT_BIT( 0xF0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("10") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("11") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("12") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("13") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("14") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("15") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("16") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("17") + + //PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + //PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_SERVICE) PORT_NAME("Bookkeeping") PORT_CODE(KEYCODE_F1) PORT_TOGGLE +INPUT_PORTS_END + + +// ROM definition ///////////////////////////////////////////////////////// + +ROM_START( m_supcrd ) + ROM_REGION( 0x10000, "main", 0 ) + ROM_LOAD( "sc271.bin", 0x8000, 0x8000, CRC(58e9c9df) SHA1(345c5aa279327d7142edc6823aad0cfd40cbeb73)) +ROM_END + +// year,name, parent, machine, input, init, monitor, company, fullname, flags +GAME( 1985,m_supcrd, 0, bfmsys85, bfmsys85, 0, 0, "BFM/ELAM", "Supercards (Dutch, Game Card 39-340-271?)", GAME_NOT_WORKING|GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK ) diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c new file mode 100644 index 00000000000..47a4e54c9ad --- /dev/null +++ b/src/mame/drivers/maygay1b.c @@ -0,0 +1,818 @@ +/***************************************************************************************** + + Maygay M1 A/B driver, (under heavy construction !!!) + + A.G.E Code Copyright J. Wallace and the AGEMAME Development Team. + Visit http://www.mameworld.net/agemame/ for more information. + + M.A.M.E Core Copyright Nicola Salmoria and the MAME Team, + used under license from http://mamedev.org + + This only loads the basic stuff - there needs to be more done to make this run. +******************************************************************************************/ +#include "driver.h" +#include "cpu/m6809/m6809.h" +#include "video/awpvid.h" //Fruit Machines Only +#include "machine/6821pia.h" +#include "machine/68681.h" +#include "machine/meters.h" +#include "machine/roc10937.h" // vfd +#include "machine/steppers.h" // stepper motor +#include "sound/ay8910.h" +#include "sound/2413intf.h" +#include "sound/okim6376.h" +#include "timer.h" + +#define VERBOSE 1 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) + +#define M1_MASTER_CLOCK (8000000) +#define M1_DUART_CLOCK (3680000) + +static struct +{ + const device_config *duart68681; +} maygaym1_devices; + +static UINT8 lamppos; +static int alpha_clock; +static int RAMEN; +static int ALARMEN; +//static int m1_enable; +static int PSUrelay; +static int WDOG; +static int SRSEL; + +static UINT8 Lamps[256]; // 256 multiplexed lamps +static int optic_pattern; + +typedef struct _i8279_state i8279_state; +struct _i8279_state +{ + UINT8 command; + UINT8 mode; + UINT8 prescale; + UINT8 inhibit; + UINT8 clear; + UINT8 ram[16]; + UINT8 read_sensor; + UINT8 write_display; + UINT8 sense_address; + UINT8 sense_auto_inc; + UINT8 disp_address; + UINT8 disp_auto_inc; +}; + +static i8279_state i8279[2]; + +static void m1_draw_lamps(int data,int strobe, int col) +{ + int i; + int scramble[8] = { 0x10, 0x20, 0x40, 0x80, 0x01, 0x02, 0x04, 0x08 }; + + lamppos = strobe + col * 8; + + for ( i = 0; i < 8; i++ ) + { + Lamps[lamppos] = ( data & scramble[i] ); + output_set_lamp_value(lamppos, Lamps[lamppos]); + } + lamppos++; +} + + +/************************************* + * + * 8279 display/keyboard driver + * + *************************************/ + +static void update_outputs(i8279_state *chip, UINT16 which) +{ + static const UINT8 ls48_map[16] = + { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; + int i; + + /* update the items in the bitmask */ + for (i = 0; i < 16; i++) + if (which & (1 << i)) + { + int val; + + val = chip->ram[i] & 0x0f; + if (chip->inhibit & 0x01) + val = chip->clear & 0x0f; + output_set_digit_value(i * 2 + 0, ls48_map[val]); + + val = chip->ram[i] >> 4; + if (chip->inhibit & 0x02) + val = chip->clear >> 4; + output_set_digit_value(i * 2 + 1, ls48_map[val]); + } +} + +static READ8_HANDLER( m1_8279_r ) +{ + i8279_state *chip = i8279 + 0; + static const char *portnames[] = { "SW1","STROBE5","STROBE7","STROBE3","SW2","STROBE4","STROBE6","STROBE2" }; + UINT8 result = 0xff; + UINT8 addr; + + /* read data */ + if ((offset & 1) == 0) + { + switch (chip->command & 0xe0) + { + /* read sensor RAM */ + case 0x40: + addr = chip->command & 0x07; + result = input_port_read(space->machine,"SW1"); + /* handle autoincrement */ + if (chip->command & 0x10) + chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f); + + break; + + + /* read display RAM */ + case 0x60: + + /* set the value of the corresponding outputs */ + addr = chip->command & 0x0f; + result = chip->ram[addr]; + + /* handle autoincrement */ + if (chip->command & 0x10) + chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + + /* read status word */ + else + { + if ( chip->read_sensor ) + { + result = input_port_read(space->machine,portnames[chip->sense_address]); +// break + } + if ( chip->sense_auto_inc ) + { + chip->sense_address = (chip->sense_address + 1 ) & 7; + } + else + { + result = chip->ram[chip->disp_address]; + if ( chip->disp_auto_inc ) + chip->disp_address++; + } + } + return result; +} + +static WRITE8_HANDLER( m1_8279_w ) +{ + i8279_state *chip = i8279 + 0; + UINT8 addr; + + /* write data */ + if ((offset & 1) == 0) + { + switch (chip->command & 0xe0) + { + /* write display RAM */ + case 0x80: + + /* set the value of the corresponding outputs */ + addr = chip->command & 0x0f; + if (!(chip->inhibit & 0x04)) + chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f); + if (!(chip->inhibit & 0x08)) + chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0); + update_outputs(chip, 1 << addr); + + /* handle autoincrement */ + if (chip->command & 0x10) + chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + + /* write command */ + else + { + chip->command = data; + + switch (data & 0xe0) + { + /* command 0: set mode */ + /* + Display modes: + + 00 = 8 x 8-bit character display -- left entry + 01 = 16 x 8-bit character display -- left entry + 10 = 8 x 8-bit character display -- right entry + 11 = 16 x 8-bit character display -- right entry + + Keyboard modes: + + 000 = Encoded scan keyboard -- 2 key lockout + 001 = Decoded scan keyboard -- 2 key lockout + 010 = Encoded scan keyboard -- N-key rollover + 011 = Decoded scan keyboard -- N-key rollover + 100 = Encoded scan sensor matrix + 101 = Decoded scan sensor matrix + 110 = Strobed input, encoded display scan + 111 = Strobed input, decoded display scan + */ + case 0x00: + logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7); + chip->mode = data & 0x1f; + break; + + /* command 1: program clock */ + case 0x20: + logerror("8279A: clock prescaler set to %02X\n", data & 0x1f); + chip->prescale = data & 0x1f; + break; + + /* command 2: read FIFO/sensor RAM */ + case 0x40: + chip->sense_address = data & 0x07; + chip->sense_auto_inc = data & 0x10; + chip->read_sensor = 1; + break; + /* command 3: read display RAM */ + case 0x60: + chip->disp_address = data & 0x0f; + chip->disp_auto_inc = data & 0x10; + chip->read_sensor = 0; + break; + /* command 4: write display RAM */ + case 0x80: + chip->disp_address = data & 0x0f; + chip->disp_auto_inc = data & 0x10; + chip->write_display = 1; + break; + + /* command 5: display write inhibit/blanking */ + case 0xa0: + chip->inhibit = data & 0x0f; + update_outputs(chip, 0); + logerror("8279: clock prescaler set to %02X\n", data & 0x1f); + break; + + break; + + /* command 6: clear */ + case 0xc0: + chip->clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00; + if (data & 0x11) + memset(chip->ram, chip->clear, sizeof(chip->ram)); + break; + + /* command 7: end interrupt/error mode set */ + case 0xe0: + break; + } + } + if ( chip->write_display ) + { // Data + if ( chip->ram[chip->disp_address] != data ) + { + m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 0); + } + chip->ram[chip->disp_address] = data; + if ( chip->disp_auto_inc ) + chip->disp_address ++; + } +} + +static READ8_HANDLER( m1_8279_2_r ) +{ + i8279_state *chip = i8279 + 1; + UINT8 result = 0xff; + UINT8 addr; + + /* read data */ + if ((offset & 1) == 0) + { + switch (chip->command & 0xe0) + { + /* read sensor RAM */ + case 0x40: + //result = ~input_port_read(machine,"DSW1"); /* DSW 1 - inverted! */ + break; + + /* read display RAM */ + case 0x60: + + /* set the value of the corresponding outputs */ + addr = chip->command & 0x0f; + result = chip->ram[addr]; + + /* handle autoincrement */ + if (chip->command & 0x10) + chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + + /* read status word */ + else + { + logerror("read 0xfc%02x\n", offset); + result = 0x10; + } + return result; +} + + +static WRITE8_HANDLER( m1_8279_2_w ) +{ + i8279_state *chip = i8279 + 1; + UINT8 addr; + + /* write data */ + if ((offset & 1) == 0) + { + switch (chip->command & 0xe0) + { + /* write display RAM */ + case 0x80: + + /* set the value of the corresponding outputs */ + addr = chip->command & 0x0f; + if (!(chip->inhibit & 0x04)) + chip->ram[addr] = (chip->ram[addr] & 0xf0) | (data & 0x0f); + if (!(chip->inhibit & 0x08)) + chip->ram[addr] = (chip->ram[addr] & 0x0f) | (data & 0xf0); + update_outputs(chip, 1 << addr); + + /* handle autoincrement */ + if (chip->command & 0x10) + chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + + /* write command */ + else + { + chip->command = data; + + switch (data & 0xe0) + { + /* command 0: set mode */ + /* + Display modes: + + 00 = 8 x 8-bit character display -- left entry + 01 = 16 x 8-bit character display -- left entry + 10 = 8 x 8-bit character display -- right entry + 11 = 16 x 8-bit character display -- right entry + + Keyboard modes: + + 000 = Encoded scan keyboard -- 2 key lockout + 001 = Decoded scan keyboard -- 2 key lockout + 010 = Encoded scan keyboard -- N-key rollover + 011 = Decoded scan keyboard -- N-key rollover + 100 = Encoded scan sensor matrix + 101 = Decoded scan sensor matrix + 110 = Strobed input, encoded display scan + 111 = Strobed input, decoded display scan + */ + case 0x00: + logerror("8279A: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7); + chip->mode = data & 0x1f; + break; + + /* command 1: program clock */ + case 0x20: + logerror("8279A: clock prescaler set to %02X\n", data & 0x1f); + chip->prescale = data & 0x1f; + break; + + /* command 2: read FIFO/sensor RAM */ + case 0x40: + chip->sense_address = data & 0x07; + chip->sense_auto_inc = data & 0x10; + chip->read_sensor = 1; + break; + /* command 3: read display RAM */ + case 0x60: + chip->disp_address = data & 0x0f; + chip->disp_auto_inc = data & 0x10; + chip->read_sensor = 0; + break; + /* command 4: write display RAM */ + case 0x80: + chip->disp_address = data & 0x0f; + chip->disp_auto_inc = data & 0x10; + chip->write_display = 1; + break; + + /* command 5: display write inhibit/blanking */ + case 0xa0: + break; + + /* command 6: clear */ + case 0xc0: + break; + + /* command 7: end interrupt/error mode set */ + case 0xe0: + break; + } + } + if ( chip->write_display ) + { // Data + if ( chip->ram[chip->disp_address] != data ) + { + m1_draw_lamps(chip->ram[chip->disp_address],chip->disp_address, 128); + } + chip->ram[chip->disp_address] = data; + if ( chip->disp_auto_inc ) + chip->disp_address ++; + } + +} + +/////////////////////////////////////////////////////////////////////////// +// called if board is reset /////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// + +static void m1_stepper_reset(void) +{ + int pattern = 0,i; + for ( i = 0; i < 6; i++) + { + stepper_reset_position(i); + if ( stepper_optic_state(i) ) pattern |= 1<config->devicelist, DUART68681, "duart68681" ); + m1_stepper_reset(); +} + +/////////////////////////////////////////////////////////////////////////// + +static void duart_irq_handler(const device_config *device, UINT8 state) +{ + cpu_set_input_line(device->machine->cpu[0], M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); + LOG(("6809 irq%d \n",state)); +} + +#if 0 +static void cpu0_firq(int state) +{ + cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); + LOG(("6809 firq%d \n",state)); +} + +static void cpu0_nmi(int state) +{ + cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, state?ASSERT_LINE:CLEAR_LINE); + LOG(("6809 nmi%d \n",state)); +} +#endif + +/*************************************************************************** + 6821 PIA +***************************************************************************/ + +static WRITE8_HANDLER( m1_pia_porta_w ) +{ + if ( data & 0x40 ) ROC10937_reset(0); + + if ( !alpha_clock && (data & 0x20) ) + { + ROC10937_shift_data(0, ( data & 0x10 )?0:1); + } + + alpha_clock = data & 0x20; + + ROC10937_draw_16seg(0); +} + +static WRITE8_HANDLER( m1_pia_portb_w ) +{ + int i; + for (i=0; i<8; i++) + if ( data & (1 << i) ) output_set_indexed_value("triac", i, data & (1 << i)); +} + +static const pia6821_interface m1_pia_intf = +{ + /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, + /*outputs: A/B,CA/B2 */ m1_pia_porta_w, m1_pia_portb_w, 0, 0, + /*irqs : A/B */ 0,0 +}; + +// input ports for M1 board //////////////////////////////////////// + +static INPUT_PORTS_START( m1 ) + PORT_START("SW1") + PORT_DIPNAME( 0x01, 0x00, "SW101" ) PORT_DIPLOCATION("SW1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "SW102" ) PORT_DIPLOCATION("SW1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "SW103" ) PORT_DIPLOCATION("SW1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "SW104" ) PORT_DIPLOCATION("SW1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "SW105" ) PORT_DIPLOCATION("SW1:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "SW106" ) PORT_DIPLOCATION("SW1:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "SW107" ) PORT_DIPLOCATION("SW1:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "AntiFraud Protection" ) PORT_DIPLOCATION("SW1:08") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("SW2") + PORT_DIPNAME( 0x01, 0x00, "SW201" ) PORT_DIPLOCATION("SW2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "SW202" ) PORT_DIPLOCATION("SW2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "SW203" ) PORT_DIPLOCATION("SW2:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "SW204" ) PORT_DIPLOCATION("SW2:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "SW205" ) PORT_DIPLOCATION("SW2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "SW206" ) PORT_DIPLOCATION("SW2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "SW207" ) PORT_DIPLOCATION("SW2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "SW208" ) PORT_DIPLOCATION("SW2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("STROBE2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("17") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("21") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("22") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("23") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") + + PORT_START("STROBE3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hi") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lo") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("28") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("29") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("30") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Rear Door") PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE + + PORT_START("STROBE4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL)//50p Tube + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL)//100p Tube rear + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SPECIAL)//100p Tube front + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("STROBE5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("49") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("50") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold 2") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold 3") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold 4") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) + + PORT_START("STROBE6") + PORT_SERVICE_NO_TOGGLE(0x01,IP_ACTIVE_HIGH) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("58") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("59") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("60") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("61") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("62") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("63") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("64") + + PORT_START("STROBE7") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("65") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("66") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("67") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("68") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("69") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("70") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("72") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("73") + +INPUT_PORTS_END + +static MACHINE_START( m1 ) +{ + int i; + pia_config(machine, 0,&m1_pia_intf); + pia_reset(); + +// setup 8 mechanical meters //////////////////////////////////////////// + Mechmtr_init(8); + +// setup 6 default 96 half step reels /////////////////////////////////// + for ( i = 0; i < 6; i++ ) + { + stepper_config(machine, i, &starpoint_interface_48step); + } + +// setup the standard oki MSC1937 display /////////////////////////////// + ROC10937_init(0, MSC1937,0); +} +static WRITE8_HANDLER( reel12_w ) +{ + stepper_update(0, data & 0x0F ); + stepper_update(1, (data>>4) & 0x0F ); + + if ( stepper_optic_state(0) ) optic_pattern |= 0x01; + else optic_pattern &= ~0x01; + if ( stepper_optic_state(1) ) optic_pattern |= 0x02; + else optic_pattern &= ~0x02; + + awp_draw_reel(0); + awp_draw_reel(1); +} + +static WRITE8_HANDLER( reel34_w ) +{ + stepper_update(2, data & 0x0F ); + stepper_update(3, (data>>4) & 0x0F ); + + if ( stepper_optic_state(2) ) optic_pattern |= 0x04; + else optic_pattern &= ~0x04; + if ( stepper_optic_state(3) ) optic_pattern |= 0x08; + else optic_pattern &= ~0x08; + + awp_draw_reel(2); + awp_draw_reel(3); +} + +static WRITE8_HANDLER( reel56_w ) +{ + stepper_update(4, data & 0x0F ); + stepper_update(5, (data>>4) & 0x0F ); + + if ( stepper_optic_state(4) ) optic_pattern |= 0x10; + else optic_pattern &= ~0x10; + if ( stepper_optic_state(5) ) optic_pattern |= 0x20; + else optic_pattern &= ~0x20; + + awp_draw_reel(4); + awp_draw_reel(5); +} + +static UINT8 m1_duart_r (const device_config *device) +{ + return (optic_pattern); +} + +static WRITE8_DEVICE_HANDLER( m1_meter_w ) +{ + int i; + UINT64 cycles = cpu_get_total_cycles(device->machine->cpu[0]); + + for (i=0; i<8; i++) + if ( data & (1 << i) ) Mechmtr_update(i, cycles, data & (1 << i) ); +} + +static WRITE8_HANDLER( m1_latch_w ) +{ + switch ( offset ) + { + case 0: // RAMEN + RAMEN = (data & 1); + break; + case 1: // AlarmEn + ALARMEN = (data & 1); + break; + case 2: // Enable +// if ( m1_enable == 0 && ( data & 1 ) && Vmm ) +// { + // cpu0_nmi(1) + // m1_enable = (data & 1); +// } + break; + case 3: // RTS + { + } + break; + case 4: // PSURelay + PSUrelay = (data & 1); + break; + case 5: // WDog + WDOG = (data & 1); + break; + case 6: // Srsel + SRSEL = (data & 1); + break; + } +} + + +static ADDRESS_MAP_START( m1_memmap, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x1fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) + + AM_RANGE(0x2000, 0x2000) AM_WRITE(reel12_w) + AM_RANGE(0x2010, 0x2010) AM_WRITE(reel34_w) + AM_RANGE(0x2020, 0x2020) AM_WRITE(reel56_w) + + AM_RANGE(0x2030, 0x2031) AM_READWRITE(m1_8279_r,m1_8279_w) + AM_RANGE(0x2040, 0x2041) AM_READWRITE(m1_8279_2_r,m1_8279_2_w) + AM_RANGE(0x2050, 0x2050)// SCAN on M1B + + AM_RANGE(0x2070, 0x207f) AM_DEVREADWRITE( DUART68681, "duart68681", duart68681_r, duart68681_w ) + + AM_RANGE(0x2090, 0x2091) AM_DEVWRITE(SOUND, "ay", ay8910_address_data_w) + AM_RANGE(0x20B0, 0x20B0) AM_DEVREAD(SOUND, "ay", ay8910_r) + + AM_RANGE(0x20A0, 0x20A3) AM_WRITE(pia_0_w) + AM_RANGE(0x20A0, 0x20A3) AM_READ( pia_0_r) + + AM_RANGE(0x20C0, 0x20C7) AM_WRITE(m1_latch_w) + + AM_RANGE(0x2400, 0x2401) AM_DEVWRITE( SOUND, "ym", ym2413_w ) + + AM_RANGE(0x2800, 0xffff) AM_ROM +ADDRESS_MAP_END + +static const ay8910_interface ay8910_config = +{ + AY8910_LEGACY_OUTPUT, + AY8910_DEFAULT_LOADS, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_HANDLER(m1_meter_w), + DEVCB_NULL, +}; + +static const duart68681_config maygaym1_duart68681_config = +{ + duart_irq_handler, + NULL, + m1_duart_r, + NULL +}; + +// machine driver for maygay m1 board ///////////////////////////////// + +static MACHINE_DRIVER_START( m1 ) + + MDRV_MACHINE_START(m1) + MDRV_MACHINE_RESET(m1) + MDRV_CPU_ADD("main", M6809, M1_MASTER_CLOCK/2) + MDRV_CPU_PROGRAM_MAP(m1_memmap,0) + + MDRV_DUART68681_ADD("duart68681", M1_DUART_CLOCK, maygaym1_duart68681_config) + + MDRV_SPEAKER_STANDARD_MONO("mono") + MDRV_SOUND_ADD("ay",AY8913, M1_MASTER_CLOCK) + MDRV_SOUND_CONFIG(ay8910_config) + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + + MDRV_SOUND_ADD("ym", YM2413, M1_MASTER_CLOCK/4) + + MDRV_SOUND_ADD("msm6376", OKIM6376, M1_MASTER_CLOCK/4) //? + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) + + MDRV_NVRAM_HANDLER(generic_0fill) + + MDRV_DEFAULT_LAYOUT(layout_awpvid16) +MACHINE_DRIVER_END + +ROM_START( m_sptlgt ) + ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) + ROM_LOAD( "sa2-412.bin",0x0000, 0x10000, CRC(17531aad) SHA1(decec517b89be9019913be59c5fC2aa2ee6e3f8f)) +ROM_END + +GAME( 199?, m_sptlgt,0, m1,m1,0, ROT0, "Maygay Machines Ltd.", "Spotlight",GAME_NOT_WORKING|GAME_NO_SOUND|GAME_REQUIRES_ARTWORK ) diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c new file mode 100644 index 00000000000..1792d23ea2c --- /dev/null +++ b/src/mame/drivers/maygayv1.c @@ -0,0 +1,1106 @@ +/*************************************************************************** + + MAYGAY MV1 hardware + + preliminary driver by Phil Bennett + + Games supported: + * Screen Play + + Other games on this hardware: + * Believe it or not? + * Caesar's Palace (reel to video) + * Crossword Quiz + * Give us a Clue + * Special Effects (reel to video) + * World Cup (reel to video) + + +Main MV1 board: + +U1 ST 8901 TS68000CP12 +U2 ST M74HC04B1 99135R +U3 ST 16S25HB1 9235 (think this is the gal chip) +U4 ST M74HC138B1 99131R +U5 P8948G MM74HC05N +U6 ST M74HC74B1 99144R +U7 ST M74HC08B1 99135R +U8 ST NE556N 99135 +U9 ST M74HC259B1 99148R +U10 ST M74HC237B1 99148R +U11 ULN2803A 9135 +U12 ST M74HC74B1 99144R +U13 ST M74HC32B1 99041R +U14 ST M74HCO4B1 99135R +U15 27C010 (Game Rom) +U16 27C010 (Game Rom) +U17 27C010 (Game Rom) +U18 27C010 (Game Rom) +U19 HYUNDAI HY6264ALP- 10 9147T +U20 HYUNDAI HY6264ALP- 10 9147T +U21 NEC IRELAND D8279C- 2 9135X8006] +U22 ULN2803A 9135 +U23 ULN2803A 9135 +U24 TEXAS INSTRUMENT F 9140 AN SN74HC148N +U25 ST 2 9148 EF68B21P +U26 Can't see one on the board! +U27 MOTOROLA MC68681P 14PT18715 +U28 ST MC1488P 99136 +U29 ST MC1489AP 99148 +U30 ST HCF 4514 BE 2 9049 +U31 MOTOROLA MC74F139N XXAA9145 +U32 TEXAS INSTRUMENT TMS4464- 12NL IHE 9145 +U33 TEXAS INSTRUMENT TMS4464- 12NL IHE 9114 +U34 TEXAS INSTRUMENT TMS4464- 12NL IHE 9145 +U35 TEXAS INSTRUMENT TMS4464- 12NL IHE 9114 +U36 MHS S-82716-4 9210 +U37 TEXAS INSTRUMENT TMS4464- 12NL IHE 9114 +U38 TEXAS INSTRUMENT TMS4464- 12NL IHE 9145 +U39 TEXAS INSTRUMENT TMS4464- 12NL IHE 9145 +U40 TEXAS INSTRUMENT TMS4464- 12NL IHE 9114 +U41 ST M74HC244B1 99131R +U42 ST M74HC244B1 99131R +U43 ST M74HC245B1 99136R +U44 ST M74HC245B1 99136R +U45 ST M74HC00B1 99135R +U46 ULN2803A 9135 +U47 ULN2803A 9135 +U48 YM2413 9127 HADG +U49 78L05 .194 + +The memory card that plugs in has 4 M27C010 game roms on. + +The extra digital and reel board has the following: + +U1 GS G06 KOREA GD74HC245 +U2 SIEMENS SAB 8032B-P SINGAPORE BB INTEL 80 9148 +U3 M27C512 (reels rom) +U4 ST M74HC373B1 99205R +U5 TEXAS INSTRUMENT 14530QT SN75155P +U6 ULN 2803A 9203 +U7 ST M74HC374B1 99205R +U8 ST M74HC374B1 99205R +U9 ULN 2803A 9203 +U10 ULN 2803A 9203 +U11 ULN 2803A 9203 +U12 M27C010 (Sound Rom) +U13 NEC JAPAN D7759C 9015KP009 +U14 ST M74HC373B1 99205R +U15 Can't see one on the board! +U16 MOTOROLA MC74HC04AN FFA09202 + + + + +upd7759 change: + +* Only accept FIFO bytes when the chip is playing!!! + +Port 1 is connected directly to the upd bus. +upd /CE is grounded +/WR bit is + +Toggle reset pin +Write data on port 1 +Toggle WR bit... + +Then, it goes off to write. + +INT1 Power failure? +INT2 - +INT3 V Sync +INT4 - +INT5 68681 DUART +INT6 - +INT7 - + + +DUART: 0 = Power failure + +M68681 Output port drives slides + +Todo: + +Find lamps/reels after UPD changes. +***************************************************************************/ + +#include "driver.h" +#include "cpu/m68000/m68000.h" +#include "video/awpvid.h" +#include "cpu/mcs51/mcs51.h" +#include "machine/6821pia.h" +#include "machine/68681.h" +#include "sound/2413intf.h" +#include "sound/upd7759.h" + +//#include "deprecat.h" + +/************************************* + * + * Defines + * + *************************************/ + +#define DUART_CLOCK 3686400 +#define PIXEL_CLOCK 0 + +/************************************* + * + * Video hardware + * + *************************************/ + +static int vsync_latch_preset; + +#define VREG(a) i82716.r[a] + +enum +{ + VCR0 = 0, + VCR1, + RWBA, + DWBA, + DWSLM, + DSBA, + PAQ, + ODTBA, + ATBA, + CTBA, + CBASE, + ATBAC, + HVCONST0, + HVCONST1, + HVCONST2, + HVCONST3 +}; + +#define VCR0_UCF 0x0001 +#define VCR0_DEI 0x0002 +#define VCR0_SAB 0x0004 +#define VCR0_DEN 0x0008 +#define VCR0_HRS 0x0010 +#define VCR0_DOF 0x0020 + +#define VCR0_DS_MASK 0x00c0 +#define VCR0_DS_SHIFT 6 +#define VCR0_BLINK_MASK 0x1f00 +#define VCR0_BLINK_SHIFT 8 +#define VCR0_DUTY_MASK 0xe000 +#define VCR0_DUTY_SHIFT 13 + +static const UINT32 banks[4] = { 0, 0x40000/2, 0x20000/2, 0x60000/2 }; + +static struct +{ + const device_config *duart68681; +} maygayv1_devices; + +#define DRAM_BANK_SEL (banks[(VREG(DSBA) >> 7) & 3]) + +static struct +{ + UINT16 r[16]; + UINT16 *dram; + + UINT8 *line_buf; // there's actually two +} i82716; + +WRITE16_HANDLER( i82716_w ) +{ + // Accessing register window? + if ((VREG(RWBA) & 0xfff0) == (offset & 0xfff0)) + { + // Register segment is fixed at start of DRAM + COMBINE_DATA(&i82716.dram[offset & 0xf]); + } + + // Accessing data window? + // TODO: mask + if (offset >= (VREG(DWBA) & 0xf800)) + { + offset -= (VREG(DWBA) & 0xf800); + COMBINE_DATA(&i82716.dram[DRAM_BANK_SEL + (VREG(DSBA) & 0xf800) + offset]); + } +} + +READ16_HANDLER( i82716_r ) +{ + // Accessing register window? + if ((VREG(RWBA) & ~0xf) == (offset & ~0xf)) + { + return(i82716.r[offset & 0xf]); + } + + // Accessing data window? TODO: mask? + if (VREG(VCR1) & 4) + { + if (offset >= (VREG(DWBA) & 0xf800)) + { + offset -= (VREG(DWBA) & 0xf800); + return i82716.dram[DRAM_BANK_SEL +(VREG(DSBA) & 0xf800) + (offset)]; + } + } + + return 0; +} + +static VIDEO_START( maygayv1 ) +{ + +} + + +static VIDEO_UPDATE( maygayv1 ) +{ + UINT16 *atable = &i82716.dram[VREG(ATBA)]; + UINT16 *otable = &i82716.dram[VREG(ODTBA) & 0xfc00]; // both must be bank 0 + + int sl, sx; + int slmask = 0xffff; // TODO: Save if using scanline callbacks + int xbound = (VREG(DWBA) & 0x3f8) | 7; + + /* Sign extend to 10 bits */ + xbound = (xbound & 0x3ff) - (xbound & 0x400); + + /* If screen output is disabled, fill with black */ + if (!(VREG(VCR0) & VCR0_DEN)) + { + bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); + return 0; + } + + /* For every scanline... */ + for (sl = cliprect->min_x; sl <= cliprect->max_y; ++sl) + { + int obj; + UINT16 aflags = atable[sl]; + UINT16 slmask_old = slmask; + + UINT16 *bmp_ptr = BITMAP_ADDR16(bitmap, sl, 0); + + slmask = 0xffff ^ (slmask ^ aflags); + + /* Clear the frame buffer on each line to BG colour (palette entry 2) */ + /* 4bpp only ! */ + memset(i82716.line_buf, 0x22, 512); + + /* Parse the list of 16 objects */ + for (obj = 0; obj < 16; ++obj) + { + int offs = obj * 4; + + // Draw on this line? + if ( !BIT(slmask, obj) ) + { + UINT32 objbase, trans, width, res, cspec; + INT32 x, xpos; + UINT16 w0, w1, w2; + UINT16 *objptr; + UINT8 *bmpptr; // ? + + /* Get object table entry words */ + w0 = otable[offs]; + w1 = otable[offs + 1]; + w2 = otable[offs + 2]; + + /* Blanked */ + if ( BIT(w0, 4) ) + break; + +// if ( BIT(w0, 5) ) +// printf("Blinking\n"); + + /* Resolution: either 4bpp or 2bpp */ + res = (w0 >> 9) & 3; + + + /* Expand 2bpp to 3bpp */ + cspec = (w0 & 3) << 2; + + if ( BIT(w0, 11) ) + { + logerror("i82716: Characters not supported\n"); + break; + } + + /* 10-bit signed - in terms of bytes */ + xpos = (w1 & 0x3ff); + xpos = (xpos & 0x3ff) - (xpos & 0x400); + + /* Transparency detect enable */ + trans = BIT(w0, 2); + + /* Width is expressed in units of 64-bit words */ + width = (w1 >> 10) & 0x3f; + + /* First scanline? Clear current object entry address */ + if ( BIT(slmask_old, obj) ) + otable[offs + 3] = 0; + + /* Bitmap data pointer */ + objbase = ((w0 & 0x00c0) << 10) | w2; + objptr = &i82716.dram[objbase + ((4 * width) * otable[offs + 3])]; + + // endian alert + bmpptr = (UINT8*)objptr; + + // 4bpp + for (x = xpos; x < MIN(xbound, xpos + width * 8); ++x) + { + if (x >= 0) + { + UINT8 p1 = *bmpptr & 0xf; + UINT8 p2 = *bmpptr >> 4; + + if (!trans || p1) + i82716.line_buf[x] = p1; + + if (!trans || p2) + i82716.line_buf[x] |= p2 << 4; + } + bmpptr++; + } + + /* Update scanline pointer - WRONG */ + otable[offs + 3]++; + } + } + + // Write it out + for (sx = cliprect->min_x; sx < cliprect->max_x; sx += 2) + { + UINT8 pix = i82716.line_buf[sx / 2]; + + bmp_ptr[sx + 0] = pix & 0xf; + bmp_ptr[sx + 1] = pix >> 4; + } + } + + return 0; +} + +static VIDEO_EOF( maygayv1 ) +{ + // UCF + if (VREG(VCR0) & VCR0_UCF) + { + int i; + + for (i = 0; i < 16; ++i) + VREG(i) = i82716.dram[i]; + } + else + { + VREG(VCR0) = i82716.dram[VCR0]; + VREG(ATBA) = i82716.dram[ATBA]; + } + + if (!(VREG(VCR0) & VCR0_DEI)) + { + int i; + UINT16 *palbase = &i82716.dram[VREG(CTBA)]; + + for (i = 0; i < 16; ++i) + { + UINT16 entry = *palbase++; + palette_set_color_rgb(machine, entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4)); + } + } +} + + + +/************************************* + * + * 68000 CPU memory handlers + * + *************************************/ + +/* + 68681 + YM2413 + 68B21 + 8279C + + 8a0008 0xe0 + 8a000c 0x7 + 8a000e 0x33 + 8a000a 0x8 + 8a001c 0xff R/W +*/ + + +static READ16_HANDLER( pia_lsb_r ) +{ + return pia_read(0, offset); +} + +static WRITE16_HANDLER( pia_lsb_w ) +{ + pia_write(0, offset, data >> 8); +} + + + +static WRITE16_HANDLER( write_odd ) +{ +} + +//;860008 is a latch of some sort +static READ16_HANDLER( read_odd ) +{ + return 0; +} + + +struct _i8279_state +{ + UINT8 command; + UINT8 mode; + UINT8 prescale; + UINT8 inhibit; + UINT8 clear; + UINT8 fifo[8]; + UINT8 ram[16]; +} i8279; + +/* TODO */ +static void update_outputs(UINT16 which) +{ + int i; + + /* update the items in the bitmask */ + for (i = 0; i < 16; i++) + if (which & (1 << i)) + { + int val; + + val = i8279.ram[i] & 0xff; +/* + val = i8279.ram[i] & 0x0f; + if (i8279.inhibit & 0x01) + val = i8279.clear & 0x0f; + + if(val) printf("%x\n", val); + + val = i8279.ram[i] >> 4; + if (i8279.inhibit & 0x02) + val = i8279.clear >> 4; + + if(val) printf("%x\n", val); +*/ + } +} + +static READ16_HANDLER( maygay_8279_r ) +{ + static const char *portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" }; + UINT8 result = 0xff; + UINT8 addr; + + /* read data */ + if ((offset & 1) == 0) + { + switch (i8279.command & 0xe0) + { + /* read sensor RAM */ + case 0x40: + addr = i8279.command & 0x07; + + result = input_port_read(space->machine, portnames[addr]); + + /* handle autoincrement */ + if (i8279.command & 0x10) + i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f); + + break; + + /* read display RAM */ + case 0x60: + + /* set the value of the corresponding outputs */ + addr = i8279.command & 0x0f; + result = i8279.ram[addr]; + + /* handle autoincrement */ + if (i8279.command & 0x10) + i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + /* read status word */ + else + { + printf("read 0xfc%02x\n", offset); + result = 0x10; + } + return result; +} + + +static WRITE16_HANDLER( maygay_8279_w ) +{ + UINT8 addr; + + data >>= 8; + + /* write data */ + if ((offset & 1) == 0) + { + switch (i8279.command & 0xe0) + { + /* write display RAM */ + case 0x80: + + /* set the value of the corresponding outputs */ + addr = i8279.command & 0x0f; + if (!(i8279.inhibit & 0x04)) + i8279.ram[addr] = (i8279.ram[addr] & 0xf0) | (data & 0x0f); + if (!(i8279.inhibit & 0x08)) + i8279.ram[addr] = (i8279.ram[addr] & 0x0f) | (data & 0xf0); + update_outputs(1 << addr); + + /* handle autoincrement */ + if (i8279.command & 0x10) + i8279.command = (i8279.command & 0xf0) | ((addr + 1) & 0x0f); + break; + } + } + + /* write command */ + else + { + i8279.command = data; + + switch (data & 0xe0) + { + /* command 0: set mode */ + /* + Display modes: + + 00 = 8 x 8-bit character display -- left entry + 01 = 16 x 8-bit character display -- left entry + 10 = 8 x 8-bit character display -- right entry + 11 = 16 x 8-bit character display -- right entry + + Keyboard modes: + + 000 = Encoded scan keyboard -- 2 key lockout + 001 = Decoded scan keyboard -- 2 key lockout + 010 = Encoded scan keyboard -- N-key rollover + 011 = Decoded scan keyboard -- N-key rollover + 100 = Encoded scan sensor matrix + 101 = Decoded scan sensor matrix + 110 = Strobed input, encoded display scan + 111 = Strobed input, decoded display scan + */ + case 0x00: + logerror("8279: display mode = %d, keyboard mode = %d\n", (data >> 3) & 3, data & 7); + i8279.mode = data & 0x1f; + break; + + /* command 1: program clock */ + case 0x20: + logerror("8279: clock prescaler set to %02X\n", data & 0x1f); + i8279.prescale = data & 0x1f; + break; + + /* command 2: read FIFO/sensor RAM */ + /* command 3: read display RAM */ + /* command 4: write display RAM */ + case 0x40: + case 0x60: + case 0x80: + break; + + /* command 5: display write inhibit/blanking */ + case 0xa0: + i8279.inhibit = data & 0x0f; + update_outputs(~0); + logerror("8279: clock prescaler set to %02X\n", data & 0x1f); + break; + + /* command 6: clear */ + case 0xc0: + i8279.clear = (data & 0x08) ? ((data & 0x04) ? 0xff : 0x20) : 0x00; + if (data & 0x11) + memset(i8279.ram, i8279.clear, sizeof(i8279.ram)); + break; + + /* command 7: end interrupt/error mode set */ + case 0xe0: + break; + } + } +} + + + + + + +static WRITE16_HANDLER( vsync_int_ctrl ) +{ + vsync_latch_preset = data & 0x0100; + + // Active low + if (!(vsync_latch_preset)) + cpu_set_input_line(space->machine->cpu[0], 3, CLEAR_LINE); +} + +static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) + AM_RANGE(0x000000, 0x07ffff) AM_ROM + AM_RANGE(0x080000, 0x083fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) + AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("main", 0x80000) + AM_RANGE(0x820000, 0x820003) AM_READWRITE(maygay_8279_r, maygay_8279_w) + AM_RANGE(0x800000, 0x800003) AM_DEVWRITE8( SOUND, "ym", ym2413_w, 0xff00 ) + AM_RANGE(0x860000, 0x86000d) AM_READWRITE(read_odd, write_odd) + AM_RANGE(0x86000e, 0x86000f) AM_WRITE(vsync_int_ctrl) + AM_RANGE(0x880000, 0x89ffff) AM_READWRITE(i82716_r, i82716_w) + AM_RANGE(0x8a0000, 0x8a001f) AM_DEVREADWRITE8( DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff) + AM_RANGE(0x8c0000, 0x8c000f) AM_READWRITE(pia_lsb_r, pia_lsb_w) +ADDRESS_MAP_END + + +/************************************* + * + * 8032 CPU memory handlers + * + *************************************/ + +/* + 74HC245 @ U1 read port + (P3.4 = /ENABLE) + P1.0 = Reel 1 optic (I) + P1.1 = Reel 2 optic (I) + P1.2 = Reel 3 optic (I) + P1.3 + P1.4 = DIPSWITCH (GND/ON by default) + P1.5 = DIPSWITCH (GND/ON by default) + P1.6 = DIPSWITCH (GND/ON by default) + P1.7 = DIPSWITCH (GND/ON by default) + + WRITE + P1.0 - 7 => D7759C + => 74HC374 @ U8 write port (CLK = 3.7) + + P3.0 = RXD + P3.1 = TXD + P3.2 = /UPD_RESET + P3.3 = !(/UPD_BUSY) + P3.4 = U1 /ENABLE + P3.5 = Status LED (inverted twice) + P3.6 = (WR) /UPD_START + P3.7 = (RD) U8 CLK - for writing! P1 + + + +*/ +static UINT8 p1 = 0xff; // save state +static UINT8 p3 = 0xff; // save state + +static READ8_HANDLER( mcu_r ) +{ + switch (offset) + { + case 1: + { + if ( !BIT(p3, 4) ) + return (input_port_read(space->machine, "REEL")); // Reels??? + else + return 0; + } + + case 3: upd7759_busy_r(0) ? 0 : 0x08; + } + return 0; +} + +static WRITE8_HANDLER( mcu_w ) +{ + logerror("O %x D %x",offset,data); + + switch (offset) + { + // Bottom nibble = UPD + case 1: + p1 = data; +// upd7759_msg_w(0, data);//? + break; + case 3: + upd7759_reset_w (0, BIT(data, 2)); + upd7759_start_w(0, BIT(data, 6)); + +// if ( !BIT(p3, 7) && BIT(data, 7) ) + // P1 propagates to outputs + + p3 = data; + break; + } +} + + +static ADDRESS_MAP_START( sound_prg, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0xffff) AM_ROM +ADDRESS_MAP_END + +static ADDRESS_MAP_START( sound_data, ADDRESS_SPACE_DATA, 8 ) + AM_RANGE(0x0000, 0xffff) AM_RAM // nothing? +ADDRESS_MAP_END + +static ADDRESS_MAP_START( sound_io, ADDRESS_SPACE_IO, 8 ) + AM_RANGE(0x00, 0xff) AM_READWRITE(mcu_r, mcu_w) +ADDRESS_MAP_END + + +/************************************* + * + * Port definitions + * + *************************************/ + +static INPUT_PORTS_START( screenpl ) + PORT_START("STROBE1") + PORT_DIPNAME( 0x01, 0x01, "DSW01") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "DSW02") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "DSW03") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "DSW04") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Stake selection?") + PORT_DIPSETTING( 0x10, "5p" ) + PORT_DIPSETTING( 0x00, "10p" ) + PORT_DIPNAME( 0x20, 0x20, "DSW06") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "DSW07") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "DSW08") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("STROBE2") + PORT_DIPNAME( 0x01, 0x01, "Teste") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("STROBE3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Unk Button") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Nudge 1") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Nudge 2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Nudge 3") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("?") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Collect") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("?") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Spin") + + PORT_START("STROBE4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Red") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Yellow") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Green") + PORT_DIPNAME( 0x08, 0x08, "DSW34") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "DSW35") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Jackpot Selection") + PORT_DIPSETTING( 0x20, "600p" ) + PORT_DIPSETTING( 0x00, "300p" ) + PORT_DIPNAME( 0x40, 0x40, "Reset?") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Cash door") + PORT_DIPSETTING( 0x80, "Open" ) + PORT_DIPSETTING( 0x00, "Closed" ) + + PORT_START("STROBE5") + PORT_DIPNAME( 0x01, 0x01, "DSW41") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Re-fill key") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "DSW43") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "DSW44") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "DSW45") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "DSW46") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "DSW47") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "DSW48") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("STROBE6") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("STROBE7") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("STROBE8") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Token") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("REEL") + PORT_DIPNAME( 0x01, 0x00, "REEL 1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "REEL 2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "REEL 3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "REEL 4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "MCU DIP1") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "MCU DIP2") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "MCU DIP3") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "MCU DIP4") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +/************************************* + * + * Machine driver + * + *************************************/ + +/*************************************************************************** + + 68681 DUART + +***************************************************************************/ + +static void duart_irq_handler(const device_config *device, UINT8 vector) +{ + cpu_set_input_line_and_vector(device->machine->cpu[0], 5, ASSERT_LINE, vector); +// cpu_set_input_line(device->machine->cpu[0], 5, state ? ASSERT_LINE : CLEAR_LINE); +}; + +static int d68681_val; + +static void duart_tx(const device_config *device, int channel, UINT8 data) +{ + if (channel == 0) + { + d68681_val = data; + cpu_set_input_line(device->machine->cpu[1], MCS51_RX_LINE, ASSERT_LINE); // ? + } + +}; + +static const duart68681_config maygayv1_duart68681_config = +{ + duart_irq_handler, + duart_tx, + NULL, + NULL +}; + + +static int data_to_i8031(const device_config *device) +{ + return d68681_val; +} + +static void data_from_i8031(const device_config *device, int data) +{ + duart68681_rx_data(maygayv1_devices.duart68681, 0, data); +} + +static READ8_HANDLER( b_read ) +{ + // Meters - upper nibble? + return 0xff; +} + +static WRITE8_HANDLER( b_writ ) +{ + logerror("B WRITE %x\n",data); +} + + +/* U25 ST 2 9148 EF68B21P */ +static const pia6821_interface pia_intf = +{ + /*inputs : A/B,CA/B1,CA/B2 */ b_read, b_read, 0, 0, 0, 0, + /*outputs: A/B,CA/B2 */ b_writ, b_writ, 0, 0, + /*irqs : A/B */ 0, 0 +}; + + +static MACHINE_START( maygayv1 ) +{ + i82716.dram = auto_malloc(0x80000); // ??? + i82716.line_buf = auto_malloc(512); + + pia_config(machine, 0, &pia_intf); + + state_save_register_global_pointer(machine, i82716.dram, 0x40000); + +// duart_68681_init(DUART_CLOCK, duart_irq_handler, duart_tx); + + i8051_set_serial_tx_callback(machine->cpu[1], data_from_i8031); + i8051_set_serial_rx_callback(machine->cpu[1], data_to_i8031); +} + +static MACHINE_RESET( maygayv1 ) +{ + // ? + maygayv1_devices.duart68681 = device_list_find_by_tag( machine->config->devicelist, DUART68681, "duart68681" ); + memset(i82716.dram, 0, 0x40000); + i82716.r[RWBA] = 0x0200; +} + + +static INTERRUPT_GEN( vsync_interrupt ) +{ + if (vsync_latch_preset) + cpu_set_input_line(device->machine->cpu[0], 3, ASSERT_LINE); +} + + +static MACHINE_DRIVER_START( maygayv1 ) + MDRV_CPU_ADD("main", M68000, XTAL_16MHz / 2) + MDRV_CPU_PROGRAM_MAP(main_map, 0) + MDRV_CPU_VBLANK_INT("main", vsync_interrupt) + + MDRV_CPU_ADD("sound", I8052, XTAL_11_0592MHz) + MDRV_CPU_PROGRAM_MAP(sound_prg, 0) + MDRV_CPU_DATA_MAP(sound_data, 0) + MDRV_CPU_IO_MAP(sound_io, 0) + + MDRV_MACHINE_START(maygayv1) + MDRV_MACHINE_RESET(maygayv1) + + MDRV_NVRAM_HANDLER(generic_0fill) + + /* TODO: Use real video timings */ + MDRV_SCREEN_ADD("main", RASTER) + MDRV_SCREEN_REFRESH_RATE(60) + MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) + MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) + MDRV_SCREEN_SIZE(640, 300) + MDRV_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 300 - 1) + + MDRV_PALETTE_LENGTH(16) + + MDRV_DUART68681_ADD("duart68681", DUART_CLOCK, maygayv1_duart68681_config) + + MDRV_VIDEO_START(maygayv1) + MDRV_VIDEO_UPDATE(maygayv1) + MDRV_VIDEO_EOF(maygayv1) + + MDRV_SPEAKER_STANDARD_MONO("mono") + + MDRV_SOUND_ADD("ym",YM2413, XTAL_16MHz / 4) + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8) + + MDRV_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK) + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) +MACHINE_DRIVER_END + + +/************************************* + * + * ROM definitions + * + *************************************/ + +ROM_START( screenpl ) + ROM_REGION( 0x100000, "main", 0 ) + ROM_LOAD16_BYTE( "20p6pnd_u15.bin", 0x00000, 0x20000, CRC(4334453c) SHA1(5c18acf29c7b3f44589b92d74b79ac66730db810) ) + ROM_LOAD16_BYTE( "20p6pnd_u16.bin", 0x00001, 0x20000, CRC(90b3f67c) SHA1(a58a0bc4ccccf083fe3222f02eb06ee5fa6f386a) ) + ROM_LOAD16_BYTE( "20p6pnd_u17.bin", 0x40000, 0x20000, CRC(ba576b11) SHA1(3ba7bcaf4e3cc4eaeeece6e3f4957c3a8dfd5752) ) + ROM_LOAD16_BYTE( "20p6pnd_u18.bin", 0x40001, 0x20000, CRC(24dd1aff) SHA1(833c59e5b75130a8dc3a63027e09c0f5c7ed17f5) ) + + ROM_LOAD16_BYTE( "20p6pnd_u2.bin", 0x80000, 0x20000, CRC(ee51ed98) SHA1(262e773cdb1465983a8f931698bc73de7c324088) ) + ROM_LOAD16_BYTE( "20p6pnd_u1.bin", 0x80001, 0x20000, CRC(d57bbe69) SHA1(b7cd93cef4828418328ca4ff16c496da7b2065e2) ) + ROM_LOAD16_BYTE( "20p6pnd_u4.bin", 0xc0000, 0x20000, CRC(01aafd7e) SHA1(d2161066655218468da8eae8aa9da8a80c07c489) ) + ROM_LOAD16_BYTE( "20p6pnd_u3.bin", 0xc0001, 0x20000, CRC(aa02dc54) SHA1(a05c8c26480f3bae671428380c7684b9c29b5a53) ) + + ROM_REGION( 0x10000, "sound", 0 ) + ROM_LOAD( "reels.bin", 0x0000, 0x10000, CRC(1319cf82) SHA1(7a233072890361bcf384de4f90170c2ca713b1de) ) + + ROM_REGION( 0x20000, "upd", 0 ) + ROM_LOAD( "sound.bin", 0x00000, 0x20000, CRC(498dd74f) SHA1(80bb204b3e9cadcecbfa75c78c52fb9908566c5e) ) +ROM_END + +ROM_START( screenp1 ) + ROM_REGION( 0x100000, "main", 0 ) + ROM_LOAD16_BYTE( "sa4-379.u15", 0x00000, 0x20000, CRC(e21b120d) SHA1(bcdebf797381b0c585dbd3511b5e984f22de2206) ) + ROM_LOAD16_BYTE( "sa4-379.u16", 0x00001, 0x20000, CRC(b04588b7) SHA1(1f9b933e441969c95bbbabbfbe44349bd945c326) ) + ROM_LOAD16_BYTE( "sa4-379.u17", 0x40000, 0x20000, CRC(4b6cdc43) SHA1(1d6a4796ce67d0d00fe74a6bafd8b731450cdaab) ) + ROM_LOAD16_BYTE( "sa4-379.u18", 0x40001, 0x20000, CRC(d986355f) SHA1(86d3f1712cd1bcc90a54945a2baccae2596de691) ) + + ROM_LOAD16_BYTE( "sq3-458.u2", 0x80000, 0x20000, CRC(7091dfcd) SHA1(d28abd70db5c49baa93f0488e443f29c27a7a559) ) + ROM_LOAD16_BYTE( "sq3-458.u1", 0x80001, 0x20000, CRC(1bb0efbf) SHA1(59d7e2e51928df149764502bc4bd5736463f40d7) ) + ROM_LOAD16_BYTE( "sq3-458.u4", 0xc0000, 0x20000, CRC(0fb0fc84) SHA1(e7ef68130f9627a842849f41f67accf8593a0819) ) + ROM_LOAD16_BYTE( "sq3-458.u3", 0xc0001, 0x20000, CRC(ef4617d8) SHA1(48231405a775585451bf970db5bb57ec2f238250) ) + + ROM_REGION( 0x10000, "sound", 0 ) + ROM_LOAD( "sr2-002", 0x0000, 0x10000, CRC(1319cf82) SHA1(7a233072890361bcf384de4f90170c2ca713b1de) ) + + ROM_REGION( 0x20000, "upd", 0 ) + ROM_LOAD( "dig2-001.u12", 0x00000, 0x20000, CRC(498dd74f) SHA1(80bb204b3e9cadcecbfa75c78c52fb9908566c5e) ) +ROM_END + +ROM_START( screenp2 ) + ROM_REGION( 0x100000, "main", 0 ) + ROM_LOAD16_BYTE( "sa4-280.u15", 0x00000, 0x20000, CRC(d7206438) SHA1(70e7dc7d58bfa7dfe00250ab46fa71e951dbf901) ) + ROM_LOAD16_BYTE( "sa4-280.u16", 0x00001, 0x20000, CRC(f99e972f) SHA1(b01c8796967ff7f27269b31ef983b5fb26b03aab) ) + ROM_LOAD16_BYTE( "sa4-280.u17", 0x40000, 0x20000, CRC(cbde5343) SHA1(e341d642d8537bc221b3ca9803c221dc0cdf86c3) ) + ROM_LOAD16_BYTE( "sa4-280.u18", 0x40001, 0x20000, CRC(885b887b) SHA1(9cfb145c8cca49450fabbf4efab9c70f98ecd2af) ) + + ROM_LOAD16_BYTE( "u2.bin", 0x80000, 0x20000, CRC(7091dfcd) SHA1(d28abd70db5c49baa93f0488e443f29c27a7a559) ) + ROM_LOAD16_BYTE( "u1.bin", 0x80001, 0x20000, CRC(1bb0efbf) SHA1(59d7e2e51928df149764502bc4bd5736463f40d7) ) + ROM_LOAD16_BYTE( "u4.bin", 0xc0000, 0x20000, CRC(0fb0fc84) SHA1(e7ef68130f9627a842849f41f67accf8593a0819) ) + ROM_LOAD16_BYTE( "u3.bin", 0xc0001, 0x20000, CRC(ef4617d8) SHA1(48231405a775585451bf970db5bb57ec2f238250) ) + + ROM_REGION( 0x10000, "sound", 0 ) + ROM_LOAD( "reels.bin", 0x00000, 0x10000, CRC(1319cf82) SHA1(7a233072890361bcf384de4f90170c2ca713b1de) ) + + ROM_REGION( 0x20000, "upd", 0 ) + ROM_LOAD( "dig2-001.u12", 0x00000, 0x20000, CRC(498dd74f) SHA1(80bb204b3e9cadcecbfa75c78c52fb9908566c5e) ) +ROM_END + +/************************************* + * + * Game driver(s) + * + *************************************/ + +GAME( 1991, screenpl, 0, maygayv1, screenpl, 0, ROT0, "Maygay", "Screen Play (ver. 4.0)", GAME_IMPERFECT_SOUND|GAME_REQUIRES_ARTWORK ) +GAME( 1991, screenp1, screenpl, maygayv1, screenpl, 0, ROT0, "Maygay", "Screen Play (ver. 1.9)", GAME_IMPERFECT_SOUND|GAME_REQUIRES_ARTWORK ) +GAME( 1991, screenp2, screenpl, maygayv1, screenpl, 0, ROT0, "Maygay", "Screen Play (ver. 1.9, Isle of Man)", GAME_IMPERFECT_SOUND|GAME_REQUIRES_ARTWORK ) diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 123953aefc7..ffd8d00c25c 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -1,6 +1,8 @@ /*********************************************************************************************************** Barcrest MPU4 highly preliminary driver by J.Wallace, and Anonymous. - This is the core driver, no game specific stuff should go in here. + + This is the core driver, no video specific stuff should go in here. + This driver holds all the mechanical games. 09-2007: Haze: Added Deal 'Em video support. 03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them. @@ -240,7 +242,6 @@ IRQ line connected to CPU TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything - Distinguish door switches using manual ***********************************************************************************************************/ - #include "driver.h" #include "machine/6821pia.h" #include "machine/6840ptm.h" @@ -249,6 +250,8 @@ TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything #include "timer.h" #include "cpu/m6809/m6809.h" #include "sound/ay8910.h" +#include "sound/okim6376.h" +#include "sound/2413intf.h" #include "machine/steppers.h" #include "machine/roc10937.h" #include "machine/meters.h" @@ -265,13 +268,10 @@ TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything #define LOG_IC3(x) do { if (MPU4VERBOSE) logerror x; } while (0) #define LOG_IC8(x) do { if (MPU4VERBOSE) logerror x; } while (0) -#ifndef AWP_VIDEO /*Defined for fruit machines with mechanical reels*/ -#define draw_reel(x) -#else -#define draw_reel(x) awp_draw_reel x -#endif -#include "mpu4.lh" +#include "video/awpvid.h" //Fruit Machines Only #include "connect4.lh" +#include "gamball.lh" +#include "mpu4.lh" #define MPU4_MASTER_CLOCK (6880000) /* local vars */ @@ -297,6 +297,9 @@ static int serial_card_connected; static emu_timer *ic24_timer; static TIMER_CALLBACK( ic24_timeout ); +static int expansion_latch;// OKI MOD 4 and above only +static int global_volume;// OKI MOD 4 and above only + /* 32 multiplexed inputs - but a further 8 possible per AUX. Two connectors 'orange' (sampled every 8ms) and 'black' (sampled every 16ms) @@ -818,8 +821,8 @@ static WRITE8_HANDLER( pia_ic6_portb_w ) if ( stepper_optic_state(1) ) optic_pattern |= 0x02; else optic_pattern &= ~0x02; } - draw_reel((0)); - draw_reel((1)); + awp_draw_reel(0); + awp_draw_reel(1); } @@ -880,8 +883,8 @@ static WRITE8_HANDLER( pia_ic7_porta_w ) if ( stepper_optic_state(3) ) optic_pattern |= 0x08; else optic_pattern &= ~0x08; } - draw_reel((2)); - draw_reel((3)); + awp_draw_reel(2); + awp_draw_reel(3); } @@ -999,6 +1002,72 @@ static const pia6821_interface pia_ic8_intf = /*irqs : A/B */ cpu0_irq, cpu0_irq }; +static WRITE8_HANDLER( pia_gb_porta_w ) +{ + const device_config *msm6376 = devtag_get_device(space->machine, SOUND, "msm6376"); + + LOG(("%04x GAMEBOARD: PIA Port A Set to %2x\n", cpu_get_previouspc(space->cpu),data)); + okim6376_w(msm6376, 0, data); +} + +static WRITE8_HANDLER( pia_gb_portb_w ) +{ + int changed = expansion_latch^data; + + LOG(("%04x GAMEBOARD: PIA Port B Set to %2x\n", cpu_get_previouspc(space->cpu),data)); + + expansion_latch = data; + + if ( changed & 0x20) + { // digital volume clock line changed + if ( !(data & 0x20) ) + { // changed from high to low, + if ( !(data & 0x10) ) + { + if ( global_volume < 31 ) global_volume++; //steps unknown + } + else + { + if ( global_volume > 0 ) global_volume--; + } + + { +// float percent = (32-global_volume)/32.0; //volume_override?1.0:(32-global_volume)/32.0; +// LOG(("GAMEBOARD: OKI volume %f \n",percent)); +// sndti_set_output_gain(SOUND_OKIM6295, 0, 0, percent); + } + } + } +} +static READ8_HANDLER( pia_gb_portb_r ) +{ + LOG(("%04x GAMEBOARD: PIA Read of Port B\n",cpu_get_previouspc(space->cpu))); + // + // b7, 1 = OKI ready, 0 = OKI busy + // b5, vol clock + // b4, 1 = Vol down, 0 = Vol up + // + +//if (offset == 0x40) +//{ +// return OKIM6295_status_r(0); +//} + return 0x40; +} + +static WRITE8_HANDLER( pia_gb_ca2_w ) +{ + LOG(("%04x GAMEBOARD: OKI RESET (offset = %d),data = %02X\n", cpu_get_previouspc(space->cpu), offset, data&0xFF)); + +// return okim6376_status_0_r(); +} + +static const pia6821_interface pia_gameboard_intf = +{ + /*inputs : A/B,CA/B1,CA/B2 */ 0, pia_gb_portb_r, 0, 0, 0, 0, + /*outputs: A/B,CA/B2 */ pia_gb_porta_w, pia_gb_portb_w, pia_gb_ca2_w, 0, + /*irqs : A/B */ 0,0 +}; /* input ports for MPU4 board */ static INPUT_PORTS_START( mpu4 ) @@ -1230,6 +1299,136 @@ static INPUT_PORTS_START( connect4 ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) INPUT_PORTS_END +static INPUT_PORTS_START( gamball ) + PORT_START("ORANGE1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("06") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("07") + + PORT_START("ORANGE2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("14") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("15") + + PORT_START("BLACK1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE + + PORT_START("BLACK2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel/Collect") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold/Nudge 1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold/Nudge 2") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold/Nudge 3") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold/Nudge 4") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) + + PORT_START("DIL1") + PORT_DIPNAME( 0x01, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DIL2") + PORT_DIPNAME( 0x01, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("AUX1") +/* PORT_DIPNAME( 0x01, 0x00, "AUX101" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "AUX102" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "AUX103" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "AUX104" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) )*/ + PORT_DIPNAME( 0x10, 0x00, "AUX105" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "AUX106" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "AUX107" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "AUX108" ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("AUX2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) +INPUT_PORTS_END + static const stepper_interface barcrest_reel_interface = { BARCREST_48STEP_REEL, @@ -1274,6 +1473,49 @@ static MACHINE_START( mpu4mod2 ) ROC10937_init(0, MSC1937,0); } +static MACHINE_START( mpu4dutch ) +{ + mpu4_config_common(machine); + pia_config(machine, 6,&pia_gameboard_intf); + pia_reset(); + + serial_card_connected=0; + +// setup 8 mechanical meters //////////////////////////////////////////// + Mechmtr_init(8); + +// setup 4 default 96 half step reels /////////////////////////////////// + stepper_config(machine, 0, &barcrest_reel_interface); + stepper_config(machine, 1, &barcrest_reel_interface); + stepper_config(machine, 2, &barcrest_reel_interface); + stepper_config(machine, 3, &barcrest_reel_interface); + +// setup the standard oki MSC1937 display /////////////////////////////// + ROC10937_init(0, MSC1937,1); // does oldtimer use a OKI MSC1937 alpha display controller? +} + +static MACHINE_START( mpu4mod4 ) +{ + mpu4_config_common(machine); + pia_config(machine, 6,&pia_gameboard_intf); + pia_reset(); + + serial_card_connected=0; + mod_number=4; + +// setup 8 mechanical meters //////////////////////////////////////////// + Mechmtr_init(8); + +// setup 4 default 96 half step reels /////////////////////////////////// + stepper_config(machine, 0, &barcrest_reel_interface); + stepper_config(machine, 1, &barcrest_reel_interface); + stepper_config(machine, 2, &barcrest_reel_interface); + stepper_config(machine, 3, &barcrest_reel_interface); + + awp_reel_setup(); +// setup the standard oki MSC1937 display /////////////////////////////// + ROC10937_init(0, MSC1937,0); +} /* Characteriser (CHR) @@ -1370,6 +1612,46 @@ static READ8_HANDLER( characteriser_r ) return 0; } +static DRIVER_INIT (m_ccelbr) +{ + int x; + static const UINT8 chr_table[72]={ 0x00,0x84,0x8C,0xB8,0x74,0x80,0x1C,0xB4, + 0xD8,0x74,0x00,0xD4,0xC8,0x78,0xA4,0x4C, + 0xE0,0xDC,0xF4,0x88,0x78,0x24,0x84,0xCC, + 0xB8,0x74,0x90,0x48,0xA0,0x1C,0x24,0x94, + 0xC8,0xB8,0x74,0x00,0x94,0x48,0x30,0x90, + 0x08,0x60,0xD4,0x58,0xF4,0x18,0x74,0x80, + 0xDC,0x74,0xD0,0x58,0x24,0x94,0xD8,0x34, + 0x90,0x58,0xF4,0x88,0x38,0x24,0xD4,0x00, + 0x00,0x50,0x00,0x50,0x10,0x40,0x04,0x00}; + + for (x=0; x<72; x++) + { + MPU4_chr_data[(x)] = chr_table[(x)]; + } + +} + +DRIVER_INIT (m_gmball) +{ + int x; + static const UINT8 chr_table[72]= { 0x00,0x0C,0x50,0x90,0xB0,0x38,0xD4,0xA0, + 0xBC,0xD4,0x30,0x90,0x38,0xC4,0xAC,0x70, + 0x98,0xDC,0xDC,0x54,0x80,0xB4,0x38,0xCC, + 0xE8,0xF8,0xD4,0x30,0x00,0x84,0x2C,0xC8, + 0xF8,0x4C,0x58,0xD4,0xA8,0x78,0x44,0x0C, + 0x48,0x50,0x98,0xD4,0xB0,0xA0,0xA4,0x3C, + 0xDC,0xD4,0xB8,0xD4,0x30,0x88,0xE0,0x24, + 0x8C,0xF8,0xCC,0x70,0x90,0x20,0x9C,0x00, + 0x00,0x18,0x08,0x10,0x00,0x18,0x08,0x00}; + + for (x=0; x < 72; x++) + { + MPU4_chr_data[(x)] = chr_table[(x)]; + } + +} + /* generate a 50 Hz signal (based on an RC time) */ static TIMER_DEVICE_CALLBACK( gen_50hz ) @@ -1403,6 +1685,78 @@ static ADDRESS_MAP_START( mod2_memmap, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1) /* 64k paged ROM (4 pages) */ ADDRESS_MAP_END +static ADDRESS_MAP_START( mod4_yam_map, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) + + AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) + + AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) + + AM_RANGE(0x0880, 0x0881) AM_DEVWRITE( SOUND, "ym2413", ym2413_w ) + +// AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w) + + AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w) // 6840PTM + AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w) // PIA6821 IC3 + AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w) // PIA6821 IC4 + AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w) // PIA6821 IC5 + AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w) // PIA6821 IC6 + AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w) // PIA6821 IC7 + AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w) // PIA6821 IC8 + + AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1) // 64k paged ROM (4 pages) +ADDRESS_MAP_END + +static ADDRESS_MAP_START( mod4_oki_map, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) + + AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) + + AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) + + AM_RANGE(0x0880, 0x0883) AM_READWRITE(pia_6_r,pia_6_w) // PIA6821 on game board + +// AM_RANGE(0x08C0, 0x08C7) AM_READERITE(ptm6840_1_r,ptm6840_1_w) // 6840PTM on game board + +// AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w) + + AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w) // 6840PTM + AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w) // PIA6821 IC3 + AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w) // PIA6821 IC4 + AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w) // PIA6821 IC5 + AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w) // PIA6821 IC6 + AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w) // PIA6821 IC7 + AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w) // PIA6821 IC8 + + AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1) // 64k paged ROM (4 pages) +ADDRESS_MAP_END + +// memory map for barcrest mpu4 board ///////////////////////////////////// + +static ADDRESS_MAP_START( dutch_memmap, ADDRESS_SPACE_PROGRAM, 8 ) + + AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) + +// AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) + + AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) + AM_RANGE(0x0880, 0x0883) AM_READWRITE(pia_6_r,pia_6_w) // PIA6821 on game board + +// AM_RANGE(0x08C0, 0x08C7) AM_READERITE(ptm6840_2_r,ptm6840_2_w) // 6840PTM on game board + +// AM_RANGE(0x08E0, 0x08E7) AM_READWRITE(68681_duart_r,68681_duart_w) + + AM_RANGE(0x0900, 0x0907) AM_READWRITE(ptm6840_0_r,ptm6840_0_w) // 6840PTM + AM_RANGE(0x0A00, 0x0A03) AM_READWRITE(pia_0_r,pia_0_w) // PIA6821 IC3 + AM_RANGE(0x0B00, 0x0B03) AM_READWRITE(pia_1_r,pia_1_w) // PIA6821 IC4 + AM_RANGE(0x0C00, 0x0C03) AM_READWRITE(pia_2_r,pia_2_w) // PIA6821 IC5 + AM_RANGE(0x0D00, 0x0D03) AM_READWRITE(pia_3_r,pia_3_w) // PIA6821 IC6 + AM_RANGE(0x0E00, 0x0E03) AM_READWRITE(pia_4_r,pia_4_w) // PIA6821 IC7 + AM_RANGE(0x0F00, 0x0F03) AM_READWRITE(pia_5_r,pia_5_w) // PIA6821 IC8 + + AM_RANGE(0x1000, 0xffff) AM_READ(SMH_BANK1) // 64k paged ROM (4 pages) +ADDRESS_MAP_END + static const ay8910_interface ay8910_config = { AY8910_SINGLE_OUTPUT, @@ -1434,5 +1788,53 @@ static MACHINE_DRIVER_START( mpu4mod2 ) MDRV_DEFAULT_LAYOUT(layout_mpu4) MACHINE_DRIVER_END +static MACHINE_DRIVER_START( mod4yam ) + MDRV_IMPORT_FROM( mpu4mod2 ) + MDRV_MACHINE_START(mpu4mod4) + MDRV_CPU_MODIFY("main") + MDRV_CPU_PROGRAM_MAP(mod4_yam_map,0) + + MDRV_SOUND_REMOVE("ay8913") + MDRV_SOUND_ADD("ym2413", YM2413, MPU4_MASTER_CLOCK/4) + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) +MACHINE_DRIVER_END + +static MACHINE_DRIVER_START( mod4oki ) + MDRV_IMPORT_FROM( mpu4mod2 ) + MDRV_MACHINE_START(mpu4mod4) + MDRV_CPU_MODIFY("main") + MDRV_CPU_PROGRAM_MAP(mod4_oki_map,0) + + MDRV_SOUND_REMOVE("ay8913") + MDRV_SOUND_ADD("msm6376", OKIM6376, 4000000) //? + MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) +MACHINE_DRIVER_END + +static MACHINE_DRIVER_START( mpu4dutch ) + MDRV_IMPORT_FROM( mod4oki ) + MDRV_CPU_MODIFY("main") + MDRV_CPU_PROGRAM_MAP(dutch_memmap,0) // setup read and write memorymap + MDRV_MACHINE_START(mpu4dutch) // main mpu4 board initialisation +MACHINE_DRIVER_END + +ROM_START( m_oldtmr ) + ROM_REGION( 0x10000, "main", 0 ) + ROM_LOAD( "dot11.bin", 0x00000, 0x10000, CRC(da095666) SHA1(bc7654dc9da1f830a43f925db8079f27e18bb61e)) +ROM_END + +ROM_START( m_ccelbr ) + ROM_REGION( 0x10000, "main", 0 ) + ROM_LOAD( "cels.p1", 0x00000, 0x10000, CRC(19d2162f) SHA1(24fe435809352725e7614c32e2184142f355298e)) +ROM_END + +ROM_START( m_gmball ) + ROM_REGION( 0x10000, "main", ROMREGION_ERASE00 ) + ROM_LOAD( "gbbx.p1", 0x0000, 0x10000, CRC(0b5adcd0) SHA1(1a198bd4a1e7d6bf4cf025c43d35aaef351415fc)) +ROM_END + +// year, name, parent, machine, input, init, monitor, company, fullname, flags +GAME( 198?, m_oldtmr,0, mpu4dutch,mpu4, 0, ROT0, "Barcrest", "Old Timer", GAME_NOT_WORKING|GAME_NO_SOUND|GAME_REQUIRES_ARTWORK ) +GAME( 198?, m_ccelbr,0, mpu4mod2, mpu4, m_ccelbr, ROT0, "Barcrest", "Club Celebration", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK ) +GAMEL(198?, m_gmball,0, mod4yam, gamball, m_gmball, ROT0, "Barcrest", "Gamball", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK,layout_gamball ) #include "drivers/mpu4drvr.c" diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index e2159d25459..cf864e22674 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -176,9 +176,8 @@ TODO: - MPU4 Master clock value taken from schematic, but 68k value is not. - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX2, but not there?) - Deal 'Em has bad tiles (apostrophe, logo, bottom corner), black should actually be transparent - - to give black on green. + to give black on green. ***********************************************************************************************************/ - /* MPU4 Video */ #include "cpu/m68000/m68000.h" #include "machine/6850acia.h" @@ -2055,7 +2054,7 @@ GAME( 199?, mating, bctvidbs,mpu4_vid, mpu4, mating,ROT0, "Barcrest", " GAME( 199?, matinga, mating, mpu4_vid, mpu4, mating,ROT0, "Barcrest", "The Mating Game (Standard)", GAME_NOT_WORKING|GAME_NO_SOUND ) GAME( 199?, vgpoker, 0, vgpoker, mpu4, 0, ROT0, "BwB", "Vegas Poker (Prototype)", GAME_NOT_WORKING|GAME_NO_SOUND ) -GAMEL(1989?,connect4,0, mpu4mod2, connect4, connect4, ROT0,"Dolbeck Systems", "Connect 4", GAME_IMPERFECT_GRAPHICS,layout_connect4 ) +GAMEL(1989?,connect4,0, mpu4mod2, connect4, connect4, ROT0,"Dolbeck Systems", "Connect 4", GAME_IMPERFECT_GRAPHICS|GAME_REQUIRES_ARTWORK,layout_connect4 ) GAME( 198?, mpu4utst,0, mpu4mod2, mpu4, 0, ROT0,"Barcrest", "MPU4 Unit Test (Program 4)", 0 ) GAME( 198?, mpu4tst2,0, mpu4mod2, mpu4, 0, ROT0,"Barcrest", "MPU4 Unit Test (Program 2)", 0 ) GAME( 198?, mpu4met0,0, mpu4mod2, mpu4, 0, ROT0,"Barcrest", "MPU4 Meter Clear ROM", 0 ) diff --git a/src/mame/drivers/mpu5.c b/src/mame/drivers/mpu5.c index cfb264cb8fc..66b6fb01722 100644 --- a/src/mame/drivers/mpu5.c +++ b/src/mame/drivers/mpu5.c @@ -9,8 +9,7 @@ -- the main CPU is a 68340, which is a 32-bit 680xx variant with modified opcodes etc. - -- should there be a bios using an 8-bit cpu like MPU4, or is the 68340 the only CPU? - + -- Much of the communication is done via a 68681 DUART. */ #include "driver.h" diff --git a/src/mame/layout/bfm_sc1.lay b/src/mame/layout/bfm_sc1.lay index cf33abf4a04..0f1f00a5c66 100644 --- a/src/mame/layout/bfm_sc1.lay +++ b/src/mame/layout/bfm_sc1.lay @@ -2090,3 +2090,2095 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/gamball.lay b/src/mame/layout/gamball.lay index ba6771ccf0f..6c30092ecca 100644 --- a/src/mame/layout/gamball.lay +++ b/src/mame/layout/gamball.lay @@ -2071,3 +2071,2076 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.mak b/src/mame/mame.mak index db1bb5a9858..0c210ba7f50 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -350,6 +350,7 @@ DRVLIBS = \ $(MAMEOBJ)/jpm.a \ $(MAMEOBJ)/kaneko.a \ $(MAMEOBJ)/konami.a \ + $(MAMEOBJ)/maygay.a \ $(MAMEOBJ)/meadows.a \ $(MAMEOBJ)/merit.a \ $(MAMEOBJ)/metro.a \ @@ -554,15 +555,18 @@ $(MAMEOBJ)/atlus.a: \ $(DRIVERS)/powerins.o $(VIDEO)/powerins.o \ $(MAMEOBJ)/barcrest.a: \ + $(VIDEO)/awpvid.o \ $(MACHINE)/meters.o \ $(DRIVERS)/mpu4.o \ $(DRIVERS)/mpu5.o \ $(MACHINE)/steppers.o \ $(MAMEOBJ)/bfm.a: \ + $(DRIVERS)/bfm_sc1.o \ + $(DRIVERS)/bfmsys85.o \ $(DRIVERS)/bfcobra.o \ $(DRIVERS)/bfm_sc2.o $(VIDEO)/bfm_adr2.o \ - $(MACHINE)/bfm_bd1.o $(VIDEO)/bfm_dm01.o $(VIDEO)/awpvid.o\ + $(MACHINE)/bfm_bd1.o $(VIDEO)/bfm_dm01.o \ $(MAMEOBJ)/bmc.a: \ $(DRIVERS)/bmcbowl.o \ @@ -931,6 +935,10 @@ $(MAMEOBJ)/konami.a: \ $(DRIVERS)/zr107.o \ $(MACHINE)/konamiic.o $(VIDEO)/konamiic.o \ +$(MAMEOBJ)/maygay.a: \ + $(DRIVERS)/maygay1b.o \ + $(DRIVERS)/maygayv1.o \ + $(MAMEOBJ)/meadows.a: \ $(DRIVERS)/lazercmd.o $(VIDEO)/lazercmd.o \ $(DRIVERS)/meadows.o $(AUDIO)/meadows.o $(VIDEO)/meadows.o \ @@ -1715,6 +1723,8 @@ $(DRIVERS)/highvdeo.o: $(LAYOUT)/fashion.lh $(DRIVERS)/bzone.o: $(LAYOUT)/bzone.lh +$(DRIVERS)/bfm_sc1.o: $(LAYOUT)/bfm_sc1.lh + $(DRIVERS)/bfm_sc2.o: $(LAYOUT)/bfm_sc2.lh \ $(LAYOUT)/awpdmd.lh \ $(LAYOUT)/awpvid14.lh \ @@ -1767,7 +1777,8 @@ $(DRIVERS)/magic10.o: $(LAYOUT)/sgsafari.lh $(DRIVERS)/maxaflex.o: $(LAYOUT)/maxaflex.lh $(DRIVERS)/mpu4.o: $(LAYOUT)/mpu4.lh \ - $(LAYOUT)/connect4.lh + $(LAYOUT)/connect4.lh \ + $(LAYOUT)/gamball.lh $(DRIVERS)/mw8080bw.o: $(LAYOUT)/clowns.lh \ $(LAYOUT)/invaders.lh \ diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c index 5cc81e6fe66..1b5d9b23ee6 100644 --- a/src/mame/mamedriv.c +++ b/src/mame/mamedriv.c @@ -8905,6 +8905,27 @@ Other Sun games DRIVER( m_luvjub ) DRIVER( m_cpeno1 ) + /* System85 games */ + DRIVER( m_supcrd ) /* (c) 198? BFM */ + + /* Scorpion1 games */ + DRIVER( m_lotsse ) /* (c) 198? BFM Dutch ROMS, prelim*/ + DRIVER( m_roulet ) /* (c) 198? BFM Dutch ROMS, prelim*/ + DRIVER( m_clattr ) /* (c) 1990 BFM, Game Card 39-370-196*/ + DRIVER( m_tppokr ) /* (c) 1996 BFM/ELAM,Game Card 95-750-899, uses Adder board for feature gfx*/ + + /* Maygay Machines Ltd. */ + DRIVER( m_sptlgt ) + + DRIVER( screenpl ) + DRIVER( screenp1 ) + DRIVER( screenp2 ) + + /* MPU4 */ + DRIVER( m_oldtmr ) /* Barcrest - highly prelim*/ + DRIVER( m_ccelbr ) + DRIVER( m_gmball ) + /* MPU5 */ DRIVER( m_honmon ) diff --git a/src/mame/video/awpvid.c b/src/mame/video/awpvid.c index 7167b33ea6c..795e36ee05e 100644 --- a/src/mame/video/awpvid.c +++ b/src/mame/video/awpvid.c @@ -29,17 +29,11 @@ **************************************************************************************/ - - #include "driver.h" #include "awpvid.h" #include "rendlay.h" #include "machine/steppers.h" - -//#include "awpvid14.lh" -//#include "awpvid16.lh" - static UINT8 steps[MAX_STEPPERS]; static UINT8 symbols[MAX_STEPPERS]; static UINT8 reelpos[MAX_STEPPERS]; @@ -123,5 +117,3 @@ void awp_draw_reel(int rno) output_set_value(rg,(reelpos[rno])); } } - - diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c index 54b15edaed6..f494fd9d7b6 100644 --- a/src/mame/video/bfm_dm01.c +++ b/src/mame/video/bfm_dm01.c @@ -30,7 +30,7 @@ Standard dm01 memorymap -----------+---+-----------------+----------------------------------------- TODO: - find out clockspeed of CPU - + - make a non-hacky Artwork representation of dot matrix Layout notes: the dot matrix is set to screen 0. Multiple matrices and matrix/VFD combos are not yet supported. @@ -42,8 +42,8 @@ Standard dm01 memorymap #include "bfm_dm01.h" // local prototypes /////////////////////////////////////////////////////// -extern void Scorpion2_DMSetSwitchState(int strobe, int data, int state); -extern int Scorpion2_DMGetSwitchState(int strobe, int data); +extern void Scorpion2_SetSwitchState(int strobe, int data, int state); +extern int Scorpion2_GetSwitchState(int strobe, int data); // local vars ///////////////////////////////////////////////////////////// @@ -116,7 +116,7 @@ static WRITE8_HANDLER( control_w ) if ( data & 8 ) busy = 0; else busy = 1; - Scorpion2_DMSetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1); + Scorpion2_SetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1); } } @@ -254,7 +254,7 @@ VIDEO_UPDATE( bfm_dm01 ) copybitmap(bitmap, dm_bitmap, 0,0,0,0, visarea); LOG(("Busy=%X",data_avail)); - LOG(("%X",Scorpion2_DMGetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA))); + LOG(("%X",Scorpion2_GetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA))); return 0; } @@ -271,7 +271,7 @@ void BFM_dm01_reset(void) xcounter = 0; data_avail = 0; - Scorpion2_DMSetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1); + Scorpion2_SetSwitchState(FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1); } PALETTE_INIT( bfm_dm01 ) -- cgit v1.2.3