motogonki checkpoint, seems running and showing something (nw)

This commit is contained in:
MetalliC 2018-05-26 21:51:03 +03:00
parent c15531dddc
commit c6e63ee748

View File

@ -145,6 +145,7 @@ public:
DECLARE_WRITE8_MEMBER(spr1_ctrl_w);
DECLARE_WRITE8_MEMBER(spr_xy_w);
DECLARE_WRITE8_MEMBER(tileram_w);
DECLARE_WRITE8_MEMBER(moto_tileram_w);
DECLARE_CUSTOM_INPUT_MEMBER(collision_r);
DECLARE_CUSTOM_INPUT_MEMBER(coin_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_inc);
@ -171,6 +172,9 @@ public:
void istreb(machine_config &config);
void io_map(address_map &map);
void mem_map(address_map &map);
void motogonki(machine_config &config);
void moto_io_map(address_map &map);
void moto_mem_map(address_map &map);
};
void istrebiteli_state::machine_start()
@ -256,6 +260,12 @@ WRITE8_MEMBER(istrebiteli_state::tileram_w)
m_tilemap->mark_tile_dirty(offset);
}
WRITE8_MEMBER(istrebiteli_state::moto_tileram_w)
{
m_tileram[offset] = data ^ 0xff;
m_tilemap->mark_tile_dirty(offset);
}
READ8_MEMBER(istrebiteli_state::ppi0_r)
{
return m_ppi0->read(space, offset ^ 3) ^ 0xff;
@ -306,6 +316,12 @@ void istrebiteli_state::mem_map(address_map &map)
map(0x1000, 0x13ff).ram();
}
void istrebiteli_state::moto_mem_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x23ff).ram();
}
void istrebiteli_state::io_map(address_map &map)
{
map.global_mask(0xff);
@ -316,6 +332,16 @@ void istrebiteli_state::io_map(address_map &map)
map(0xc8, 0xcf).w(this, FUNC(istrebiteli_state::spr_xy_w));
}
void istrebiteli_state::moto_io_map(address_map &map)
{
map.global_mask(0xff);
map.unmap_value_high();
map(0x30, 0x37).w(this, FUNC(istrebiteli_state::spr_xy_w));
map(0x38, 0x3b).rw(m_ppi0, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x3c, 0x3f).rw(m_ppi1, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x40, 0x4f).w(this, FUNC(istrebiteli_state::moto_tileram_w));
}
CUSTOM_INPUT_MEMBER(istrebiteli_state::collision_r)
{
// piece of HACK
@ -378,6 +404,38 @@ static INPUT_PORTS_START( istreb )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, istrebiteli_state,coin_inc, nullptr)
INPUT_PORTS_END
static INPUT_PORTS_START( moto )
PORT_START("IN0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1)
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, collision_r, 1)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("IN1")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2)
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, collision_r, 0)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("IN2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START1)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) // unknown
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
//PORT_BIT(0x3c, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CUSTOM_MEMBER(DEVICE_SELF, istrebiteli_state, coin_r, nullptr)
//PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_HBLANK("screen")
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, istrebiteli_state,coin_inc, nullptr)
INPUT_PORTS_END
static const gfx_layout char_layout =
{
8,16,
@ -450,6 +508,17 @@ MACHINE_CONFIG_START(istrebiteli_state::istreb)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
MACHINE_CONFIG_START(istrebiteli_state::motogonki)
istreb(config);
MCFG_DEVICE_MODIFY(I8080_TAG)
MCFG_DEVICE_PROGRAM_MAP(moto_mem_map)
MCFG_DEVICE_IO_MAP(moto_io_map)
MCFG_DEVICE_MODIFY("ppi1")
MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
MACHINE_CONFIG_END
ROM_START( istreb )
ROM_REGION( 0x1000, I8080_TAG, ROMREGION_ERASEFF )
ROM_LOAD( "002-ia12.bin", 0x000, 0x200, CRC(de0bce75) SHA1(ca284e8220d0d55c1a4dd3e951b53404f40fc873) )
@ -491,5 +560,5 @@ ROM_START( motogonki )
ROM_LOAD( "003_iw3.w3", 0x000, 0x200, CRC(814854ba) SHA1(2cbfd60df01f00d7659393efa58547de660bf201) )
ROM_END
GAME( 198?, istreb, 0, istreb, istreb, istrebiteli_state, empty_init, ROT0, "Terminal", "Istrebiteli", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE)
GAME( 198?, motogonki, 0, istreb, istreb, istrebiteli_state, empty_init, ROT0, "Terminal", "Motogonki", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
GAME( 198?, istreb, 0, istreb, istreb, istrebiteli_state, empty_init, ROT0, "Terminal", "Istrebiteli", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE)
GAME( 198?, motogonki, 0, motogonki, moto, istrebiteli_state, empty_init, ROT0, "Terminal", "Motogonki", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND)