slapstic: Full rewrite, using infrastructure we did not have previously

This commit is contained in:
Olivier Galibert 2021-02-04 19:28:19 +01:00
parent ac0c0344f5
commit f4f9a3284b
18 changed files with 945 additions and 770 deletions

View File

@ -407,6 +407,7 @@ void atarig1_state::hydra(machine_config &config)
hydrap(config);
m_maincpu->set_addrmap(AS_PROGRAM, &atarig1_state::hydra_map);
SLAPSTIC(config, m_slapstic, 116);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x78000, 0x79fff, 0x6000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -418,6 +419,7 @@ void atarig1_state::pfslap111(machine_config &config)
ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, m_slapstic, 111);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x39fff, 0x6000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -429,6 +431,7 @@ void atarig1_state::pfslap112(machine_config &config)
ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, m_slapstic, 112);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x39fff, 0x6000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -440,6 +443,7 @@ void atarig1_state::pfslap113(machine_config &config)
ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, m_slapstic, 113);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x39fff, 0x6000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -451,6 +455,7 @@ void atarig1_state::pfslap114(machine_config &config)
ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_pitfight);
SLAPSTIC(config, m_slapstic, 114);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x39fff, 0x6000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -1308,10 +1313,6 @@ ROM_END
void atarig1_state::init_hydra()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x78000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x78000, 0x7ffff, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
m_is_pitfight = false;
}
@ -1323,18 +1324,12 @@ void atarig1_state::init_hydrap()
void atarig1_state::init_pitfight()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x38000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x38000, 0x3ffff, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
m_is_pitfight = true;
}
void atarig1_state::init_pitfightb()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x38000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x38000, 0x3ffff, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { pitfightb_cheap_slapstic_tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { pitfightb_cheap_slapstic_tweak(offset >> 1); });
/* not primed by default */
m_bslapstic_primed = false;

View File

@ -796,6 +796,7 @@ void atarisy1_state::marble(machine_config &config)
{
atarisy1(config);
SLAPSTIC(config, m_slapstic, 103);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -804,6 +805,7 @@ void atarisy1_state::peterpak(machine_config &config)
atarisy1(config);
add_adc(config);
SLAPSTIC(config, m_slapstic, 107);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
// Digital joystick read through ADC
@ -819,6 +821,7 @@ void atarisy1_state::indytemp(machine_config &config)
add_adc(config);
add_speech(config);
SLAPSTIC(config, m_slapstic, 105);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
// Digital joystick read through ADC
@ -834,6 +837,7 @@ void atarisy1_state::roadrunn(machine_config &config)
add_adc(config);
add_speech(config);
SLAPSTIC(config, m_slapstic, 108);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
// Hall-effect analog joystick
@ -847,6 +851,7 @@ void atarisy1_state::roadb109(machine_config &config)
add_adc(config);
add_speech(config);
SLAPSTIC(config, m_slapstic, 109);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
// Road Blasters gas pedal
@ -859,6 +864,7 @@ void atarisy1_state::roadb110(machine_config &config)
add_adc(config);
add_speech(config);
SLAPSTIC(config, m_slapstic, 110);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x80000, 0x87fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
// Road Blasters gas pedal
@ -2495,18 +2501,6 @@ ROM_END
void atarisy1_state::init_slapstic()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x80000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x80000, 0x87fff, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
// Some states of the slapstic seems trigger on the whole address space, but that slows things down too much and this point.
// limit to the ranges marble madness and peterpak actually need
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x2ff5a, 0x2ff5b, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x101d4, 0x101d9, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
}
void atarisy1_state::init_marble()

View File

@ -799,28 +799,14 @@ void atarisy2_state::main_map(address_map &map)
map(0014000, 0014001).mirror(01776).r(FUNC(atarisy2_state::switch_r));
map(0014000, 0014000).mirror(01776).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0016000, 0016001).mirror(01776).r(FUNC(atarisy2_state::sound_r));
map(0020000, 0037777).m(m_vrambank, FUNC(address_map_bank_device::amap16));
map(0020000, 0037777).view(m_vmmu);
m_vmmu[0](020000, 033777).ram().w(m_alpha_tilemap, FUNC(tilemap_device::write16)).share("alpha");
m_vmmu[0](034000, 037777).ram().w(FUNC(atarisy2_state::spriteram_w)).share("mob");
m_vmmu[2](020000, 037777).ram().w(FUNC(atarisy2_state::playfieldt_w)).share(m_playfieldt);
m_vmmu[3](020000, 037777).ram().w(FUNC(atarisy2_state::playfieldb_w)).share(m_playfieldb);
map(0040000, 0057777).bankr("rombank1");
map(0060000, 0077777).bankr("rombank2");
map(0100000, 0177777).rom();
map(0100000, 0100777).rw(FUNC(atarisy2_state::slapstic_r), FUNC(atarisy2_state::slapstic_w));
}
/*************************************
*
* Bankswitched VRAM handlers
*
*************************************/
// full memory map derived from schematics
void atarisy2_state::vrambank_map(address_map &map)
{
map.unmap_value_high();
map(000000, 013777).ram().w(m_alpha_tilemap, FUNC(tilemap_device::write16)).share("alpha");
map(014000, 017777).ram().w(FUNC(atarisy2_state::spriteram_w)).share("mob");
map(020000, 037777).ram();
map(040000, 077777).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield");
}
@ -1275,8 +1261,6 @@ void atarisy2_state::atarisy2(machine_config &config)
screen.set_palette("palette");
screen.screen_vblank().set(FUNC(atarisy2_state::vblank_int));
ADDRESS_MAP_BANK(config, "vrambank").set_map(&atarisy2_state::vrambank_map).set_options(ENDIANNESS_LITTLE, 16, 15, 020000);
// sound hardware
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
@ -1309,6 +1293,8 @@ void atarisy2_state::paperboy(machine_config &config)
{
atarisy2(config);
SLAPSTIC(config, m_slapstic, 105);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0100000, 0100777, 0);
m_slapstic->set_view(m_vmmu);
}
@ -1320,6 +1306,8 @@ void atarisy2_state::_720(machine_config &config)
to ~2.2MHz "fixes" the problem */
SLAPSTIC(config, m_slapstic, 107);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0100000, 0100777, 0);
m_slapstic->set_view(m_vmmu);
}
@ -1327,6 +1315,8 @@ void atarisy2_state::ssprint(machine_config &config)
{
atarisy2(config);
SLAPSTIC(config, m_slapstic, 108);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0100000, 0100777, 0);
m_slapstic->set_view(m_vmmu);
// sound hardware
config.device_remove("tms");
@ -1337,6 +1327,8 @@ void atarisy2_state::csprint(machine_config &config)
{
atarisy2(config);
SLAPSTIC(config, m_slapstic, 109);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0100000, 0100777, 0);
m_slapstic->set_view(m_vmmu);
// sound hardware
config.device_remove("tms");
@ -1347,6 +1339,8 @@ void atarisy2_state::apb(machine_config &config)
{
atarisy2(config);
SLAPSTIC(config, m_slapstic, 110);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0100000, 0100777, 0);
m_slapstic->set_view(m_vmmu);
}

View File

@ -98,56 +98,25 @@ void atetris_state::irq_ack_w(uint8_t data)
*
*************************************/
void atetris_state::reset_bank()
{
memcpy(m_slapstic_base, &m_slapstic_source[m_current_bank * 0x4000], 0x4000);
}
void atetris_state::machine_start()
{
/* Prepare the rom bank */
m_slapstic_bank->configure_entries(0, 2, m_slapstic_region, 0x4000);
m_slapstic_bank->configure_entries(2, 2, m_slapstic_region, 0x4000);
/* Allocate interrupt timer */
m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atetris_state::interrupt_gen),this));
/* Set up save state */
save_item(NAME(m_current_bank));
machine().save().register_postload(save_prepost_delegate(FUNC(atetris_state::reset_bank), this));
}
void atetris_state::machine_reset()
{
m_current_bank = m_slapstic->bank() & 1;
reset_bank();
/* start interrupts going (32V clocked by 16V) */
m_interrupt_timer->adjust(m_screen->time_until_pos(48), 48);
}
/*************************************
*
* Slapstic handler
*
*************************************/
uint8_t atetris_state::slapstic_r(offs_t offset)
{
int result = m_slapstic_base[0x2000 + offset];
int new_bank = m_slapstic->tweak(offset) & 1;
/* update for the new bank */
if (new_bank != m_current_bank)
{
m_current_bank = new_bank;
reset_bank();
}
return result;
}
/*************************************
*
* Coin counters
@ -168,16 +137,7 @@ void atetris_bartop_state::output_w(uint8_t data)
/* atetrisbp: $3c00 also handles ROM bank selection */
/* game writes 0x4 to select bank 0, 0x5 to select bank 1 */
if (data & 4)
{
int new_bank = data & 1;
/* update for the new bank */
if (new_bank != m_current_bank)
{
m_current_bank = new_bank;
reset_bank();
}
}
m_slapstic_bank->set_entry(data & 1);
}
@ -200,8 +160,7 @@ void atetris_state::main_map(address_map &map)
map(0x3400, 0x3400).mirror(0x03ff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write8));
map(0x3800, 0x3800).mirror(0x03ff).w(FUNC(atetris_state::irq_ack_w));
map(0x3c00, 0x3c00).mirror(0x03ff).w(FUNC(atetris_state::coincount_w));
map(0x4000, 0x5fff).rom();
map(0x6000, 0x7fff).r(FUNC(atetris_state::slapstic_r));
map(0x4000, 0x7fff).bankr(m_slapstic_bank);
map(0x8000, 0xffff).rom();
}
@ -223,8 +182,7 @@ void atetris_state::atetrisb2_map(address_map &map)
map(0x3400, 0x3400).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write8));
map(0x3800, 0x3800).w(FUNC(atetris_state::irq_ack_w));
map(0x3c00, 0x3c00).w(FUNC(atetris_state::coincount_w));
map(0x4000, 0x5fff).rom();
map(0x6000, 0x7fff).r(FUNC(atetris_state::slapstic_r));
map(0x4000, 0x7fff).bankr(m_slapstic_bank);
map(0x8000, 0xffff).rom();
}
@ -242,8 +200,7 @@ void atetris_mcu_state::atetrisb3_map(address_map &map)
map(0x3400, 0x3400).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write8));
map(0x3800, 0x3800).w(FUNC(atetris_mcu_state::irq_ack_w));
map(0x3c00, 0x3c00).w(FUNC(atetris_mcu_state::coincount_w));
map(0x4000, 0x5fff).rom();
map(0x6000, 0x7fff).r(FUNC(atetris_mcu_state::slapstic_r));
map(0x4000, 0x7fff).bankr(m_slapstic_bank);
map(0x8000, 0xffff).rom();
}
@ -260,7 +217,8 @@ void atetris_bartop_state::atetrisbp_map(address_map &map)
map(0x3400, 0x3400).mirror(0x03ff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write8));
map(0x3800, 0x3800).mirror(0x03ff).w(FUNC(atetris_bartop_state::irq_ack_w));
map(0x3c00, 0x3c00).mirror(0x03ff).w(FUNC(atetris_bartop_state::output_w));
map(0x4000, 0xffff).rom();
map(0x4000, 0x7fff).bankr(m_slapstic_bank);
map(0x8000, 0xffff).rom();
}
@ -380,8 +338,6 @@ void atetris_state::atetris_base(machine_config &config)
M6502(config, m_maincpu, MASTER_CLOCK/8);
m_maincpu->set_addrmap(AS_PROGRAM, &atetris_state::main_map);
SLAPSTIC(config, m_slapstic, 101);
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
@ -400,7 +356,7 @@ void atetris_state::atetris_base(machine_config &config)
SPEAKER(config, "mono").front_center();
}
void atetris_state::atetris(machine_config &config)
void atetris_state::atetris_pokey(machine_config &config)
{
atetris_base(config);
@ -415,6 +371,14 @@ void atetris_state::atetris(machine_config &config)
pokey2.add_route(ALL_OUTPUTS, "mono", 0.50);
}
void atetris_state::atetris(machine_config &config)
{
atetris_pokey(config);
SLAPSTIC(config, m_slapstic, 101);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x6000, 0x7fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
}
void atetris_state::atetrisb2(machine_config &config)
{
@ -460,7 +424,7 @@ void atetris_mcu_state::atetrisb3(machine_config &config)
void atetris_bartop_state::atetrisbp(machine_config &config)
{
atetris(config);
atetris_pokey(config);
m_maincpu->set_addrmap(AS_PROGRAM, &atetris_bartop_state::atetrisbp_map);
}
@ -473,9 +437,8 @@ void atetris_bartop_state::atetrisbp(machine_config &config)
*************************************/
ROM_START( atetris )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "136066-1100.45f", 0x10000, 0x8000, CRC(2acbdb09) SHA1(5e1189227f26563fd3e5372121ea5c915620f892) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "136066-1100.45f", 0x0000, 0x10000, CRC(2acbdb09) SHA1(5e1189227f26563fd3e5372121ea5c915620f892) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "136066-1101.35a", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) )
@ -483,9 +446,8 @@ ROM_END
ROM_START( atetrisa )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "d1", 0x10000, 0x8000, CRC(2bcab107) SHA1(3cfb8df8cd3782f3ff7f6b32ff15c461352061ee) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "d1", 0x0000, 0x10000, CRC(2bcab107) SHA1(3cfb8df8cd3782f3ff7f6b32ff15c461352061ee) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "136066-1101.35a", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) )
@ -493,9 +455,8 @@ ROM_END
ROM_START( atetrisb )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "tetris.01", 0x10000, 0x8000, CRC(944d15f6) SHA1(926fa5cb26b6e6a50bea455eec1f6d3fb92aa95c) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "tetris.01", 0x0000, 0x10000, CRC(944d15f6) SHA1(926fa5cb26b6e6a50bea455eec1f6d3fb92aa95c) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "tetris.02", 0x0000, 0x10000, CRC(5c4e7258) SHA1(58060681a728e74d69b2b6f5d02faa597ca6c226) )
@ -508,9 +469,8 @@ ROM_END
ROM_START( atetrisb2 )
ROM_REGION( 0x18000, "maincpu", 0 ) // Some bootleg PCBs uses unmodified Atari ROMs
ROM_LOAD( "k1-01", 0x10000, 0x8000, CRC(fa056809) SHA1(e4ccccdf9b04b68127c7b03ae263519cf00f94cb) ) // 27512
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 ) // Some bootleg PCBs uses unmodified Atari ROMs
ROM_LOAD( "k1-01", 0x0000, 0x10000, CRC(fa056809) SHA1(e4ccccdf9b04b68127c7b03ae263519cf00f94cb) ) // 27512
ROM_REGION( 0x10000, "gfx1", 0 ) // Some bootleg PCBs uses unmodified Atari ROMs
ROM_LOAD( "136066-1101.35a", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) ) // 27512
@ -561,9 +521,8 @@ The MCU XTAL is 10.73835 MHz rather than 10 MHz on this PCB.
*/
ROM_START( atetrisb3 )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "prg.bin", 0x10000, 0x8000, CRC(2bcab107) SHA1(3cfb8df8cd3782f3ff7f6b32ff15c461352061ee) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "prg.bin", 0x0000, 0x10000, CRC(2bcab107) SHA1(3cfb8df8cd3782f3ff7f6b32ff15c461352061ee) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "gfx.bin", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) )
@ -587,9 +546,8 @@ ROM_START( atetrisb3 )
ROM_END
ROM_START( atetrisb4 ) // bootleg on an unusually big PCB for this game
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "1.bin", 0x10000, 0x8000, CRC(56589096) SHA1(df0ff776f3e3506c86d703d2283db59a576abea6) ) // only difference is the credits for 'video graphics' where changed
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "1.bin", 0x0000, 0x10000, CRC(56589096) SHA1(df0ff776f3e3506c86d703d2283db59a576abea6) ) // only difference is the credits for 'video graphics' where changed
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "2.bin", 0x0000, 0x10000, CRC(70859030) SHA1(bb6bf88b75be3a81672e0aa30a8cbd7181bc87d0) ) // unique, but extremely similar to the one of the original
@ -630,9 +588,8 @@ N |PAL16R4 74LS??? 4017 74LS08 74LS32 74LS04 PAL16R4 82S123 74LS32 |
1 2 3 4 5 6 7 8 9
*/
ROM_START( atetb3482 )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "i4-d1.bin", 0x10000, 0x8000, CRC(2acbdb09) SHA1(5e1189227f26563fd3e5372121ea5c915620f892) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "i4-d1.bin", 0x0000, 0x10000, CRC(2acbdb09) SHA1(5e1189227f26563fd3e5372121ea5c915620f892) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "f8-d2.bin", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) )
@ -696,18 +653,16 @@ wasn't a viable game to make, its the only known example.
*/
ROM_START( atetrisbp )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "tet_rom_rev1.40f", 0x10000, 0x8000, CRC(b6224e6c) SHA1(6b549317499e91a2f19ec282d927fba08f217488) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "tet_rom_rev1.40f", 0x0000, 0x10000, CRC(b6224e6c) SHA1(6b549317499e91a2f19ec282d927fba08f217488) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "8901-136066-1101.40p", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) BAD_DUMP ) // "© 1988 ATARI"; not dumped from this set
ROM_END
ROM_START( atetrisc )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "tetcktl1.rom", 0x10000, 0x8000, CRC(9afd1f4a) SHA1(323d1576d92c905e8e95108b39cabf6fa0c10db6) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "tetcktl1.rom", 0x0000, 0x10000, CRC(9afd1f4a) SHA1(323d1576d92c905e8e95108b39cabf6fa0c10db6) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "136066-1103.35a", 0x0000, 0x10000, CRC(ec2a7f93) SHA1(cb850141ffd1504f940fa156a39e71a4146d7fea) )
@ -715,9 +670,8 @@ ROM_END
ROM_START( atetrisc2 )
ROM_REGION( 0x18000, "maincpu", 0 )
ROM_LOAD( "136066-1102.45f", 0x10000, 0x8000, CRC(1bd28902) SHA1(ae8c34f082bce1f827bf60830f207c46cb282421) )
ROM_CONTINUE( 0x08000, 0x8000 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "136066-1102.45f", 0x0000, 0x10000, CRC(1bd28902) SHA1(ae8c34f082bce1f827bf60830f207c46cb282421) )
ROM_REGION( 0x10000, "gfx1", 0 )
ROM_LOAD( "136066-1103.35a", 0x0000, 0x10000, CRC(ec2a7f93) SHA1(cb850141ffd1504f940fa156a39e71a4146d7fea) )
@ -725,35 +679,19 @@ ROM_END
/*************************************
*
* Driver init
*
*************************************/
void atetris_state::init_atetris()
{
uint8_t *rgn = memregion("maincpu")->base();
m_slapstic_source = &rgn[0x10000];
m_slapstic_base = &rgn[0x04000];
}
/*************************************
*
* Game drivers
*
*************************************/
GAME( 1988, atetris, 0, atetris, atetris, atetris_state, init_atetris, ROT0, "Atari Games", "Tetris (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisa, atetris, atetris, atetris, atetris_state, init_atetris, ROT0, "Atari Games", "Tetris (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb, atetris, atetris, atetris, atetris_state, init_atetris, ROT0, "bootleg", "Tetris (bootleg set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb2, atetris, atetrisb2, atetris, atetris_state, init_atetris, ROT0, "bootleg", "Tetris (bootleg set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb3, atetris, atetrisb3, atetris, atetris_mcu_state, init_atetris, ROT0, "bootleg", "Tetris (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb4, atetris, atetris, atetris, atetris_state, init_atetris, ROT0, "bootleg", "Tetris (bootleg set 4)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetb3482, atetris, atetris, atetris, atetris_state, init_atetris, ROT0, "bootleg", "Tetris (bootleg set 5, with UM3482)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
GAME( 1989, atetrisbp, atetris, atetrisbp, atetris, atetris_bartop_state, init_atetris, ROT0, "Atari Games", "Tetris (bartop, prototype)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, atetrisc, atetris, atetris, atetrisc, atetris_state, init_atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, atetrisc2, atetris, atetris, atetrisc, atetris_state, init_atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetris, 0, atetris, atetris, atetris_state, empty_init, ROT0, "Atari Games", "Tetris (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisa, atetris, atetris, atetris, atetris_state, empty_init, ROT0, "Atari Games", "Tetris (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb, atetris, atetris, atetris, atetris_state, empty_init, ROT0, "bootleg", "Tetris (bootleg set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb2, atetris, atetrisb2, atetris, atetris_state, empty_init, ROT0, "bootleg", "Tetris (bootleg set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb3, atetris, atetrisb3, atetris, atetris_mcu_state, empty_init, ROT0, "bootleg", "Tetris (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetrisb4, atetris, atetris, atetris, atetris_state, empty_init, ROT0, "bootleg", "Tetris (bootleg set 4)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, atetb3482, atetris, atetris, atetris, atetris_state, empty_init, ROT0, "bootleg", "Tetris (bootleg set 5, with UM3482)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
GAME( 1989, atetrisbp, atetris, atetrisbp, atetris, atetris_bartop_state, empty_init, ROT0, "Atari Games", "Tetris (bartop, prototype)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, atetrisc, atetris, atetris, atetrisc, atetris_state, empty_init, ROT270, "Atari Games", "Tetris (cocktail set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1989, atetrisc2, atetris, atetris, atetrisc, atetris_state, empty_init, ROT270, "Atari Games", "Tetris (cocktail set 2)", MACHINE_SUPPORTS_SAVE )

View File

@ -421,6 +421,7 @@ void cyberbal_state::cyberbalt(machine_config &config)
EEPROM_2816(config, "eeprom").lock_after_write(true);
SLAPSTIC(config, m_slapstic, 116);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x18000, 0x1ffff, 0);
m_slapstic->set_bank(m_slapstic_bank);
m_maincpu->set_addrmap(AS_PROGRAM, &cyberbal_state::tournament_map);
}
@ -1002,10 +1003,6 @@ ROM_END
void cyberbal_state::init_cyberbalt()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x18000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x18000, 0x1ffff, 0, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
}

View File

@ -549,6 +549,7 @@ void gauntlet_state::gauntlet(machine_config & config)
{
gauntlet_base(config);
SLAPSTIC(config, m_slapstic, 104);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x3ffff, 0x280000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -557,6 +558,7 @@ void gauntlet_state::gaunt2p(machine_config & config)
{
gauntlet_base(config);
SLAPSTIC(config, m_slapstic, 107);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x3ffff, 0x280000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -565,6 +567,7 @@ void gauntlet_state::gauntlet2(machine_config & config)
{
gauntlet_base(config);
SLAPSTIC(config, m_slapstic, 106);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x3ffff, 0x280000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -573,6 +576,7 @@ void gauntlet_state::vindctr2(machine_config & config)
{
gauntlet_base(config);
SLAPSTIC(config, m_slapstic, 118);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x38000, 0x3ffff, 0x280000);
m_slapstic->set_bank(m_slapstic_bank);
}
@ -1659,18 +1663,6 @@ void gauntlet_state::common_init(int vindctr2)
{
u8 *rom = memregion("maincpu")->base();
m_slapstic_bank->configure_entries(0, 4, rom + 0x38000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x38000, 0x3ffff, 0x280000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
// Out-of-range access on alternate 1
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x4fed0, 0x4fed7, 0x000000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x56e54, 0x56e57, 0x000000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
// swap the top and bottom halves of the main CPU ROM images
swap_memory(rom + 0x000000, rom + 0x008000, 0x8000);

View File

@ -367,7 +367,7 @@ harddriv_state::harddriv_state(const machine_config &mconfig, device_type type,
m_dsk_10c(*this, "dsk_10c"),
m_dsk_30c(*this, "dsk_30c"),
m_dsk_pio_access(0),
m_m68k_slapstic_base(nullptr),
m_m68k_sloop_base(nullptr),
m_m68k_sloop_alt_base(nullptr),
m_200e(*this, "200e"),
m_210e(*this, "210e"),
@ -460,7 +460,8 @@ harddriv_state::harddriv_state(const machine_config &mconfig, device_type type,
m_sound_int_state(0),
m_video_int_state(0),
m_palette(*this, "palette"),
m_slapstic_device(*this, "slapstic"),
m_slapstic(*this, "slapstic"),
m_slapstic_bank(*this, "slapstic_bank"),
m_rs232(*this, "rs232")
{
int i;
@ -1455,7 +1456,9 @@ void harddriv_state::driver_nomsp(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &harddriv_state::driver_68k_map);
m_maincpu->set_periodic_int(FUNC(harddriv_state::hd68k_irq_gen), attotime::from_hz(HARDDRIV_MASTER_CLOCK/16/16/16/16/2));
SLAPSTIC(config, m_slapstic_device, 117);
SLAPSTIC(config, m_slapstic, 117);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0xe0000, 0xe7fff, 0x18000);
m_slapstic->set_bank(m_slapstic_bank);
WATCHDOG_TIMER(config, "watchdog");
@ -5061,8 +5064,8 @@ void harddriv_state::init_racedriv()
init_driver_sound();
/* set up the slapstic */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_r)), write16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_w)));
m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xe0000, 0xe7fff, 0x18000, m_slapstic_bank);
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0xe0000, 0x8000);
/* synchronization */
m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync0_w)));
@ -5085,8 +5088,8 @@ void harddriv_state::racedrivc_init_common(offs_t gsp_protection)
init_driver_sound();
/* set up the slapstic */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_r)), write16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_w)));
m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xe0000, 0xe7fff, 0x18000, m_slapstic_bank);
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0xe0000, 0x8000);
/* synchronization */
m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32s_delegate(*this, FUNC(harddriv_state::rddsp32_sync0_w)));
@ -5119,8 +5122,8 @@ void harddriv_state::init_racedrivc_panorama_side()
init_adsp();
/* set up the slapstic */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_r)), write16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_w)));
m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xe0000, 0xe7fff, 0x18000, m_slapstic_bank);
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0xe0000, 0x8000);
/* set up protection hacks */
m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16smo_delegate(*this, FUNC(harddriv_state::hdgsp_protection_w)));
@ -5177,7 +5180,7 @@ void harddriv_state::steeltal_init_common(offs_t ds3_transfer_pc, int proto_sloo
else
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16sm_delegate(*this, FUNC(harddriv_state::st68k_protosloop_r)), write16sm_delegate(*this, FUNC(harddriv_state::st68k_protosloop_w)));
m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_m68k_sloop_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_m68k_sloop_alt_base = (uint16_t *)(memregion("maincpu")->base() + 0x4e000);
/* set up protection hacks */
@ -5218,8 +5221,8 @@ void harddriv_state::init_strtdriv()
init_dsk();
/* set up the slapstic */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_r)), write16sm_delegate(*this, FUNC(harddriv_state::rd68k_slapstic_w)));
m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000);
m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xe0000, 0xe7fff, 0x18000, m_slapstic_bank);
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0xe0000, 0x8000);
m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16smo_delegate(*this, FUNC(harddriv_state::hda68k_port1_r)));

View File

@ -329,6 +329,7 @@ void rampart_state::rampart(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &rampart_state::main_map);
SLAPSTIC(config, m_slapstic, 118);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x140000, 0x147fff, 0x438000);
m_slapstic->set_bank(m_slapstic_bank);
TIMER(config, "scantimer").configure_scanline(FUNC(rampart_state::scanline_interrupt), m_screen, 0, 32);
@ -495,13 +496,6 @@ ROM_END
void rampart_state::machine_start()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x40000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x140000, 0x147fff, 0x438000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
// The slapstic seems to trigger on the whole rom, but that slows things down too much. limit to the range rampart actually needs
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x040000, 0x041fff, 0x000000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
}

View File

@ -329,8 +329,9 @@ void starwars_state::esb(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &starwars_state::esb_main_map);
SLAPSTIC(config, m_slapstic_device, 101);
m_slapstic_device->set_bank(m_slapstic_bank);
SLAPSTIC(config, m_slapstic, 101);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x8000, 0x9fff, 0);
m_slapstic->set_bank(m_slapstic_bank);
subdevice<ls259_device>("outlatch")->q_out_cb<4>().append_membank("bank2");
}
@ -526,10 +527,6 @@ void starwars_state::init_esb()
/* init the slapstic */
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x14000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x8000, 0x9fff, 0, "slapstic",
[this](offs_t offset, u8 &data, u8 mem_mask) { m_slapstic_device->tweak(offset & 0x1fff); },
[this](offs_t offset, u8 &data, u8 mem_mask) { m_slapstic_device->tweak(offset & 0x1fff); });
/* prepare the matrix processor */
starwars_mproc_init();

View File

@ -176,6 +176,7 @@ void xybots_state::xybots(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &xybots_state::main_map);
SLAPSTIC(config, m_slapstic, 107);
m_slapstic->set_range(m_maincpu, AS_PROGRAM, 0x8000, 0xffff, 0x7c0000);
m_slapstic->set_bank(m_slapstic_bank);
EEPROM_2804(config, "eeprom").lock_after_write(true);
@ -383,10 +384,6 @@ ROM_END
void xybots_state::machine_start()
{
m_slapstic_bank->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x2000);
m_maincpu->space(AS_PROGRAM).install_readwrite_tap(0x8000, 0xffff, 0x7c0000, "slapstic",
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); },
[this](offs_t offset, u16 &data, u16 mem_mask) { m_slapstic->tweak(offset >> 1); });
m_h256 = 0x0400;
}

View File

@ -32,7 +32,6 @@ public:
, m_screen(*this, "screen")
, m_mob(*this, "mob")
, m_slapstic_region(*this, "maincpu")
, m_vrambank(*this, "vrambank")
, m_playfield_tilemap(*this, "playfield")
, m_alpha_tilemap(*this, "alpha")
, m_xscroll(*this, "xscroll")
@ -44,6 +43,9 @@ public:
, m_tms5220(*this, "tms")
, m_rombank(*this, "rombank%u", 1U)
, m_slapstic(*this, "slapstic")
, m_vmmu(*this, "vmmu")
, m_playfieldt(*this, "playfieldt")
, m_playfieldb(*this, "playfieldb")
, m_leds(*this, "led%u", 0U)
{ }
@ -75,7 +77,6 @@ private:
required_device<screen_device> m_screen;
required_device<atari_motion_objects_device> m_mob;
required_region_ptr<uint16_t> m_slapstic_region;
required_device<address_map_bank_device> m_vrambank;
uint8_t m_interrupt_enable;
@ -99,6 +100,9 @@ private:
required_memory_bank_array<2> m_rombank;
required_device<atari_slapstic_device> m_slapstic;
memory_view m_vmmu;
required_shared_ptr<uint16_t> m_playfieldt;
required_shared_ptr<uint16_t> m_playfieldb;
uint8_t m_sound_reset_state;
@ -146,15 +150,14 @@ private:
DECLARE_WRITE_LINE_MEMBER(vblank_int);
TIMER_CALLBACK_MEMBER(delayed_int_enable_w);
TIMER_CALLBACK_MEMBER(reset_yscroll_callback);
uint16_t slapstic_r(offs_t offset);
void slapstic_w(offs_t offset, uint16_t data);
void yscroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void xscroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void playfieldt_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void playfieldb_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
static rgb_t RRRRGGGGBBBBIIII(uint32_t raw);
static const atari_motion_objects_config s_mob_config;
void main_map(address_map &map);
void sound_map(address_map &map);
void vrambank_map(address_map &map);
};

View File

@ -26,11 +26,14 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_slapstic(*this, "slapstic"),
m_slapstic_bank(*this, "slapstic_bank"),
m_slapstic_region(*this, "maincpu"),
m_videoram(*this, "videoram")
{
}
void atetris_base(machine_config &config);
void atetris_pokey(machine_config &config);
void atetris(machine_config &config);
void atetrisb2(machine_config &config);
@ -45,17 +48,15 @@ protected:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
optional_device<atari_slapstic_device> m_slapstic;
optional_memory_bank m_slapstic_bank;
required_region_ptr<uint8_t> m_slapstic_region;
required_shared_ptr<uint8_t> m_videoram;
uint8_t *m_slapstic_source;
uint8_t *m_slapstic_base;
uint8_t m_current_bank;
emu_timer *m_interrupt_timer;
tilemap_t *m_bg_tilemap;
void irq_ack_w(uint8_t data);
uint8_t slapstic_r(offs_t offset);
void coincount_w(uint8_t data);
void videoram_w(offs_t offset, uint8_t data);
TILE_GET_INFO_MEMBER(get_tile_info);

View File

@ -235,9 +235,6 @@ protected:
/* DSPCOM board */
void hddspcom_control_w(offs_t offset, uint16_t data);
void rd68k_slapstic_w(offs_t offset, uint16_t data);
uint16_t rd68k_slapstic_r(offs_t offset);
/* Game-specific protection */
void st68k_sloop_w(offs_t offset, uint16_t data);
uint16_t st68k_sloop_r(offs_t offset);
@ -317,7 +314,7 @@ protected:
optional_device<eeprom_parallel_28xx_device> m_dsk_30c;
uint8_t m_dsk_pio_access;
uint16_t * m_m68k_slapstic_base;
uint16_t * m_m68k_sloop_base;
uint16_t * m_m68k_sloop_alt_base;
required_device<timekeeper_device> m_200e;
@ -491,7 +488,8 @@ protected:
optional_device<palette_device> m_palette;
int get_hblank(screen_device &screen) const { return (screen.hpos() > (screen.width() * 9 / 10)); }
optional_device<atari_slapstic_device> m_slapstic_device;
optional_device<atari_slapstic_device> m_slapstic;
memory_bank_creator m_slapstic_bank;
optional_device<rs232_port_device> m_rs232;

View File

@ -32,7 +32,7 @@ public:
m_pokey(*this, "pokey%u", 1U),
m_tms(*this, "tms"),
m_novram(*this, "x2212"),
m_slapstic_device(*this, "slapstic"),
m_slapstic(*this, "slapstic"),
m_slapstic_bank(*this, "slapstic_bank")
{ }
@ -54,7 +54,7 @@ private:
required_device_array<pokey_device, 4> m_pokey;
required_device<tms5220_device> m_tms;
required_device<x2212_device> m_novram;
optional_device<atari_slapstic_device> m_slapstic_device;
optional_device<atari_slapstic_device> m_slapstic;
optional_memory_bank m_slapstic_bank;
int m_MPA;

View File

@ -1691,26 +1691,6 @@ void harddriv_state::hddspcom_control_w(offs_t offset, uint16_t data)
#pragma mark * GAME-SPECIFIC PROTECTION
#endif
/*************************************
*
* Race Drivin' slapstic handling
*
*************************************/
void harddriv_state::rd68k_slapstic_w(offs_t offset, uint16_t data)
{
m_slapstic_device->tweak(offset & 0x3fff);
}
uint16_t harddriv_state::rd68k_slapstic_r(offs_t offset)
{
int bank = m_slapstic_device->tweak(offset & 0x3fff) * 0x4000;
return m_m68k_slapstic_base[bank + (offset & 0x3fff)];
}
/*************************************
*
* Steel Talons SLOOP handling
@ -1753,7 +1733,7 @@ void harddriv_state::st68k_sloop_w(offs_t offset, uint16_t data)
uint16_t harddriv_state::st68k_sloop_r(offs_t offset)
{
int bank = st68k_sloop_tweak(offset) * 0x4000;
return m_m68k_slapstic_base[bank + (offset & 0x3fff)];
return m_m68k_sloop_base[bank + (offset & 0x3fff)];
}
@ -1818,7 +1798,7 @@ void harddriv_state::st68k_protosloop_w(offs_t offset, uint16_t data)
uint16_t harddriv_state::st68k_protosloop_r(offs_t offset)
{
int bank = st68k_protosloop_tweak(offset) * 0x4000;
return m_m68k_slapstic_base[bank + (offset & 0x3fff)];
return m_m68k_sloop_base[bank + (offset & 0x3fff)];
}

File diff suppressed because it is too large Load Diff

View File

@ -25,86 +25,6 @@ DECLARE_DEVICE_TYPE(SLAPSTIC, atari_slapstic_device)
*
*************************************/
struct mask_value
{
int mask, value;
};
struct slapstic_data
{
int bankstart;
int bank[4];
struct mask_value alt1;
struct mask_value alt2;
struct mask_value alt3;
struct mask_value alt4;
int altshift;
struct mask_value bit1;
struct mask_value bit2c0;
struct mask_value bit2s0;
struct mask_value bit2c1;
struct mask_value bit2s1;
struct mask_value bit3;
struct mask_value add1;
struct mask_value add2;
struct mask_value addplus1;
struct mask_value addplus2;
struct mask_value add3;
};
/*************************************
*
* Shorthand
*
*************************************/
#define UNKNOWN 0xffff
#define NO_BITWISE \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }
#define NO_ADDITIVE \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }, \
{ UNKNOWN,UNKNOWN }
#define MATCHES_MASK_VALUE(val, maskval) (((val) & (maskval).mask) == (maskval).value)
/*************************************
*
* Constants
*
*************************************/
enum
{
DISABLED,
ENABLED,
ALTERNATE1,
ALTERNATE2,
ALTERNATE3,
BITWISE1,
BITWISE2,
BITWISE3,
ADDITIVE1,
ADDITIVE2,
ADDITIVE3
};
class atari_slapstic_device : public device_t
{
public:
@ -118,34 +38,236 @@ public:
atari_slapstic_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
template <typename T> void set_bank(T &&tag) { m_bank.set_tag(std::forward<T>(tag)); }
void set_view(memory_view &view) { m_view = &view; }
int bank();
int tweak(offs_t offset);
template <typename T> void set_range(T &&tag, int index, offs_t start, offs_t end, offs_t mirror) {
m_space.set_tag(std::forward<T>(tag), index);
m_start = start;
m_end = end;
m_mirror = mirror;
}
void set_chipnum(int chipnum) { m_chipnum = chipnum; }
int m_chipnum;
u8 state;
u8 current_bank;
int access_68k;
u8 alt_bank;
u8 bit_bank;
u8 add_bank;
u8 bit_xor;
struct slapstic_data slapstic;
void slapstic_log(offs_t offset);
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_validity_check(validity_checker &valid) const override;
private:
struct mask_value {
u16 mask, value;
};
struct slapstic_data {
u8 bankstart;
u16 bank[4];
mask_value alt1;
mask_value alt2;
mask_value alt3;
mask_value alt4;
int altshift;
mask_value bit1;
mask_value bit2;
mask_value bit3c0;
mask_value bit3s0;
mask_value bit3c1;
mask_value bit3s1;
mask_value bit4;
mask_value add1;
mask_value add2;
mask_value addplus1;
mask_value addplus2;
mask_value add3;
};
static const slapstic_data slapstic101;
// 102 has never been encountered
static const slapstic_data slapstic103;
static const slapstic_data slapstic104;
static const slapstic_data slapstic105;
static const slapstic_data slapstic106;
static const slapstic_data slapstic107;
static const slapstic_data slapstic108;
static const slapstic_data slapstic109;
static const slapstic_data slapstic110;
static const slapstic_data slapstic111;
static const slapstic_data slapstic112;
static const slapstic_data slapstic113;
static const slapstic_data slapstic114;
static const slapstic_data slapstic115;
static const slapstic_data slapstic116;
static const slapstic_data slapstic117;
static const slapstic_data slapstic118;
static const slapstic_data *const slapstic_table[];
struct test {
offs_t m_m, m_v;
test() : m_m(0), m_v(0) {}
test(offs_t m, offs_t v) : m_m(m), m_v(v) {}
bool operator()(offs_t a) const { return (a & m_m) == m_v; }
};
struct checker {
offs_t m_range_mask, m_range_value, m_shift, m_input_mask;
checker(offs_t start, offs_t end, offs_t mirror, int data_width, int address_lines);
test test_in(const mask_value &mv) const;
test test_any(const mask_value &mv) const;
test test_inside() const;
test test_reset() const;
test test_bank(u16 b) const;
};
struct state {
atari_slapstic_device *m_sl;
state(atari_slapstic_device *sl) : m_sl(sl) {}
virtual ~state() = default;
virtual void test(offs_t addr) const = 0;
};
struct idle : public state {
struct test m_reset;
idle(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct active_101_102 : public state {
struct test m_bank[4], m_alt, m_bit;
active_101_102(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct active_103_110 : public state {
struct test m_bank[4], m_alt, m_bit;
active_103_110(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct active_111_118 : public state {
struct test m_bank[4], m_alt, m_add;
active_111_118(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct alt_valid_101_102 : public state {
struct test m_reset, m_inside, m_valid;
alt_valid_101_102(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct alt_valid_103_110 : public state {
struct test m_reset, m_valid;
alt_valid_103_110(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct alt_valid_111_118 : public state {
struct test m_reset, m_valid, m_add;
alt_valid_111_118(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct alt_select_101_110 : public state {
struct test m_reset, m_select;
int m_shift;
alt_select_101_110(atari_slapstic_device *sl, const checker &check, const slapstic_data *data, int shift);
virtual void test(offs_t addr) const override;
};
struct alt_select_111_118 : public state {
struct test m_reset, m_select;
int m_shift;
alt_select_111_118(atari_slapstic_device *sl, const checker &check, const slapstic_data *data, int shift);
virtual void test(offs_t addr) const override;
};
struct alt_commit : public state {
struct test m_reset, m_commit;
alt_commit(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct bit_load : public state {
struct test m_reset, m_load;
bit_load(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct bit_set : public state {
struct test m_reset, m_set0, m_clear0, m_set1, m_clear1, m_commit;
bool m_is_odd;
bit_set(atari_slapstic_device *sl, const checker &check, const slapstic_data *data, bool odd);
virtual void test(offs_t addr) const override;
};
struct add_load : public state {
struct test m_reset, m_load;
add_load(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
struct add_set : public state {
struct test m_reset, m_add1, m_add2, m_end;
add_set(atari_slapstic_device *sl, const checker &check, const slapstic_data *data);
virtual void test(offs_t addr) const override;
};
int m_chipnum;
optional_memory_bank m_bank;
memory_view *m_view;
optional_address_space m_space;
offs_t m_start, m_end, m_mirror;
std::unique_ptr<state> m_s_idle;
std::unique_ptr<state> m_s_active;
std::unique_ptr<state> m_s_alt_valid;
std::unique_ptr<state> m_s_alt_select;
std::unique_ptr<state> m_s_alt_commit;
std::unique_ptr<state> m_s_bit_load;
std::unique_ptr<state> m_s_bit_set_odd;
std::unique_ptr<state> m_s_bit_set_even;
std::unique_ptr<state> m_s_add_load;
std::unique_ptr<state> m_s_add_set;
const state *m_state;
u8 m_current_bank;
u8 m_loaded_bank;
void change_bank(int bank);
void commit_bank();
};
#endif // MAME_INCLUDES_SLAPSTIC_H

View File

@ -27,7 +27,7 @@ TILE_GET_INFO_MEMBER(atarisy2_state::get_alpha_tile_info)
TILE_GET_INFO_MEMBER(atarisy2_state::get_playfield_tile_info)
{
uint16_t data = m_playfield_tilemap->basemem_read(tile_index);
uint16_t data = tile_index < 020000/2 ? m_playfieldt[tile_index] : m_playfieldb[tile_index & (020000/2 - 1)];
int code = (m_playfield_tile_bank[(data >> 10) & 1] << 10) | (data & 0x3ff);
int color = (data >> 11) & 7;
tileinfo.set(0, code, color, 0);
@ -79,7 +79,6 @@ void atarisy2_state::video_start()
{
// reset the statics
m_yscroll_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atarisy2_state::reset_yscroll_callback),this));
m_vrambank->set_bank(0);
// save states
save_item(NAME(m_playfield_tile_bank));
@ -181,32 +180,6 @@ rgb_t atarisy2_state::RRRRGGGGBBBBIIII(uint32_t raw)
}
/*************************************
*
* Video RAM bank read/write handlers
*
*************************************/
uint16_t atarisy2_state::slapstic_r(offs_t offset)
{
int result = m_slapstic_region[offset + 0100000/2];
m_slapstic->tweak(offset);
/* an extra tweak for the next opcode fetch */
m_vrambank->set_bank(m_slapstic->tweak(0x1234));
return result;
}
void atarisy2_state::slapstic_w(offs_t offset, uint16_t data)
{
m_slapstic->tweak(offset);
/* an extra tweak for the next opcode fetch */
m_vrambank->set_bank(m_slapstic->tweak(0x1234));
}
/*************************************
*
* Video RAM read/write handlers
@ -221,6 +194,18 @@ void atarisy2_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask
COMBINE_DATA(&m_mob->spriteram()[offset]);
}
void atarisy2_state::playfieldt_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(m_playfieldt + offset);
m_playfield_tilemap->mark_tile_dirty(offset);
}
void atarisy2_state::playfieldb_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(m_playfieldb + offset);
m_playfield_tilemap->mark_tile_dirty(offset + 020000/2);
}
/*************************************
*