diff options
Diffstat (limited to 'src/mame/drivers/sunplus_gcm394.cpp')
-rw-r--r-- | src/mame/drivers/sunplus_gcm394.cpp | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/src/mame/drivers/sunplus_gcm394.cpp b/src/mame/drivers/sunplus_gcm394.cpp index 137d9d72fb9..88431cd0162 100644 --- a/src/mame/drivers/sunplus_gcm394.cpp +++ b/src/mame/drivers/sunplus_gcm394.cpp @@ -2,7 +2,7 @@ // copyright-holders:David Haywood /* SunPlus unSP based hardware, SPG-??? (6xx?) (die is GCM394) - + Compared to vii.cpp this is clearly newer, has extra opcodes, different internal map etc. also scaling and higher resolutions based on Spongebob Smart Fit Park @@ -34,7 +34,7 @@ public: m_romregion(*this, "maincpu") { } - + void base(machine_config &config); @@ -89,7 +89,7 @@ protected: //virtual void machine_reset() override; void wrlshunt_map(address_map &map); - + private: DECLARE_READ16_MEMBER(hunt_porta_r); @@ -116,7 +116,8 @@ public: void generalplus_gpac800(machine_config &config); - void nand_init(); + void nand_init210(); + void nand_init840(); protected: virtual void machine_reset() override; @@ -124,6 +125,8 @@ protected: void generalplus_gpac800_map(address_map &map); private: + void nand_init(int blocksize, int blocksize_stripped); + required_shared_ptr<u16> m_mainram; std::vector<uint8_t> m_strippedrom; }; @@ -175,7 +178,7 @@ READ16_MEMBER(wrlshunt_game_state::read_external_space) WRITE16_MEMBER(wrlshunt_game_state::write_external_space) { -// logerror("DMA writing to external space (RAM?) %08x %04x\n", offset, data); +// logerror("DMA writing to external space (RAM?) %08x %04x\n", offset, data); if (offset & 0x0800000) { @@ -217,7 +220,7 @@ READ16_MEMBER(gcm394_game_state::portb_r) WRITE16_MEMBER(gcm394_game_state::porta_w) { logerror("%s: Port A:WRITE %04x\n", machine().describe_context(), data); -} +} void gcm394_game_state::base(machine_config &config) @@ -230,7 +233,7 @@ void gcm394_game_state::base(machine_config &config) m_maincpu->space_read_callback().set(FUNC(gcm394_game_state::read_external_space)); m_maincpu->space_write_callback().set(FUNC(gcm394_game_state::write_external_space)); m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->mapping_write_callback().set(FUNC(gcm394_game_state::mapping_w)); + m_maincpu->mapping_write_callback().set(FUNC(gcm394_game_state::mapping_w)); m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); @@ -286,7 +289,7 @@ void generalplus_gpac800_game_state::generalplus_gpac800(machine_config &config) m_maincpu->space_read_callback().set(FUNC(generalplus_gpac800_game_state::read_external_space)); m_maincpu->space_write_callback().set(FUNC(generalplus_gpac800_game_state::write_external_space)); m_maincpu->set_irq_acknowledge_callback(m_maincpu, FUNC(sunplus_gcm394_base_device::irq_vector_cb)); - m_maincpu->mapping_write_callback().set(FUNC(generalplus_gpac800_game_state::mapping_w)); + m_maincpu->mapping_write_callback().set(FUNC(generalplus_gpac800_game_state::mapping_w)); m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5); m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5); @@ -372,9 +375,9 @@ static INPUT_PORTS_START( gcm394 ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") // hold button Circle and Star on startup for test menu (other conditions? doesn't always work?) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Square / Orange") - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Star / Blue") - + PORT_START("P2") PORT_DIPNAME( 0x0001, 0x0001, "P2" ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) @@ -595,7 +598,7 @@ void generalplus_gpac800_game_state::machine_reset() int dest = m_strippedrom[0x15] << 8; // copy a block of code from the NAND to RAM - for (int i = 0; i < 0x2000; i++) + for (int i = 0; i < 0x7000-dest; i++) { uint16_t word = m_strippedrom[(i * 2) + 0] | (m_strippedrom[(i * 2) + 1] << 8); @@ -607,14 +610,11 @@ void generalplus_gpac800_game_state::machine_reset() } -void generalplus_gpac800_game_state::nand_init() +void generalplus_gpac800_game_state::nand_init(int blocksize, int blocksize_stripped) { uint8_t* rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); - const int blocksize = 0x210; - const int blocksize_stripped = 0x200; - int numblocks = size / blocksize; m_strippedrom.resize(numblocks * blocksize_stripped); @@ -625,7 +625,7 @@ void generalplus_gpac800_game_state::nand_init() const int basestripped = i * blocksize_stripped; for (int j = 0; j < blocksize_stripped; j++) - { + { m_strippedrom[basestripped + j] = rom[base + j]; } } @@ -645,12 +645,21 @@ void generalplus_gpac800_game_state::nand_init() } } +void generalplus_gpac800_game_state::nand_init210() +{ + nand_init(0x210, 0x200); +} + +void generalplus_gpac800_game_state::nand_init840() +{ + nand_init(0x840, 0x800); +} // NAND dumps w/ internal bootstrap (and u'nSP 2.0 extended opcodes) (have gpnandnand strings) // the JAKKS ones seem to be known as 'Generalplus GPAC800' hardware -CONS(2010, wlsair60, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_car2, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, vbaby, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) -CONS(200?, beambox, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(2010, wlsair60, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init840, "Jungle Soft / Kids Station Toys Inc", "Wireless Air 60", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_gtg, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Golden Tee Golf (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_car2, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Cars 2 (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, jak_tsm , 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "JAKKS Pacific Inc", "Toy Story Mania (JAKKS Pacific TV Game)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, vbaby, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init840, "VTech", "V.Baby", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) +CONS(200?, beambox, 0, 0, generalplus_gpac800, gcm394, generalplus_gpac800_game_state, nand_init210, "Hasbro", "Playskool Heroes Transformers Rescue Bots Beam Box (Spain)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) |