From 465487cf1d77e58bbe5d69a45c3a44b72caf73a4 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Fri, 12 Aug 2022 07:53:44 -0800 Subject: nintendo/nes.cpp: Added an RGB capable Famicom clone. (#10200) New working clones ------------------ Sharp My Computer Terebi C1 [kmg] --- hash/nes.xml | 20 -------------------- src/mame/mame.lst | 1 + src/mame/nintendo/nes.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++++- src/mame/nintendo/nes.h | 2 ++ 4 files changed, 49 insertions(+), 21 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 47a57da666b..4f0189c49dd 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -44521,26 +44521,6 @@ We should eventually add it to MAME as a separate driver with a NES CPU and a GB - - - My Computer TV C1 (Japan) - 1983 - Sharp - - - - - - - - - - - - - - - Keyboard Transformer (Rus) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 02427d7515d..622d3c433ec 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -33317,6 +33317,7 @@ dendy2 // Dendy Classic 2 (Russian import of IQ-502 fam sb486 // Subor/Xiao Ba Wang SB-486 drpcjr // Bung Doctor PC Jr famicom // Nintendo Family Computer (a.k.a. Famicom) +famitvc1 // Sharp My Computer Terebi C1 famitwin // Sharp Famicom Twin System fds // Nintendo Family Computer (a.k.a. Famicom) + Disk System add-on gchinatv // Golden China TV Game Centre (Chinese famiclone) diff --git a/src/mame/nintendo/nes.cpp b/src/mame/nintendo/nes.cpp index da421bc2a43..b331e5a12ba 100644 --- a/src/mame/nintendo/nes.cpp +++ b/src/mame/nintendo/nes.cpp @@ -228,6 +228,39 @@ void nes_state::fds(machine_config &config) config.device_remove("famibox_list"); } +MACHINE_RESET_MEMBER( nes_state, famitvc1 ) +{ + // TODO: supposedly the C1 used the cartridge connector audio pins to detect + // the presence of a cart and picks the builtin ROM accordingly. If so, the C1 + // should not support Famicom expansion audio chips. + + // Reset the mapper variables. Will also mark the char-gen ram as dirty + if (m_cartslot->exists()) + { + m_cartslot->pcb_reset(); + } + else + { + m_maincpu->space(AS_PROGRAM).install_rom(0x8000, 0x9fff, 0x6000, memregion("canvas_prg")->base()); + m_ppu->space(AS_PROGRAM).install_rom(0x0000, 0x1fff, memregion("canvas_chr")->base()); + } + + m_maincpu->reset(); +} + +void nes_state::famitvc1(machine_config &config) +{ + famicom(config); + + MCFG_MACHINE_RESET_OVERRIDE( nes_state, famitvc1 ) + + PPU_2C03B(config.replace(), m_ppu); + m_ppu->set_cpu_tag(m_maincpu); + m_ppu->int_callback().set_inputline("maincpu", INPUT_LINE_NMI); + + m_cartslot->set_must_be_loaded(false); +} + MACHINE_START_MEMBER( nes_state, famitwin ) { // start the base nes stuff @@ -281,6 +314,17 @@ ROM_START( famicom ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) // Main RAM ROM_END +ROM_START( famitvc1 ) + ROM_REGION( 0x2000, "canvas_prg", 0 ) + ROM_LOAD( "ix0402ce.ic109", 0x0000, 0x2000, CRC(96456b13) SHA1(a4dcb3c4f2be5077f0d197e870a26414287ce189) ) // dump needs verified + + ROM_REGION( 0x2000, "canvas_chr", 0 ) + ROM_LOAD( "ix0403ce.ic110", 0x0000, 0x2000, CRC(9cba4524) SHA1(2bd833f8049bf7a14ce337c3cde35f2140242a18) ) // dump needs verified + + ROM_REGION( 0xc0, "ppu:palette", 0 ) + ROM_LOAD( "rp2c0x.pal", 0x00, 0xc0, CRC(48de65dc) SHA1(d10acafc8da9ff479c270ec01180cca61efe62f5) ) +ROM_END + #define rom_fds rom_famicom ROM_START( famitwin ) @@ -354,7 +398,8 @@ CONS( 198?, m82p, nes, 0, nespal, nes, nes_state, empty_init, // Famicom hardware CONS( 1983, famicom, 0, nes, famicom, famicom, nes_state, init_famicom, "Nintendo", "Famicom", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -CONS( 1983, fds, famicom, 0, fds, famicom, nes_state, init_famicom, "Nintendo", "Famicom (w/ Disk System add-on)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +CONS( 1983, famitvc1, famicom, 0, famitvc1, famicom, nes_state, init_famicom, "Sharp", "My Computer Terebi C1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +CONS( 1986, fds, famicom, 0, fds, famicom, nes_state, init_famicom, "Nintendo", "Famicom (w/ Disk System add-on)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) CONS( 1986, famitwin, famicom, 0, famitwin, famicom, nes_state, init_famicom, "Sharp", "Famicom Twin", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // Clone hardware diff --git a/src/mame/nintendo/nes.h b/src/mame/nintendo/nes.h index d0bab2f92a2..bf0be0b5d7d 100644 --- a/src/mame/nintendo/nes.h +++ b/src/mame/nintendo/nes.h @@ -79,11 +79,13 @@ public: DECLARE_MACHINE_START(famitwin); DECLARE_MACHINE_RESET(fds); DECLARE_MACHINE_RESET(famitwin); + DECLARE_MACHINE_RESET(famitvc1); void setup_disk(nes_disksys_device *slot); void suborkbd(machine_config &config); void famipalc(machine_config &config); void famicom(machine_config &config); + void famitvc1(machine_config &config); void famitwin(machine_config &config); void nespal(machine_config &config); void nespalc(machine_config &config); -- cgit v1.2.3