Previous 199869 Revisions Next

r17548 Wednesday 29th August, 2012 at 00:34:47 UTC by Angelo Salese
First step to Super Famicom Box
[src/emu/cpu/z180]z180.c
[src/mame/drivers]sfcbox.c

trunk/src/mame/drivers/sfcbox.c
r17547r17548
1212
1313The "To Do" list:
1414-----------------
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
1616-Hook the z180 clone, the DSP 1A/1B and the Super FX
1717-Add the missing GROM4-1
1818-Add the possibly alternate revision of the attract ROM, with Kirby holding a coin
r17547r17548
116116#include "emu.h"
117117#include "cpu/spc700/spc700.h"
118118#include "cpu/g65816/g65816.h"
119#include "cpu/z180/z180.h"
119120#include "includes/snes.h"
120121#include "audio/snes_snd.h"
121122
122static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, snes_state )
123class sfcbox_state : public snes_state
124{
125public:
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
137static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, sfcbox_state )
123138   AM_RANGE(0x000000, 0x2fffff) AM_READWRITE_LEGACY(snes_r_bank1, snes_w_bank1)   /* I/O and ROM (repeats for each bank) */
124139   AM_RANGE(0x300000, 0x3fffff) AM_READWRITE_LEGACY(snes_r_bank2, snes_w_bank2)   /* I/O and ROM (repeats for each bank) */
125140   AM_RANGE(0x400000, 0x5fffff) AM_READ_LEGACY(snes_r_bank3)                  /* ROM (and reserved in Mode 20) */
r17547r17548
140155   spc_ram_w(device, offset + 0x100, data);
141156}
142157
143static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, snes_state )
158static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, sfcbox_state )
144159   AM_RANGE(0x0000, 0x00ef) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_r, spc_ram_w)   /* lower 32k ram */
145160   AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE_LEGACY("spc700", spc_io_r, spc_io_w)   /* spc io */
146161   AM_RANGE(0x0100, 0xffff) AM_DEVWRITE_LEGACY("spc700", spc_ram_100_w)
r17547r17548
148163   AM_RANGE(0xffc0, 0xffff) AM_DEVREAD_LEGACY("spc700", spc_ipl_r)
149164ADDRESS_MAP_END
150165
166static 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
171ADDRESS_MAP_END
172
173
174WRITE8_MEMBER( sfcbox_state::tx_w )
175{
176   printf("%02x\n",data);
177}
178
179static 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
193ADDRESS_MAP_END
194
195
151196static INPUT_PORTS_START( snes )
152197   PORT_START("SERIAL1_DATA1_L")
153198   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
r17547r17548
263308#endif
264309INPUT_PORTS_END
265310
266static MACHINE_CONFIG_START( snes, snes_state )
311static MACHINE_CONFIG_START( snes, sfcbox_state )
267312
268313   /* basic machine hardware */
269314   MCFG_CPU_ADD("maincpu", _5A22, 3580000*6)   /* 2.68Mhz, also 3.58Mhz */
r17547r17548
291336   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
292337MACHINE_CONFIG_END
293338
339
294340static MACHINE_CONFIG_DERIVED( sfcbox, snes )
295341
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)
297345
298346MACHINE_CONFIG_END
299347
r17547r17548
303351
304352***************************************************************************/
305353
306ROM_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) ) \
308360
309//  ROM_REGION( 0x80000, "atrom", 0 )
310//  ROM_REGION( 0x10000, "user3", 0 )
311361
312   ROM_REGION( 0x100, "user5", 0 )      /* IPL ROM */
313   ROM_LOAD( "spc700.rom", 0x00, 0x40, CRC(44bb3a40) SHA1(97e352553e94242ae823547cd853eecda55c20f0) )   /* boot rom */
362ROM_START( sfcbox )
363   SFCBOX_BIOS
314364
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 )
320366ROM_END
321367
322368ROM_START( pss61 )
323   ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 )
369   SFCBOX_BIOS
324370
325371   ROM_REGION( 0x100000, "atrom", 0 )
326372   ROM_LOAD( "atrom-4s-0.rom5", 0x00000, 0x80000, CRC(ad3ec05c) SHA1(a3d336db585fe02a37c323422d9db6a33fd489a6) )
327373
328   ROM_REGION( 0x10000, "grom", 0 )
374   ROM_REGION( 0x8000, "grom", 0 )
329375   ROM_LOAD( "grom1-1.ic1", 0x0000, 0x8000, CRC(333bf9a7) SHA1(5d0cd9ca29e5580c3eebe9f136839987c879f979) )
330376
331377   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) )
334380   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 )
341381ROM_END
342382
343383ROM_START( pss62 )
344   ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 )
384   SFCBOX_BIOS
345385
346   ROM_REGION( 0x10000, "grom", 0 )
386   ROM_REGION( 0x8000, "grom", 0 )
347387   ROM_LOAD( "grom2-1.ic1", 0x0000, 0x8000, CRC(bcfc5642) SHA1(a96e52685bd3dcdf09d1b7acd6e1c1ab7726a640) )
348388
349389   ROM_REGION( 0x180000, "user3", 0 )
350390   ROM_LOAD( "shvc-gc-0.rom1", 0x000000, 0x100000, CRC(b4fd7aff) SHA1(eb553b77418dedba25fc4d5dddcb04f424b0f6a9) )
351391   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 )
358392ROM_END
359393
360394ROM_START( pss63 )
361   ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 )
395   SFCBOX_BIOS
362396
363   ROM_REGION( 0x10000, "grom", 0 )
397   ROM_REGION( 0x8000, "grom", 0 )
364398   ROM_LOAD( "grom3-1.ic1", 0x0000, 0x8000, CRC(ebec4c1c) SHA1(d638ef1486b4c0b3d4d5b666929ca7947e16efad) )
365399
366400   ROM_REGION( 0x500000, "user3", 0 )
367401   ROM_LOAD( "shvc-t2-1.rom3", 0x000000, 0x100000, CRC(4ae93c10) SHA1(5fa25d027940907b769578d7bf85a9d5ba94911a) )
368402   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 )
375403ROM_END
376404
377405ROM_START( pss64 )
378   ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 )
406   SFCBOX_BIOS
379407
380   ROM_REGION( 0x10000, "grom", 0 )
408   ROM_REGION( 0x8000, "grom", 0 )
381409   ROM_LOAD( "grom4-1.ic1", 0x0000, 0x8000, NO_DUMP )
382410
383411   ROM_REGION( 0x500000, "user3", 0 )
r17547r17548
386414//  Possibly reverse order :
387415//  ROM_LOAD( "shvc-8x-1.rom1", 0x000000, 0x400000, CRC(3adef543) SHA1(df02860e691fbee453e345dd343c08b6da08d4ea) )
388416//  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 )
395417ROM_END
396418
397419
trunk/src/emu/cpu/z180/z180.c
r17547r17548
902902
903903   case Z180_CNTR:
904904      data = cpustate->IO_CNTR & Z180_CNTR_RMASK;
905      LOG(("Z180 '%s' CNTR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
905      data &= ~0x10; // Super Famicom Box sets the TE bit then wants it to be toggled after 8 bits transmitted
906      logerror("Z180 '%s' CNTR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]);
906907      break;
907908
908909   case Z180_TRDR:
909910      data = cpustate->IO_TRDR & Z180_TRDR_RMASK;
910      LOG(("Z180 '%s' TRDR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
911      logerror("Z180 '%s' TRDR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]);
911912      break;
912913
913914   case Z180_TMDR0L:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team