diff options
author | 2022-10-09 14:33:33 +0200 | |
---|---|---|
committer | 2022-10-09 14:33:45 +0200 | |
commit | c16e4a2ff3d3f1bb7d9a61e1d9d62c1b1d2fcf60 (patch) | |
tree | 9ff1270189a31c047608c83a4d60345c45649165 | |
parent | 960a16b4137fd8a0258739a5aeae5ad991f446a3 (diff) |
othello: hook up upd7751c sample player
-rw-r--r-- | src/devices/cpu/mcs48/mcs48.cpp | 4 | ||||
-rw-r--r-- | src/mame/entex/advision.cpp | 11 | ||||
-rw-r--r-- | src/mame/misc/othello.cpp | 68 |
3 files changed, 40 insertions, 43 deletions
diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 3bc9be2758f..b429ac28ead 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -34,7 +34,7 @@ 8648 64 1k 27 (OTPROM) 8748 64 1k 27 (EPROM) 8884 64 1k - N7751 128 2k + N7751 64 1k (8048, speech synthesizer in internal ROM) 8039 128 0 27 (external ROM) 8049 128 2k 27 (ROM) @@ -159,7 +159,7 @@ DEFINE_DEVICE_TYPE(I8742, i8742_device, "i8742", "Intel 8742") DEFINE_DEVICE_TYPE(I8042AH, i8042ah_device, "i8042ah", "Intel 8042AH") DEFINE_DEVICE_TYPE(I8742AH, i8742ah_device, "i8742ah", "Intel 8742AH") DEFINE_DEVICE_TYPE(MB8884, mb8884_device, "mb8884", "MB8884") -DEFINE_DEVICE_TYPE(N7751, n7751_device, "n7751", "N7751") +DEFINE_DEVICE_TYPE(N7751, n7751_device, "n7751", "NEC uPD7751") DEFINE_DEVICE_TYPE(M58715, m58715_device, "m58715", "M58715") diff --git a/src/mame/entex/advision.cpp b/src/mame/entex/advision.cpp index 40d590fcb46..2bebb1b79bf 100644 --- a/src/mame/entex/advision.cpp +++ b/src/mame/entex/advision.cpp @@ -63,6 +63,13 @@ public: , m_joy(*this, "JOY") { } + void advision(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: required_device<i8048_device> m_maincpu; required_device<cop411_cpu_device> m_soundcpu; required_device<dac_1bit_device> m_dac; @@ -73,9 +80,6 @@ public: required_memory_bank m_ea_bank; required_ioport m_joy; - virtual void machine_start() override; - virtual void machine_reset() override; - u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(vblank); void vh_update(int x); @@ -104,7 +108,6 @@ public: int m_sound_cmd = 0; - void advision(machine_config &config); void io_map(address_map &map); void program_map(address_map &map); }; diff --git a/src/mame/misc/othello.cpp b/src/mame/misc/othello.cpp index 56de9fe573a..518190accb0 100644 --- a/src/mame/misc/othello.cpp +++ b/src/mame/misc/othello.cpp @@ -19,10 +19,7 @@ Video Board: almost empty - 3/4 soldering pins not populated - Todo: - -- hook up upd7751c sample player (it works correctly but there's main cpu side write(latch/command) missing) - correct colors (based on the color DAC (24 resistors) on pcb - cocktail mode - map a bunch of unknown read/writes (related to above I think) @@ -31,8 +28,8 @@ Notes: DSw 1:2 Limit for help/undo (matta): -- when it's off, you can use each of them twice - every time you win and advance to the next game +- when it's off, you can use each of them twice every time you + win and advance to the next game - when it's on, you can only use them twice throughout the game */ @@ -82,11 +79,11 @@ private: required_shared_ptr<uint8_t> m_videoram; /* video-related */ - int m_tile_bank = 0; + int m_tile_bank = 0; /* misc */ - int m_ay_select = 0; - int m_ack_data = 0; + int m_ay_select = 0; + int m_ack_data = 0; uint8_t m_n7751_command = 0; int m_sound_addr = 0; int m_n7751_busy = 0; @@ -103,8 +100,8 @@ private: uint8_t unk_87_r(); void unk_8a_w(uint8_t data); - void unk_8c_w(uint8_t data); - uint8_t unk_8c_r(); + void n7751_command_w(uint8_t data); + uint8_t n7751_busy_r(); uint8_t sound_ack_r(); void unk_8f_w(uint8_t data); void tilebank_w(uint8_t data); @@ -173,30 +170,24 @@ void othello_state::main_map(address_map &map) uint8_t othello_state::unk_87_r() { - /* n7751_status_r ? bit 7 = ack/status from device connected to port 8a? */ - return machine().rand(); + // bit 7 = ack/status from device connected to port 8a? + return 0; } void othello_state::unk_8a_w(uint8_t data) { - /* - m_n7751_command = (data & 0x07); - m_n7751->set_input_line(0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE); - //m_n7751->set_input_line(0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); - machine().scheduler().perfect_quantum(attotime::from_usec(100)); - */ - logerror("8a -> %x\n", data); } -void othello_state::unk_8c_w(uint8_t data) +void othello_state::n7751_command_w(uint8_t data) { - logerror("8c -> %x\n", data); + m_n7751->set_input_line(0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); + m_n7751_command = data; } -uint8_t othello_state::unk_8c_r() +uint8_t othello_state::n7751_busy_r() { - return machine().rand(); + return m_n7751_busy; } uint8_t othello_state::sound_ack_r() @@ -226,15 +217,17 @@ void othello_state::main_portmap(address_map &map) map(0x86, 0x86).w(FUNC(othello_state::tilebank_w)); map(0x87, 0x87).r(FUNC(othello_state::unk_87_r)); map(0x8a, 0x8a).w(FUNC(othello_state::unk_8a_w)); - map(0x8c, 0x8c).rw(FUNC(othello_state::unk_8c_r), FUNC(othello_state::unk_8c_w)); + map(0x8c, 0x8c).rw(FUNC(othello_state::n7751_busy_r), FUNC(othello_state::n7751_command_w)); map(0x8d, 0x8d).r(FUNC(othello_state::sound_ack_r)).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8f, 0x8f).w(FUNC(othello_state::unk_8f_w)); } uint8_t othello_state::latch_r() { - int retval = m_soundlatch->read(); - m_soundlatch->clear_w(); + uint8_t retval = m_soundlatch->read(); + if (!machine().side_effects_disabled()) + m_soundlatch->clear_w(); + return retval; } @@ -303,7 +296,7 @@ uint8_t othello_state::n7751_rom_r() uint8_t othello_state::n7751_command_r() { - return 0x80 | ((m_n7751_command & 0x07) << 4); + return m_n7751_command << 4 | 0x0f; } void othello_state::n7751_p2_w(uint8_t data) @@ -313,7 +306,7 @@ void othello_state::n7751_p2_w(uint8_t data) /* output of bit $80 indicates we are ready (1) or busy (0) */ /* no other outputs are used */ - m_n7751_busy = data; + m_n7751_busy = data & 0x80; } static INPUT_PORTS_START( othello ) @@ -359,7 +352,6 @@ static INPUT_PORTS_START( othello ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - INPUT_PORTS_END void othello_state::machine_start() @@ -402,6 +394,8 @@ void othello_state::othello(machine_config &config) m_n7751->p2_out_cb().set(FUNC(othello_state::n7751_p2_w)); m_n7751->prog_out_cb().set(m_i8243, FUNC(i8243_device::prog_w)); + config.set_perfect_quantum(m_maincpu); + I8243(config, m_i8243); m_i8243->p4_out_cb().set(FUNC(othello_state::n7751_rom_addr_w<0>)); m_i8243->p5_out_cb().set(FUNC(othello_state::n7751_rom_addr_w<4>)); @@ -429,10 +423,10 @@ void othello_state::othello(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); - AY8910(config, m_ay[0], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.15); - AY8910(config, m_ay[1], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.15); + AY8910(config, m_ay[0], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.25); + AY8910(config, m_ay[1], 2000000).add_route(ALL_OUTPUTS, "speaker", 0.25); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.3); // unknown DAC + DAC_8BIT_R2R(config, "dac").add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC } ROM_START( othello ) @@ -442,12 +436,12 @@ ROM_START( othello ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "3.ic32", 0x0000, 0x2000, CRC(2bb4f75d) SHA1(29a659031acf0d50f374f440b8d353bcf98145a0)) - ROM_REGION( 0x1000, "n7751", 0 ) /* 4k for 7751 onboard ROM */ - ROM_LOAD( "7751.bin", 0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) + ROM_REGION( 0x1000, "n7751", 0 ) /* 1k for 7751 onboard ROM */ + ROM_LOAD( "7751.bin", 0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) ROM_REGION( 0x4000, "n7751data", 0 ) /* 7751 sound data */ - ROM_LOAD( "1.ic48", 0x0000, 0x2000, CRC(c3807dea) SHA1(d6339380e1239f3e20bcca2fbc673ad72e9ca608)) - ROM_LOAD( "2.ic49", 0x2000, 0x2000, CRC(a945f3e7) SHA1(ea18efc18fda63ce1747287bbe2a9704b08daff8)) + ROM_LOAD( "1.ic48", 0x0000, 0x2000, CRC(c3807dea) SHA1(d6339380e1239f3e20bcca2fbc673ad72e9ca608)) + ROM_LOAD( "2.ic49", 0x2000, 0x2000, CRC(a945f3e7) SHA1(ea18efc18fda63ce1747287bbe2a9704b08daff8)) ROM_REGION( 0x6000, "gfx", 0 ) ROM_LOAD( "5.ic40", 0x0000, 0x2000, CRC(45fdc1ab) SHA1(f30f6002e3f34a647effac8b0116c8ed064e226a)) @@ -455,4 +449,4 @@ ROM_START( othello ) ROM_LOAD( "7.ic42", 0x4000, 0x2000, CRC(a76705f7) SHA1(b7d2a65d65d065732ddd0b3b738749369b382b48)) ROM_END -GAME( 1984, othello, 0, othello, othello, othello_state, empty_init, ROT0, "Success", "Othello (version 3.0)", MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, othello, 0, othello, othello, othello_state, empty_init, ROT0, "Success", "Othello (version 3.0)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) |