trunk/src/mess/machine/c64/partner.c
| r0 | r25380 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Timeworks PARTNER 64 cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | /* |
| 11 | |
| 12 | PCB Layout |
| 13 | ---------- |
| 14 | |
| 15 | |===========================| |
| 16 | |=| | |
| 17 | |=|LS05 LS09 LS00 HC74 | |
| 18 | |=| | |
| 19 | |=| | |
| 20 | |=| ROM RAM | |
| 21 | |=| LS133 | |
| 22 | |=| LS156 | |
| 23 | |=| | |
| 24 | |===========================| |
| 25 | |
| 26 | ROM - General Instrument 27C128-25 16Kx8 EPROM "TIMEWORKS C-64 VER 2-16-87" |
| 27 | RAM - Sony CXK5864PN-15L 8Kx8 SRAM |
| 28 | |
| 29 | */ |
| 30 | |
| 31 | #include "partner.h" |
| 32 | |
| 33 | |
| 34 | |
| 35 | //************************************************************************** |
| 36 | // DEVICE DEFINITIONS |
| 37 | //************************************************************************** |
| 38 | |
| 39 | const device_type C64_PARTNER = &device_creator<c64_partner_cartridge_device>; |
| 40 | |
| 41 | |
| 42 | //------------------------------------------------- |
| 43 | // INPUT_PORTS( c64_partner ) |
| 44 | //------------------------------------------------- |
| 45 | |
| 46 | static INPUT_PORTS_START( c64_partner ) |
| 47 | PORT_START("RESET") |
| 48 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_expansion_slot_device, reset_w) |
| 49 | INPUT_PORTS_END |
| 50 | |
| 51 | |
| 52 | //------------------------------------------------- |
| 53 | // input_ports - device-specific input ports |
| 54 | //------------------------------------------------- |
| 55 | |
| 56 | ioport_constructor c64_partner_cartridge_device::device_input_ports() const |
| 57 | { |
| 58 | return INPUT_PORTS_NAME( c64_partner ); |
| 59 | } |
| 60 | |
| 61 | |
| 62 | |
| 63 | //************************************************************************** |
| 64 | // LIVE DEVICE |
| 65 | //************************************************************************** |
| 66 | |
| 67 | //------------------------------------------------- |
| 68 | // c64_partner_cartridge_device - constructor |
| 69 | //------------------------------------------------- |
| 70 | |
| 71 | c64_partner_cartridge_device::c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 72 | device_t(mconfig, C64_PARTNER, "C64 PARTNER 64 cartridge", tag, owner, clock, "c64_partner", __FILE__), |
| 73 | device_c64_expansion_card_interface(mconfig, *this) |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | |
| 78 | //------------------------------------------------- |
| 79 | // device_start - device-specific startup |
| 80 | //------------------------------------------------- |
| 81 | |
| 82 | void c64_partner_cartridge_device::device_start() |
| 83 | { |
| 84 | // allocate memory |
| 85 | c64_ram_pointer(machine(), 0x2000); |
| 86 | } |
| 87 | |
| 88 | |
| 89 | //------------------------------------------------- |
| 90 | // device_reset - device-specific reset |
| 91 | //------------------------------------------------- |
| 92 | |
| 93 | void c64_partner_cartridge_device::device_reset() |
| 94 | { |
| 95 | } |
| 96 | |
| 97 | |
| 98 | //------------------------------------------------- |
| 99 | // c64_cd_r - cartridge data read |
| 100 | //------------------------------------------------- |
| 101 | |
| 102 | UINT8 c64_partner_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 103 | { |
| 104 | return data; |
| 105 | } |
| 106 | |
| 107 | |
| 108 | //------------------------------------------------- |
| 109 | // c64_cd_w - cartridge data write |
| 110 | //------------------------------------------------- |
| 111 | |
| 112 | void c64_partner_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 113 | { |
| 114 | } |
| 115 | |
| 116 | |
| 117 | //------------------------------------------------- |
| 118 | // c64_exrom_r - EXROM read |
| 119 | //------------------------------------------------- |
| 120 | |
| 121 | int c64_partner_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) |
| 122 | { |
| 123 | return m_exrom; |
| 124 | } |
| 125 | |
| 126 | |
| 127 | //------------------------------------------------- |
| 128 | // c64_game_r - GAME read |
| 129 | //------------------------------------------------- |
| 130 | |
| 131 | int c64_partner_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw) |
| 132 | { |
| 133 | return m_game; |
| 134 | } |
trunk/src/mess/machine/c64/partner.h
| r0 | r25380 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Timeworks PARTNER 64 cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __PARTNER__ |
| 13 | #define __PARTNER__ |
| 14 | |
| 15 | #include "emu.h" |
| 16 | #include "machine/c64/exp.h" |
| 17 | |
| 18 | |
| 19 | |
| 20 | //************************************************************************** |
| 21 | // TYPE DEFINITIONS |
| 22 | //************************************************************************** |
| 23 | |
| 24 | // ======================> c64_partner_cartridge_device |
| 25 | |
| 26 | class c64_partner_cartridge_device : public device_t, |
| 27 | public device_c64_expansion_card_interface |
| 28 | { |
| 29 | public: |
| 30 | // construction/destruction |
| 31 | c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 32 | |
| 33 | // optional information overrides |
| 34 | virtual ioport_constructor device_input_ports() const; |
| 35 | |
| 36 | protected: |
| 37 | // device-level overrides |
| 38 | virtual void device_start(); |
| 39 | virtual void device_reset(); |
| 40 | |
| 41 | // device_c64_expansion_card_interface overrides |
| 42 | 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); |
| 43 | 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); |
| 44 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw); |
| 45 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw); |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | // device type definition |
| 50 | extern const device_type C64_PARTNER; |
| 51 | |
| 52 | |
| 53 | #endif |