thunderj: Decouple from atarigen_state (nw)

This commit is contained in:
AJR 2018-04-03 18:52:53 -04:00
parent bc2acfcb76
commit 85c5f68c53
2 changed files with 11 additions and 10 deletions

View File

@ -51,16 +51,15 @@
* *
*************************************/ *************************************/
void thunderj_state::update_interrupts() WRITE_LINE_MEMBER(thunderj_state::scanline_int_write_line)
{ {
m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_4, state ? ASSERT_LINE : CLEAR_LINE);
m_extra->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); m_extra->set_input_line(M68K_IRQ_4, state ? ASSERT_LINE : CLEAR_LINE);
} }
void thunderj_state::machine_start() void thunderj_state::machine_start()
{ {
atarigen_state::machine_start();
save_item(NAME(m_alpha_tile_bank)); save_item(NAME(m_alpha_tile_bank));
} }
@ -123,7 +122,7 @@ void thunderj_state::main_map(address_map &map)
map(0x360010, 0x360011).w(this, FUNC(thunderj_state::latch_w)); map(0x360010, 0x360011).w(this, FUNC(thunderj_state::latch_w));
map(0x360020, 0x360021).w(m_jsa, FUNC(atari_jsa_ii_device::sound_reset_w)); map(0x360020, 0x360021).w(m_jsa, FUNC(atari_jsa_ii_device::sound_reset_w));
map(0x360031, 0x360031).w(m_jsa, FUNC(atari_jsa_ii_device::main_command_w)); map(0x360031, 0x360031).w(m_jsa, FUNC(atari_jsa_ii_device::main_command_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(0x3f0000, 0x3f1fff).ram().w(m_vad, FUNC(atari_vad_device::playfield2_latched_msb_w)).share("vad:playfield2"); map(0x3f0000, 0x3f1fff).ram().w(m_vad, FUNC(atari_vad_device::playfield2_latched_msb_w)).share("vad:playfield2");
map(0x3f2000, 0x3f3fff).ram().w(m_vad, FUNC(atari_vad_device::playfield_latched_lsb_w)).share("vad:playfield"); map(0x3f2000, 0x3f3fff).ram().w(m_vad, FUNC(atari_vad_device::playfield_latched_lsb_w)).share("vad:playfield");
@ -152,7 +151,6 @@ void thunderj_state::extra_map(address_map &map)
map(0x260010, 0x260011).portr("260010"); map(0x260010, 0x260011).portr("260010");
map(0x260012, 0x260013).r(this, FUNC(thunderj_state::special_port2_r)); map(0x260012, 0x260013).r(this, FUNC(thunderj_state::special_port2_r));
map(0x260031, 0x260031).r(m_jsa, FUNC(atari_jsa_ii_device::main_response_r)); map(0x260031, 0x260031).r(m_jsa, FUNC(atari_jsa_ii_device::main_response_r));
map(0x360000, 0x360001).w(this, FUNC(thunderj_state::video_int_ack_w));
map(0x360010, 0x360011).w(this, FUNC(thunderj_state::latch_w)); map(0x360010, 0x360011).w(this, FUNC(thunderj_state::latch_w));
map(0x360020, 0x360021).w(m_jsa, FUNC(atari_jsa_ii_device::sound_reset_w)); map(0x360020, 0x360021).w(m_jsa, FUNC(atari_jsa_ii_device::sound_reset_w));
map(0x360031, 0x360031).w(m_jsa, FUNC(atari_jsa_ii_device::main_command_w)); map(0x360031, 0x360031).w(m_jsa, FUNC(atari_jsa_ii_device::main_command_w));

View File

@ -10,19 +10,20 @@
#pragma once #pragma once
#include "machine/atarigen.h"
#include "audio/atarijsa.h" #include "audio/atarijsa.h"
#include "video/atarimo.h" #include "video/atarimo.h"
#include "video/atarivad.h" #include "video/atarivad.h"
#include "screen.h" #include "screen.h"
class thunderj_state : public atarigen_state class thunderj_state : public driver_device
{ {
public: public:
thunderj_state(const machine_config &mconfig, device_type type, const char *tag) : thunderj_state(const machine_config &mconfig, device_type type, const char *tag) :
atarigen_state(mconfig, type, tag), driver_device(mconfig, type, tag),
m_screen(*this, "screen"),
m_jsa(*this, "jsa"), m_jsa(*this, "jsa"),
m_vad(*this, "vad"), m_vad(*this, "vad"),
m_maincpu(*this, "maincpu"),
m_extra(*this, "extra") m_extra(*this, "extra")
{ } { }
@ -31,7 +32,7 @@ public:
protected: protected:
virtual void machine_start() override; virtual void machine_start() override;
virtual void update_interrupts() override; DECLARE_WRITE_LINE_MEMBER(scanline_int_write_line);
DECLARE_READ16_MEMBER(special_port2_r); DECLARE_READ16_MEMBER(special_port2_r);
DECLARE_WRITE16_MEMBER(latch_w); DECLARE_WRITE16_MEMBER(latch_w);
TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_alpha_tile_info);
@ -43,8 +44,10 @@ protected:
void main_map(address_map &map); void main_map(address_map &map);
private: private:
required_device<screen_device> m_screen;
required_device<atari_jsa_ii_device> m_jsa; required_device<atari_jsa_ii_device> m_jsa;
required_device<atari_vad_device> m_vad; required_device<atari_vad_device> m_vad;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_extra; required_device<cpu_device> m_extra;
uint8_t m_alpha_tile_bank; uint8_t m_alpha_tile_bank;