hash/c64_cart.xml
| r14405 | r14406 | |
| 266 | 266 | <feature name="game" value="0" /> |
| 267 | 267 | <feature name="exrom" value="0" /> |
| 268 | 268 | |
| 269 | | <dataarea name="rom" size="0x10000"> |
| 269 | <dataarea name="roml" size="0x10000"> |
| 270 | 270 | <rom name="u1.bin" size="0x8000" crc="dd6c545a" sha1="d32005405cb944f77932901916608232e3c05a42" offset="0x0000" /> |
| 271 | 271 | <rom name="u2.bin" size="0x8000" crc="3dc43ab1" sha1="1a21771e7bf61ca1771de450c8230bd5ac46b1c6" offset="0x8000" /> |
| 272 | 272 | </dataarea> |
| r14405 | r14406 | |
| 295 | 295 | ROM1 - Hitachi HN613128P 16Kx8 EPROM "CR3001" |
| 296 | 296 | --> |
| 297 | 297 | <part name="cart" interface="c64_cart"> |
| 298 | | <feature name="slot" value="easy_calc_result" /> |
| 298 | <feature name="slot" value="easycalcres" /> |
| 299 | 299 | <feature name="game" value="0" /> |
| 300 | 300 | <feature name="exrom" value="0" /> |
| 301 | 301 | |
| r14405 | r14406 | |
| 316 | 316 | <!-- |
| 317 | 317 | --> |
| 318 | 318 | <part name="cart" interface="c64_cart"> |
| 319 | | <feature name="slot" value="easy_calc_result" /> |
| 319 | <feature name="slot" value="easycalcres" /> |
| 320 | 320 | <feature name="game" value="0" /> |
| 321 | 321 | <feature name="exrom" value="0" /> |
| 322 | 322 | |
| r14405 | r14406 | |
| 422 | 422 | <feature name="exrom" value="0" /> |
| 423 | 423 | <feature name="battery" value="CR2325" /> |
| 424 | 424 | |
| 425 | | <dataarea name="roml" size="0x4000"> |
| 426 | | <rom name="cart-1.bin" size="0x4000" crc="a0dc670c" sha1="bbee117340477a7416bba2e9abc2b8debd940cd4" offset="0x0000" /> |
| 425 | <dataarea name="roml" size="0x34000"> |
| 426 | <rom name="cart-1.bin" size="0x4000" crc="a0dc670c" sha1="bbee117340477a7416bba2e9abc2b8debd940cd4" offset="0x00000" /> |
| 427 | <rom name="cart-2.bin" size="0x8000" crc="2abaad8e" sha1="897f98e954418e2e9313f219cd64b100c60c68b1" offset="0x04000" /> |
| 428 | <rom name="cart-3.bin" size="0x8000" crc="ecddbbfc" sha1="70c72b77dc3981be8bcbec9ba0cc38d9aa5936fd" offset="0x0c000" /> |
| 429 | <rom name="cart-4.bin" size="0x8000" crc="042678ef" sha1="ff2582c617f72bf57be7d76bcf8270665144f924" offset="0x14000" /> |
| 427 | 430 | </dataarea> |
| 428 | 431 | |
| 429 | | <dataarea name="rom" size="0x30000"> |
| 430 | | <rom name="cart-2.bin" size="0x8000" crc="2abaad8e" sha1="897f98e954418e2e9313f219cd64b100c60c68b1" offset="0x0000" /> |
| 431 | | <rom name="cart-3.bin" size="0x8000" crc="ecddbbfc" sha1="70c72b77dc3981be8bcbec9ba0cc38d9aa5936fd" offset="0x4000" /> |
| 432 | | <rom name="cart-4.bin" size="0x8000" crc="042678ef" sha1="ff2582c617f72bf57be7d76bcf8270665144f924" offset="0x8000" /> |
| 433 | | </dataarea> |
| 434 | | |
| 435 | 432 | <dataarea name="ram" size="0x2000" /> |
| 436 | 433 | </part> |
| 437 | 434 | <!-- |
| r14405 | r14406 | |
| 5014 | 5011 | <feature name="game" value="1" /> |
| 5015 | 5012 | <feature name="exrom" value="0" /> |
| 5016 | 5013 | <dataarea name="roml" size="0x2000"> |
| 5017 | | <rom name="simons' basic (198x)(commodore).80" size="0x2000" crc="3117d4ee" sha1="9a67cc6d01939eae6f9fd141a6d963259820335d" offset="0x0000" /> |
| 5014 | <rom name="317008-02" size="0x2000" crc="3117d4ee" sha1="9a67cc6d01939eae6f9fd141a6d963259820335d" offset="0x0000" /> |
| 5018 | 5015 | </dataarea> |
| 5019 | 5016 | <dataarea name="romh" size="0x2000"> |
| 5020 | | <rom name="simons' basic (198x)(commodore).a0" size="0x2000" crc="23f1bd02" sha1="2a103fb2f5f2895af79e235c75393e96d213eaa9" offset="0x0000" /> |
| 5017 | <rom name="317009-02" size="0x2000" crc="23f1bd02" sha1="2a103fb2f5f2895af79e235c75393e96d213eaa9" offset="0x0000" /> |
| 5021 | 5018 | </dataarea> |
| 5022 | 5019 | </part> |
| 5023 | 5020 | </software> |
src/mess/machine/cbmipt.c
| r14405 | r14406 | |
| 1144 | 1144 | |
| 1145 | 1145 | SLOT_INTERFACE_START( c64_expansion_cards ) |
| 1146 | 1146 | SLOT_INTERFACE("standard", C64_STD) |
| 1147 | SLOT_INTERFACE("easycalcres", C64_EASY_CALC_RESULT) |
| 1148 | SLOT_INTERFACE("multiscreen", C64_MULTISCREEN) |
| 1149 | SLOT_INTERFACE("pagefox", C64_PAGEFOX) |
| 1147 | 1150 | SLOT_INTERFACE("silverrock", C64_SILVERROCK) |
| 1151 | SLOT_INTERFACE("simons_basic", C64_SIMONS_BASIC) |
| 1148 | 1152 | SLOT_INTERFACE("super_explode", C64_SUPER_EXPLODE) |
| 1149 | 1153 | SLOT_INTERFACE("vizawrite", C64_VW64) |
| 1150 | 1154 | SLOT_INTERFACE("xl80", C64_XL80) |
src/mess/machine/c64_pagefox.c
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Scanntronik Pagefox 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 | |=| RAM LS11 |
|
| 18 | |=| |
|
| 19 | |=| LS139 |
|
| 20 | |=| ROM0 |
|
| 21 | |=| LS273 |
|
| 22 | |=| |
|
| 23 | |=| ROM1 LS00 |
|
| 24 | |===========================|
|
| 25 | |
| 26 | RAM - NEC D43256-12L 32Kx8 RAM
|
| 27 | ROM0 - SGS M27256-2FI 32Kx8 EPROM
|
| 28 | ROM1 - National Instruments NMC27C256Q 32Kx8 EPROM
|
| 29 | |
| 30 | */
|
| 31 | |
| 32 | #include "c64_pagefox.h"
|
| 33 | |
| 34 | |
| 35 | |
| 36 | //**************************************************************************
|
| 37 | // DEVICE DEFINITIONS
|
| 38 | //**************************************************************************
|
| 39 | |
| 40 | const device_type C64_PAGEFOX = &device_creator<c64_pagefox_cartridge_device>;
|
| 41 | |
| 42 | |
| 43 | |
| 44 | //**************************************************************************
|
| 45 | // LIVE DEVICE
|
| 46 | //**************************************************************************
|
| 47 | |
| 48 | //-------------------------------------------------
|
| 49 | // c64_pagefox_cartridge_device - constructor
|
| 50 | //-------------------------------------------------
|
| 51 | |
| 52 | c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
| 53 | device_t(mconfig, C64_PAGEFOX, "C64 Pagefox cartridge", tag, owner, clock),
|
| 54 | device_c64_expansion_card_interface(mconfig, *this)
|
| 55 | {
|
| 56 | }
|
| 57 | |
| 58 | |
| 59 | //-------------------------------------------------
|
| 60 | // device_start - device-specific startup
|
| 61 | //-------------------------------------------------
|
| 62 | |
| 63 | void c64_pagefox_cartridge_device::device_start()
|
| 64 | {
|
| 65 | // state saving
|
| 66 | save_item(NAME(m_bank));
|
| 67 | }
|
| 68 | |
| 69 | |
| 70 | //-------------------------------------------------
|
| 71 | // device_reset - device-specific reset
|
| 72 | //-------------------------------------------------
|
| 73 | |
| 74 | void c64_pagefox_cartridge_device::device_reset()
|
| 75 | {
|
| 76 | m_bank = 0;
|
| 77 | }
|
| 78 | |
| 79 | |
| 80 | //-------------------------------------------------
|
| 81 | // c64_cd_r - cartridge data read
|
| 82 | //-------------------------------------------------
|
| 83 | |
| 84 | UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
|
| 85 | {
|
| 86 | UINT8 data = 0;
|
| 87 |
|
| 88 | if (!roml || !romh)
|
| 89 | {
|
| 90 | if (BIT(m_bank, 3))
|
| 91 | {
|
| 92 | offs_t addr = (BIT(m_bank, 1) << 14) | (offset & 0x3fff);
|
| 93 | data = m_ram[addr];
|
| 94 | }
|
| 95 | else
|
| 96 | {
|
| 97 | int bank = (m_bank >> 1) & 0x07;
|
| 98 | offs_t addr = (bank << 14) | (offset & 0x3fff);
|
| 99 | data = m_roml[addr];
|
| 100 | }
|
| 101 | }
|
| 102 | |
| 103 | return data;
|
| 104 | }
|
| 105 | |
| 106 | |
| 107 | //-------------------------------------------------
|
| 108 | // c64_cd_w - cartridge data write
|
| 109 | //-------------------------------------------------
|
| 110 | |
| 111 | void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
|
| 112 | {
|
| 113 | if (offset >= 0x8000 && offset < 0xc000)
|
| 114 | {
|
| 115 | if (BIT(m_bank, 3))
|
| 116 | {
|
| 117 | offs_t addr = (BIT(m_bank, 1) << 14) | (offset & 0x3fff);
|
| 118 | m_ram[addr] = data;
|
| 119 | }
|
| 120 | }
|
| 121 | else if (!io1 && BIT(offset, 7))
|
| 122 | {
|
| 123 | if (data == 0xff)
|
| 124 | {
|
| 125 | m_game = 1;
|
| 126 | m_exrom = 1;
|
| 127 | }
|
| 128 | else
|
| 129 | {
|
| 130 | m_game = 0;
|
| 131 | m_exrom = 0;
|
| 132 | }
|
| 133 | |
| 134 | m_bank = data;
|
| 135 | }
|
| 136 | }
|
src/mess/machine/c64_pagefox.h
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Scanntronik Pagefox 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 __PAGEFOX__
|
| 13 | #define __PAGEFOX__
|
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN
|
| 16 | |
| 17 | #include "emu.h"
|
| 18 | #include "machine/c64exp.h"
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // TYPE DEFINITIONS
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | // ======================> c64_pagefox_cartridge_device
|
| 27 | |
| 28 | class c64_pagefox_cartridge_device : public device_t,
|
| 29 | public device_c64_expansion_card_interface
|
| 30 | {
|
| 31 | public:
|
| 32 | // construction/destruction
|
| 33 | c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
| 34 | |
| 35 | protected:
|
| 36 | // device-level overrides
|
| 37 | virtual void device_start();
|
| 38 | virtual void device_reset();
|
| 39 | |
| 40 | // device_c64_expansion_card_interface overrides
|
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
|
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
|
| 43 | |
| 44 | private:
|
| 45 | UINT8 m_bank;
|
| 46 | };
|
| 47 | |
| 48 | |
| 49 | // device type definition
|
| 50 | extern const device_type C64_PAGEFOX;
|
| 51 | |
| 52 | |
| 53 | #endif
|
src/mess/machine/c64_simons_basic.c
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | VizaWrite 64 cartridge emulation
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************/
|
| 9 | |
| 10 | #include "c64_simons_basic.h"
|
| 11 | |
| 12 | |
| 13 | |
| 14 | //**************************************************************************
|
| 15 | // DEVICE DEFINITIONS
|
| 16 | //**************************************************************************
|
| 17 | |
| 18 | const device_type C64_SIMONS_BASIC = &device_creator<c64_simons_basic_cartridge_device>;
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // LIVE DEVICE
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | //-------------------------------------------------
|
| 27 | // c64_simons_basic_cartridge_device - constructor
|
| 28 | //-------------------------------------------------
|
| 29 | |
| 30 | c64_simons_basic_cartridge_device::c64_simons_basic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
| 31 | device_t(mconfig, C64_SIMONS_BASIC, "Simons' BASIC", tag, owner, clock),
|
| 32 | device_c64_expansion_card_interface(mconfig, *this)
|
| 33 | {
|
| 34 | }
|
| 35 | |
| 36 | |
| 37 | //-------------------------------------------------
|
| 38 | // device_start - device-specific startup
|
| 39 | //-------------------------------------------------
|
| 40 | |
| 41 | void c64_simons_basic_cartridge_device::device_start()
|
| 42 | {
|
| 43 | }
|
| 44 | |
| 45 | |
| 46 | //-------------------------------------------------
|
| 47 | // device_reset - device-specific reset
|
| 48 | //-------------------------------------------------
|
| 49 | |
| 50 | void c64_simons_basic_cartridge_device::device_reset()
|
| 51 | {
|
| 52 | m_game = 1;
|
| 53 | }
|
| 54 | |
| 55 | |
| 56 | //-------------------------------------------------
|
| 57 | // c64_cd_r - cartridge data read
|
| 58 | //-------------------------------------------------
|
| 59 | |
| 60 | UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
|
| 61 | {
|
| 62 | UINT8 data = 0;
|
| 63 | |
| 64 | if (!roml)
|
| 65 | {
|
| 66 | data = m_roml[offset & 0x1fff];
|
| 67 | }
|
| 68 | else if (!romh)
|
| 69 | {
|
| 70 | data = m_romh[offset & 0x1fff];
|
| 71 | }
|
| 72 |
|
| 73 | return data;
|
| 74 | }
|
| 75 | |
| 76 | |
| 77 | //-------------------------------------------------
|
| 78 | // c64_cd_w - cartridge data write
|
| 79 | //-------------------------------------------------
|
| 80 | |
| 81 | void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
|
| 82 | {
|
| 83 | if (!io1)
|
| 84 | {
|
| 85 | m_game = !BIT(data, 0);
|
| 86 | }
|
| 87 | }
|
src/mess/machine/c64_simons_basic.h
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Simons' BASIC 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 __SIMONS_BASIC__
|
| 13 | #define __SIMONS_BASIC__
|
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN
|
| 16 | |
| 17 | #include "emu.h"
|
| 18 | #include "machine/c64exp.h"
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // TYPE DEFINITIONS
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | // ======================> c64_simons_basic_cartridge_device
|
| 27 | |
| 28 | class c64_simons_basic_cartridge_device : public device_t,
|
| 29 | public device_c64_expansion_card_interface
|
| 30 | {
|
| 31 | public:
|
| 32 | // construction/destruction
|
| 33 | c64_simons_basic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
| 34 | |
| 35 | protected:
|
| 36 | // device-level overrides
|
| 37 | virtual void device_start();
|
| 38 | virtual void device_reset();
|
| 39 | |
| 40 | // device_c64_expansion_card_interface overrides
|
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
|
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
|
| 43 | };
|
| 44 | |
| 45 | |
| 46 | // device type definition
|
| 47 | extern const device_type C64_SIMONS_BASIC;
|
| 48 | |
| 49 | |
| 50 | #endif
|
src/mess/machine/c64_multiscreen.c
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Multiscreen 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 | | ROM6 |
|
| 17 | | MC14066 |
|
| 18 | | |
|
| 19 | |===============| ROM5 |
|
| 20 | |=| |
|
| 21 | |=| |
|
| 22 | |=| RAM BAT ROM4 |
|
| 23 | |=| |
|
| 24 | |=| |
|
| 25 | |=| ROM0 ROM3 |
|
| 26 | |=| |
|
| 27 | |=| |
|
| 28 | |===============| LS138 ROM2 |
|
| 29 | | LS138 |
|
| 30 | | LS174 |
|
| 31 | | LS133 ROM1 |
|
| 32 | |===================|
|
| 33 | |
| 34 | BAT - BR2325 lithium battery
|
| 35 | RAM - ? 8Kx8 RAM
|
| 36 | ROM0 - ? 16Kx8 EPROM
|
| 37 | ROM1 - ? 32Kx8 EPROM
|
| 38 | ROM2 - ? 32Kx8 EPROM
|
| 39 | ROM3 - ? 32Kx8 EPROM
|
| 40 | ROM4 - not populated
|
| 41 | ROM5 - not populated
|
| 42 | ROM6 - not populated
|
| 43 | |
| 44 | */
|
| 45 | |
| 46 | /*
|
| 47 | |
| 48 | TODO:
|
| 49 |
|
| 50 | - M6802 board
|
| 51 | |
| 52 | */
|
| 53 | |
| 54 | #include "c64_multiscreen.h"
|
| 55 | |
| 56 | |
| 57 | |
| 58 | //**************************************************************************
|
| 59 | // MACROS/CONSTANTS
|
| 60 | //**************************************************************************
|
| 61 | |
| 62 | #define BANK_RAM 0x0d
|
| 63 | |
| 64 | |
| 65 | |
| 66 | //**************************************************************************
|
| 67 | // DEVICE DEFINITIONS
|
| 68 | //**************************************************************************
|
| 69 | |
| 70 | const device_type C64_MULTISCREEN = &device_creator<c64_multiscreen_cartridge_device>;
|
| 71 | |
| 72 | |
| 73 | |
| 74 | //**************************************************************************
|
| 75 | // LIVE DEVICE
|
| 76 | //**************************************************************************
|
| 77 | |
| 78 | //-------------------------------------------------
|
| 79 | // c64_multiscreen_cartridge_device - constructor
|
| 80 | //-------------------------------------------------
|
| 81 | |
| 82 | c64_multiscreen_cartridge_device::c64_multiscreen_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
| 83 | device_t(mconfig, C64_MULTISCREEN, "C64 Multiscreen cartridge", tag, owner, clock),
|
| 84 | device_c64_expansion_card_interface(mconfig, *this)
|
| 85 | {
|
| 86 | }
|
| 87 | |
| 88 | |
| 89 | //-------------------------------------------------
|
| 90 | // device_start - device-specific startup
|
| 91 | //-------------------------------------------------
|
| 92 | |
| 93 | void c64_multiscreen_cartridge_device::device_start()
|
| 94 | {
|
| 95 | // state saving
|
| 96 | save_item(NAME(m_bank));
|
| 97 | }
|
| 98 | |
| 99 | |
| 100 | //-------------------------------------------------
|
| 101 | // device_reset - device-specific reset
|
| 102 | //-------------------------------------------------
|
| 103 | |
| 104 | void c64_multiscreen_cartridge_device::device_reset()
|
| 105 | {
|
| 106 | m_bank = 0;
|
| 107 | }
|
| 108 | |
| 109 | |
| 110 | //-------------------------------------------------
|
| 111 | // c64_cd_r - cartridge data read
|
| 112 | //-------------------------------------------------
|
| 113 | |
| 114 | UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
|
| 115 | {
|
| 116 | UINT8 data = 0;
|
| 117 |
|
| 118 | if (!roml)
|
| 119 | {
|
| 120 | int bank = m_bank & 0x0f;
|
| 121 | |
| 122 | if (bank == BANK_RAM)
|
| 123 | {
|
| 124 | data = m_ram[offset & 0x1fff];
|
| 125 | }
|
| 126 | else
|
| 127 | {
|
| 128 | data = m_roml[(bank << 14) | (offset & 0x3fff)];
|
| 129 | }
|
| 130 | }
|
| 131 | else if (!romh)
|
| 132 | {
|
| 133 | int bank = m_bank & 0x0f;
|
| 134 | |
| 135 | if (bank == BANK_RAM)
|
| 136 | {
|
| 137 | data = m_roml[offset & 0x3fff];
|
| 138 | }
|
| 139 | else
|
| 140 | {
|
| 141 | data = m_roml[(bank << 14) | (offset & 0x3fff)];
|
| 142 | }
|
| 143 | }
|
| 144 | |
| 145 | return data;
|
| 146 | }
|
| 147 | |
| 148 | |
| 149 | //-------------------------------------------------
|
| 150 | // c64_cd_w - cartridge data write
|
| 151 | //-------------------------------------------------
|
| 152 | |
| 153 | void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
|
| 154 | {
|
| 155 | if (offset >= 0x8000 && offset < 0xa000)
|
| 156 | {
|
| 157 | int bank = m_bank & 0x0f;
|
| 158 | |
| 159 | if (bank == BANK_RAM)
|
| 160 | {
|
| 161 | m_ram[offset & 0x1fff] = data;
|
| 162 | }
|
| 163 | }
|
| 164 | else if (!io2)
|
| 165 | {
|
| 166 | m_bank = data;
|
| 167 | }
|
| 168 | }
|
src/mess/machine/c64_multiscreen.h
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Multiscreen 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 __MULTISCREEN__
|
| 13 | #define __MULTISCREEN__
|
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN
|
| 16 | |
| 17 | #include "emu.h"
|
| 18 | #include "machine/c64exp.h"
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // TYPE DEFINITIONS
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | // ======================> c64_multiscreen_cartridge_device
|
| 27 | |
| 28 | class c64_multiscreen_cartridge_device : public device_t,
|
| 29 | public device_c64_expansion_card_interface
|
| 30 | {
|
| 31 | public:
|
| 32 | // construction/destruction
|
| 33 | c64_multiscreen_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
| 34 | |
| 35 | protected:
|
| 36 | // device-level overrides
|
| 37 | virtual void device_start();
|
| 38 | virtual void device_reset();
|
| 39 | |
| 40 | // device_c64_expansion_card_interface overrides
|
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
|
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
|
| 43 | |
| 44 | private:
|
| 45 | UINT8 m_bank;
|
| 46 | };
|
| 47 | |
| 48 | |
| 49 | // device type definition
|
| 50 | extern const device_type C64_MULTISCREEN;
|
| 51 | |
| 52 | |
| 53 | #endif
|
src/mess/machine/c64_easy_calc_result.c
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Easy Calc Result cartridge emulation
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************/
|
| 9 | |
| 10 | #include "c64_easy_calc_result.h"
|
| 11 | |
| 12 | |
| 13 | |
| 14 | //**************************************************************************
|
| 15 | // DEVICE DEFINITIONS
|
| 16 | //**************************************************************************
|
| 17 | |
| 18 | const device_type C64_EASY_CALC_RESULT = &device_creator<c64_easy_calc_result_cartridge_device>;
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // LIVE DEVICE
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | //-------------------------------------------------
|
| 27 | // c64_easy_calc_result_cartridge_device - constructor
|
| 28 | //-------------------------------------------------
|
| 29 | |
| 30 | c64_easy_calc_result_cartridge_device::c64_easy_calc_result_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
| 31 | device_t(mconfig, C64_EASY_CALC_RESULT, "C64 Easy Calc Result cartridge", tag, owner, clock),
|
| 32 | device_c64_expansion_card_interface(mconfig, *this)
|
| 33 | {
|
| 34 | }
|
| 35 | |
| 36 | |
| 37 | //-------------------------------------------------
|
| 38 | // device_start - device-specific startup
|
| 39 | //-------------------------------------------------
|
| 40 | |
| 41 | void c64_easy_calc_result_cartridge_device::device_start()
|
| 42 | {
|
| 43 | // state saving
|
| 44 | save_item(NAME(m_bank));
|
| 45 | }
|
| 46 | |
| 47 | |
| 48 | //-------------------------------------------------
|
| 49 | // device_reset - device-specific reset
|
| 50 | //-------------------------------------------------
|
| 51 | |
| 52 | void c64_easy_calc_result_cartridge_device::device_reset()
|
| 53 | {
|
| 54 | m_bank = 0;
|
| 55 | }
|
| 56 | |
| 57 | |
| 58 | //-------------------------------------------------
|
| 59 | // c64_cd_r - cartridge data read
|
| 60 | //-------------------------------------------------
|
| 61 | |
| 62 | UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2)
|
| 63 | {
|
| 64 | UINT8 data = 0;
|
| 65 |
|
| 66 | if (!roml)
|
| 67 | {
|
| 68 | data = m_roml[offset & 0x1fff];
|
| 69 | }
|
| 70 | else if (!romh)
|
| 71 | {
|
| 72 | data = m_romh[(m_bank << 13) | (offset & 0x1fff)];
|
| 73 | }
|
| 74 | |
| 75 | return data;
|
| 76 | }
|
| 77 | |
| 78 | |
| 79 | //-------------------------------------------------
|
| 80 | // c64_cd_w - cartridge data write
|
| 81 | //-------------------------------------------------
|
| 82 | |
| 83 | void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2)
|
| 84 | {
|
| 85 | if (!io1)
|
| 86 | {
|
| 87 | m_bank = !BIT(offset, 0);
|
| 88 | }
|
| 89 | }
|
src/mess/machine/c64_easy_calc_result.h
| r0 | r14406 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Easy Calc Result 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 __EASY_CALC_RESULT__
|
| 13 | #define __EASY_CALC_RESULT__
|
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN
|
| 16 | |
| 17 | #include "emu.h"
|
| 18 | #include "machine/c64exp.h"
|
| 19 | |
| 20 | |
| 21 | |
| 22 | //**************************************************************************
|
| 23 | // TYPE DEFINITIONS
|
| 24 | //**************************************************************************
|
| 25 | |
| 26 | // ======================> c64_easy_calc_result_cartridge_device
|
| 27 | |
| 28 | class c64_easy_calc_result_cartridge_device : public device_t,
|
| 29 | public device_c64_expansion_card_interface
|
| 30 | {
|
| 31 | public:
|
| 32 | // construction/destruction
|
| 33 | c64_easy_calc_result_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
| 34 | |
| 35 | protected:
|
| 36 | // device-level overrides
|
| 37 | virtual void device_start();
|
| 38 | virtual void device_reset();
|
| 39 | |
| 40 | // device_c64_expansion_card_interface overrides
|
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2);
|
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2);
|
| 43 | |
| 44 | private:
|
| 45 | int m_bank;
|
| 46 | };
|
| 47 | |
| 48 | |
| 49 | // device type definition
|
| 50 | extern const device_type C64_EASY_CALC_RESULT;
|
| 51 | |
| 52 | |
| 53 | #endif
|
src/mess/machine/c64exp.c
| r14405 | r14406 | |
| 12 | 12 | #include "machine/c64exp.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | |
| 15 | 16 | //************************************************************************** |
| 16 | | // GLOBAL VARIABLES |
| 17 | // DEVICE DEFINITIONS |
| 17 | 18 | //************************************************************************** |
| 18 | 19 | |
| 19 | 20 | const device_type C64_EXPANSION_SLOT = &device_creator<c64_expansion_slot_device>; |
| 20 | 21 | |
| 21 | 22 | |
| 23 | |
| 22 | 24 | //************************************************************************** |
| 23 | 25 | // DEVICE C64_EXPANSION CARD INTERFACE |
| 24 | 26 | //************************************************************************** |
| r14405 | r14406 | |
| 31 | 33 | : device_slot_card_interface(mconfig, device), |
| 32 | 34 | m_roml(NULL), |
| 33 | 35 | m_romh(NULL), |
| 36 | m_ram(NULL), |
| 34 | 37 | m_game(1), |
| 35 | 38 | m_exrom(1) |
| 36 | 39 | { |
| r14405 | r14406 | |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | |
| 83 | //------------------------------------------------- |
| 84 | // c64_ram_pointer - get RAM pointer |
| 85 | //------------------------------------------------- |
| 80 | 86 | |
| 87 | UINT8* device_c64_expansion_card_interface::c64_ram_pointer(running_machine &machine, size_t size) |
| 88 | { |
| 89 | if (m_ram == NULL) |
| 90 | { |
| 91 | m_ram = auto_alloc_array(machine, UINT8, size); |
| 92 | } |
| 93 | |
| 94 | return m_ram; |
| 95 | } |
| 96 | |
| 97 | |
| 98 | |
| 81 | 99 | //************************************************************************** |
| 82 | 100 | // LIVE DEVICE |
| 83 | 101 | //************************************************************************** |
| r14405 | r14406 | |
| 219 | 237 | |
| 220 | 238 | size = get_software_region_length("romh"); |
| 221 | 239 | if (size) memcpy(m_cart->c64_romh_pointer(machine(), size), get_software_region("romh"), size); |
| 240 | |
| 241 | size = get_software_region_length("ram"); |
| 242 | if (size) memset(m_cart->c64_ram_pointer(machine(), size), 0, size); |
| 222 | 243 | } |
| 223 | 244 | |
| 224 | 245 | m_cart->c64_game_w(atol(get_feature("game"))); |
| r14405 | r14406 | |
| 253 | 274 | |
| 254 | 275 | |
| 255 | 276 | //------------------------------------------------- |
| 277 | // read - |
| 278 | //------------------------------------------------- |
| 279 | |
| 280 | READ8_MEMBER( c64_expansion_slot_device::read ) |
| 281 | { |
| 282 | UINT8 data = 0; |
| 283 | |
| 284 | if (m_cart != NULL) |
| 285 | { |
| 286 | data = m_cart->c64_cd_r(space, offset, 1, 1, 1, 1); |
| 287 | } |
| 288 | |
| 289 | return data; |
| 290 | } |
| 291 | |
| 292 | |
| 293 | //------------------------------------------------- |
| 294 | // write - |
| 295 | //------------------------------------------------- |
| 296 | |
| 297 | WRITE8_MEMBER( c64_expansion_slot_device::write ) |
| 298 | { |
| 299 | if (m_cart != NULL) |
| 300 | { |
| 301 | m_cart->c64_cd_w(space, offset, data, 1, 1, 1, 1); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | |
| 306 | //------------------------------------------------- |
| 256 | 307 | // roml_r - low ROM read |
| 257 | 308 | //------------------------------------------------- |
| 258 | 309 | |
src/mess/machine/c64exp.h
| r14405 | r14406 | |
| 93 | 93 | c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 94 | 94 | virtual ~c64_expansion_slot_device(); |
| 95 | 95 | |
| 96 | DECLARE_READ8_MEMBER( read ); |
| 97 | DECLARE_WRITE8_MEMBER( write ); |
| 96 | 98 | DECLARE_READ8_MEMBER( roml_r ); |
| 97 | 99 | DECLARE_READ8_MEMBER( romh_r ); |
| 98 | 100 | DECLARE_READ8_MEMBER( io1_r ); |
| r14405 | r14406 | |
| 169 | 171 | // standard ROM cartridge |
| 170 | 172 | virtual UINT8* c64_roml_pointer(running_machine &machine, size_t size); |
| 171 | 173 | virtual UINT8* c64_romh_pointer(running_machine &machine, size_t size); |
| 174 | virtual UINT8* c64_ram_pointer(running_machine &machine, size_t size); |
| 172 | 175 | |
| 173 | 176 | protected: |
| 174 | 177 | c64_expansion_slot_device *m_slot; |
| 175 | 178 | |
| 176 | 179 | UINT8 *m_roml; |
| 177 | 180 | UINT8 *m_romh; |
| 181 | UINT8 *m_ram; |
| 178 | 182 | |
| 179 | 183 | int m_game; |
| 180 | 184 | int m_exrom; |