summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/leland.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/leland.h')
-rw-r--r--src/mame/includes/leland.h165
1 files changed, 91 insertions, 74 deletions
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index 17bcf40e56c..3ec1e263010 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -36,52 +36,116 @@ public:
, m_master(*this, "master")
, m_slave(*this, "slave")
, m_mainram(*this, "mainram")
- , m_battery_ram(*this, "battery")
+ , m_master_bankslot(*this, "masterbank_%u", 0U)
+ , m_master_base(*this, "master")
+ , m_slave_bankslot(*this, "slavebank")
+ , m_slave_base(*this, "slave")
, m_eeprom(*this, "eeprom")
+ , m_battery_ram(*this, "battery")
+ , m_palette(*this, "palette")
+ , m_screen(*this, "screen")
+ , m_gfxdecode(*this, "gfxdecode")
, m_dac(*this, "dac%u", 0U)
, m_ay8910(*this, "ay8910")
, m_ay8912(*this, "ay8912")
- , m_screen(*this, "screen")
- , m_gfxdecode(*this, "gfxdecode")
- , m_palette(*this, "palette")
- , m_master_base(*this, "master")
- , m_slave_base(*this, "slave")
, m_bg_gfxrom(*this, "bg_gfx")
, m_bg_prom(*this, "bg_prom")
- , m_master_bankslot(*this, "masterbank_%u", 0U)
- , m_slave_bankslot(*this, "slavebank")
{ }
+ void leland(machine_config &config);
+ void leland_video(machine_config &config);
+
+ void init_dblplay();
+ void init_dangerz();
+ void init_mayhem();
+ void init_alleymas();
+ void init_strkzone();
+ void init_wseries();
+ void init_powrplay();
+ void init_basebal2();
+ void init_upyoural();
+ void init_cerberus();
+
+ void cerberus_bankswitch();
+ void mayhem_bankswitch();
+ void dangerz_bankswitch();
+ void basebal2_bankswitch();
+ void redline_bankswitch();
+
+ void offroad_bankswitch();
+ void viper_bankswitch();
+
+ DECLARE_READ8_MEMBER(leland_raster_r);
+ DECLARE_WRITE8_MEMBER(leland_slave_video_addr_w);
+ DECLARE_WRITE8_MEMBER(leland_slave_large_banksw_w);
+ DECLARE_WRITE8_MEMBER(leland_master_video_addr_w);
+
+ TIMER_CALLBACK_MEMBER(ataxx_interrupt_callback);
+
+protected:
required_device<cpu_device> m_master;
required_device<cpu_device> m_slave;
required_shared_ptr<uint8_t> m_mainram;
- required_shared_ptr<uint8_t> m_battery_ram;
+ required_memory_bank_array<2> m_master_bankslot;
+ required_region_ptr<uint8_t> m_master_base;
+ required_memory_bank m_slave_bankslot;
+ required_region_ptr<uint8_t> m_slave_base;
required_device<eeprom_serial_93cxx_device> m_eeprom;
+ required_shared_ptr<uint8_t> m_battery_ram;
+ required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
+ required_device<gfxdecode_device> m_gfxdecode;
+
+ emu_timer *m_master_int_timer;
+ uint8_t m_battery_ram_enable;
+
+ void leland_rotate_memory(const char *cpuname);
+
+ int dial_compute_value(int new_val, int indx);
+ uint8_t m_dial_last_input[4];
+ uint8_t m_dial_last_result[4];
+ uint8_t m_analog_result;
+
+ int m_dangerz_x;
+ int m_dangerz_y;
+
+ void init_master_ports(uint8_t mvram_base, uint8_t io_base);
+ void (leland_state::*m_update_master_bank)();
+
+ int leland_vram_port_r(address_space &space, int offset, int num);
+ void leland_vram_port_w(address_space &space, int offset, int data, int num);
+
+ uint8_t m_wcol_enable;
+
+ DECLARE_READ8_MEMBER(leland_master_analog_key_r);
+ DECLARE_WRITE8_MEMBER(leland_master_analog_key_w);
+ DECLARE_READ8_MEMBER(dangerz_input_y_r);
+ DECLARE_READ8_MEMBER(dangerz_input_x_r);
+ DECLARE_READ8_MEMBER(dangerz_input_upper_r);
+ DECLARE_WRITE8_MEMBER(leland_scroll_w);
+ DECLARE_WRITE8_MEMBER(leland_master_alt_bankswitch_w);
+
+ tilemap_t *m_tilemap;
+ uint16_t m_xscroll;
+ uint16_t m_yscroll;
+ std::unique_ptr<uint8_t[]> m_video_ram;
+ struct vram_state_data m_vram_state[2];
+
+ void slave_map_program(address_map &map);
+
+ TIMER_CALLBACK_MEMBER(leland_delayed_mvram_w);
+
+private:
optional_device_array<dac_byte_interface, 2> m_dac;
optional_device<ay8910_device> m_ay8910;
optional_device<ay8912_device> m_ay8912;
- required_device<screen_device> m_screen;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_region_ptr<uint8_t> m_master_base;
- required_region_ptr<uint8_t> m_slave_base;
required_region_ptr<uint8_t> m_bg_gfxrom;
optional_region_ptr<uint8_t> m_bg_prom;
- 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;
uint8_t m_gfx_control;
- uint8_t m_wcol_enable;
- emu_timer *m_master_int_timer;
- int m_dangerz_x;
- int m_dangerz_y;
- uint8_t m_analog_result;
- uint8_t m_dial_last_input[4];
- uint8_t m_dial_last_result[4];
uint8_t m_keycard_shift;
uint8_t m_keycard_bit;
uint8_t m_keycard_state;
@@ -90,12 +154,6 @@ public:
uint8_t m_top_board_bank;
uint8_t m_sound_port_bank;
uint8_t m_alternate_bank;
- void (leland_state::*m_update_master_bank)();
- uint8_t m_battery_ram_enable;
- std::unique_ptr<uint8_t[]> m_video_ram;
- struct vram_state_data m_vram_state[2];
- uint16_t m_xscroll;
- uint16_t m_yscroll;
uint8_t m_gfxbank;
uint16_t m_last_scanline;
emu_timer *m_scanline_timer;
@@ -103,82 +161,43 @@ public:
DECLARE_READ8_MEMBER(cerberus_dial_1_r);
DECLARE_READ8_MEMBER(cerberus_dial_2_r);
DECLARE_WRITE8_MEMBER(alleymas_joystick_kludge);
- DECLARE_READ8_MEMBER(dangerz_input_y_r);
- DECLARE_READ8_MEMBER(dangerz_input_x_r);
- DECLARE_READ8_MEMBER(dangerz_input_upper_r);
- DECLARE_WRITE8_MEMBER(leland_master_alt_bankswitch_w);
DECLARE_WRITE8_MEMBER(leland_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_WRITE8_MEMBER(leland_gated_paletteram_w);
DECLARE_READ8_MEMBER(leland_gated_paletteram_r);
DECLARE_WRITE8_MEMBER(leland_slave_small_banksw_w);
- DECLARE_WRITE8_MEMBER(leland_slave_large_banksw_w);
DECLARE_WRITE8_MEMBER(ataxx_slave_banksw_w);
- DECLARE_READ8_MEMBER(leland_raster_r);
- DECLARE_WRITE8_MEMBER(leland_scroll_w);
- DECLARE_WRITE8_MEMBER(leland_master_video_addr_w);
DECLARE_WRITE8_MEMBER(leland_mvram_port_w);
DECLARE_READ8_MEMBER(leland_mvram_port_r);
- DECLARE_WRITE8_MEMBER(leland_slave_video_addr_w);
DECLARE_WRITE8_MEMBER(leland_svram_port_w);
DECLARE_READ8_MEMBER(leland_svram_port_r);
DECLARE_READ8_MEMBER(leland_sound_port_r);
DECLARE_WRITE8_MEMBER(leland_sound_port_w);
DECLARE_WRITE8_MEMBER(leland_gfx_port_w);
- void init_dblplay();
- void init_dangerz();
- void init_mayhem();
- void init_alleymas();
- void init_strkzone();
- void init_wseries();
- void init_powrplay();
- void init_basebal2();
- void init_upyoural();
- void init_cerberus();
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);
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);
- TIMER_CALLBACK_MEMBER(ataxx_interrupt_callback);
TIMER_CALLBACK_MEMBER(scanline_callback);
- TIMER_CALLBACK_MEMBER(leland_delayed_mvram_w);
void leland_video_addr_w(address_space &space, int offset, int data, int num);
- int leland_vram_port_r(address_space &space, int offset, int num);
- void leland_vram_port_w(address_space &space, int offset, int data, int num);
- int dial_compute_value(int new_val, int indx);
void update_dangerz_xy();
- void cerberus_bankswitch();
- void mayhem_bankswitch();
- void dangerz_bankswitch();
- void basebal2_bankswitch();
- void redline_bankswitch();
- void viper_bankswitch();
- void offroad_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 leland(machine_config &config);
- void leland_video(machine_config &config);
void master_map_io(address_map &map);
void master_map_program(address_map &map);
void slave_map_io(address_map &map);
- void slave_map_program(address_map &map);
void slave_small_map_program(address_map &map);
};
@@ -207,7 +226,7 @@ public:
void quarterb(machine_config &config);
void lelandi(machine_config &config);
-protected:
+private:
DECLARE_READ8_MEMBER(redline_pedal_1_r);
DECLARE_READ8_MEMBER(redline_pedal_2_r);
DECLARE_READ8_MEMBER(redline_wheel_1_r);
@@ -220,7 +239,6 @@ protected:
void master_redline_map_io(address_map &map);
void slave_large_map_program(address_map &map);
-private:
required_device<leland_80186_sound_device> m_sound;
};
@@ -246,7 +264,7 @@ public:
void ataxx(machine_config &config);
void wsf(machine_config &config);
-protected:
+private:
DECLARE_READ8_MEMBER(ataxx_trackball_r);
DECLARE_READ8_MEMBER(indyheat_analog_r);
DECLARE_WRITE8_MEMBER(indyheat_analog_w);
@@ -278,7 +296,6 @@ protected:
void master_map_io_2(address_map &map);
void slave_map_io_2(address_map &map);
-private:
required_device<leland_80186_sound_device> m_sound;
optional_ioport_array<4> m_track_axes;