trunk/hash/channelf.xml
r32698 | r32699 | |
530 | 530 | </software> |
531 | 531 | |
532 | 532 | |
533 | | <software name="multicrt"> |
534 | | <description>Channel F Multi-Cart</description> |
| 533 | <software name="multicrt" supported="partial"> |
| 534 | <description>Channel F Multi-Cart (Final)</description> |
535 | 535 | <year>2004</year> |
536 | 536 | <publisher><homebrew></publisher> |
537 | 537 | <part name="cart" interface="channelf_cart"> |
r32698 | r32699 | |
542 | 542 | </part> |
543 | 543 | </software> |
544 | 544 | |
| 545 | <software name="multicrto" cloneof="multicrt" supported="partial"> |
| 546 | <description>Channel F Multi-Cart (Older)</description> |
| 547 | <year>2004</year> |
| 548 | <publisher><homebrew></publisher> |
| 549 | <part name="cart" interface="channelf_cart"> |
| 550 | <feature name="slot" value="multi_old" /> |
| 551 | <dataarea name="rom" size="262144"> |
| 552 | <rom name="multigame older.bin" size="262144" crc="ad4ebe3f" sha1="6064489fd4ba0b95fa4effcd8ee971751504c63f" offset="0" /> |
| 553 | </dataarea> |
| 554 | </part> |
| 555 | </software> |
545 | 556 | |
| 557 | |
546 | 558 | </softwarelist> |
trunk/src/emu/bus/chanf/rom.c
r32698 | r32699 | |
25 | 25 | const device_type CHANF_ROM_MAZE = &device_creator<chanf_maze_device>; |
26 | 26 | const device_type CHANF_ROM_HANGMAN = &device_creator<chanf_hangman_device>; |
27 | 27 | const device_type CHANF_ROM_CHESS = &device_creator<chanf_chess_device>; |
28 | | const device_type CHANF_ROM_MULTI = &device_creator<chanf_multi_device>; |
| 28 | const device_type CHANF_ROM_MULTI_OLD = &device_creator<chanf_multi_old_device>; |
| 29 | const device_type CHANF_ROM_MULTI_FINAL = &device_creator<chanf_multi_final_device>; |
29 | 30 | |
30 | 31 | |
31 | 32 | chanf_rom_device::chanf_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
r32698 | r32699 | |
55 | 56 | { |
56 | 57 | } |
57 | 58 | |
58 | | chanf_multi_device::chanf_multi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
59 | | : chanf_rom_device(mconfig, CHANF_ROM_MULTI, "Channel F Multigame Cart", tag, owner, clock, "chanf_multi", __FILE__) |
| 59 | chanf_multi_old_device::chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 60 | : chanf_rom_device(mconfig, CHANF_ROM_MULTI_OLD, "Channel F Multigame (Earlier Version) Cart", tag, owner, clock, "chanf_multi_old", __FILE__) |
60 | 61 | { |
61 | 62 | } |
62 | 63 | |
| 64 | chanf_multi_final_device::chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 65 | : chanf_rom_device(mconfig, CHANF_ROM_MULTI_FINAL, "Channel F Multigame (Final Version) Cart", tag, owner, clock, "chanf_multi_fin", __FILE__) |
| 66 | { |
| 67 | } |
63 | 68 | |
64 | 69 | |
| 70 | |
65 | 71 | //------------------------------------------------- |
66 | 72 | // mapper specific start/reset |
67 | 73 | //------------------------------------------------- |
r32698 | r32699 | |
109 | 115 | } |
110 | 116 | |
111 | 117 | |
112 | | void chanf_multi_device::device_start() |
| 118 | void chanf_multi_old_device::device_start() |
113 | 119 | { |
114 | 120 | save_item(NAME(m_base_bank)); |
115 | 121 | } |
116 | 122 | |
117 | | void chanf_multi_device::device_reset() |
| 123 | void chanf_multi_old_device::device_reset() |
118 | 124 | { |
119 | 125 | m_base_bank = 0; |
120 | 126 | } |
121 | 127 | |
122 | 128 | |
| 129 | void chanf_multi_final_device::device_start() |
| 130 | { |
| 131 | save_item(NAME(m_base_bank)); |
| 132 | save_item(NAME(m_half_bank)); |
| 133 | } |
| 134 | |
| 135 | void chanf_multi_final_device::device_reset() |
| 136 | { |
| 137 | m_base_bank = 0; |
| 138 | m_half_bank = 0; |
| 139 | } |
| 140 | |
| 141 | |
123 | 142 | /*------------------------------------------------- |
124 | 143 | mapper specific handlers |
125 | 144 | -------------------------------------------------*/ |
r32698 | r32699 | |
191 | 210 | m_ram[offset] = data; |
192 | 211 | } |
193 | 212 | |
194 | | READ8_MEMBER(chanf_multi_device::read_rom) |
| 213 | READ8_MEMBER(chanf_multi_old_device::read_rom) |
195 | 214 | { |
196 | 215 | if (offset < 0x2000) |
197 | | return m_rom[offset + (m_base_bank * 0x2000)]; |
| 216 | return m_rom[offset + m_base_bank * 0x2000]; |
198 | 217 | else |
199 | 218 | return 0xff; |
200 | 219 | } |
201 | 220 | |
202 | | WRITE8_MEMBER(chanf_multi_device::write_bank) |
| 221 | WRITE8_MEMBER(chanf_multi_old_device::write_bank) |
203 | 222 | { |
204 | | m_base_bank = data; |
| 223 | //printf("0x%x\n", data); |
| 224 | m_base_bank = data & 0x1f; |
205 | 225 | } |
206 | 226 | |
| 227 | READ8_MEMBER(chanf_multi_final_device::read_rom) |
| 228 | { |
| 229 | if (offset < 0x2000) |
| 230 | return m_rom[offset + (m_base_bank * 0x2000) + (m_half_bank * 0x1000)]; |
| 231 | else |
| 232 | return 0xff; |
| 233 | } |
| 234 | |
| 235 | WRITE8_MEMBER(chanf_multi_final_device::write_bank) |
| 236 | { |
| 237 | //printf("0x%x\n", data); |
| 238 | m_base_bank = data & 0x1f; |
| 239 | m_half_bank = BIT(data, 5); |
| 240 | } |
| 241 | |
trunk/src/emu/bus/chanf/slot.c
r32698 | r32699 | |
124 | 124 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it |
125 | 125 | static const chanf_slot slot_list[] = |
126 | 126 | { |
127 | | { CF_STD, "std" }, |
128 | | { CF_MAZE, "maze" }, |
129 | | { CF_HANGMAN, "hangman" }, |
130 | | { CF_CHESS, "chess" }, |
131 | | { CF_MULTI, "multi" } |
| 127 | { CF_STD, "std" }, |
| 128 | { CF_MAZE, "maze" }, |
| 129 | { CF_HANGMAN, "hangman" }, |
| 130 | { CF_CHESS, "chess" }, |
| 131 | { CF_MULTI_OLD,"multi_old" }, |
| 132 | { CF_MULTI, "multi" } |
132 | 133 | }; |
133 | 134 | |
134 | 135 | static int chanf_get_pcb_id(const char *slot) |
r32698 | r32699 | |
175 | 176 | // we default to "chess" slot because some homebrew programs have been written to run |
176 | 177 | // on PCBs with RAM at $2000-$2800 as Saba Schach! |
177 | 178 | if (len == 0x40000) |
178 | | m_type = CF_MULTI; |
| 179 | m_type = CF_MULTI; // TODO1: differentiate multicart final and earlier from fullpath |
179 | 180 | else |
180 | | m_type = CF_CHESS; // is there any way to detect Maze and Hangman from fullpath? |
| 181 | m_type = CF_CHESS; // TODO2: is there any way to detect Maze and Hangman from fullpath? |
181 | 182 | |
182 | 183 | m_cart->ram_alloc(0x800); |
183 | 184 | } |
trunk/src/emu/bus/chanf/rom.h
r32698 | r32699 | |
84 | 84 | }; |
85 | 85 | |
86 | 86 | |
87 | | // ======================> chanf_multi_device |
| 87 | // ======================> chanf_multi_old_device |
88 | 88 | |
89 | | class chanf_multi_device : public chanf_rom_device |
| 89 | class chanf_multi_old_device : public chanf_rom_device |
90 | 90 | { |
91 | 91 | public: |
92 | 92 | // construction/destruction |
93 | | chanf_multi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 93 | chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
94 | 94 | |
95 | 95 | // device-level overrides |
96 | 96 | virtual void device_start(); |
r32698 | r32699 | |
107 | 107 | }; |
108 | 108 | |
109 | 109 | |
| 110 | // ======================> chanf_multi_final_device |
110 | 111 | |
| 112 | class chanf_multi_final_device : public chanf_rom_device |
| 113 | { |
| 114 | public: |
| 115 | // construction/destruction |
| 116 | chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 117 | |
| 118 | // device-level overrides |
| 119 | virtual void device_start(); |
| 120 | virtual void device_reset(); |
| 121 | |
| 122 | // reading and writing |
| 123 | virtual DECLARE_READ8_MEMBER(read_rom); |
| 124 | virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); } |
| 125 | virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); } |
| 126 | virtual DECLARE_WRITE8_MEMBER(write_bank); |
| 127 | |
| 128 | private: |
| 129 | int m_base_bank, m_half_bank; |
| 130 | }; |
| 131 | |
| 132 | |
111 | 133 | // device type definition |
112 | 134 | extern const device_type CHANF_ROM_STD; |
113 | 135 | extern const device_type CHANF_ROM_MAZE; |
114 | 136 | extern const device_type CHANF_ROM_HANGMAN; |
115 | 137 | extern const device_type CHANF_ROM_CHESS; |
116 | | extern const device_type CHANF_ROM_MULTI; |
| 138 | extern const device_type CHANF_ROM_MULTI_OLD; |
| 139 | extern const device_type CHANF_ROM_MULTI_FINAL; |
117 | 140 | |
118 | 141 | |
119 | 142 | #endif |
trunk/src/mess/drivers/channelf.c
r32698 | r32699 | |
173 | 173 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2800, 0x2fff, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); |
174 | 174 | break; |
175 | 175 | case CF_MULTI: |
| 176 | case CF_MULTI_OLD: |
176 | 177 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2800, 0x2fff, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); |
177 | 178 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x3000, 0x3fff, write8_delegate(FUNC(channelf_cart_slot_device::write_bank),(channelf_cart_slot_device*)m_cart)); |
178 | 179 | break; |
r32698 | r32699 | |
187 | 188 | SLOT_INTERFACE_INTERNAL("maze", CHANF_ROM_MAZE) |
188 | 189 | SLOT_INTERFACE_INTERNAL("hangman", CHANF_ROM_HANGMAN) |
189 | 190 | SLOT_INTERFACE_INTERNAL("chess", CHANF_ROM_CHESS) |
190 | | SLOT_INTERFACE_INTERNAL("multi", CHANF_ROM_MULTI) |
| 191 | SLOT_INTERFACE_INTERNAL("multi_old",CHANF_ROM_MULTI_OLD) |
| 192 | SLOT_INTERFACE_INTERNAL("multi", CHANF_ROM_MULTI_FINAL) |
191 | 193 | SLOT_INTERFACE_END |
192 | 194 | |
193 | 195 | |