trunk/src/mame/drivers/sfcbox.c
r17547 | r17548 | |
12 | 12 | |
13 | 13 | The "To Do" list: |
14 | 14 | ----------------- |
15 | | -Consider moving the 3 cartridges of the slot 2 in a sowtware list since they are interchangable |
| 15 | -Consider moving the 3 cartridges of the slot 2 in a sotwware list since they are interchangable |
16 | 16 | -Hook the z180 clone, the DSP 1A/1B and the Super FX |
17 | 17 | -Add the missing GROM4-1 |
18 | 18 | -Add the possibly alternate revision of the attract ROM, with Kirby holding a coin |
r17547 | r17548 | |
116 | 116 | #include "emu.h" |
117 | 117 | #include "cpu/spc700/spc700.h" |
118 | 118 | #include "cpu/g65816/g65816.h" |
| 119 | #include "cpu/z180/z180.h" |
119 | 120 | #include "includes/snes.h" |
120 | 121 | #include "audio/snes_snd.h" |
121 | 122 | |
122 | | static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, snes_state ) |
| 123 | class sfcbox_state : public snes_state |
| 124 | { |
| 125 | public: |
| 126 | sfcbox_state(const machine_config &mconfig, device_type type, const char *tag) |
| 127 | : snes_state(mconfig, type, tag), |
| 128 | m_bios(*this, "bios") |
| 129 | { } |
| 130 | |
| 131 | required_device <cpu_device> m_bios; |
| 132 | |
| 133 | DECLARE_WRITE8_MEMBER(tx_w); |
| 134 | }; |
| 135 | |
| 136 | |
| 137 | static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, sfcbox_state ) |
123 | 138 | AM_RANGE(0x000000, 0x2fffff) AM_READWRITE_LEGACY(snes_r_bank1, snes_w_bank1) /* I/O and ROM (repeats for each bank) */ |
124 | 139 | AM_RANGE(0x300000, 0x3fffff) AM_READWRITE_LEGACY(snes_r_bank2, snes_w_bank2) /* I/O and ROM (repeats for each bank) */ |
125 | 140 | AM_RANGE(0x400000, 0x5fffff) AM_READ_LEGACY(snes_r_bank3) /* ROM (and reserved in Mode 20) */ |
r17547 | r17548 | |
140 | 155 | spc_ram_w(device, offset + 0x100, data); |
141 | 156 | } |
142 | 157 | |
143 | | static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, snes_state ) |
| 158 | static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, sfcbox_state ) |
144 | 159 | AM_RANGE(0x0000, 0x00ef) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_r, spc_ram_w) /* lower 32k ram */ |
145 | 160 | AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE_LEGACY("spc700", spc_io_r, spc_io_w) /* spc io */ |
146 | 161 | AM_RANGE(0x0100, 0xffff) AM_DEVWRITE_LEGACY("spc700", spc_ram_100_w) |
r17547 | r17548 | |
148 | 163 | AM_RANGE(0xffc0, 0xffff) AM_DEVREAD_LEGACY("spc700", spc_ipl_r) |
149 | 164 | ADDRESS_MAP_END |
150 | 165 | |
| 166 | static ADDRESS_MAP_START( sfcbox_map, AS_PROGRAM, 8, sfcbox_state ) |
| 167 | AM_RANGE(0x00000, 0x0ffff) AM_ROM AM_REGION("krom", 0) |
| 168 | AM_RANGE(0x20000, 0x27fff) AM_RAM |
| 169 | AM_RANGE(0x40000, 0x47fff) AM_ROM AM_REGION("grom", 0) |
| 170 | AM_RANGE(0x60000, 0x67fff) AM_NOP // grom slot 1 |
| 171 | ADDRESS_MAP_END |
| 172 | |
| 173 | |
| 174 | WRITE8_MEMBER( sfcbox_state::tx_w ) |
| 175 | { |
| 176 | printf("%02x\n",data); |
| 177 | } |
| 178 | |
| 179 | static ADDRESS_MAP_START( sfcbox_io, AS_IO, 8, sfcbox_state ) |
| 180 | AM_RANGE(0x0b, 0x0b) AM_WRITE(tx_w) |
| 181 | AM_RANGE(0x00, 0x3f) AM_RAM // internal i/o |
| 182 | // AM_RANGE(0x80, 0x80) // Keyswitch and Button Inputs / SNES Transfer and Misc Output |
| 183 | // AM_RANGE(0x81, 0x81) // SNES Transfer and Misc Input / Misc Output |
| 184 | // AM_RANGE(0x82, 0x82) // Unknown/unused |
| 185 | // AM_RANGE(0x83, 0x83) // Joypad Input/Status / Joypad Output/Control |
| 186 | // AM_RANGE(0x84, 0x84) // Joypad 1, MSB (1st 8 bits) (eg. Bit7=ButtonB, 0=Low=Pressed) |
| 187 | // AM_RANGE(0x85, 0x85) // Joypad 1, LSB (2nd 8 bits) (eg. Bit0=LSB of ID, 0=Low=One) |
| 188 | // AM_RANGE(0x86, 0x86) // Joypad 2, MSB (1st 8 bits) (eg. Bit7=ButtonB, 0=Low=Pressed) |
| 189 | // AM_RANGE(0x87, 0x87) // Joypad 2, LSB (2nd 8 bits) (eg. Bit0=LSB of ID, 0=Low=One) |
| 190 | // AM_RANGE(0xa0, 0xa0) // Real Time Clock |
| 191 | // AM_RANGE(0xc0, 0xc0) // SNES Mapping Register 0 |
| 192 | // AM_RANGE(0xc1, 0xc1) // SNES Mapping Register 1 |
| 193 | ADDRESS_MAP_END |
| 194 | |
| 195 | |
151 | 196 | static INPUT_PORTS_START( snes ) |
152 | 197 | PORT_START("SERIAL1_DATA1_L") |
153 | 198 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1) |
r17547 | r17548 | |
263 | 308 | #endif |
264 | 309 | INPUT_PORTS_END |
265 | 310 | |
266 | | static MACHINE_CONFIG_START( snes, snes_state ) |
| 311 | static MACHINE_CONFIG_START( snes, sfcbox_state ) |
267 | 312 | |
268 | 313 | /* basic machine hardware */ |
269 | 314 | MCFG_CPU_ADD("maincpu", _5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */ |
r17547 | r17548 | |
291 | 336 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.00) |
292 | 337 | MACHINE_CONFIG_END |
293 | 338 | |
| 339 | |
294 | 340 | static MACHINE_CONFIG_DERIVED( sfcbox, snes ) |
295 | 341 | |
296 | | // ... |
| 342 | MCFG_CPU_ADD("bios", Z180, XTAL_12MHz / 2) /* HD64180RF6X */ |
| 343 | MCFG_CPU_PROGRAM_MAP(sfcbox_map) |
| 344 | MCFG_CPU_IO_MAP(sfcbox_io) |
297 | 345 | |
298 | 346 | MACHINE_CONFIG_END |
299 | 347 | |
r17547 | r17548 | |
303 | 351 | |
304 | 352 | ***************************************************************************/ |
305 | 353 | |
306 | | ROM_START( sfcbox ) |
307 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 354 | #define SFCBOX_BIOS \ |
| 355 | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) \ |
| 356 | ROM_REGION( 0x100, "user5", 0 ) \ |
| 357 | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) \ |
| 358 | ROM_REGION( 0x10000, "krom", 0 ) \ |
| 359 | ROM_LOAD( "krom1.ic1", 0x00000, 0x10000, CRC(c9010002) SHA1(f4c74086a83b728b1c1af3a021a60efa80eff5a4) ) \ |
308 | 360 | |
309 | | // ROM_REGION( 0x80000, "atrom", 0 ) |
310 | | // ROM_REGION( 0x10000, "user3", 0 ) |
311 | 361 | |
312 | | ROM_REGION( 0x100, "user5", 0 ) /* IPL ROM */ |
313 | | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
| 362 | ROM_START( sfcbox ) |
| 363 | SFCBOX_BIOS |
314 | 364 | |
315 | | ROM_REGION( 0x10000, "krom", 0 ) |
316 | | ROM_LOAD( "krom1.ic1", 0x00000, 0x10000, CRC(c9010002) SHA1(f4c74086a83b728b1c1af3a021a60efa80eff5a4) ) |
317 | | |
318 | | // ROM_REGION( 0x1000, "addons", ROMREGION_ERASE00 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
319 | | // ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 ) |
| 365 | ROM_REGION( 0x8000, "grom", ROMREGION_ERASEFF ) |
320 | 366 | ROM_END |
321 | 367 | |
322 | 368 | ROM_START( pss61 ) |
323 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 369 | SFCBOX_BIOS |
324 | 370 | |
325 | 371 | ROM_REGION( 0x100000, "atrom", 0 ) |
326 | 372 | ROM_LOAD( "atrom-4s-0.rom5", 0x00000, 0x80000, CRC(ad3ec05c) SHA1(a3d336db585fe02a37c323422d9db6a33fd489a6) ) |
327 | 373 | |
328 | | ROM_REGION( 0x10000, "grom", 0 ) |
| 374 | ROM_REGION( 0x8000, "grom", 0 ) |
329 | 375 | ROM_LOAD( "grom1-1.ic1", 0x0000, 0x8000, CRC(333bf9a7) SHA1(5d0cd9ca29e5580c3eebe9f136839987c879f979) ) |
330 | 376 | |
331 | 377 | ROM_REGION( 0x380000, "user3", 0 ) |
332 | | ROM_LOAD( "shvc-mk-0.rom6", 0x000000, 0x080000, CRC(c8002453) SHA1(cbb853bf911255c1d8eb27cd34fc7855a0dda218) ) |
333 | | ROM_LOAD( "shvc-4m-1.rom3", 0x080000, 0x200000, CRC(91b28d56) SHA1(b83dd73d3d6049450bb8092d73c3af879804f58c) ) |
| 378 | ROM_LOAD( "shvc-mk-0.rom6", 0x000000, 0x080000, CRC(c8002453) SHA1(cbb853bf911255c1d8eb27cd34fc7855a0dda218) ) |
| 379 | ROM_LOAD( "shvc-4m-1.rom3", 0x080000, 0x200000, CRC(91b28d56) SHA1(b83dd73d3d6049450bb8092d73c3af879804f58c) ) |
334 | 380 | ROM_LOAD( "shvc-fo-1.ic20", 0x280000, 0x100000, CRC(ad668a41) SHA1(39ff7354a7fa02295c899b7a7ec3556998ac2636) ) /* Super FX hook needed for Star Fox */ |
335 | | |
336 | | ROM_REGION( 0x100, "user5", 0 ) /* IPL ROM */ |
337 | | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
338 | | |
339 | | // ROM_REGION( 0x1000, "addons", ROMREGION_ERASE00 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
340 | | // ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 ) |
341 | 381 | ROM_END |
342 | 382 | |
343 | 383 | ROM_START( pss62 ) |
344 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 384 | SFCBOX_BIOS |
345 | 385 | |
346 | | ROM_REGION( 0x10000, "grom", 0 ) |
| 386 | ROM_REGION( 0x8000, "grom", 0 ) |
347 | 387 | ROM_LOAD( "grom2-1.ic1", 0x0000, 0x8000, CRC(bcfc5642) SHA1(a96e52685bd3dcdf09d1b7acd6e1c1ab7726a640) ) |
348 | 388 | |
349 | 389 | ROM_REGION( 0x180000, "user3", 0 ) |
350 | 390 | ROM_LOAD( "shvc-gc-0.rom1", 0x000000, 0x100000, CRC(b4fd7aff) SHA1(eb553b77418dedba25fc4d5dddcb04f424b0f6a9) ) |
351 | 391 | ROM_LOAD( "shvc-2a-1.rom3", 0x100000, 0x080000, CRC(6b23e2e4) SHA1(684123a12ca1e31115bd6221d96f82461066877f) ) |
352 | | |
353 | | ROM_REGION( 0x100, "user5", 0 ) /* IPL ROM */ |
354 | | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
355 | | |
356 | | // ROM_REGION( 0x1000, "addons", ROMREGION_ERASE00 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
357 | | // ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 ) |
358 | 392 | ROM_END |
359 | 393 | |
360 | 394 | ROM_START( pss63 ) |
361 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 395 | SFCBOX_BIOS |
362 | 396 | |
363 | | ROM_REGION( 0x10000, "grom", 0 ) |
| 397 | ROM_REGION( 0x8000, "grom", 0 ) |
364 | 398 | ROM_LOAD( "grom3-1.ic1", 0x0000, 0x8000, CRC(ebec4c1c) SHA1(d638ef1486b4c0b3d4d5b666929ca7947e16efad) ) |
365 | 399 | |
366 | 400 | ROM_REGION( 0x500000, "user3", 0 ) |
367 | 401 | ROM_LOAD( "shvc-t2-1.rom3", 0x000000, 0x100000, CRC(4ae93c10) SHA1(5fa25d027940907b769578d7bf85a9d5ba94911a) ) |
368 | 402 | ROM_LOAD( "shvc-8x-1.rom1", 0x100000, 0x400000, CRC(3adef543) SHA1(df02860e691fbee453e345dd343c08b6da08d4ea) ) |
369 | | |
370 | | ROM_REGION( 0x100, "user5", 0 ) /* IPL ROM */ |
371 | | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
372 | | |
373 | | // ROM_REGION( 0x1000, "addons", ROMREGION_ERASE00 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
374 | | // ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 ) |
375 | 403 | ROM_END |
376 | 404 | |
377 | 405 | ROM_START( pss64 ) |
378 | | ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 ) |
| 406 | SFCBOX_BIOS |
379 | 407 | |
380 | | ROM_REGION( 0x10000, "grom", 0 ) |
| 408 | ROM_REGION( 0x8000, "grom", 0 ) |
381 | 409 | ROM_LOAD( "grom4-1.ic1", 0x0000, 0x8000, NO_DUMP ) |
382 | 410 | |
383 | 411 | ROM_REGION( 0x500000, "user3", 0 ) |
r17547 | r17548 | |
386 | 414 | // Possibly reverse order : |
387 | 415 | // ROM_LOAD( "shvc-8x-1.rom1", 0x000000, 0x400000, CRC(3adef543) SHA1(df02860e691fbee453e345dd343c08b6da08d4ea) ) |
388 | 416 | // ROM_LOAD( "shvc-m4-0.rom3", 0x400000, 0x100000, CRC(fb259f4f) SHA1(8faeb56f80e82dd042bdc84d19c526a979c6de8f) ) |
389 | | |
390 | | ROM_REGION( 0x100, "user5", 0 ) /* IPL ROM */ |
391 | | ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) ) /* boot rom */ |
392 | | |
393 | | // ROM_REGION( 0x1000, "addons", ROMREGION_ERASE00 ) /* add-on chip ROMs (DSP, SFX, etc) */ |
394 | | // ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 ) |
395 | 417 | ROM_END |
396 | 418 | |
397 | 419 | |