summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Michaël Banaan Ananas <happppp@users.noreply.github.com>2012-04-22 02:41:47 +0000
committer Michaël Banaan Ananas <happppp@users.noreply.github.com>2012-04-22 02:41:47 +0000
commit0866030f2f4e592b517423645e1eebc874046d40 (patch)
tree72eeaaec69c09151a2fcf21e6ecdcd0617b35d1a
parent7936bd18b7a892b078f049528c874e5bef6aac79 (diff)
some updates, nothing to see yet from the outside
-rw-r--r--src/mame/drivers/meyc8088.c155
1 files changed, 115 insertions, 40 deletions
diff --git a/src/mame/drivers/meyc8088.c b/src/mame/drivers/meyc8088.c
index 7b05a048cb9..79442ba8355 100644
--- a/src/mame/drivers/meyc8088.c
+++ b/src/mame/drivers/meyc8088.c
@@ -1,11 +1,13 @@
-/*
+/****************************************************************
-Meyco 8088 based hardware
+ Meyco 8088 based hardware
-significant chips: i8088 CPU, two i8155, what else???
-It locks up with an interrupt error. How are interrupts generated? The vector is written to $00080, pointing to $fe19f
+ i8088 CPU @ 5MHz (15MHz XTAL + i8284A clock generator),
+ 3 x 8KB EPROM (max 4), 3 x 8KB RAM (max 4), 2KB battery RAM,
+ 2 x i8155, optional i8251A for factory debug
-*/
+
+****************************************************************/
#include "emu.h"
#include "cpu/i86/i86.h"
@@ -17,10 +19,20 @@ class meyc8088_state : public driver_device
public:
meyc8088_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
+ m_maincpu(*this,"maincpu"),
m_vram(*this, "vram")
{ }
+ required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_vram;
+
+ UINT8 m_status;
+ UINT8 m_common;
+
+ DECLARE_WRITE8_MEMBER(video5_flip_w);
+ DECLARE_READ8_MEMBER(video5_flip_r);
+ DECLARE_WRITE8_MEMBER(screen_flip_w);
+ DECLARE_READ8_MEMBER(screen_flip_r);
};
@@ -57,68 +69,123 @@ static SCREEN_UPDATE_IND16( meyc8088 )
***************************************************************************/
+// switch screen on/off on $b4000 access
+READ8_MEMBER(meyc8088_state::screen_flip_r)
+{
+ m_status ^= 2;
+ return 0;
+}
+
+WRITE8_MEMBER(meyc8088_state::screen_flip_w)
+{
+ m_status ^= 2;
+}
+
+// switch video5 (color prom d4) on/off on $b5000 access
+READ8_MEMBER(meyc8088_state::video5_flip_r)
+{
+ m_status ^= 4;
+ return 0;
+}
+
+WRITE8_MEMBER(meyc8088_state::video5_flip_w)
+{
+ m_status ^= 4;
+}
+
+
static ADDRESS_MAP_START( meyc8088_map, AS_PROGRAM, 8, meyc8088_state )
AM_RANGE(0x00000, 0x007ff) AM_RAM
AM_RANGE(0x70000, 0x77fff) AM_RAM AM_SHARE("vram")
- AM_RANGE(0xb0000, 0xb00ff) AM_DEVREADWRITE("i8155_0", i8155_device, memory_r, memory_w)
- AM_RANGE(0xb0800, 0xb0807) AM_DEVREADWRITE("i8155_0", i8155_device, io_r, io_w)
+ AM_RANGE(0xb0000, 0xb00ff) AM_DEVREADWRITE("i8155_2", i8155_device, memory_r, memory_w)
+ AM_RANGE(0xb0800, 0xb0807) AM_DEVREADWRITE("i8155_2", i8155_device, io_r, io_w)
AM_RANGE(0xb1000, 0xb10ff) AM_DEVREADWRITE("i8155_1", i8155_device, memory_r, memory_w)
AM_RANGE(0xb1800, 0xb1807) AM_DEVREADWRITE("i8155_1", i8155_device, io_r, io_w)
-// AM_RANGE(0xb2000, 0xb2000) AM_NOP // ?
-// AM_RANGE(0xb3000, 0xb3000) AM_RAM // serial device, debug related
-// AM_RANGE(0xb3800, 0xb3800) AM_RAM // ? writes 00 00 00 40 4A 37
-// AM_RANGE(0xb4000, 0xb4000) AM_NOP // ?
-// AM_RANGE(0xb5000, 0xb5000) AM_NOP // ?
+// AM_RANGE(0xb2000, 0xb2000) AM_NOP // drive motor?
+// AM_RANGE(0xb3000, 0xb3000) AM_RAM // 8251A, debug related
+// AM_RANGE(0xb3800, 0xb3800) AM_RAM // "
+ AM_RANGE(0xb4000, 0xb4000) AM_READWRITE(screen_flip_r, screen_flip_w)
+ AM_RANGE(0xb5000, 0xb5000) AM_READWRITE(video5_flip_r, video5_flip_w)
AM_RANGE(0xf8000, 0xfffff) AM_ROM
ADDRESS_MAP_END
-static WRITE8_DEVICE_HANDLER(meyc8088_i8155_a_w)
+static WRITE8_DEVICE_HANDLER(meyc8088_lights1_w)
{
- logerror("i8155 Port A: %02X\n", data);
+ // lite 1-8
+ for (int i = 0; i < 8; i++)
+ output_set_lamp_value(i, data >> i & 1);
}
-static WRITE8_DEVICE_HANDLER(meyc8088_i8155_b_w)
+static WRITE8_DEVICE_HANDLER(meyc8088_lights2_w)
{
- logerror("i8155 Port B: %02X\n", data);
+ // lite 9-16
+ for (int i = 0; i < 8; i++)
+ output_set_lamp_value(i + 8, data >> i & 1);
}
-static WRITE8_DEVICE_HANDLER(meyc8088_i8155_c_w)
+static WRITE8_DEVICE_HANDLER(meyc8088_common_w)
{
+ meyc8088_state *state = device->machine().driver_data<meyc8088_state>();
+
+ // d0: /CR2
+ state->m_status = (state->m_status & ~1) | (data & 1);
+
+ // d1: battery on
+
+ // d2-d5: /common
+ state->m_common = data >> 2 & 0xf;
+
logerror("i8155 Port C: %02X\n", data);
}
-static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_0_timer_out)
+static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_1_timer_out)
{
- //logerror("Timer 0 out %d\n", state);
+ // clock 8251A
+ //logerror("Timer 1 out %d\n", state);
}
-static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_1_timer_out)
+static WRITE_LINE_DEVICE_HANDLER(meyc8088_i8155_2_timer_out)
{
- //logerror("Timer 1 out %d\n", state);
+ // sound dac
+ //logerror("Timer 2 out %d\n", state);
+}
+
+
+static READ8_DEVICE_HANDLER(meyc8088_status_r)
+{
+ meyc8088_state *state = device->machine().driver_data<meyc8088_state>();
+
+ // d0: /CR2
+ // d1: screen on
+ // d2: video5
+ // d3: N/C
+ // d4: battery ok
+ // d5: /drive on
+ return (state->m_status & 7) | 0x38;
}
static const i8155_interface i8155_intf[2] =
{
{
- // all ports set to output
+ // all ports set to input
+ DEVCB_INPUT_PORT("IN0"),
DEVCB_NULL,
- DEVCB_HANDLER(meyc8088_i8155_a_w),
+ DEVCB_INPUT_PORT("IN1"),
DEVCB_NULL,
- DEVCB_HANDLER(meyc8088_i8155_b_w),
+ DEVCB_HANDLER(meyc8088_status_r),
DEVCB_NULL,
- DEVCB_HANDLER(meyc8088_i8155_c_w),
- DEVCB_LINE(meyc8088_i8155_0_timer_out)
+ DEVCB_LINE(meyc8088_i8155_1_timer_out)
},
{
- // all ports set to input
- DEVCB_INPUT_PORT("IN0"),
+ // all ports set to output
DEVCB_NULL,
- DEVCB_INPUT_PORT("IN1"),
+ DEVCB_HANDLER(meyc8088_lights2_w),
DEVCB_NULL,
- DEVCB_INPUT_PORT("IN2"),
+ DEVCB_HANDLER(meyc8088_lights1_w),
DEVCB_NULL,
- DEVCB_LINE(meyc8088_i8155_1_timer_out)
+ DEVCB_HANDLER(meyc8088_common_w),
+ DEVCB_LINE(meyc8088_i8155_2_timer_out)
}
};
@@ -157,9 +224,7 @@ static INPUT_PORTS_START( gldarrow )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN1")
- PORT_DIPNAME( 0x01, 0x01, "IN1 1" )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_DIPNAME( 0x02, 0x02, "IN1 2" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -216,14 +281,21 @@ INPUT_PORTS_END
***************************************************************************/
+static INTERRUPT_GEN( meyc8088_irq )
+{
+ // INTR on LC255, INTA hardwired to $20
+ device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x20);
+}
+
static MACHINE_CONFIG_START( meyc8088, meyc8088_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", I8088, 5000000)
+ MCFG_CPU_ADD("maincpu", I8088, XTAL_15MHz / 3)
MCFG_CPU_PROGRAM_MAP(meyc8088_map)
+ MCFG_CPU_VBLANK_INT("screen", meyc8088_irq)
- MCFG_I8155_ADD("i8155_0", 5000000, i8155_intf[0])
- MCFG_I8155_ADD("i8155_1", 5000000, i8155_intf[1])
+ MCFG_I8155_ADD("i8155_1", XTAL_15MHz / 3, i8155_intf[0])
+ MCFG_I8155_ADD("i8155_2", XTAL_15MHz / 3, i8155_intf[1])
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -240,9 +312,12 @@ MACHINE_CONFIG_END
ROM_START( gldarrow )
ROM_REGION( 0x100000, "maincpu", 0 )
- ROM_LOAD( "3.bin", 0x0fa000, 0x002000, CRC(a4acc6df) SHA1(b25f2cf8154932834100615e2e9c44ef47a15fea) )
- ROM_LOAD( "2.bin", 0x0fc000, 0x002000, CRC(595e380d) SHA1(6f8e58f646106d33cb651d97ca6a1133f7b05373) )
- ROM_LOAD( "1.bin", 0x0fe000, 0x002000, CRC(71bd0e39) SHA1(15345f5726cd33ecb1b2da05f2852b6cc3ac7747) )
+ ROM_LOAD( "3.14h", 0x0fa000, 0x002000, CRC(a4acc6df) SHA1(b25f2cf8154932834100615e2e9c44ef47a15fea) )
+ ROM_LOAD( "2.13h", 0x0fc000, 0x002000, CRC(595e380d) SHA1(6f8e58f646106d33cb651d97ca6a1133f7b05373) )
+ ROM_LOAD( "1.12h", 0x0fe000, 0x002000, CRC(71bd0e39) SHA1(15345f5726cd33ecb1b2da05f2852b6cc3ac7747) )
+
+ ROM_REGION( 0x20, "proms", 0 )
+ ROM_LOAD( "prom.2c", 0x00, 0x20, NO_DUMP ) // M3-7602-5 color prom
ROM_END