diff options
Diffstat (limited to 'src/devices/machine/mpu401.cpp')
-rw-r--r-- | src/devices/machine/mpu401.cpp | 74 |
1 files changed, 17 insertions, 57 deletions
diff --git a/src/devices/machine/mpu401.cpp b/src/devices/machine/mpu401.cpp index 48cc04b455d..2bf71c51fbf 100644 --- a/src/devices/machine/mpu401.cpp +++ b/src/devices/machine/mpu401.cpp @@ -39,11 +39,11 @@ ***************************************************************************/ #include "emu.h" -#include "machine/mpu401.h" +#include "mpu401.h" + #include "bus/midi/midi.h" #define M6801_TAG "mpu6801" -#define ROM_TAG "mpurom" #define MIDIIN_TAG "mdin" #define MIDIOUT_TAG "mdout" @@ -59,15 +59,12 @@ void mpu401_device::mpu401_map(address_map &map) { - map(0x0000, 0x001f).rw(FUNC(mpu401_device::regs_mode2_r), FUNC(mpu401_device::regs_mode2_w)); map(0x0020, 0x0021).rw(FUNC(mpu401_device::asic_r), FUNC(mpu401_device::asic_w)); - map(0x0080, 0x00ff).ram(); // on-chip RAM map(0x0800, 0x0fff).ram(); // external RAM - map(0xf000, 0xffff).rom().region(ROM_TAG, 0); } ROM_START( mpu401 ) - ROM_REGION(0x1000, ROM_TAG, 0) + ROM_REGION(0x1000, M6801_TAG, 0) ROM_LOAD( "roland__6801v0b55p__15179222.bin", 0x000000, 0x001000, CRC(65d3a151) SHA1(00efbfb96aeb997b69bb16981c6751d3c784bb87) ) /* Mask MCU; Label: "Roland // 6801V0B55P // 5A1 JAPAN // 15179222"; This is the final version (1.5A) of the mpu401 firmware; version is located at offsets 0x649 (0x15) and 0x64f (0x01) */ ROM_END @@ -83,7 +80,7 @@ DEFINE_DEVICE_TYPE(MPU401, mpu401_device, "mpu401", "Roland MPU-401 I/O box") void mpu401_device::device_add_mconfig(machine_config &config) { - M6801(config, m_ourcpu, 4000000); /* 4 MHz as per schematics */ + HD6801V0(config, m_ourcpu, 4000000); /* 4 MHz as per schematics */ m_ourcpu->set_addrmap(AS_PROGRAM, &mpu401_device::mpu401_map); m_ourcpu->in_p1_cb().set(FUNC(mpu401_device::port1_r)); m_ourcpu->out_p1_cb().set(FUNC(mpu401_device::port1_w)); @@ -126,8 +123,7 @@ mpu401_device::mpu401_device(const machine_config &mconfig, const char *tag, dev void mpu401_device::device_start() { - write_irq.resolve_safe(); - m_timer = timer_alloc(0, nullptr); + m_timer = timer_alloc(FUNC(mpu401_device::serial_tick), this); } //------------------------------------------------- @@ -145,72 +141,36 @@ void mpu401_device::device_reset() } //------------------------------------------------- -// device_timer - called when our device timer expires +// serial_tick - update the 6801's serial clock //------------------------------------------------- -void mpu401_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) -{ - m_ourcpu->m6801_clock_serial(); -} - -READ8_MEMBER(mpu401_device::regs_mode2_r) +TIMER_CALLBACK_MEMBER(mpu401_device::serial_tick) { - switch (offset) - { - case 4: - case 5: - case 6: - case 7: - case 0xf: -// logerror("MPU401: read @ unk %x %s\n", offset, machine().describe_context()); - break; - - default: - return m_ourcpu->m6801_io_r(space, offset); - } - - return 0xff; -} - -WRITE8_MEMBER(mpu401_device::regs_mode2_w) -{ - switch (offset) - { - case 4: - case 5: - case 6: - case 7: - case 0xf: -// logerror("MPU401: %02x @ unk %x %s\n", data, offset, machine().describe_context()); - break; - - default: - return m_ourcpu->m6801_io_w(space, offset, data); - } + m_ourcpu->clock_serial(); } -READ8_MEMBER(mpu401_device::port1_r) +uint8_t mpu401_device::port1_r() { return 0xff; } -WRITE8_MEMBER(mpu401_device::port1_w) +void mpu401_device::port1_w(uint8_t data) { // printf("port1_w: %02x met %x syncout %x DSRD %d DRRD %d\n", data, data & 3, (data>>3) & 3, (data>>6) & 1, (data>>7) & 1); } -READ8_MEMBER(mpu401_device::port2_r) +uint8_t mpu401_device::port2_r() { // printf("%s Read P2\n", machine().describe_context().c_str()); return m_port2; } -WRITE8_MEMBER(mpu401_device::port2_w) +void mpu401_device::port2_w(uint8_t data) { // printf("port2_w: %02x SYCOUT %d SYCIN %d SRCK %d MIDI OUT %d\n", data, (data & 1), (data>>1) & 1, (data>>2) & 1, (data>>4) & 1); } -READ8_MEMBER(mpu401_device::mpu_r) +uint8_t mpu401_device::mpu_r(offs_t offset) { // printf("mpu_r @ %d\n", offset); @@ -226,7 +186,7 @@ READ8_MEMBER(mpu401_device::mpu_r) } } -WRITE8_MEMBER(mpu401_device::mpu_w) +void mpu401_device::mpu_w(offs_t offset, uint8_t data) { // printf("%02x to MPU-401 @ %d\n", data, offset); m_command = data; @@ -242,7 +202,7 @@ WRITE8_MEMBER(mpu401_device::mpu_w) } } -READ8_MEMBER(mpu401_device::asic_r) +uint8_t mpu401_device::asic_r(offs_t offset) { if (offset == 0) { @@ -257,7 +217,7 @@ READ8_MEMBER(mpu401_device::asic_r) return 0xff; } -WRITE8_MEMBER(mpu401_device::asic_w) +void mpu401_device::asic_w(offs_t offset, uint8_t data) { // printf("MPU401: %02x to gate array @ %d\n", data, offset); @@ -270,7 +230,7 @@ WRITE8_MEMBER(mpu401_device::asic_w) } // MIDI receive -WRITE_LINE_MEMBER( mpu401_device::midi_rx_w ) +void mpu401_device::midi_rx_w(int state) { if (state == ASSERT_LINE) { |