New working clones

------------------
Route 16 (Sun Electronics) [Guru]
This commit is contained in:
Ivan Vangelista 2020-04-12 15:05:46 +02:00
parent 31a46619fb
commit edcee4f8cb
4 changed files with 80 additions and 62 deletions

View File

@ -98,7 +98,7 @@ SUN ELECTRONICS CORPORATION
| | X |
| | MB8841 X | <--- Sub board on top containing 4 logic
| | X | chips and an MB8841 microcontroller
| 10MHz | X |
| 10MHz | X | PCB Number: TVX-S1
| | X |
| ^SN76477 MB7052.61 |---------X-|
|#VRS AY-3-8910 X |
@ -162,7 +162,6 @@ PL2 Button | 7A | 7B | PL1 Button
#include "sound/dac.h"
#include "sound/volt_reg.h"
#include "screen.h"
#include "speaker.h"
@ -182,7 +181,7 @@ MACHINE_START_MEMBER(route16_state, jongpute)
save_item(NAME(m_jongpute_port_select));
}
void route16_state::init_route16()
void route16_state::init_route16a()
{
// hack out the protection
u8 *rom = memregion("cpu1")->base();
@ -196,7 +195,7 @@ void route16_state::init_route16()
init_route16c();
}
void route16_state::init_route16a()
void route16_state::init_route16()
{
save_item(NAME(m_protection_data));
// hack out the protection
@ -283,7 +282,7 @@ void route16_state::init_vscompmj() // only opcodes encrypted
*
*************************************/
template<bool cpu1> WRITE8_MEMBER(route16_state::route16_sharedram_w)
template<bool cpu1> void route16_state::route16_sharedram_w(offs_t offset, uint8_t data)
{
m_sharedram[offset] = data;
@ -303,7 +302,7 @@ template<bool cpu1> WRITE8_MEMBER(route16_state::route16_sharedram_w)
*
*************************************/
READ8_MEMBER(route16_state::routex_prot_read)
uint8_t route16_state::routex_prot_read()
{
if (m_cpu1->pc() == 0x2f) return 0xfb;
@ -312,7 +311,7 @@ READ8_MEMBER(route16_state::routex_prot_read)
}
// never called, see notes.
READ8_MEMBER(route16_state::route16_prot_read)
uint8_t route16_state::route16_prot_read()
{
m_protection_data++;
return (1 << ((m_protection_data >> 1) & 7));
@ -326,7 +325,7 @@ READ8_MEMBER(route16_state::route16_prot_read)
*
*************************************/
WRITE8_MEMBER(route16_state::stratvox_sn76477_w)
void route16_state::stratvox_sn76477_w(uint8_t data)
{
/***************************************************************
* AY8910 output bits are connected to...
@ -356,38 +355,38 @@ WRITE8_MEMBER(route16_state::stratvox_sn76477_w)
*
***************************************************/
WRITE8_MEMBER(route16_state::jongpute_input_port_matrix_w)
void route16_state::jongpute_input_port_matrix_w(uint8_t data)
{
m_jongpute_port_select = data;
}
READ8_MEMBER(route16_state::jongpute_p1_matrix_r)
uint8_t route16_state::jongpute_p1_matrix_r()
{
uint8_t ret = 0;
switch (m_jongpute_port_select)
{
case 1: ret = ioport("KEY0")->read(); break;
case 2: ret = ioport("KEY1")->read(); break;
case 4: ret = ioport("KEY2")->read(); break;
case 8: ret = ioport("KEY3")->read(); break;
case 1: ret = m_key[0]->read(); break;
case 2: ret = m_key[1]->read(); break;
case 4: ret = m_key[2]->read(); break;
case 8: ret = m_key[3]->read(); break;
default: break;
}
return ret;
}
READ8_MEMBER(route16_state::jongpute_p2_matrix_r)
uint8_t route16_state::jongpute_p2_matrix_r()
{
uint8_t ret = 0;
switch (m_jongpute_port_select)
{
case 1: ret = ioport("KEY4")->read(); break;
case 2: ret = ioport("KEY5")->read(); break;
case 4: ret = ioport("KEY6")->read(); break;
case 8: ret = ioport("KEY7")->read(); break;
case 1: ret = m_key[4]->read(); break;
case 2: ret = m_key[5]->read(); break;
case 4: ret = m_key[6]->read(); break;
case 8: ret = m_key[7]->read(); break;
default: break;
}
@ -404,7 +403,7 @@ READ8_MEMBER(route16_state::jongpute_p2_matrix_r)
this would then be checking that the sounds are mixed correctly.
***************************************************************************/
READ8_MEMBER(route16_state::speakres_in3_r)
uint8_t route16_state::speakres_in3_r()
{
int bit2=4, bit1=2, bit0=1;
@ -419,7 +418,7 @@ READ8_MEMBER(route16_state::speakres_in3_r)
return 0xf8|bit2|bit1|bit0;
}
WRITE8_MEMBER(route16_state::speakres_out2_w)
void route16_state::speakres_out2_w(uint8_t data)
{
m_speakres_vrx=0;
}
@ -545,10 +544,10 @@ static INPUT_PORTS_START( route16 )
PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_HIGH, "DSW:!2" ) // Manual says unused
PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_HIGH, "DSW:!3" ) // Manual says unused
PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:!4,!5")
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) // same as 0x00
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) // same as 0x10
PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) // Same as 0x08
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW:!6")
PORT_DIPSETTING( 0x20, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
@ -586,10 +585,10 @@ static INPUT_PORTS_START( route16a )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:!4,!5")
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) // same as 0x00
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) // Same as 0x08
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) ) // same as 0x10
INPUT_PORTS_END
@ -964,6 +963,30 @@ void route16_state::vscompmj(machine_config &config)
*************************************/
ROM_START( route16 )
ROM_REGION( 0x10000, "cpu1", 0 )
ROM_LOAD( "stvg54.a0", 0x0000, 0x0800, CRC(b8471cdc) SHA1(2a890782e15fa74a6c706b06f91216f427435700) )
ROM_LOAD( "stvg55.a1", 0x0800, 0x0800, CRC(3ec52fe5) SHA1(451969b5caedd665231ef78cf262679d6d4c8507) )
ROM_LOAD( "stvg56.a2", 0x1000, 0x0800, CRC(a8e92871) SHA1(68a709c14309d2b617997b76ae9d7b80fd326f39) )
ROM_LOAD( "stvg57.a3", 0x1800, 0x0800, CRC(a0fc9fc5) SHA1(7013750c1b3d403b12eac10282a930538ed9c73e) )
ROM_LOAD( "stvg58.a4", 0x2000, 0x0800, CRC(cc95c02c) SHA1(c0b85070883463a98098d72282c52e14822c204e) )
ROM_LOAD( "stvg59.a5", 0x2800, 0x0800, CRC(a39ef648) SHA1(866095d9880b60b01f7ca66b332f5f6c4b41a5ac) )
ROM_REGION( 0x10000, "cpu2", 0 )
ROM_LOAD( "stvg60.b0", 0x0000, 0x0800, CRC(fef605f3) SHA1(bfbffa0ded3e285c034f0ad832864021ef3f2256) )
ROM_LOAD( "stvg61.b1", 0x0800, 0x0800, CRC(d0d6c189) SHA1(75cec891e20cf05aae354c8950857aea83c6dadc) )
ROM_LOAD( "stvg62.b2", 0x1000, 0x0800, CRC(defc5797) SHA1(aec8179e647de70016e0e63b720f932752adacc1) )
ROM_LOAD( "stvg63.b3", 0x1800, 0x0800, CRC(88d94a66) SHA1(163e952ada7c05110d1f1c681bd57d3b9ea8866e) )
ROM_REGION( 0x800, "mcu", 0 ) // on a small daughterboard inserted at a6
ROM_LOAD( "mb8841", 0x000, 0x800, NO_DUMP )
ROM_REGION( 0x0200, "proms", 0 ) /* Intersil IM5623CPE proms compatible with 82s129 */
/* The upper 128 bytes are 0's, used by the hardware to blank the display */
ROM_LOAD( "im5623.f10", 0x0000, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* top bitmap */
ROM_LOAD( "im5623.f12", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* bottom bitmap */
ROM_END
ROM_START( route16a )
ROM_REGION( 0x10000, "cpu1", 0 )
ROM_LOAD( "tvg54.a0", 0x0000, 0x0800, CRC(aef9ffc1) SHA1(178d23e4963336ded93c13cb17940a4ae98270c5) )
ROM_LOAD( "tvg55.a1", 0x0800, 0x0800, CRC(389bc077) SHA1(b0606f6e647e81ceae7148bda96bd4673a51e823) )
@ -1005,7 +1028,7 @@ ROM_START( route16c )
ROM_LOAD( "im5623.f12", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* bottom bitmap */
ROM_END
ROM_START( route16a )
ROM_START( route16b )
ROM_REGION( 0x10000, "cpu1", 0 )
ROM_LOAD( "vg-54", 0x0000, 0x0800, CRC(0c966319) SHA1(2f57e9a30dab864bbee2ccb0107c1b4212c5abaf) )
ROM_LOAD( "vg-55", 0x0800, 0x0800, CRC(a6a8c212) SHA1(a4a695d401b1e495c863c6938296a99592df0e7d) )
@ -1047,8 +1070,6 @@ ROM_START( route16bl )
ROM_LOAD( "im5623.f12", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* bottom bitmap */
ROM_END
ROM_START( routex )
ROM_REGION( 0x10000, "cpu1", 0 )
ROM_LOAD( "routex01.a0", 0x0000, 0x0800, CRC(99b500e7) SHA1(2561c04a1425d7ac3309faf29fcfde63a0cda4da) )
@ -1329,11 +1350,12 @@ ROM_END
*
*************************************/
GAME( 1981, route16, 0, route16, route16, route16_state, init_route16, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16a, route16, route16, route16a, route16_state, init_route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16c, route16, route16, route16a, route16_state, init_route16c, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 3, bootleg?)", MACHINE_SUPPORTS_SAVE ) // similar to set 1 but with some protection removed?
GAME( 1981, route16bl,route16, route16, route16a, route16_state, empty_init, ROT270, "bootleg (Leisure and Allied)", "Route 16 (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, routex, route16, routex, route16a, route16_state, empty_init, ROT270, "bootleg", "Route X (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16, 0, route16, route16, route16_state, init_route16, ROT270, "Sun Electronics", "Route 16 (Sun Electronics)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16a, 0, route16, route16a, route16_state, init_route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (Centuri license, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16b, route16, route16, route16, route16_state, init_route16, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (Centuri license, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, route16c, route16, route16, route16, route16_state, init_route16c, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (Centuri license, set 3, bootleg?)", MACHINE_SUPPORTS_SAVE ) // similar to set 1 but with some protection removed?
GAME( 1981, route16bl,route16, route16, route16, route16_state, empty_init, ROT270, "bootleg (Leisure and Allied)", "Route 16 (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, routex, route16, routex, route16, route16_state, empty_init, ROT270, "bootleg", "Route X (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1980, speakres, 0, speakres, speakres, route16_state, empty_init, ROT270, "Sun Electronics", "Speak & Rescue", MACHINE_SUPPORTS_SAVE )
GAME( 1980, speakresb,speakres, speakres, speakres, route16_state, empty_init, ROT270, "bootleg", "Speak & Rescue (bootleg)", MACHINE_SUPPORTS_SAVE )

View File

@ -23,6 +23,7 @@ public:
, m_decrypted_opcodes(*this, "decrypted_opcodes")
, m_palette(*this, "palette")
, m_screen(*this, "screen")
, m_key(*this, "KEY%u", 0U)
, m_protection_data(0)
{}
@ -39,18 +40,21 @@ public:
void init_route16c();
void init_vscompmj();
protected:
virtual void video_start() override;
private:
DECLARE_WRITE8_MEMBER(out0_w);
DECLARE_WRITE8_MEMBER(out1_w);
template<bool cpu1> DECLARE_WRITE8_MEMBER(route16_sharedram_w);
DECLARE_READ8_MEMBER(route16_prot_read);
DECLARE_READ8_MEMBER(routex_prot_read);
DECLARE_WRITE8_MEMBER(jongpute_input_port_matrix_w);
DECLARE_READ8_MEMBER(jongpute_p1_matrix_r);
DECLARE_READ8_MEMBER(jongpute_p2_matrix_r);
DECLARE_READ8_MEMBER(speakres_in3_r);
DECLARE_WRITE8_MEMBER(speakres_out2_w);
DECLARE_WRITE8_MEMBER(stratvox_sn76477_w);
void out0_w(uint8_t data);
void out1_w(uint8_t data);
template<bool cpu1> void route16_sharedram_w(offs_t offset, uint8_t data);
uint8_t route16_prot_read();
uint8_t routex_prot_read();
void jongpute_input_port_matrix_w(uint8_t data);
uint8_t jongpute_p1_matrix_r();
uint8_t jongpute_p2_matrix_r();
uint8_t speakres_in3_r();
void speakres_out2_w(uint8_t data);
void stratvox_sn76477_w(uint8_t data);
DECLARE_MACHINE_START(speakres);
DECLARE_MACHINE_START(jongpute);
@ -78,6 +82,7 @@ private:
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
optional_ioport_array<8> m_key;
uint8_t m_protection_data;
uint8_t m_jongpute_port_select;
@ -85,8 +90,6 @@ private:
uint8_t m_flipscreen;
uint8_t m_palette_1;
uint8_t m_palette_2;
virtual void video_start() override;
};
#endif // MAME_INCLUDES_ROUTE16_H

View File

@ -34733,8 +34733,9 @@ roul // (c) 1990
@source:route16.cpp
jongpute // 1981 Alpha Denshi Co.
route16 // (c) 1981 Tehkan/Sun + Centuri license
route16 // (c) 1981 Sun Electronics
route16a // (c) 1981 Tehkan/Sun + Centuri license
route16b // (c) 1981 Tehkan/Sun + Centuri license
route16bl // bootleg
route16c // (c) 1981 Tehkan/Sun + Centuri license
routex // bootleg

View File

@ -2,7 +2,7 @@
// copyright-holders:Zsolt Vasvari
/***************************************************************************
route16.c
route16.cpp
Functions to emulate the video hardware of the machine.
@ -24,7 +24,7 @@ void route16_state::video_start()
*
*************************************/
WRITE8_MEMBER(route16_state::out0_w)
void route16_state::out0_w(uint8_t data)
{
m_palette_1 = data & 0x1f;
@ -32,7 +32,7 @@ WRITE8_MEMBER(route16_state::out0_w)
}
WRITE8_MEMBER(route16_state::out1_w)
void route16_state::out1_w(uint8_t data)
{
m_palette_2 = data & 0x1f;
@ -59,22 +59,18 @@ WRITE8_MEMBER(route16_state::out1_w)
uint32_t route16_state::screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
offs_t offs;
uint8_t *color_prom1 = &memregion("proms")->base()[0x000];
uint8_t *color_prom2 = &memregion("proms")->base()[0x100];
for (offs = 0; offs < m_videoram1.bytes(); offs++)
for (offs_t offs = 0; offs < m_videoram1.bytes(); offs++)
{
int i;
uint8_t y = offs >> 6;
uint8_t x = offs << 2;
uint8_t data1 = m_videoram1[offs];
uint8_t data2 = m_videoram2[offs];
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
uint8_t color1 = color_prom1[((m_palette_1 << 6) & 0x80) |
(m_palette_1 << 2) |
@ -111,22 +107,18 @@ uint32_t route16_state::screen_update_route16(screen_device &screen, bitmap_rgb3
uint32_t route16_state::screen_update_jongpute(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
offs_t offs;
uint8_t *color_prom1 = &memregion("proms")->base()[0x000];
uint8_t *color_prom2 = &memregion("proms")->base()[0x100];
for (offs = 0; offs < m_videoram1.bytes(); offs++)
for (offs_t offs = 0; offs < m_videoram1.bytes(); offs++)
{
int i;
uint8_t y = offs >> 6;
uint8_t x = offs << 2;
uint8_t data1 = m_videoram1[offs];
uint8_t data2 = m_videoram2[offs];
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
uint8_t color1 = color_prom1[(m_palette_1 << 2) |
((data1 >> 3) & 0x02) |