From a733240aa6afd3af9f5fa3c07777bd90a80b8882 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 27 Jul 2015 00:25:19 +0300 Subject: [PATCH] c128: Added a skeleton for the PARTNER 128 cartridge. [Curt Coder] --- hash/c128_cart.xml | 23 ++++++ scripts/src/bus.lua | 2 + src/emu/bus/c64/c128_partner.c | 130 +++++++++++++++++++++++++++++++++ src/emu/bus/c64/c128_partner.h | 60 +++++++++++++++ src/emu/bus/c64/exp.c | 2 + 5 files changed, 217 insertions(+) create mode 100644 src/emu/bus/c64/c128_partner.c create mode 100644 src/emu/bus/c64/c128_partner.h diff --git a/hash/c128_cart.xml b/hash/c128_cart.xml index fc71535f96c..f7ef8270592 100644 --- a/hash/c128_cart.xml +++ b/hash/c128_cart.xml @@ -156,4 +156,27 @@ Missing dumps: + + PARTNER 128 + 1985 + Timeworks + + + + + + + + + + + + + + + + + + + diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 79bf54b9627..07d1c468e93 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -240,6 +240,8 @@ if (BUSES["C64"]~=null) then MAME_DIR .. "src/emu/bus/c64/exp.h", MAME_DIR .. "src/emu/bus/c64/c128_comal80.c", MAME_DIR .. "src/emu/bus/c64/c128_comal80.h", + MAME_DIR .. "src/emu/bus/c64/c128_partner.c", + MAME_DIR .. "src/emu/bus/c64/c128_partner.h", MAME_DIR .. "src/emu/bus/c64/comal80.c", MAME_DIR .. "src/emu/bus/c64/comal80.h", MAME_DIR .. "src/emu/bus/c64/cpm.c", diff --git a/src/emu/bus/c64/c128_partner.c b/src/emu/bus/c64/c128_partner.c new file mode 100644 index 00000000000..97a4e50b998 --- /dev/null +++ b/src/emu/bus/c64/c128_partner.c @@ -0,0 +1,130 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Timeworks PARTNER 128 cartridge emulation + +**********************************************************************/ + +/* + + PCB Layout + ---------- + + |---------------| + |LS74 SW CN| + |LS09 LS273| + |LS139 RAM | + |LS133 | + | LS240 | + |LS33 ROM | + |LS09 | + ||||||||||||||| + + ROM - EPROM + RAM - Sony CXK5864PN-15L 8Kx8 SRAM + SW - push button switch + CN - lead out to joystick port dongle + +*/ + +#include "c128_partner.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type C128_PARTNER = &device_creator; + + +//------------------------------------------------- +// INPUT_PORTS( c128_partner ) +//------------------------------------------------- + +WRITE_LINE_MEMBER( partner128_t::nmi_w ) +{ +} + +static INPUT_PORTS_START( c128_partner ) + PORT_START("NMI") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Menu") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, partner128_t, nmi_w) +INPUT_PORTS_END + + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor partner128_t::device_input_ports() const +{ + return INPUT_PORTS_NAME( c128_partner ); +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// partner128_t - constructor +//------------------------------------------------- + +partner128_t::partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, C128_PARTNER, "PARTNER 128", tag, owner, clock, "c128_partner", __FILE__), + device_c64_expansion_card_interface(mconfig, *this), + device_vcs_control_port_interface(mconfig, *this), + m_ram(*this, "ram") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void partner128_t::device_start() +{ + // allocate memory + m_ram.allocate(0x2000); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void partner128_t::device_reset() +{ +} + + +//------------------------------------------------- +// c64_cd_r - cartridge data read +//------------------------------------------------- + +UINT8 partner128_t::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +{ + return data; +} + + +//------------------------------------------------- +// c64_cd_w - cartridge data write +//------------------------------------------------- + +void partner128_t::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +{ +} + + +//------------------------------------------------- +// c64_game_r - GAME read +//------------------------------------------------- + +int partner128_t::c64_game_r(offs_t offset, int sphi2, int ba, int rw) +{ + return 1; +} diff --git a/src/emu/bus/c64/c128_partner.h b/src/emu/bus/c64/c128_partner.h new file mode 100644 index 00000000000..442557cb4ec --- /dev/null +++ b/src/emu/bus/c64/c128_partner.h @@ -0,0 +1,60 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Timeworks PARTNER 128 cartridge emulation + +**********************************************************************/ + +#pragma once + +#ifndef __C128_PARTNER__ +#define __C128_PARTNER__ + +#include "emu.h" +#include "bus/c64/exp.h" +#include "bus/vcs_ctrl/ctrl.h" + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> partner128_t + +class partner128_t : public device_t, + public device_c64_expansion_card_interface, + public device_vcs_control_port_interface +{ +public: + // construction/destruction + partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual ioport_constructor device_input_ports() const; + + DECLARE_WRITE_LINE_MEMBER( nmi_w ); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + // device_c64_expansion_card_interface overrides + virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); + virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); + virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw); + + // device_vcs_control_port_interface overrides + +private: + optional_shared_ptr m_ram; +}; + + +// device type definition +extern const device_type C128_PARTNER; + + +#endif diff --git a/src/emu/bus/c64/exp.c b/src/emu/bus/c64/exp.c index 16b3746e8c7..a1c449d180e 100644 --- a/src/emu/bus/c64/exp.c +++ b/src/emu/bus/c64/exp.c @@ -308,6 +308,7 @@ int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw, // slot devices #include "16kb.h" #include "c128_comal80.h" +#include "c128_partner.h" #include "comal80.h" #include "cpm.h" #include "currah_speech.h" @@ -420,6 +421,7 @@ SLOT_INTERFACE_START( c64_expansion_cards ) SLOT_INTERFACE_INTERNAL("ocean", C64_OCEAN) SLOT_INTERFACE_INTERNAL("pagefox", C64_PAGEFOX) SLOT_INTERFACE_INTERNAL("partner", C64_PARTNER) + SLOT_INTERFACE_INTERNAL("partner128", C128_PARTNER) SLOT_INTERFACE_INTERNAL("prophet64", C64_PROPHET64) SLOT_INTERFACE_INTERNAL("ps64", C64_PS64) SLOT_INTERFACE_INTERNAL("rex", C64_REX)