hash/c64_cart.xml
| r14953 | r14954 | |
| 62 | 62 | List of mostly undumped cartridges: |
| 63 | 63 | http://www.retroport.de/C64_C128_Hardware.html |
| 64 | 64 | http://members.optusnet.com.au/spacetaxi64/DRIVERS/DRIVERS.htm |
| 65 | http://members.optusnet.com.au/spacetaxi64/SPEED-UP-CARTS/SPEED-C64-CPU.htm |
| 65 | 66 | |
| 66 | 67 | --> |
| 67 | 68 | <softwarelist name="c64_cart" description="Commodore 64 cartridges"> |
| r14953 | r14954 | |
| 70 | 71 | <description>VizaWrite 64</description> |
| 71 | 72 | <year>1984</year> |
| 72 | 73 | <publisher>Viza Software</publisher> |
| 73 | | <!-- |
| 74 | | |===========================| |
| 75 | | |=| LS10 LS122 C | |
| 76 | | |=| R | |
| 77 | | |=| | |
| 78 | | |=| | |
| 79 | | |=| ROM0 ROM2 ROM1 | |
| 80 | | |=| | |
| 81 | | |=| | |
| 82 | | |=| | |
| 83 | | |===========================| |
| 84 | 74 | |
| 85 | | ROM0 - Mitsubishi M5L2764K 8Kx8 EPROM "U" |
| 86 | | ROM1 - Mitsubishi M5L2764K 8Kx8 EPROM "3" |
| 87 | | ROM2 - Mitsubishi M5L2764K 8Kx8 EPROM "2" (located on solder side) |
| 88 | | R - 56K |
| 89 | | C - 47uF |
| 90 | | |
| 91 | | data and address lines are scrambled: |
| 92 | | data = BITSWAP8(7,6,0,5,1,4,2,3) |
| 93 | | address = BITSWAP16(15,14,13,12,7,8,6,9,5,11,4,3,2,10,1,0) |
| 94 | | GAME:after reset GND for 1.1844s (74LS122 tW=0.45*R*C) then goes to Vcc |
| 95 | | EXROM:GND |
| 96 | | --> |
| 97 | 75 | <part name="cart" interface="c64_cart"> |
| 98 | 76 | <feature name="slot" value="vizawrite" /> |
| 99 | 77 | <feature name="game" value="0" /> |
| r14953 | r14954 | |
| 114 | 92 | <description>Triton QD TDOS 1.2</description> |
| 115 | 93 | <year>198?</year> |
| 116 | 94 | <publisher>Radofin</publisher> |
| 117 | | <!-- |
| 118 | | XM-2206-A (top) |
| 119 | | XM-2205-A (bottom) |
| 120 | | |===========================| |
| 121 | | | CN4 | |
| 122 | | | | |
| 123 | | | ULA | |
| 124 | | | | |
| 125 | | | 6.5MHz | |
| 126 | | | | |
| 127 | | | SSDA | |
| 128 | | | LS175 | |
| 129 | | | LS367 | |
| 130 | | | CN3 | |
| 131 | | |=========|||||||||=========| |
| 132 | | ||||||||| |
| 133 | | |=============|||||||||============| |
| 134 | | | CN2 | |
| 135 | | | LS00 LS02 LS138 | |
| 136 | | |=======| | |
| 137 | | |=| LS245 ROM | |
| 138 | | |=| | |
| 139 | | |=| | |
| 140 | | |=| CN1| |
| 141 | | |=| | |
| 142 | | |=| | |
| 143 | | |=| | |
| 144 | | |=| SW1 | |
| 145 | | |==========================================| |
| 146 | 95 | |
| 147 | | ROM - Hitachi HN482764G 8Kx8 EPROM "TDOS 1.2" |
| 148 | | ULA - Ferranti ULA5RB073E1 XZ-2085-1 |
| 149 | | SSDA - Motorola MC68A52P SSDA |
| 150 | | CN1 - C64 expansion connector (pass-thru) |
| 151 | | CN2,3 - 19x1 flat ribbon cable to other PCB |
| 152 | | CN4 - 9 wires to 3" drive |
| 153 | | SW1 - cartridge on/off switch |
| 154 | | --> |
| 155 | 96 | <part name="cart" interface="c64_cart"> |
| 156 | 97 | <feature name="slot" value="tdos" /> |
| 157 | 98 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 215 | 156 | <description>Fast Load Cartridge v2</description> |
| 216 | 157 | <year>1984</year> |
| 217 | 158 | <publisher>Epyx</publisher> |
| 218 | | <!-- |
| 219 | | --> |
| 159 | |
| 220 | 160 | <part name="cart" interface="c64_cart"> |
| 221 | 161 | <feature name="slot" value="epyxfastload" /> |
| 222 | 162 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 232 | 172 | <description>Fast Load Cartridge v1</description> |
| 233 | 173 | <year>1984</year> |
| 234 | 174 | <publisher>Epyx</publisher> |
| 235 | | <!-- |
| 236 | | --> |
| 175 | |
| 237 | 176 | <part name="cart" interface="c64_cart"> |
| 238 | 177 | <feature name="slot" value="epyxfastload" /> |
| 239 | 178 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 412 | 351 | <description>Print Technik-Help</description> |
| 413 | 352 | <year>19??</year> |
| 414 | 353 | <publisher><unknown></publisher> |
| 415 | | <!-- |
| 416 | | --> |
| 354 | |
| 417 | 355 | <part name="cart" interface="c64_cart"> |
| 418 | 356 | <feature name="game" value="1" /> |
| 419 | 357 | <feature name="exrom" value="0" /> |
| r14953 | r14954 | |
| 447 | 385 | </part> |
| 448 | 386 | </software> |
| 449 | 387 | |
| 450 | | <software name="4040fast" supported="no"> |
| 388 | <software name="4040fast"> |
| 451 | 389 | <description>4040 + Fast Hack'Em</description> |
| 452 | 390 | <year>1990</year> |
| 453 | 391 | <publisher>Basement Boys Software</publisher> |
| 454 | | <!-- |
| 455 | | |===========================| |
| 456 | | |=| | |
| 457 | | |=| SW1 | |
| 458 | | |=| ROM0 | |
| 459 | | |=| | |
| 460 | | |=| | |
| 461 | | |=| ROM1 | |
| 462 | | |=| | |
| 463 | | |=| | |
| 464 | | |===========================| |
| 465 | 392 | |
| 466 | | ROM0,1 - National Semiconductor NMC27C64Q 8Kx8 EPROM |
| 467 | | SW1 - ROM selection switch |
| 468 | | EXROM:GND |
| 469 | | GAME:Vcc |
| 470 | | --> |
| 471 | 393 | <part name="cart" interface="c64_cart"> |
| 472 | | <feature name="slot" value="4040_fast_hack_em" /> |
| 394 | <feature name="slot" value="sw8k" /> |
| 473 | 395 | <feature name="game" value="1" /> |
| 474 | 396 | <feature name="exrom" value="0" /> |
| 475 | 397 | |
| r14953 | r14954 | |
| 519 | 441 | </part> |
| 520 | 442 | </software> |
| 521 | 443 | |
| 522 | | <software name="xl80" supported="no"> |
| 444 | <software name="xl80"> |
| 523 | 445 | <description>XL 80</description> |
| 524 | 446 | <year>1984</year> |
| 525 | 447 | <publisher>Data 20</publisher> |
| r14953 | r14954 | |
| 750 | 672 | <description>Super Explode! v5.0</description> |
| 751 | 673 | <year>1989</year> |
| 752 | 674 | <publisher>The Soft Group</publisher> |
| 753 | | <!-- |
| 754 | | Bankswitch register at $DF00, then executes code from the I/O2 area: |
| 755 | 675 | |
| 756 | | 0193: lda #$80 |
| 757 | | 0195: sta $DF00 |
| 758 | | 0198: jsr $DF15 |
| 759 | | --> |
| 760 | 676 | <part name="cart" interface="c64_cart"> |
| 761 | 677 | <feature name="slot" value="super_explode" /> |
| 762 | 678 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 903 | 819 | <description>Stardos</description> |
| 904 | 820 | <year>1986</year> |
| 905 | 821 | <publisher>Starpoint Software</publisher> |
| 906 | | <!-- |
| 907 | | |===========================| |
| 908 | | |=| | |
| 909 | | |=| LS30 | |
| 910 | | |=| LS157 | |
| 911 | | |=| LS00 | |
| 912 | | |=| ROM | |
| 913 | | |=| 7407 | |
| 914 | | |=| | |
| 915 | | |=| SW1| |
| 916 | | |===========================| |
| 917 | 822 | |
| 918 | | ROM - Toshiba TMM271128D-25 16Kx8 EPROM |
| 919 | | --> |
| 920 | 823 | <part name="cart" interface="c64_cart"> |
| 921 | 824 | <feature name="slot" value="stardos" /> |
| 922 | 825 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 1056 | 959 | <description>Grappler CD</description> |
| 1057 | 960 | <year>1984</year> |
| 1058 | 961 | <publisher>Orange Micro</publisher> |
| 1059 | | <!-- |
| 1060 | | --> |
| 962 | |
| 1061 | 963 | <part name="cart" interface="c64_cart"> |
| 1062 | 964 | <feature name="slot" value="grappler" /> |
| 1063 | 965 | <feature name="game" value="1" /> |
| r14953 | r14954 | |
| 1207 | 1109 | |
| 1208 | 1110 | <software name="flash8" supported="no"> |
| 1209 | 1111 | <description>Flash 8</description> |
| 1210 | | <year>19??</year> |
| 1211 | | <publisher><unknown></publisher> |
| 1112 | <year>1992</year> |
| 1113 | <publisher>Elektronik-Technik-Peters</publisher> |
| 1212 | 1114 | <part name="cart" interface="c64_cart"> |
| 1213 | 1115 | <feature name="slot" value="flash8" /> |
| 1214 | 1116 | <feature name="exrom" value="0" /> |
src/mess/machine/c64_tdos.c
| r0 | r14954 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Triton QD TDOS 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 | XM-2206-A (top) |
| 16 | XM-2205-A (bottom) |
| 17 | |
| 18 | |===========================| |
| 19 | | CN4 | |
| 20 | | | |
| 21 | | ULA | |
| 22 | | | |
| 23 | | 6.5MHz | |
| 24 | | | |
| 25 | | SSDA | |
| 26 | | LS175 | |
| 27 | | LS367 | |
| 28 | | CN3 | |
| 29 | |=========|||||||||=========| |
| 30 | ||||||||| |
| 31 | |=============|||||||||============| |
| 32 | | CN2 | |
| 33 | | LS00 LS02 LS138 | |
| 34 | |=======| | |
| 35 | |=| LS245 ROM | |
| 36 | |=| | |
| 37 | |=| | |
| 38 | |=| CN1| |
| 39 | |=| | |
| 40 | |=| | |
| 41 | |=| | |
| 42 | |=| SW1 | |
| 43 | |==========================================| |
| 44 | |
| 45 | ROM - Hitachi HN482764G 8Kx8 EPROM "TDOS 1.2" |
| 46 | ULA - Ferranti ULA5RB073E1 XZ-2085-1 custom (?) |
| 47 | SSDA - Motorola MC68A52P SSDA |
| 48 | CN1 - C64 expansion connector (pass-thru) |
| 49 | CN2,3 - 19x1 flat ribbon cable to other PCB |
| 50 | CN4 - 9 wires to 3" drive |
| 51 | SW1 - cartridge on/off switch |
| 52 | |
| 53 | */ |
| 54 | |
| 55 | #include "c64_tdos.h" |
| 56 | |
| 57 | |
| 58 | |
| 59 | //************************************************************************** |
| 60 | // MACROS/CONSTANTS |
| 61 | //************************************************************************** |
| 62 | |
| 63 | #define MC68A52P_TAG "mc6852" |
| 64 | |
| 65 | |
| 66 | |
| 67 | //************************************************************************** |
| 68 | // DEVICE DEFINITIONS |
| 69 | //************************************************************************** |
| 70 | |
| 71 | const device_type C64_TDOS = &device_creator<c64_tdos_cartridge_device>; |
| 72 | |
| 73 | |
| 74 | //------------------------------------------------- |
| 75 | // MC6852_INTERFACE( ssda_intf ) |
| 76 | //------------------------------------------------- |
| 77 | |
| 78 | static MC6852_INTERFACE( ssda_intf ) |
| 79 | { |
| 80 | 0, |
| 81 | 0, |
| 82 | DEVCB_NULL, |
| 83 | DEVCB_NULL, |
| 84 | DEVCB_NULL, |
| 85 | DEVCB_NULL, |
| 86 | DEVCB_NULL, |
| 87 | DEVCB_NULL, |
| 88 | DEVCB_NULL |
| 89 | }; |
| 90 | |
| 91 | |
| 92 | //------------------------------------------------- |
| 93 | // floppy_interface tdos_floppy_interface |
| 94 | //------------------------------------------------- |
| 95 | |
| 96 | static const floppy_interface tdos_floppy_interface = |
| 97 | { |
| 98 | DEVCB_NULL, |
| 99 | DEVCB_NULL, |
| 100 | DEVCB_NULL, |
| 101 | DEVCB_NULL, |
| 102 | DEVCB_NULL, |
| 103 | FLOPPY_STANDARD_5_25_DSHD, |
| 104 | LEGACY_FLOPPY_OPTIONS_NAME(default), |
| 105 | "floppy_2_8", |
| 106 | NULL |
| 107 | }; |
| 108 | |
| 109 | |
| 110 | //------------------------------------------------- |
| 111 | // C64_EXPANSION_INTERFACE( expansion_intf ) |
| 112 | //------------------------------------------------- |
| 113 | |
| 114 | READ8_MEMBER( c64_tdos_cartridge_device::dma_cd_r ) |
| 115 | { |
| 116 | return m_slot->dma_cd_r(offset); |
| 117 | } |
| 118 | |
| 119 | WRITE8_MEMBER( c64_tdos_cartridge_device::dma_cd_w ) |
| 120 | { |
| 121 | m_slot->dma_cd_w(offset, data); |
| 122 | } |
| 123 | |
| 124 | WRITE_LINE_MEMBER( c64_tdos_cartridge_device::irq_w ) |
| 125 | { |
| 126 | m_slot->irq_w(state); |
| 127 | } |
| 128 | |
| 129 | WRITE_LINE_MEMBER( c64_tdos_cartridge_device::nmi_w ) |
| 130 | { |
| 131 | m_slot->nmi_w(state); |
| 132 | } |
| 133 | |
| 134 | WRITE_LINE_MEMBER( c64_tdos_cartridge_device::dma_w ) |
| 135 | { |
| 136 | m_slot->dma_w(state); |
| 137 | } |
| 138 | |
| 139 | WRITE_LINE_MEMBER( c64_tdos_cartridge_device::reset_w ) |
| 140 | { |
| 141 | m_slot->reset_w(state); |
| 142 | } |
| 143 | |
| 144 | static C64_EXPANSION_INTERFACE( expansion_intf ) |
| 145 | { |
| 146 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_cd_r), |
| 147 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_cd_w), |
| 148 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, irq_w), |
| 149 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, nmi_w), |
| 150 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, dma_w), |
| 151 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_tdos_cartridge_device, reset_w) |
| 152 | }; |
| 153 | |
| 154 | |
| 155 | //------------------------------------------------- |
| 156 | // MACHINE_CONFIG_FRAGMENT( c64_multiscreen ) |
| 157 | //------------------------------------------------- |
| 158 | |
| 159 | static MACHINE_CONFIG_FRAGMENT( c64_tdos ) |
| 160 | MCFG_MC6852_ADD(MC68A52P_TAG, XTAL_6_5MHz, ssda_intf) |
| 161 | MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, tdos_floppy_interface) |
| 162 | |
| 163 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL) |
| 164 | MACHINE_CONFIG_END |
| 165 | |
| 166 | |
| 167 | //------------------------------------------------- |
| 168 | // machine_config_additions - device-specific |
| 169 | // machine configurations |
| 170 | //------------------------------------------------- |
| 171 | |
| 172 | machine_config_constructor c64_tdos_cartridge_device::device_mconfig_additions() const |
| 173 | { |
| 174 | return MACHINE_CONFIG_NAME( c64_tdos ); |
| 175 | } |
| 176 | |
| 177 | |
| 178 | |
| 179 | //************************************************************************** |
| 180 | // LIVE DEVICE |
| 181 | //************************************************************************** |
| 182 | |
| 183 | //------------------------------------------------- |
| 184 | // c64_tdos_cartridge_device - constructor |
| 185 | //------------------------------------------------- |
| 186 | |
| 187 | c64_tdos_cartridge_device::c64_tdos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 188 | device_t(mconfig, C64_TDOS, "C64 TDOS cartridge", tag, owner, clock), |
| 189 | device_c64_expansion_card_interface(mconfig, *this), |
| 190 | m_ssda(*this, MC68A52P_TAG), |
| 191 | m_exp(*this, C64_EXPANSION_SLOT_TAG) |
| 192 | { |
| 193 | } |
| 194 | |
| 195 | |
| 196 | //------------------------------------------------- |
| 197 | // device_start - device-specific startup |
| 198 | //------------------------------------------------- |
| 199 | |
| 200 | void c64_tdos_cartridge_device::device_start() |
| 201 | { |
| 202 | } |
| 203 | |
| 204 | |
| 205 | //------------------------------------------------- |
| 206 | // device_reset - device-specific reset |
| 207 | //------------------------------------------------- |
| 208 | |
| 209 | void c64_tdos_cartridge_device::device_reset() |
| 210 | { |
| 211 | } |
| 212 | |
| 213 | |
| 214 | //------------------------------------------------- |
| 215 | // c64_cd_r - cartridge data read |
| 216 | //------------------------------------------------- |
| 217 | |
| 218 | UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2) |
| 219 | { |
| 220 | UINT8 data = m_exp->cd_r(space, offset, roml, romh, io1, io2); |
| 221 | |
| 222 | // TODO |
| 223 | |
| 224 | return data; |
| 225 | } |
| 226 | |
| 227 | |
| 228 | //------------------------------------------------- |
| 229 | // c64_cd_w - cartridge data write |
| 230 | //------------------------------------------------- |
| 231 | |
| 232 | void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2) |
| 233 | { |
| 234 | // TODO |
| 235 | m_exp->cd_w(space, offset, data, roml, romh, io1, io2); |
| 236 | } |
| 237 | |
| 238 | |
| 239 | //------------------------------------------------- |
| 240 | // c64_game_r - GAME read |
| 241 | //------------------------------------------------- |
| 242 | |
| 243 | int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) |
| 244 | { |
| 245 | return m_exp->game_r(offset, ba, rw, hiram); |
| 246 | } |
| 247 | |
| 248 | |
| 249 | //------------------------------------------------- |
| 250 | // c64_exrom_r - EXROM read |
| 251 | //------------------------------------------------- |
| 252 | |
| 253 | int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram) |
| 254 | { |
| 255 | return m_exp->exrom_r(offset, ba, rw, hiram); |
| 256 | } |
src/mess/machine/c64_tdos.h
| r0 | r14954 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Triton QD TDOS 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 __TDOS__ |
| 13 | #define __TDOS__ |
| 14 | |
| 15 | |
| 16 | #include "emu.h" |
| 17 | #include "imagedev/flopdrv.h" |
| 18 | #include "machine/c64exp.h" |
| 19 | #include "machine/cbmipt.h" |
| 20 | #include "machine/mc6852.h" |
| 21 | |
| 22 | |
| 23 | |
| 24 | //************************************************************************** |
| 25 | // TYPE DEFINITIONS |
| 26 | //************************************************************************** |
| 27 | |
| 28 | // ======================> c64_tdos_cartridge_device |
| 29 | |
| 30 | class c64_tdos_cartridge_device : public device_t, |
| 31 | public device_c64_expansion_card_interface |
| 32 | { |
| 33 | public: |
| 34 | // construction/destruction |
| 35 | c64_tdos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 36 | |
| 37 | // optional information overrides |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; |
| 39 | |
| 40 | // not really public |
| 41 | DECLARE_READ8_MEMBER( dma_cd_r ); |
| 42 | DECLARE_WRITE8_MEMBER( dma_cd_w ); |
| 43 | DECLARE_WRITE_LINE_MEMBER( irq_w ); |
| 44 | DECLARE_WRITE_LINE_MEMBER( nmi_w ); |
| 45 | DECLARE_WRITE_LINE_MEMBER( dma_w ); |
| 46 | DECLARE_WRITE_LINE_MEMBER( reset_w ); |
| 47 | |
| 48 | protected: |
| 49 | // device-level overrides |
| 50 | virtual void device_config_complete() { m_shortname = "c64_tdos"; } |
| 51 | virtual void device_start(); |
| 52 | virtual void device_reset(); |
| 53 | |
| 54 | // device_c64_expansion_card_interface overrides |
| 55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2); |
| 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int roml, int romh, int io1, int io2); |
| 57 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); |
| 58 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); |
| 59 | |
| 60 | private: |
| 61 | required_device<mc6852_device> m_ssda; |
| 62 | required_device<c64_expansion_slot_device> m_exp; |
| 63 | }; |
| 64 | |
| 65 | |
| 66 | // device type definition |
| 67 | extern const device_type C64_TDOS; |
| 68 | |
| 69 | |
| 70 | #endif |
src/mess/machine/c64_sw8k.c
| r0 | r14954 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | C64 switchable 8K cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | /* |
| 11 | |
| 12 | 4040 + Fast Hack'em |
| 13 | |
| 14 | PCB Layout |
| 15 | ---------- |
| 16 | |
| 17 | |===========================| |
| 18 | |=| | |
| 19 | |=| SW1 | |
| 20 | |=| ROM0 | |
| 21 | |=| | |
| 22 | |=| | |
| 23 | |=| ROM1 | |
| 24 | |=| | |
| 25 | |=| | |
| 26 | |===========================| |
| 27 | |
| 28 | ROM0,1 - National Semiconductor NMC27C64Q 8Kx8 EPROM |
| 29 | SW1 - ROM selection switch |
| 30 | |
| 31 | */ |
| 32 | |
| 33 | #include "c64_sw8k.h" |
| 34 | |
| 35 | |
| 36 | |
| 37 | //************************************************************************** |
| 38 | // DEVICE DEFINITIONS |
| 39 | //************************************************************************** |
| 40 | |
| 41 | const device_type C64_SW8K = &device_creator<c64_switchable_8k_cartridge_device>; |
| 42 | |
| 43 | |
| 44 | //------------------------------------------------- |
| 45 | // INPUT_PORTS( c64_easyflash ) |
| 46 | //------------------------------------------------- |
| 47 | |
| 48 | static INPUT_PORTS_START( c64_switchable_8k ) |
| 49 | PORT_START("SW") |
| 50 | PORT_DIPNAME( 0x01, 0x00, "ROM Select" ) |
| 51 | PORT_DIPSETTING( 0x00, "ROM 0" ) |
| 52 | PORT_DIPSETTING( 0x01, "ROM 1" ) |
| 53 | INPUT_PORTS_END |
| 54 | |
| 55 | |
| 56 | //------------------------------------------------- |
| 57 | // input_ports - device-specific input ports |
| 58 | //------------------------------------------------- |
| 59 | |
| 60 | ioport_constructor c64_switchable_8k_cartridge_device::device_input_ports() const |
| 61 | { |
| 62 | return INPUT_PORTS_NAME( c64_switchable_8k ); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | |
| 67 | //************************************************************************** |
| 68 | // LIVE DEVICE |
| 69 | //************************************************************************** |
| 70 | |
| 71 | //------------------------------------------------- |
| 72 | // c64_switchable_8k_cartridge_device - constructor |
| 73 | //------------------------------------------------- |
| 74 | |
| 75 | c64_switchable_8k_cartridge_device::c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 76 | device_t(mconfig, C64_SW8K, "C64 Switchable 8K cartridge", tag, owner, clock), |
| 77 | device_c64_expansion_card_interface(mconfig, *this) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // device_start - device-specific startup |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | void c64_switchable_8k_cartridge_device::device_start() |
| 87 | { |
| 88 | } |
| 89 | |
| 90 | |
| 91 | //------------------------------------------------- |
| 92 | // device_reset - device-specific reset |
| 93 | //------------------------------------------------- |
| 94 | |
| 95 | void c64_switchable_8k_cartridge_device::device_reset() |
| 96 | { |
| 97 | m_bank = input_port_read(*this, "SW"); |
| 98 | } |
| 99 | |
| 100 | |
| 101 | //------------------------------------------------- |
| 102 | // c64_cd_r - cartridge data read |
| 103 | //------------------------------------------------- |
| 104 | |
| 105 | UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int roml, int romh, int io1, int io2) |
| 106 | { |
| 107 | UINT8 data = 0; |
| 108 | |
| 109 | if (!roml) |
| 110 | { |
| 111 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 112 | data = m_roml[addr]; |
| 113 | } |
| 114 | |
| 115 | return data; |
| 116 | } |