mirror of
https://github.com/holub/mame
synced 2025-07-09 19:57:45 +03:00
leland: split out ataxx-specific stuff from base state class - really needs more cleanup (nw)
This commit is contained in:
parent
48215606ac
commit
8c16502bf7
@ -107,26 +107,26 @@ void leland_state::master_redline_map_io(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
void leland_state::master_map_program_2(address_map &map)
|
||||
void ataxx_state::master_map_program_2(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).rom();
|
||||
map(0x2000, 0x9fff).bankr("masterbank_0");
|
||||
map(0xa000, 0xdfff).bankr("masterbank_1").w(this, FUNC(leland_state::ataxx_battery_ram_w)).share("battery");
|
||||
map(0xa000, 0xdfff).bankr("masterbank_1").w(this, FUNC(ataxx_state::ataxx_battery_ram_w)).share("battery");
|
||||
map(0xe000, 0xf7ff).ram().share("mainram");
|
||||
map(0xf800, 0xffff).rw(this, FUNC(leland_state::ataxx_paletteram_and_misc_r), FUNC(leland_state::ataxx_paletteram_and_misc_w)).share("palette");
|
||||
map(0xf800, 0xffff).rw(this, FUNC(ataxx_state::ataxx_paletteram_and_misc_r), FUNC(ataxx_state::ataxx_paletteram_and_misc_w)).share("palette");
|
||||
}
|
||||
|
||||
|
||||
void leland_state::master_map_io_2(address_map &map)
|
||||
void ataxx_state::master_map_io_2(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x04, 0x04).r(m_sound, FUNC(leland_80186_sound_device::leland_80186_response_r));
|
||||
map(0x05, 0x05).w(m_sound, FUNC(leland_80186_sound_device::leland_80186_command_hi_w));
|
||||
map(0x06, 0x06).w(m_sound, FUNC(leland_80186_sound_device::leland_80186_command_lo_w));
|
||||
map(0x0c, 0x0c).w(m_sound, FUNC(leland_80186_sound_device::ataxx_80186_control_w));
|
||||
map(0x20, 0x20).rw(this, FUNC(leland_state::ataxx_eeprom_r), FUNC(leland_state::ataxx_eeprom_w));
|
||||
map(0xd0, 0xef).rw(this, FUNC(leland_state::ataxx_mvram_port_r), FUNC(leland_state::ataxx_mvram_port_w));
|
||||
map(0xf0, 0xff).rw(this, FUNC(leland_state::ataxx_master_input_r), FUNC(leland_state::ataxx_master_output_w));
|
||||
map(0x20, 0x20).rw(this, FUNC(ataxx_state::ataxx_eeprom_r), FUNC(ataxx_state::ataxx_eeprom_w));
|
||||
map(0xd0, 0xef).rw(this, FUNC(ataxx_state::ataxx_mvram_port_r), FUNC(ataxx_state::ataxx_mvram_port_w));
|
||||
map(0xf0, 0xff).rw(this, FUNC(ataxx_state::ataxx_master_input_r), FUNC(ataxx_state::ataxx_master_output_w));
|
||||
}
|
||||
|
||||
|
||||
@ -179,10 +179,10 @@ void leland_state::slave_map_program(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
void leland_state::slave_map_io_2(address_map &map)
|
||||
void ataxx_state::slave_map_io_2(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x60, 0x7f).rw(this, FUNC(leland_state::ataxx_svram_port_r), FUNC(leland_state::ataxx_svram_port_w));
|
||||
map(0x60, 0x7f).rw(this, FUNC(ataxx_state::ataxx_svram_port_r), FUNC(ataxx_state::ataxx_svram_port_w));
|
||||
}
|
||||
|
||||
/*************************************
|
||||
@ -990,9 +990,6 @@ MACHINE_CONFIG_START(leland_state::leland)
|
||||
MCFG_DEVICE_PROGRAM_MAP(slave_small_map_program)
|
||||
MCFG_DEVICE_IO_MAP(slave_map_io)
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(leland_state,leland)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(leland_state,leland)
|
||||
|
||||
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
|
||||
MCFG_NVRAM_ADD_0FILL("battery")
|
||||
|
||||
@ -1053,7 +1050,7 @@ MACHINE_CONFIG_START(leland_state::lelandi)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
MACHINE_CONFIG_START(leland_state::ataxx)
|
||||
MACHINE_CONFIG_START(ataxx_state::ataxx)
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("master", Z80, 6000000)
|
||||
@ -1064,9 +1061,6 @@ MACHINE_CONFIG_START(leland_state::ataxx)
|
||||
MCFG_DEVICE_PROGRAM_MAP(slave_map_program)
|
||||
MCFG_DEVICE_IO_MAP(slave_map_io_2)
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(leland_state,ataxx)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(leland_state,ataxx)
|
||||
|
||||
MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")
|
||||
MCFG_EEPROM_SERIAL_ENABLE_STREAMING()
|
||||
|
||||
@ -1080,7 +1074,7 @@ MACHINE_CONFIG_START(leland_state::ataxx)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
MACHINE_CONFIG_START(leland_state::wsf)
|
||||
MACHINE_CONFIG_START(ataxx_state::wsf)
|
||||
ataxx(config);
|
||||
|
||||
MCFG_DEVICE_REMOVE("custom")
|
||||
@ -3218,27 +3212,27 @@ void leland_state::init_pigout()
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_ataxx()
|
||||
void ataxx_state::init_ataxx()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this));
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(ataxx_state::ataxx_trackball_r),this));
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_ataxxj()
|
||||
void ataxx_state::init_ataxxj()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(leland_state::ataxx_trackball_r),this));
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x03, read8_delegate(FUNC(ataxx_state::ataxx_trackball_r),this));
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_wsf()
|
||||
void ataxx_state::init_wsf()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
@ -3250,24 +3244,24 @@ void leland_state::init_wsf()
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_indyheat()
|
||||
void ataxx_state::init_indyheat()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x02, read8_delegate(FUNC(leland_state::indyheat_wheel_r),this));
|
||||
m_master->space(AS_IO).install_read_handler(0x08, 0x0b, read8_delegate(FUNC(leland_state::indyheat_analog_r),this));
|
||||
m_master->space(AS_IO).install_read_handler(0x00, 0x02, read8_delegate(FUNC(ataxx_state::indyheat_wheel_r),this));
|
||||
m_master->space(AS_IO).install_read_handler(0x08, 0x0b, read8_delegate(FUNC(ataxx_state::indyheat_analog_r),this));
|
||||
m_master->space(AS_IO).install_read_port(0x0d, 0x0d, "P1");
|
||||
m_master->space(AS_IO).install_read_port(0x0e, 0x0e, "P2");
|
||||
m_master->space(AS_IO).install_read_port(0x0f, 0x0f, "P3");
|
||||
|
||||
/* set up additional output ports */
|
||||
m_master->space(AS_IO).install_write_handler(0x08, 0x0b, write8_delegate(FUNC(leland_state::indyheat_analog_w),this));
|
||||
m_master->space(AS_IO).install_write_handler(0x08, 0x0b, write8_delegate(FUNC(ataxx_state::indyheat_analog_w),this));
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_brutforc()
|
||||
void ataxx_state::init_brutforc()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
@ -3279,7 +3273,7 @@ void leland_state::init_brutforc()
|
||||
}
|
||||
|
||||
|
||||
void leland_state::init_asylum()
|
||||
void ataxx_state::init_asylum()
|
||||
{
|
||||
leland_rotate_memory("master");
|
||||
leland_rotate_memory("slave");
|
||||
@ -3342,11 +3336,11 @@ GAME( 1990, pigout, 0, lelandi, pigout, leland_state, init_pigou
|
||||
GAME( 1990, pigouta, pigout, lelandi, pigout, leland_state, init_pigout, ROT0, "Leland Corporation", "Pig Out: Dine Like a Swine! (rev 1)", 0 )
|
||||
|
||||
/* Ataxx-era PCB, 80186 sound */
|
||||
GAME( 1990, ataxx, 0, ataxx, ataxx, leland_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (rev 5)", 0 )
|
||||
GAME( 1990, ataxxa, ataxx, ataxx, ataxx, leland_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (rev 4)", 0 )
|
||||
GAME( 1990, ataxxe, ataxx, ataxx, ataxx, leland_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (Europe)", 0 )
|
||||
GAME( 1990, ataxxj, ataxx, ataxx, ataxx, leland_state, init_ataxxj, ROT0, "Leland Corporation (Capcom license)", "Ataxx (Japan)", 0 )
|
||||
GAME( 1990, wsf, 0, wsf, wsf, leland_state, init_wsf, ROT0, "Leland Corporation", "World Soccer Finals (rev 3)", 0 )
|
||||
GAME( 1991, indyheat, 0, wsf, indyheat, leland_state, init_indyheat, ROT0, "Leland Corporation", "Danny Sullivan's Indy Heat (rev 1)", 0 )
|
||||
GAME( 1991, brutforc, 0, wsf, brutforc, leland_state, init_brutforc, ROT0, "Leland Corporation", "Brute Force", 0 )
|
||||
GAME( 1991, asylum, 0, wsf, brutforc, leland_state, init_asylum, ROT270, "Leland Corporation", "Asylum (prototype)", 0 )
|
||||
GAME( 1990, ataxx, 0, ataxx, ataxx, ataxx_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (rev 5)", 0 )
|
||||
GAME( 1990, ataxxa, ataxx, ataxx, ataxx, ataxx_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (rev 4)", 0 )
|
||||
GAME( 1990, ataxxe, ataxx, ataxx, ataxx, ataxx_state, init_ataxx, ROT0, "Leland Corporation", "Ataxx (Europe)", 0 )
|
||||
GAME( 1990, ataxxj, ataxx, ataxx, ataxx, ataxx_state, init_ataxxj, ROT0, "Leland Corporation (Capcom license)", "Ataxx (Japan)", 0 )
|
||||
GAME( 1990, wsf, 0, wsf, wsf, ataxx_state, init_wsf, ROT0, "Leland Corporation", "World Soccer Finals (rev 3)", 0 )
|
||||
GAME( 1991, indyheat, 0, wsf, indyheat, ataxx_state, init_indyheat, ROT0, "Leland Corporation", "Danny Sullivan's Indy Heat (rev 1)", 0 )
|
||||
GAME( 1991, brutforc, 0, wsf, brutforc, ataxx_state, init_brutforc, ROT0, "Leland Corporation", "Brute Force", 0 )
|
||||
GAME( 1991, asylum, 0, wsf, brutforc, ataxx_state, init_asylum, ROT270, "Leland Corporation", "Asylum (prototype)", 0 )
|
||||
|
@ -48,7 +48,6 @@ public:
|
||||
, m_slave_base(*this, "slave")
|
||||
, m_bg_gfxrom(*this, "bg_gfx")
|
||||
, m_bg_prom(*this, "bg_prom")
|
||||
, m_xrom_base(*this, "xrom")
|
||||
, m_master_bankslot(*this, "masterbank_%u", 0U)
|
||||
, m_slave_bankslot(*this, "slavebank")
|
||||
{ }
|
||||
@ -70,14 +69,12 @@ public:
|
||||
required_region_ptr<uint8_t> m_slave_base;
|
||||
required_region_ptr<uint8_t> m_bg_gfxrom;
|
||||
optional_region_ptr<uint8_t> m_bg_prom;
|
||||
optional_region_ptr<uint8_t> m_xrom_base;
|
||||
|
||||
required_memory_bank_array<2> m_master_bankslot;
|
||||
required_memory_bank m_slave_bankslot;
|
||||
|
||||
uint8_t m_dac_control;
|
||||
uint8_t *m_alleymas_kludge_mem;
|
||||
std::unique_ptr<uint8_t[]> m_ataxx_qram;
|
||||
uint8_t m_gfx_control;
|
||||
uint8_t m_wcol_enable;
|
||||
emu_timer *m_master_int_timer;
|
||||
@ -94,12 +91,8 @@ public:
|
||||
uint8_t m_top_board_bank;
|
||||
uint8_t m_sound_port_bank;
|
||||
uint8_t m_alternate_bank;
|
||||
uint8_t m_master_bank;
|
||||
void (leland_state::*m_update_master_bank)();
|
||||
uint32_t m_xrom1_addr;
|
||||
uint32_t m_xrom2_addr;
|
||||
uint8_t m_battery_ram_enable;
|
||||
std::unique_ptr<uint8_t[]> m_extra_tram;
|
||||
std::unique_ptr<uint8_t[]> m_video_ram;
|
||||
struct vram_state_data m_vram_state[2];
|
||||
uint16_t m_xscroll;
|
||||
@ -121,23 +114,14 @@ public:
|
||||
DECLARE_READ8_MEMBER(offroad_wheel_1_r);
|
||||
DECLARE_READ8_MEMBER(offroad_wheel_2_r);
|
||||
DECLARE_READ8_MEMBER(offroad_wheel_3_r);
|
||||
DECLARE_READ8_MEMBER(ataxx_trackball_r);
|
||||
DECLARE_READ8_MEMBER(indyheat_wheel_r);
|
||||
DECLARE_READ8_MEMBER(indyheat_analog_r);
|
||||
DECLARE_WRITE8_MEMBER(indyheat_analog_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_master_alt_bankswitch_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_battery_ram_w);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_battery_ram_w);
|
||||
DECLARE_READ8_MEMBER(leland_master_analog_key_r);
|
||||
DECLARE_WRITE8_MEMBER(leland_master_analog_key_w);
|
||||
DECLARE_READ8_MEMBER(leland_master_input_r);
|
||||
DECLARE_WRITE8_MEMBER(leland_master_output_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_master_input_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_master_output_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_gated_paletteram_w);
|
||||
DECLARE_READ8_MEMBER(leland_gated_paletteram_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_paletteram_and_misc_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_paletteram_and_misc_r);
|
||||
DECLARE_WRITE8_MEMBER(leland_slave_small_banksw_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_slave_large_banksw_w);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_slave_banksw_w);
|
||||
@ -149,12 +133,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(leland_slave_video_addr_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_svram_port_w);
|
||||
DECLARE_READ8_MEMBER(leland_svram_port_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_mvram_port_w);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_svram_port_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_mvram_port_r);
|
||||
DECLARE_READ8_MEMBER(ataxx_svram_port_r);
|
||||
DECLARE_READ8_MEMBER(ataxx_eeprom_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_eeprom_w);
|
||||
DECLARE_READ8_MEMBER(leland_sound_port_r);
|
||||
DECLARE_WRITE8_MEMBER(leland_sound_port_w);
|
||||
DECLARE_WRITE8_MEMBER(leland_gfx_port_w);
|
||||
@ -179,26 +157,14 @@ public:
|
||||
void init_upyoural();
|
||||
void init_cerberus();
|
||||
void init_aafbd2p();
|
||||
void init_ataxx();
|
||||
void init_ataxxj();
|
||||
void init_wsf();
|
||||
void init_indyheat();
|
||||
void init_brutforc();
|
||||
void init_asylum();
|
||||
DECLARE_MACHINE_START(ataxx);
|
||||
DECLARE_MACHINE_RESET(ataxx);
|
||||
DECLARE_MACHINE_START(leland);
|
||||
DECLARE_MACHINE_RESET(leland);
|
||||
DECLARE_VIDEO_START(leland);
|
||||
DECLARE_VIDEO_START(leland2);
|
||||
DECLARE_VIDEO_START(ataxx);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
tilemap_t *m_tilemap;
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(leland_scan);
|
||||
TILE_GET_INFO_MEMBER(leland_get_tile_info);
|
||||
TILEMAP_MAPPER_MEMBER(ataxx_scan);
|
||||
TILE_GET_INFO_MEMBER(ataxx_get_tile_info);
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(leland_master_interrupt);
|
||||
TIMER_CALLBACK_MEMBER(leland_interrupt_callback);
|
||||
@ -219,34 +185,90 @@ public:
|
||||
void redline_bankswitch();
|
||||
void viper_bankswitch();
|
||||
void offroad_bankswitch();
|
||||
void ataxx_bankswitch();
|
||||
void leland_init_eeprom(uint8_t default_val, const uint16_t *data, uint8_t serial_offset, uint8_t serial_type);
|
||||
void ataxx_init_eeprom(const uint16_t *data);
|
||||
int keycard_r();
|
||||
void keycard_w(int data);
|
||||
void leland_rotate_memory(const char *cpuname);
|
||||
void init_master_ports(uint8_t mvram_base, uint8_t io_base);
|
||||
void ataxx(machine_config &config);
|
||||
void redline(machine_config &config);
|
||||
void lelandi(machine_config &config);
|
||||
void leland(machine_config &config);
|
||||
void quarterb(machine_config &config);
|
||||
void wsf(machine_config &config);
|
||||
void leland_video(machine_config &config);
|
||||
void ataxx_video(machine_config &config);
|
||||
void master_map_io(address_map &map);
|
||||
void master_map_io_2(address_map &map);
|
||||
void master_map_program(address_map &map);
|
||||
void master_map_program_2(address_map &map);
|
||||
void master_redline_map_io(address_map &map);
|
||||
void slave_large_map_program(address_map &map);
|
||||
void slave_map_io(address_map &map);
|
||||
void slave_map_io_2(address_map &map);
|
||||
void slave_map_program(address_map &map);
|
||||
void slave_small_map_program(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
class ataxx_state : public leland_state
|
||||
{
|
||||
public:
|
||||
ataxx_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: leland_state(mconfig, type, tag)
|
||||
, m_xrom_base(*this, "xrom")
|
||||
{
|
||||
}
|
||||
|
||||
void init_ataxx();
|
||||
void init_ataxxj();
|
||||
void init_wsf();
|
||||
void init_indyheat();
|
||||
void init_brutforc();
|
||||
void init_asylum();
|
||||
|
||||
void ataxx(machine_config &config);
|
||||
void wsf(machine_config &config);
|
||||
|
||||
protected:
|
||||
DECLARE_READ8_MEMBER(ataxx_trackball_r);
|
||||
DECLARE_READ8_MEMBER(indyheat_wheel_r);
|
||||
DECLARE_READ8_MEMBER(indyheat_analog_r);
|
||||
DECLARE_WRITE8_MEMBER(indyheat_analog_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(ataxx_battery_ram_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_master_input_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_master_output_w);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_paletteram_and_misc_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_paletteram_and_misc_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_mvram_port_w);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_svram_port_w);
|
||||
DECLARE_READ8_MEMBER(ataxx_mvram_port_r);
|
||||
DECLARE_READ8_MEMBER(ataxx_svram_port_r);
|
||||
DECLARE_READ8_MEMBER(ataxx_eeprom_r);
|
||||
DECLARE_WRITE8_MEMBER(ataxx_eeprom_w);
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(ataxx_scan);
|
||||
TILE_GET_INFO_MEMBER(ataxx_get_tile_info);
|
||||
|
||||
void ataxx_bankswitch();
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
void ataxx_video(machine_config &config);
|
||||
|
||||
void master_map_program_2(address_map &map);
|
||||
void master_map_io_2(address_map &map);
|
||||
void slave_map_io_2(address_map &map);
|
||||
|
||||
private:
|
||||
required_region_ptr<uint8_t> m_xrom_base;
|
||||
|
||||
std::unique_ptr<uint8_t[]> m_ataxx_qram;
|
||||
uint8_t m_master_bank;
|
||||
uint32_t m_xrom1_addr;
|
||||
uint32_t m_xrom2_addr;
|
||||
std::unique_ptr<uint8_t[]> m_extra_tram;
|
||||
};
|
||||
|
||||
|
||||
#define SERIAL_TYPE_NONE 0
|
||||
#define SERIAL_TYPE_ADD 1
|
||||
#define SERIAL_TYPE_ADD_XOR 2
|
||||
|
@ -245,7 +245,7 @@ READ8_MEMBER(leland_state::offroad_wheel_3_r)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_trackball_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_trackball_r)
|
||||
{
|
||||
static const char *const tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
|
||||
|
||||
@ -260,7 +260,7 @@ READ8_MEMBER(leland_state::ataxx_trackball_r)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(leland_state::indyheat_wheel_r)
|
||||
READ8_MEMBER(ataxx_state::indyheat_wheel_r)
|
||||
{
|
||||
static const char *const tracknames[] = { "AN0", "AN1", "AN2" };
|
||||
|
||||
@ -268,7 +268,7 @@ READ8_MEMBER(leland_state::indyheat_wheel_r)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(leland_state::indyheat_analog_r)
|
||||
READ8_MEMBER(ataxx_state::indyheat_analog_r)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -289,7 +289,7 @@ READ8_MEMBER(leland_state::indyheat_analog_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::indyheat_analog_w)
|
||||
WRITE8_MEMBER(ataxx_state::indyheat_analog_w)
|
||||
{
|
||||
static const char *const tracknames[] = { "AN3", "AN4", "AN5" };
|
||||
|
||||
@ -315,7 +315,7 @@ WRITE8_MEMBER(leland_state::indyheat_analog_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
MACHINE_START_MEMBER(leland_state,leland)
|
||||
void leland_state::machine_start()
|
||||
{
|
||||
/* start scanline interrupts going */
|
||||
m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::leland_interrupt_callback),this));
|
||||
@ -337,7 +337,7 @@ MACHINE_START_MEMBER(leland_state,leland)
|
||||
}
|
||||
|
||||
|
||||
MACHINE_RESET_MEMBER(leland_state,leland)
|
||||
void leland_state::machine_reset()
|
||||
{
|
||||
m_master_int_timer->adjust(m_screen->time_until_pos(8), 8);
|
||||
|
||||
@ -372,8 +372,9 @@ MACHINE_RESET_MEMBER(leland_state,leland)
|
||||
}
|
||||
|
||||
|
||||
MACHINE_START_MEMBER(leland_state,ataxx)
|
||||
void ataxx_state::machine_start()
|
||||
{
|
||||
// TODO: further untangle driver so the base class doesn't have stuff that isn't common and this can call the base implementation
|
||||
/* set the odd data banks */
|
||||
m_extra_tram = std::make_unique<uint8_t[]>(ATAXX_EXTRA_TRAM_SIZE);
|
||||
|
||||
@ -391,8 +392,9 @@ MACHINE_START_MEMBER(leland_state,ataxx)
|
||||
}
|
||||
|
||||
|
||||
MACHINE_RESET_MEMBER(leland_state,ataxx)
|
||||
void ataxx_state::machine_reset()
|
||||
{
|
||||
// TODO: further untangle driver so the base class doesn't have stuff that isn't common and this can call the base implementation
|
||||
memset(m_extra_tram.get(), 0, ATAXX_EXTRA_TRAM_SIZE);
|
||||
m_master_int_timer->adjust(m_screen->time_until_pos(8), 8);
|
||||
|
||||
@ -597,7 +599,7 @@ void leland_state::offroad_bankswitch()
|
||||
|
||||
|
||||
/* bankswitching for Ataxx, WSF, Indy Heat, and Brute Force */
|
||||
void leland_state::ataxx_bankswitch()
|
||||
void ataxx_state::ataxx_bankswitch()
|
||||
{
|
||||
static const uint32_t bank_list[] =
|
||||
{
|
||||
@ -820,7 +822,7 @@ void leland_state::ataxx_init_eeprom(const uint16_t *data)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_eeprom_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_eeprom_r)
|
||||
{
|
||||
int port = ioport("IN2")->read();
|
||||
if (LOG_EEPROM) logerror("%s:EE read\n", machine().describe_context());
|
||||
@ -828,7 +830,7 @@ READ8_MEMBER(leland_state::ataxx_eeprom_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_eeprom_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_eeprom_w)
|
||||
{
|
||||
if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", machine().describe_context(),
|
||||
(data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
|
||||
@ -857,7 +859,7 @@ WRITE8_MEMBER(leland_state::leland_battery_ram_w)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_battery_ram_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_battery_ram_w)
|
||||
{
|
||||
if (m_battery_ram_enable)
|
||||
{
|
||||
@ -1169,7 +1171,7 @@ WRITE8_MEMBER(leland_state::leland_master_output_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_master_input_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_master_input_r)
|
||||
{
|
||||
int result = 0xff;
|
||||
|
||||
@ -1193,7 +1195,7 @@ READ8_MEMBER(leland_state::ataxx_master_input_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_master_output_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_master_output_w)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -1251,7 +1253,7 @@ READ8_MEMBER(leland_state::leland_gated_paletteram_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_paletteram_and_misc_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_paletteram_and_misc_w)
|
||||
{
|
||||
if (m_wcol_enable)
|
||||
m_palette->write8(space, offset, data);
|
||||
@ -1282,7 +1284,7 @@ WRITE8_MEMBER(leland_state::ataxx_paletteram_and_misc_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_paletteram_and_misc_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_paletteram_and_misc_r)
|
||||
{
|
||||
if (m_wcol_enable)
|
||||
return m_palette->basemem().read8(offset);
|
||||
|
@ -74,13 +74,13 @@ TILE_GET_INFO_MEMBER(leland_state::leland_get_tile_info)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(leland_state::ataxx_scan)
|
||||
TILEMAP_MAPPER_MEMBER(ataxx_state::ataxx_scan)
|
||||
{
|
||||
/* logical (col,row) -> memory offset */
|
||||
return (col & 0xff) | ((row & 0x3f) << 8) | ((row & 0x40) << 9);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(leland_state::ataxx_get_tile_info)
|
||||
TILE_GET_INFO_MEMBER(ataxx_state::ataxx_get_tile_info)
|
||||
{
|
||||
uint16_t tile = m_ataxx_qram[tile_index] | ((m_ataxx_qram[0x4000 | tile_index] & 0x7f) << 8);
|
||||
SET_TILE_INFO_MEMBER(0, tile, 0, 0);
|
||||
@ -93,7 +93,7 @@ TILE_GET_INFO_MEMBER(leland_state::ataxx_get_tile_info)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
VIDEO_START_MEMBER(leland_state,leland)
|
||||
void leland_state::video_start()
|
||||
{
|
||||
/* tilemap */
|
||||
m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(leland_state::leland_get_tile_info),this), tilemap_mapper_delegate(FUNC(leland_state::leland_scan),this), 8, 8, 256, 256);
|
||||
@ -118,10 +118,11 @@ VIDEO_START_MEMBER(leland_state,leland)
|
||||
}
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(leland_state,ataxx)
|
||||
void ataxx_state::video_start()
|
||||
{
|
||||
// TODO: further untangle driver so the base class doesn't have stuff that isn't common and this can call the base implementation
|
||||
/* tilemap */
|
||||
m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(leland_state::ataxx_get_tile_info),this), tilemap_mapper_delegate(FUNC(leland_state::ataxx_scan),this), 8, 8, 256, 128);
|
||||
m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(ataxx_state::ataxx_get_tile_info),this), tilemap_mapper_delegate(FUNC(ataxx_state::ataxx_scan),this), 8, 8, 256, 128);
|
||||
|
||||
/* first do the standard stuff */
|
||||
m_video_ram = make_unique_clear<uint8_t[]>(VRAM_SIZE);
|
||||
@ -200,12 +201,12 @@ WRITE8_MEMBER(leland_state::leland_gfx_port_w)
|
||||
|
||||
void leland_state::leland_video_addr_w(address_space &space, int offset, int data, int num)
|
||||
{
|
||||
struct vram_state_data *state = m_vram_state + num;
|
||||
struct vram_state_data &state = m_vram_state[num];
|
||||
|
||||
if (!offset)
|
||||
state->m_addr = (state->m_addr & 0xfe00) | ((data << 1) & 0x01fe);
|
||||
state.m_addr = (state.m_addr & 0xfe00) | ((data << 1) & 0x01fe);
|
||||
else
|
||||
state->m_addr = ((data << 9) & 0xfe00) | (state->m_addr & 0x01fe);
|
||||
state.m_addr = ((data << 9) & 0xfe00) | (state.m_addr & 0x01fe);
|
||||
}
|
||||
|
||||
|
||||
@ -402,14 +403,14 @@ READ8_MEMBER(leland_state::leland_svram_port_r)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_mvram_port_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_mvram_port_w)
|
||||
{
|
||||
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(leland_state::leland_delayed_mvram_w),this), 0x00000 | (offset << 8) | data);
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(ataxx_state::leland_delayed_mvram_w),this), 0x00000 | (offset << 8) | data);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(leland_state::ataxx_svram_port_w)
|
||||
WRITE8_MEMBER(ataxx_state::ataxx_svram_port_w)
|
||||
{
|
||||
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
|
||||
leland_vram_port_w(space, offset, data, 1);
|
||||
@ -422,14 +423,14 @@ WRITE8_MEMBER(leland_state::ataxx_svram_port_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_mvram_port_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_mvram_port_r)
|
||||
{
|
||||
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
|
||||
return leland_vram_port_r(space, offset, 0);
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(leland_state::ataxx_svram_port_r)
|
||||
READ8_MEMBER(ataxx_state::ataxx_svram_port_r)
|
||||
{
|
||||
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
|
||||
return leland_vram_port_r(space, offset, 1);
|
||||
@ -444,24 +445,24 @@ READ8_MEMBER(leland_state::ataxx_svram_port_r)
|
||||
|
||||
uint32_t leland_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap_ind16 &src = m_tilemap->pixmap();
|
||||
int height_mask = m_tilemap->height()-1;
|
||||
bitmap_ind16 const &src = m_tilemap->pixmap();
|
||||
int const height_mask = m_tilemap->height() - 1;
|
||||
|
||||
/* for each scanline in the visible region */
|
||||
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
|
||||
{
|
||||
uint16_t *dst = &bitmap.pix16(y);
|
||||
uint8_t *fg_src = &m_video_ram[y << 8];
|
||||
uint16_t *const dst = &bitmap.pix16(y);
|
||||
uint8_t const *const fg_src = &m_video_ram[y << 8];
|
||||
|
||||
/* for each pixel on the scanline */
|
||||
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
|
||||
{
|
||||
/* compute the effective scrolled pixel coordinates */
|
||||
uint16_t sx = (x + m_xscroll) & 0x07ff;
|
||||
uint16_t sy = (y + m_yscroll) & height_mask;
|
||||
uint16_t const sx = (x + m_xscroll) & 0x07ff;
|
||||
uint16_t const sy = (y + m_yscroll) & height_mask;
|
||||
|
||||
/* build the pen, background is d0-d5 */
|
||||
pen_t pen = src.pix16(sy,sx) & 0x3f;
|
||||
pen_t pen = src.pix16(sy, sx) & 0x3f;
|
||||
|
||||
/* foreground is d6-d9 */
|
||||
if (x & 0x01)
|
||||
@ -514,9 +515,6 @@ static GFXDECODE_START( gfx_ataxx )
|
||||
GFXDECODE_END
|
||||
|
||||
MACHINE_CONFIG_START(leland_state::leland_video)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(leland_state,leland)
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_leland)
|
||||
MCFG_PALETTE_ADD("palette", 1024)
|
||||
MCFG_PALETTE_FORMAT(BBGGGRRR)
|
||||
@ -530,9 +528,8 @@ MACHINE_CONFIG_START(leland_state::leland_video)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(leland_state::ataxx_video)
|
||||
MACHINE_CONFIG_START(ataxx_state::ataxx_video)
|
||||
leland_video(config);
|
||||
MCFG_VIDEO_START_OVERRIDE(leland_state,ataxx)
|
||||
|
||||
MCFG_DEVICE_REPLACE("gfxdecode", GFXDECODE, "palette", gfx_ataxx)
|
||||
MCFG_PALETTE_MODIFY("palette")
|
||||
|
Loading…
Reference in New Issue
Block a user