Separate a few Atari drivers from atarigen_state (nw)

This commit is contained in:
AJR 2018-04-03 17:14:51 -04:00
parent 8cd7955a62
commit 00286343c1
9 changed files with 40 additions and 64 deletions

View File

@ -174,17 +174,6 @@ Measurements -
* *
*************************************/ *************************************/
void badlands_state::update_interrupts()
{
m_maincpu->set_input_line(1, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
void badlands_state::scanline_update(screen_device &screen, int scanline)
{
// sound CPU irq is scanline controlled, we update it below to make bootlegs happy
}
TIMER_DEVICE_CALLBACK_MEMBER(badlands_state::sound_scanline) TIMER_DEVICE_CALLBACK_MEMBER(badlands_state::sound_scanline)
{ {
int scanline = param; int scanline = param;
@ -198,7 +187,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(badlands_state::sound_scanline)
MACHINE_START_MEMBER(badlands_state,badlands) MACHINE_START_MEMBER(badlands_state,badlands)
{ {
atarigen_state::machine_start();
save_item(NAME(m_pedal_value)); save_item(NAME(m_pedal_value));
} }
@ -207,7 +195,6 @@ MACHINE_RESET_MEMBER(badlands_state,badlands)
{ {
m_pedal_value[0] = m_pedal_value[1] = 0x80; m_pedal_value[0] = m_pedal_value[1] = 0x80;
atarigen_state::machine_reset();
//scanline_timer_reset(*m_screen, 32); //scanline_timer_reset(*m_screen, 32);
membank("soundbank")->set_entry(0); membank("soundbank")->set_entry(0);
@ -235,7 +222,12 @@ INTERRUPT_GEN_MEMBER(badlands_state::vblank_int)
m_pedal_value[i]++; m_pedal_value[i]++;
} }
video_int_write_line(1); m_maincpu->set_input_line(M68K_IRQ_1, ASSERT_LINE);
}
WRITE16_MEMBER(badlands_state::video_int_ack_w)
{
m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE);
} }
@ -383,7 +375,7 @@ void badlands_state::main_map(address_map &map)
map(0xfea000, 0xfebfff).r(m_soundcomm, FUNC(atari_sound_comm_device::main_response_r)).umask16(0xff00); map(0xfea000, 0xfebfff).r(m_soundcomm, FUNC(atari_sound_comm_device::main_response_r)).umask16(0xff00);
map(0xfec000, 0xfedfff).w(this, FUNC(badlands_state::badlands_pf_bank_w)); map(0xfec000, 0xfedfff).w(this, FUNC(badlands_state::badlands_pf_bank_w));
map(0xfee000, 0xfeffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); map(0xfee000, 0xfeffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16));
map(0xffc000, 0xffc3ff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0xff00).share("palette"); map(0xffc000, 0xffc3ff).rw("palette", FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0xff00).share("palette");
map(0xffe000, 0xffefff).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield"); map(0xffe000, 0xffefff).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield");
map(0xfff000, 0xfff1ff).ram().share("mob"); map(0xfff000, 0xfff1ff).ram().share("mob");
map(0xfff200, 0xffffff).ram(); map(0xfff200, 0xffffff).ram();

View File

@ -203,7 +203,6 @@ GFXDECODE_END
void badlandsbl_state::machine_reset() void badlandsbl_state::machine_reset()
{ {
// m_pedal_value[0] = m_pedal_value[1] = 0x80; // m_pedal_value[0] = m_pedal_value[1] = 0x80;
atarigen_state::machine_reset();
// scanline_timer_reset(*m_screen, 32); // scanline_timer_reset(*m_screen, 32);
// memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000); // memcpy(m_bank_base, &m_bank_source_data[0x0000], 0x1000);

View File

@ -35,16 +35,8 @@
* *
*************************************/ *************************************/
void batman_state::update_interrupts()
{
m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
void batman_state::machine_start() void batman_state::machine_start()
{ {
atarigen_state::machine_start();
save_item(NAME(m_latch_data)); save_item(NAME(m_latch_data));
save_item(NAME(m_alpha_tile_bank)); save_item(NAME(m_alpha_tile_bank));
} }
@ -103,7 +95,7 @@ void batman_state::main_map(address_map &map)
map(0x260050, 0x260051).mirror(0x11ff8e).w(this, FUNC(batman_state::latch_w)); map(0x260050, 0x260051).mirror(0x11ff8e).w(this, FUNC(batman_state::latch_w));
map(0x260060, 0x260061).mirror(0x11ff8e).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); map(0x260060, 0x260061).mirror(0x11ff8e).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16));
map(0x2a0000, 0x2a0001).mirror(0x11fffe).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0x2a0000, 0x2a0001).mirror(0x11fffe).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
map(0x2e0000, 0x2e0fff).mirror(0x100000).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x2e0000, 0x2e0fff).mirror(0x100000).ram().w("palette", FUNC(palette_device::write16)).share("palette");
map(0x2effc0, 0x2effff).mirror(0x100000).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x2effc0, 0x2effff).mirror(0x100000).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write));
map(0x2f0000, 0x2fffff).mirror(0x100000).ram(); map(0x2f0000, 0x2fffff).mirror(0x100000).ram();
map(0x2f0000, 0x2f1fff).mirror(0x100000).w(m_vad, FUNC(atari_vad_device::playfield2_latched_msb_w)).share("vad:playfield2"); map(0x2f0000, 0x2f1fff).mirror(0x100000).w(m_vad, FUNC(atari_vad_device::playfield2_latched_msb_w)).share("vad:playfield2");
@ -207,7 +199,7 @@ MACHINE_CONFIG_START(batman_state::batman)
MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB)
MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(batman_state, scanline_int_write_line)) MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4))
MCFG_ATARI_VAD_PLAYFIELD(batman_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD(batman_state, "gfxdecode", get_playfield_tile_info)
MCFG_ATARI_VAD_PLAYFIELD2(batman_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(batman_state, "gfxdecode", get_playfield2_tile_info)
MCFG_ATARI_VAD_ALPHA(batman_state, "gfxdecode", get_alpha_tile_info) MCFG_ATARI_VAD_ALPHA(batman_state, "gfxdecode", get_alpha_tile_info)

View File

@ -29,15 +29,8 @@
* *
*************************************/ *************************************/
void cybstorm_state::update_interrupts()
{
m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
void cybstorm_state::machine_start() void cybstorm_state::machine_start()
{ {
atarigen_state::machine_start();
save_item(NAME(m_latch_data)); save_item(NAME(m_latch_data));
save_item(NAME(m_alpha_tile_bank)); save_item(NAME(m_alpha_tile_bank));
} }
@ -90,7 +83,7 @@ WRITE32_MEMBER(cybstorm_state::latch_w)
void cybstorm_state::main_map(address_map &map) void cybstorm_state::main_map(address_map &map)
{ {
map(0x000000, 0x1fffff).rom(); map(0x000000, 0x1fffff).rom();
map(0x200000, 0x20ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); map(0x200000, 0x20ffff).ram().w("palette", FUNC(palette_device::write32)).share("palette");
map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write));
map(0x3f0000, 0x3fffff).m(m_vadbank, FUNC(address_map_bank_device::amap16)); map(0x3f0000, 0x3fffff).m(m_vadbank, FUNC(address_map_bank_device::amap16));
map(0x9f0000, 0x9f0003).portr("9F0000"); map(0x9f0000, 0x9f0003).portr("9F0000");
@ -240,7 +233,7 @@ MACHINE_CONFIG_START(cybstorm_state::round2)
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(cybstorm_state, scanline_int_write_line)) MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4))
MCFG_ATARI_VAD_PLAYFIELD(cybstorm_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD(cybstorm_state, "gfxdecode", get_playfield_tile_info)
MCFG_ATARI_VAD_PLAYFIELD2(cybstorm_state, "gfxdecode", get_playfield2_tile_info) MCFG_ATARI_VAD_PLAYFIELD2(cybstorm_state, "gfxdecode", get_playfield2_tile_info)
MCFG_ATARI_VAD_ALPHA(cybstorm_state, "gfxdecode", get_alpha_tile_info) MCFG_ATARI_VAD_ALPHA(cybstorm_state, "gfxdecode", get_alpha_tile_info)
@ -262,7 +255,6 @@ MACHINE_CONFIG_START(cybstorm_state::round2)
/* note: these parameters are from published specs, not derived */ /* note: these parameters are from published specs, not derived */
/* the board uses an SOS-2 chip to generate video signals */ /* the board uses an SOS-2 chip to generate video signals */
MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240) MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(cybstorm_state, video_int_write_line))
MCFG_SCREEN_UPDATE_DRIVER(cybstorm_state, screen_update_cybstorm) MCFG_SCREEN_UPDATE_DRIVER(cybstorm_state, screen_update_cybstorm)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -29,19 +29,6 @@
/*************************************
*
* Interrupt handling
*
*************************************/
void offtwall_state::update_interrupts()
{
m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
/************************************* /*************************************
* *
* I/O handling * I/O handling
@ -238,7 +225,7 @@ void offtwall_state::main_map(address_map &map)
map(0x260050, 0x260051).w(this, FUNC(offtwall_state::io_latch_w)); map(0x260050, 0x260051).w(this, FUNC(offtwall_state::io_latch_w));
map(0x260060, 0x260061).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16)); map(0x260060, 0x260061).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16));
map(0x2a0000, 0x2a0001).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0x2a0000, 0x2a0001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
map(0x3e0000, 0x3e0fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x3e0000, 0x3e0fff).ram().w("palette", FUNC(palette_device::write16)).share("palette");
map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write)); map(0x3effc0, 0x3effff).rw(m_vad, FUNC(atari_vad_device::control_read), FUNC(atari_vad_device::control_write));
map(0x3f4000, 0x3f5eff).ram().w(m_vad, FUNC(atari_vad_device::playfield_latched_msb_w)).share("vad:playfield"); map(0x3f4000, 0x3f5eff).ram().w(m_vad, FUNC(atari_vad_device::playfield_latched_msb_w)).share("vad:playfield");
map(0x3f5f00, 0x3f5f7f).ram().share("vad:eof"); map(0x3f5f00, 0x3f5f7f).ram().share("vad:eof");
@ -364,7 +351,7 @@ MACHINE_CONFIG_START(offtwall_state::offtwall)
MCFG_PALETTE_ADD("palette", 2048) MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB) MCFG_PALETTE_FORMAT(IRRRRRGGGGGBBBBB)
MCFG_ATARI_VAD_ADD("vad", "screen", WRITELINE(offtwall_state, scanline_int_write_line)) MCFG_ATARI_VAD_ADD("vad", "screen", INPUTLINE("maincpu", M68K_IRQ_4))
MCFG_ATARI_VAD_PLAYFIELD(offtwall_state, "gfxdecode", get_playfield_tile_info) MCFG_ATARI_VAD_PLAYFIELD(offtwall_state, "gfxdecode", get_playfield_tile_info)
MCFG_ATARI_VAD_MOB(offtwall_state::s_mob_config, "gfxdecode") MCFG_ATARI_VAD_MOB(offtwall_state::s_mob_config, "gfxdecode")

View File

@ -29,25 +29,29 @@
INPUT_PORTS_EXTERN(badlands); INPUT_PORTS_EXTERN(badlands);
class badlands_state : public atarigen_state class badlands_state : public driver_device
{ {
public: public:
badlands_state(const machine_config &mconfig, device_type type, const char *tag) badlands_state(const machine_config &mconfig, device_type type, const char *tag)
: atarigen_state(mconfig, type, tag), : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"), m_audiocpu(*this, "audiocpu"),
m_soundcomm(*this, "soundcomm"), m_soundcomm(*this, "soundcomm"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_playfield_tilemap(*this, "playfield"), m_playfield_tilemap(*this, "playfield"),
m_mob(*this, "mob") m_mob(*this, "mob")
{ } { }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu; optional_device<cpu_device> m_audiocpu;
optional_device<atari_sound_comm_device> m_soundcomm; optional_device<atari_sound_comm_device> m_soundcomm;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<tilemap_device> m_playfield_tilemap; required_device<tilemap_device> m_playfield_tilemap;
optional_device<atari_motion_objects_device> m_mob; optional_device<atari_motion_objects_device> m_mob;
virtual void update_interrupts() override;
virtual void scanline_update(screen_device &screen, int scanline) override;
DECLARE_READ16_MEMBER(sound_busy_r); DECLARE_READ16_MEMBER(sound_busy_r);
DECLARE_READ16_MEMBER(pedal_0_r); DECLARE_READ16_MEMBER(pedal_0_r);
DECLARE_READ16_MEMBER(pedal_1_r); DECLARE_READ16_MEMBER(pedal_1_r);
@ -60,6 +64,7 @@ public:
DECLARE_VIDEO_START(badlands); DECLARE_VIDEO_START(badlands);
uint32_t screen_update_badlands(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_badlands(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_int); INTERRUPT_GEN_MEMBER(vblank_int);
DECLARE_WRITE16_MEMBER(video_int_ack_w);
TIMER_DEVICE_CALLBACK_MEMBER(sound_scanline); TIMER_DEVICE_CALLBACK_MEMBER(sound_scanline);
DECLARE_WRITE16_MEMBER( badlands_pf_bank_w ); DECLARE_WRITE16_MEMBER( badlands_pf_bank_w );

View File

@ -14,11 +14,13 @@
#include "audio/atarijsa.h" #include "audio/atarijsa.h"
#include "video/atarimo.h" #include "video/atarimo.h"
class batman_state : public atarigen_state class batman_state : public driver_device
{ {
public: public:
batman_state(const machine_config &mconfig, device_type type, const char *tag) : batman_state(const machine_config &mconfig, device_type type, const char *tag) :
atarigen_state(mconfig, type, tag), driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_screen(*this, "screen"),
m_jsa(*this, "jsa"), m_jsa(*this, "jsa"),
m_vad(*this, "vad") m_vad(*this, "vad")
{ } { }
@ -34,10 +36,11 @@ protected:
TILE_GET_INFO_MEMBER(get_playfield2_tile_info); TILE_GET_INFO_MEMBER(get_playfield2_tile_info);
uint32_t screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
virtual void update_interrupts() override;
void main_map(address_map &map); void main_map(address_map &map);
private: private:
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
required_device<atari_jsa_iii_device> m_jsa; required_device<atari_jsa_iii_device> m_jsa;
required_device<atari_vad_device> m_vad; required_device<atari_vad_device> m_vad;

View File

@ -15,14 +15,17 @@
#include "machine/bankdev.h" #include "machine/bankdev.h"
class cybstorm_state : public atarigen_state class cybstorm_state : public driver_device
{ {
public: public:
cybstorm_state(const machine_config &mconfig, device_type type, const char *tag) cybstorm_state(const machine_config &mconfig, device_type type, const char *tag)
: atarigen_state(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_jsa(*this, "jsa") , m_jsa(*this, "jsa")
, m_vad(*this, "vad") , m_vad(*this, "vad")
, m_vadbank(*this, "vadbank") , m_vadbank(*this, "vadbank")
, m_screen(*this, "screen")
, m_gfxdecode(*this, "gfxdecode")
{ } { }
DECLARE_DRIVER_INIT(cybstorm); DECLARE_DRIVER_INIT(cybstorm);
@ -31,7 +34,6 @@ public:
protected: protected:
virtual void machine_start() override; virtual void machine_start() override;
virtual void video_start() override; virtual void video_start() override;
virtual void update_interrupts() override;
DECLARE_READ32_MEMBER(special_port1_r); DECLARE_READ32_MEMBER(special_port1_r);
DECLARE_WRITE32_MEMBER(latch_w); DECLARE_WRITE32_MEMBER(latch_w);
@ -48,9 +50,12 @@ protected:
void vadbank_map(address_map &map); void vadbank_map(address_map &map);
private: private:
required_device<cpu_device> m_maincpu;
optional_device<atari_jsa_iiis_device> m_jsa; optional_device<atari_jsa_iiis_device> m_jsa;
required_device<atari_vad_device> m_vad; required_device<atari_vad_device> m_vad;
required_device<address_map_bank_device> m_vadbank; required_device<address_map_bank_device> m_vadbank;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
uint32_t m_latch_data; uint32_t m_latch_data;
uint8_t m_alpha_tile_bank; uint8_t m_alpha_tile_bank;

View File

@ -14,11 +14,12 @@
#include "audio/atarijsa.h" #include "audio/atarijsa.h"
#include "video/atarimo.h" #include "video/atarimo.h"
class offtwall_state : public atarigen_state class offtwall_state : public driver_device
{ {
public: public:
offtwall_state(const machine_config &mconfig, device_type type, const char *tag) : offtwall_state(const machine_config &mconfig, device_type type, const char *tag) :
atarigen_state(mconfig, type, tag), driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_jsa(*this, "jsa"), m_jsa(*this, "jsa"),
m_vad(*this, "vad"), m_vad(*this, "vad"),
m_mainram(*this, "mainram"), m_mainram(*this, "mainram"),
@ -31,7 +32,6 @@ public:
void offtwall(machine_config &config); void offtwall(machine_config &config);
protected: protected:
virtual void update_interrupts() override;
DECLARE_WRITE16_MEMBER(io_latch_w); DECLARE_WRITE16_MEMBER(io_latch_w);
DECLARE_READ16_MEMBER(bankswitch_r); DECLARE_READ16_MEMBER(bankswitch_r);
DECLARE_READ16_MEMBER(bankrom_r); DECLARE_READ16_MEMBER(bankrom_r);
@ -42,6 +42,7 @@ protected:
void main_map(address_map &map); void main_map(address_map &map);
private: private:
required_device<cpu_device> m_maincpu;
required_device<atari_jsa_iii_device> m_jsa; required_device<atari_jsa_iii_device> m_jsa;
required_device<atari_vad_device> m_vad; required_device<atari_vad_device> m_vad;
required_shared_ptr<uint16_t> m_mainram; required_shared_ptr<uint16_t> m_mainram;