mirror of
https://github.com/holub/mame
synced 2025-04-16 13:34:55 +03:00
atarisy1.cpp, atarisy2.cpp, gauntlet.cpp: Modernization
- Use generic latch devices for sound communications - More accurate handling of programmed sound resets - Add the other LS259 to gauntlet.cpp - Correct watchdog timeouts for all three drivers - General code cleanup atarigen: Eliminate ATARI_CLOCK_xxxMHz macros in favor of standard XTAL constants (nw) atariscom: Separate source file from atarigen.cpp; move IRQ handling to atarijsa (not a property of the actual device) (nw)
This commit is contained in:
parent
1e3ae4ac51
commit
15386236cf
@ -1358,6 +1358,8 @@ files {
|
||||
MAME_DIR .. "src/mame/machine/asic65.h",
|
||||
MAME_DIR .. "src/mame/machine/atarigen.cpp",
|
||||
MAME_DIR .. "src/mame/machine/atarigen.h",
|
||||
MAME_DIR .. "src/mame/machine/atariscom.cpp",
|
||||
MAME_DIR .. "src/mame/machine/atariscom.h",
|
||||
MAME_DIR .. "src/mame/machine/mathbox.cpp",
|
||||
MAME_DIR .. "src/mame/machine/mathbox.h",
|
||||
MAME_DIR .. "src/mame/machine/slapstic.cpp",
|
||||
|
@ -102,7 +102,7 @@ void atari_jsa_i_device::atarijsa1_map(address_map &map)
|
||||
map(0x2800, 0x2800).mirror(0x01f9); // N/C
|
||||
map(0x2802, 0x2802).mirror(0x01f9).r(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r)); // /RDP
|
||||
map(0x2804, 0x2804).mirror(0x01f9).r(FUNC(atari_jsa_i_device::rdio_r)); // /RDIO
|
||||
map(0x2806, 0x2806).mirror(0x01f9).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_irq_ack_r), FUNC(atari_sound_comm_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2806, 0x2806).mirror(0x01f9).rw(FUNC(atari_jsa_i_device::sound_irq_ack_r), FUNC(atari_jsa_i_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2a00, 0x2a00).mirror(0x01f9).w(FUNC(atari_jsa_i_device::tms5220_voice)); // /VOICE
|
||||
map(0x2a02, 0x2a02).mirror(0x01f9).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_response_w)); // /WRP
|
||||
map(0x2a04, 0x2a04).mirror(0x01f9).w(FUNC(atari_jsa_i_device::wrio_w)); // /WRIO
|
||||
@ -120,7 +120,7 @@ void atari_jsa_ii_device::atarijsa2_map(address_map &map)
|
||||
map(0x2800, 0x2800).mirror(0x01f9).r(FUNC(atari_jsa_ii_device::oki_r)); // /RDV
|
||||
map(0x2802, 0x2802).mirror(0x01f9).r(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r)); // /RDP
|
||||
map(0x2804, 0x2804).mirror(0x01f9).r(FUNC(atari_jsa_ii_device::rdio_r)); // /RDIO
|
||||
map(0x2806, 0x2806).mirror(0x01f9).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_irq_ack_r), FUNC(atari_sound_comm_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2806, 0x2806).mirror(0x01f9).rw(FUNC(atari_jsa_ii_device::sound_irq_ack_r), FUNC(atari_jsa_ii_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2a00, 0x2a00).mirror(0x01f9).w(FUNC(atari_jsa_ii_device::oki_w)); // /WRV
|
||||
map(0x2a02, 0x2a02).mirror(0x01f9).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_response_w)); // /WRP
|
||||
map(0x2a04, 0x2a04).mirror(0x01f9).w(FUNC(atari_jsa_ii_device::wrio_w)); // /WRIO
|
||||
@ -138,7 +138,7 @@ void atari_jsa_iii_device::atarijsa3_map(address_map &map)
|
||||
map(0x2800, 0x2801).mirror(0x05f8).rw(FUNC(atari_jsa_iii_device::oki_r), FUNC(atari_jsa_iii_device::overall_volume_w)); // /RDV
|
||||
map(0x2802, 0x2802).mirror(0x05f9).r(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r)); // /RDP
|
||||
map(0x2804, 0x2804).mirror(0x05f9).r(FUNC(atari_jsa_iii_device::rdio_r)); // /RDIO
|
||||
map(0x2806, 0x2806).mirror(0x05f9).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_irq_ack_r), FUNC(atari_sound_comm_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2806, 0x2806).mirror(0x05f9).rw(FUNC(atari_jsa_iii_device::sound_irq_ack_r), FUNC(atari_jsa_iii_device::sound_irq_ack_w)); // R/W=/IRQACK
|
||||
map(0x2a00, 0x2a01).mirror(0x05f8).w(FUNC(atari_jsa_iii_device::oki_w)); // /WRV
|
||||
map(0x2a02, 0x2a02).mirror(0x05f9).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_response_w)); // /WRP
|
||||
map(0x2a04, 0x2a04).mirror(0x05f9).w(FUNC(atari_jsa_iii_device::wrio_w)); // /WRIO
|
||||
@ -222,6 +222,8 @@ atari_jsa_base_device::atari_jsa_base_device(const machine_config &mconfig, devi
|
||||
m_cpu_bank(*this, "cpubank"),
|
||||
m_test_read_cb(*this),
|
||||
m_main_int_cb(*this),
|
||||
m_timed_int(false),
|
||||
m_ym2151_int(false),
|
||||
m_ym2151_volume(1.0),
|
||||
m_ym2151_ct1(0),
|
||||
m_ym2151_ct2(0)
|
||||
@ -243,6 +245,8 @@ void atari_jsa_base_device::device_start()
|
||||
m_main_int_cb.resolve_safe();
|
||||
|
||||
// save states
|
||||
save_item(NAME(m_timed_int));
|
||||
save_item(NAME(m_ym2151_int));
|
||||
save_item(NAME(m_ym2151_volume));
|
||||
save_item(NAME(m_ym2151_ct1));
|
||||
save_item(NAME(m_ym2151_ct2));
|
||||
@ -324,12 +328,76 @@ READ_LINE_MEMBER(atari_jsa_base_device::main_test_read_line)
|
||||
// from the comm device to the owning callback
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( atari_jsa_base_device::main_int_write_line )
|
||||
WRITE_LINE_MEMBER(atari_jsa_base_device::main_int_write_line)
|
||||
{
|
||||
m_main_int_cb(state);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_irq_gen: Generates an IRQ signal to the
|
||||
// 6502 sound processor.
|
||||
//-------------------------------------------------
|
||||
|
||||
INTERRUPT_GEN_MEMBER(atari_jsa_base_device::sound_irq_gen)
|
||||
{
|
||||
m_timed_int = 1;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_irq_ack_r: Resets the IRQ signal to the
|
||||
// 6502 sound processor. Both reads and writes
|
||||
// can be used.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_jsa_base_device::sound_irq_ack_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_timed_int = 0;
|
||||
update_sound_irq();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void atari_jsa_base_device::sound_irq_ack_w(u8 data)
|
||||
{
|
||||
m_timed_int = 0;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ym2151_irq_gen: Sets the state of the
|
||||
// YM2151's IRQ line.
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER(atari_jsa_base_device::ym2151_irq_gen)
|
||||
{
|
||||
m_ym2151_int = state;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// update_sound_irq: Called whenever the IRQ state
|
||||
// changes. An interrupt is generated if either
|
||||
// sound_irq_gen() was called, or if the YM2151
|
||||
// generated an interrupt via the
|
||||
// ym2151_irq_gen() callback.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_jsa_base_device::update_sound_irq()
|
||||
{
|
||||
if (m_timed_int || m_ym2151_int)
|
||||
m_jsacpu->set_input_line(m6502_device::IRQ_LINE, ASSERT_LINE);
|
||||
else
|
||||
m_jsacpu->set_input_line(m6502_device::IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// BASE DEVICE CLASS FOR OKI6295-BASED VERSIONS
|
||||
@ -703,14 +771,14 @@ void atari_jsa_i_device::device_add_mconfig(machine_config &config)
|
||||
// basic machine hardware
|
||||
M6502(config, m_jsacpu, JSA_MASTER_CLOCK/2);
|
||||
m_jsacpu->set_addrmap(AS_PROGRAM, &atari_jsa_i_device::atarijsa1_map);
|
||||
m_jsacpu->set_periodic_int("soundcomm", FUNC(atari_sound_comm_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
m_jsacpu->set_periodic_int(FUNC(atari_jsa_i_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
|
||||
// sound hardware
|
||||
ATARI_SOUND_COMM(config, m_soundcomm, m_jsacpu)
|
||||
.int_callback().set(FUNC(atari_jsa_base_device::main_int_write_line));
|
||||
|
||||
YM2151(config, m_ym2151, JSA_MASTER_CLOCK);
|
||||
m_ym2151->irq_handler().set(m_soundcomm, FUNC(atari_sound_comm_device::ym2151_irq_gen));
|
||||
m_ym2151->irq_handler().set(FUNC(atari_jsa_i_device::ym2151_irq_gen));
|
||||
m_ym2151->port_write_handler().set(FUNC(atari_jsa_base_device::ym2151_port_w));
|
||||
m_ym2151->add_route(0, *this, 0.60, AUTO_ALLOC_INPUT, 0);
|
||||
m_ym2151->add_route(1, *this, 0.60, AUTO_ALLOC_INPUT, 1);
|
||||
@ -834,14 +902,14 @@ void atari_jsa_ii_device::device_add_mconfig(machine_config &config)
|
||||
// basic machine hardware
|
||||
M6502(config, m_jsacpu, JSA_MASTER_CLOCK/2);
|
||||
m_jsacpu->set_addrmap(AS_PROGRAM, &atari_jsa_ii_device::atarijsa2_map);
|
||||
m_jsacpu->set_periodic_int("soundcomm", FUNC(atari_sound_comm_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
m_jsacpu->set_periodic_int(FUNC(atari_jsa_ii_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
|
||||
// sound hardware
|
||||
ATARI_SOUND_COMM(config, m_soundcomm, m_jsacpu)
|
||||
.int_callback().set(FUNC(atari_jsa_base_device::main_int_write_line));
|
||||
|
||||
YM2151(config, m_ym2151, JSA_MASTER_CLOCK);
|
||||
m_ym2151->irq_handler().set(m_soundcomm, FUNC(atari_sound_comm_device::ym2151_irq_gen));
|
||||
m_ym2151->irq_handler().set(FUNC(atari_jsa_ii_device::ym2151_irq_gen));
|
||||
m_ym2151->port_write_handler().set(FUNC(atari_jsa_base_device::ym2151_port_w));
|
||||
m_ym2151->add_route(ALL_OUTPUTS, *this, 0.60, AUTO_ALLOC_INPUT, 0);
|
||||
|
||||
@ -917,14 +985,14 @@ void atari_jsa_iii_device::device_add_mconfig(machine_config &config)
|
||||
// basic machine hardware
|
||||
M6502(config, m_jsacpu, JSA_MASTER_CLOCK/2);
|
||||
m_jsacpu->set_addrmap(AS_PROGRAM, &atari_jsa_iii_device::atarijsa3_map);
|
||||
m_jsacpu->set_periodic_int("soundcomm", FUNC(atari_sound_comm_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
m_jsacpu->set_periodic_int(FUNC(atari_jsa_iii_device::sound_irq_gen), attotime::from_hz(JSA_MASTER_CLOCK/4/16/16/14));
|
||||
|
||||
// sound hardware
|
||||
ATARI_SOUND_COMM(config, m_soundcomm, m_jsacpu)
|
||||
.int_callback().set(FUNC(atari_jsa_base_device::main_int_write_line));
|
||||
|
||||
YM2151(config, m_ym2151, JSA_MASTER_CLOCK);
|
||||
m_ym2151->irq_handler().set(m_soundcomm, FUNC(atari_sound_comm_device::ym2151_irq_gen));
|
||||
m_ym2151->irq_handler().set(FUNC(atari_jsa_iii_device::ym2151_irq_gen));
|
||||
m_ym2151->port_write_handler().set(FUNC(atari_jsa_base_device::ym2151_port_w));
|
||||
m_ym2151->add_route(ALL_OUTPUTS, *this, 0.60, AUTO_ALLOC_INPUT, 0);
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "sound/ym2151.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "sound/pokey.h"
|
||||
#include "machine/atarigen.h"
|
||||
#include "machine/atariscom.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -78,6 +78,12 @@ public:
|
||||
// I/O lines
|
||||
DECLARE_WRITE_LINE_MEMBER(main_int_write_line);
|
||||
|
||||
// 6502 interrupt handlers
|
||||
INTERRUPT_GEN_MEMBER(sound_irq_gen);
|
||||
void sound_irq_ack_w(u8 data = 0);
|
||||
u8 sound_irq_ack_r();
|
||||
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -85,6 +91,7 @@ protected:
|
||||
|
||||
// internal helpers
|
||||
virtual void update_all_volumes() = 0;
|
||||
void update_sound_irq();
|
||||
|
||||
// devices
|
||||
required_device<atari_sound_comm_device> m_soundcomm;
|
||||
@ -102,9 +109,11 @@ protected:
|
||||
devcb_write_line m_main_int_cb;
|
||||
|
||||
// internal state
|
||||
bool m_timed_int;
|
||||
bool m_ym2151_int;
|
||||
double m_ym2151_volume;
|
||||
uint8_t m_ym2151_ct1;
|
||||
uint8_t m_ym2151_ct2;
|
||||
uint8_t m_ym2151_ct1;
|
||||
uint8_t m_ym2151_ct2;
|
||||
};
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ void atari_sac_device::sac_6502_map(address_map &map)
|
||||
map(0x0000, 0x1fff).ram();
|
||||
map(0x2000, 0x2001).mirror(0x7fe).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write));
|
||||
map(0x2800, 0x2800).mirror(0x3f9).w(m_datin, FUNC(generic_latch_8_device::write));
|
||||
map(0x2802, 0x2802).mirror(0x3f9).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_irq_ack_r), FUNC(atari_sound_comm_device::sound_irq_ack_w));
|
||||
map(0x2802, 0x2802).mirror(0x3f9).rw(FUNC(atari_sac_device::sound_irq_ack_r), FUNC(atari_sac_device::sound_irq_ack_w));
|
||||
map(0x2804, 0x2804).mirror(0x3f9).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_response_w));
|
||||
map(0x2806, 0x2806).mirror(0x3f9).w(FUNC(atari_sac_device::wrio_w));
|
||||
map(0x2c00, 0x2c00).mirror(0x3f9).r(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r));
|
||||
@ -246,7 +246,7 @@ void atari_sac_device::device_add_mconfig(machine_config &config)
|
||||
// basic machine hardware
|
||||
M6502(config, m_jsacpu, 14.318181_MHz_XTAL/8);
|
||||
m_jsacpu->set_addrmap(AS_PROGRAM, &atari_sac_device::sac_6502_map);
|
||||
m_jsacpu->set_periodic_int("soundcomm", FUNC(atari_sound_comm_device::sound_irq_gen), attotime::from_hz(14.318181_MHz_XTAL/4/4/16/16/14));
|
||||
m_jsacpu->set_periodic_int(FUNC(atari_sac_device::sound_irq_gen), attotime::from_hz(14.318181_MHz_XTAL/4/4/16/16/14));
|
||||
|
||||
M68000(config, m_daccpu, 14.318181_MHz_XTAL/2);
|
||||
m_daccpu->set_addrmap(AS_PROGRAM, &atari_sac_device::sac_68k_map);
|
||||
@ -264,7 +264,7 @@ void atari_sac_device::device_add_mconfig(machine_config &config)
|
||||
.int_callback().set(FUNC(atari_sac_device::main_int_write_line));
|
||||
|
||||
YM2151(config, m_ym2151, 14.318181_MHz_XTAL/4);
|
||||
m_ym2151->irq_handler().set(m_soundcomm, FUNC(atari_sound_comm_device::ym2151_irq_gen));
|
||||
m_ym2151->irq_handler().set(FUNC(atari_sac_device::ym2151_irq_gen));
|
||||
m_ym2151->port_write_handler().set(FUNC(atari_sac_device::ym2151_port_w));
|
||||
m_ym2151->add_route(0, *this, 0.60, AUTO_ALLOC_INPUT, 0);
|
||||
m_ym2151->add_route(1, *this, 0.60, AUTO_ALLOC_INPUT, 1);
|
||||
|
@ -388,7 +388,7 @@ static const atari_rle_objects_config modesc_pitfight =
|
||||
void atarig1_state::atarig1(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &atarig1_state::main_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -408,7 +408,7 @@ void atarig1_state::atarig1(machine_config &config)
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(atarig1_state::screen_update_atarig1));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_1, ASSERT_LINE);
|
||||
@ -429,7 +429,7 @@ void atarig1_state::hydrap(machine_config &config)
|
||||
{
|
||||
atarig1(config);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16);
|
||||
m_adc->in_callback<0>().set_ioport("ADC0");
|
||||
m_adc->in_callback<1>().set_ioport("ADC1");
|
||||
m_adc->in_callback<2>().set_ioport("ADC2");
|
||||
|
@ -513,7 +513,7 @@ static const atari_rle_objects_config modesc_0x400 =
|
||||
void atarig42_state::atarig42(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &atarig42_state::main_map);
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(atarig42_state::scanline_update), m_screen, 0, 8);
|
||||
@ -535,7 +535,7 @@ void atarig42_state::atarig42(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(atarig42_state::screen_update_atarig42));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
@ -556,7 +556,7 @@ void atarig42_0x200_state::atarig42_0x200(machine_config &config)
|
||||
atarig42(config);
|
||||
ATARI_RLE_OBJECTS(config, m_rle, 0, modesc_0x200);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz / 16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL / 16);
|
||||
m_adc->in_callback<0>().set_ioport("A2D0");
|
||||
m_adc->in_callback<1>().set_ioport("A2D1");
|
||||
|
||||
|
@ -833,7 +833,7 @@ static const atari_rle_objects_config modesc =
|
||||
void atarigt_state::atarigt(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68EC020(config, m_maincpu, ATARI_CLOCK_50MHz/2);
|
||||
M68EC020(config, m_maincpu, 50_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &atarigt_state::main_map);
|
||||
m_maincpu->set_periodic_int(FUNC(atarigt_state::scanline_int_gen), attotime::from_hz(250));
|
||||
|
||||
@ -854,7 +854,7 @@ void atarigt_state::atarigt(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a pair of GALs to determine H and V parameters */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(atarigt_state::screen_update_atarigt));
|
||||
m_screen->screen_vblank().set(FUNC(atarigt_state::video_int_write_line));
|
||||
|
||||
@ -871,7 +871,7 @@ void atarigt_state::tmek(machine_config &config)
|
||||
{
|
||||
atarigt(config);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16); // should be 447 kHz according to schematics, but that fails the self-test
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16); // should be 447 kHz according to schematics, but that fails the self-test
|
||||
m_adc->in_callback<2>().set_ioport("AN4");
|
||||
m_adc->in_callback<3>().set_ioport("AN1");
|
||||
m_adc->in_callback<6>().set_ioport("AN2");
|
||||
|
@ -1485,12 +1485,12 @@ static const atari_rle_objects_config modesc_0x400 =
|
||||
void atarigx2_state::atarigx2(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68EC020(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
M68EC020(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &atarigx2_state::main_map);
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(atarigx2_state::scanline_update), m_screen, 0, 8);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16);
|
||||
m_adc->in_callback<0>().set_ioport("A2D0");
|
||||
m_adc->in_callback<1>().set_ioport("A2D1");
|
||||
m_adc->in_callback<2>().set_ioport("A2D2");
|
||||
@ -1515,7 +1515,7 @@ void atarigx2_state::atarigx2(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a pair of GALs to determine H and V parameters */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(atarigx2_state::screen_update_atarigx2));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
|
@ -194,7 +194,6 @@ RoadBlasters (aka Future Vette):005*
|
||||
#include "includes/atarisy1.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "machine/6522via.h"
|
||||
#include "machine/eeprompar.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/pokey.h"
|
||||
@ -210,22 +209,24 @@ RoadBlasters (aka Future Vette):005*
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void atarisy1_state::video_int_ack_w(uint16_t data)
|
||||
void atarisy1_state::video_int_ack_w(uint8_t data)
|
||||
{
|
||||
m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
MACHINE_START_MEMBER(atarisy1_state,atarisy1)
|
||||
void atarisy1_state::machine_start()
|
||||
{
|
||||
atarigen_state::machine_start();
|
||||
}
|
||||
|
||||
|
||||
MACHINE_RESET_MEMBER(atarisy1_state,atarisy1)
|
||||
void atarisy1_state::machine_reset()
|
||||
{
|
||||
atarigen_state::machine_reset();
|
||||
|
||||
bankselect_w(0);
|
||||
|
||||
if (m_adc.found())
|
||||
m_ajsint->in_w<0>(0);
|
||||
}
|
||||
@ -238,13 +239,13 @@ MACHINE_RESET_MEMBER(atarisy1_state,atarisy1)
|
||||
*************************************/
|
||||
|
||||
template<int Input>
|
||||
READ8_MEMBER(atarisy1_state::digital_joystick_r)
|
||||
uint8_t atarisy1_state::digital_joystick_r()
|
||||
{
|
||||
return BIT(ioport("IN0")->read(), 7 - Input) ? 0xf0 : 0x00;
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(atarisy1_state::adc_r)
|
||||
uint8_t atarisy1_state::adc_r(offs_t offset)
|
||||
{
|
||||
if (!m_adc.found())
|
||||
return 0xff;
|
||||
@ -252,13 +253,13 @@ READ8_MEMBER(atarisy1_state::adc_r)
|
||||
int value = m_adc->data_r();
|
||||
|
||||
if (!machine().side_effects_disabled())
|
||||
adc_w(space, offset, 0);
|
||||
adc_w(offset, 0);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(atarisy1_state::adc_w)
|
||||
void atarisy1_state::adc_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (!m_adc.found())
|
||||
return;
|
||||
@ -277,7 +278,7 @@ WRITE8_MEMBER(atarisy1_state::adc_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ16_MEMBER(atarisy1_state::trakball_r)
|
||||
uint16_t atarisy1_state::trakball_r(offs_t offset)
|
||||
{
|
||||
int result = 0xff;
|
||||
|
||||
@ -325,7 +326,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(atarisy1_state::switch_6502_r)
|
||||
uint8_t atarisy1_state::switch_6502_r()
|
||||
{
|
||||
int temp = ioport("1820")->read();
|
||||
if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
|
||||
@ -355,33 +356,21 @@ READ8_MEMBER(atarisy1_state::switch_6502_r)
|
||||
* D5 = LED (out)
|
||||
*/
|
||||
|
||||
WRITE8_MEMBER(atarisy1_state::via_pa_w)
|
||||
void atarisy1_state::via_pb_w(uint8_t data)
|
||||
{
|
||||
m_tms->data_w(data);
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(atarisy1_state::via_pa_r)
|
||||
{
|
||||
return m_tms->status_r();
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(atarisy1_state::via_pb_w)
|
||||
{
|
||||
/* write strobe */
|
||||
// write strobe
|
||||
m_tms->wsq_w(data & 1);
|
||||
|
||||
/* read strobe */
|
||||
// read strobe
|
||||
m_tms->rsq_w((data & 2)>>1);
|
||||
|
||||
/* bit 4 is connected to an up-counter, clocked by SYCLKB */
|
||||
// bit 4 is connected to an up-counter, clocked by SYCLKB
|
||||
data = 5 | ((data >> 3) & 2);
|
||||
m_tms->set_unscaled_clock(ATARI_CLOCK_14MHz/2 / (16 - data));
|
||||
m_tms->set_unscaled_clock(14.318181_MHz_XTAL/2 / (16 - data));
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(atarisy1_state::via_pb_r)
|
||||
uint8_t atarisy1_state::via_pb_r()
|
||||
{
|
||||
return (m_tms->readyq_r() << 2) | (m_tms->intq_r() << 3);
|
||||
}
|
||||
@ -416,16 +405,16 @@ WRITE_LINE_MEMBER(atarisy1_state::coin_counter_left_w)
|
||||
void atarisy1_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x000000, 0x07ffff).rom();
|
||||
map(0x080000, 0x087fff).rom(); /* slapstic maps here */
|
||||
map(0x080000, 0x087fff).rom(); // slapstic maps here
|
||||
map(0x2e0000, 0x2e0001).r(FUNC(atarisy1_state::atarisy1_int3state_r));
|
||||
map(0x400000, 0x401fff).ram();
|
||||
map(0x800000, 0x800001).w(FUNC(atarisy1_state::atarisy1_xscroll_w)).share("xscroll");
|
||||
map(0x820000, 0x820001).w(FUNC(atarisy1_state::atarisy1_yscroll_w)).share("yscroll");
|
||||
map(0x840000, 0x840001).w(FUNC(atarisy1_state::atarisy1_priority_w));
|
||||
map(0x860000, 0x860001).w(FUNC(atarisy1_state::atarisy1_bankselect_w)).share("bankselect");
|
||||
map(0x880000, 0x880001).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
|
||||
map(0x8a0000, 0x8a0001).w(FUNC(atarisy1_state::video_int_ack_w));
|
||||
map(0x8c0000, 0x8c0001).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16));
|
||||
map(0x860001, 0x860001).w(FUNC(atarisy1_state::bankselect_w));
|
||||
map(0x880001, 0x880001).w("watchdog", FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x8a0001, 0x8a0001).w(FUNC(atarisy1_state::video_int_ack_w));
|
||||
map(0x8c0001, 0x8c0001).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write8));
|
||||
map(0x900000, 0x9fffff).ram();
|
||||
map(0xa00000, 0xa01fff).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield");
|
||||
map(0xa02000, 0xa02fff).ram().w(FUNC(atarisy1_state::atarisy1_spriteram_w)).share("mob");
|
||||
@ -435,9 +424,9 @@ void atarisy1_state::main_map(address_map &map)
|
||||
map(0xf20000, 0xf20007).r(FUNC(atarisy1_state::trakball_r));
|
||||
map(0xf40000, 0xf4001f).rw(FUNC(atarisy1_state::adc_r), FUNC(atarisy1_state::adc_w)).umask16(0x00ff);
|
||||
map(0xf60000, 0xf60003).portr("F60000");
|
||||
map(0xf80001, 0xf80001).w(m_soundcomm, FUNC(atari_sound_comm_device::main_command_w)); /* used by roadbls2 */
|
||||
map(0xfc0001, 0xfc0001).r(m_soundcomm, FUNC(atari_sound_comm_device::main_response_r));
|
||||
map(0xfe0001, 0xfe0001).w(m_soundcomm, FUNC(atari_sound_comm_device::main_command_w));
|
||||
map(0xf80001, 0xf80001).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // used by roadbls2
|
||||
map(0xfc0001, 0xfc0001).r(m_mainlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0xfe0001, 0xfe0001).w(m_soundlatch, FUNC(generic_latch_8_device::write));
|
||||
}
|
||||
|
||||
|
||||
@ -450,13 +439,14 @@ void atarisy1_state::main_map(address_map &map)
|
||||
|
||||
void atarisy1_state::sound_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0fff).ram();
|
||||
map(0x1000, 0x100f).m("via6522_0", FUNC(via6522_device::map));
|
||||
map(0x1800, 0x1801).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
|
||||
map(0x1810, 0x1810).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r), FUNC(atari_sound_comm_device::sound_response_w));
|
||||
map(0x1820, 0x1820).r(FUNC(atarisy1_state::switch_6502_r));
|
||||
map(0x1820, 0x1827).w(m_outlatch, FUNC(ls259_device::write_d0));
|
||||
map(0x1870, 0x187f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
|
||||
map(0x0000, 0x0fff).mirror(0x2000).ram();
|
||||
map(0x1000, 0x100f).mirror(0x27f0).m(m_via, FUNC(via6522_device::map)); // SNDEXT
|
||||
map(0x1800, 0x1801).mirror(0x278e).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
|
||||
map(0x1810, 0x1810).mirror(0x278f).r(m_soundlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0x1810, 0x1810).mirror(0x278f).w(m_mainlatch, FUNC(generic_latch_8_device::write));
|
||||
map(0x1820, 0x1820).mirror(0x278f).r(FUNC(atarisy1_state::switch_6502_r));
|
||||
map(0x1820, 0x1827).mirror(0x2788).w(m_outlatch, FUNC(ls259_device::write_d0));
|
||||
map(0x1870, 0x187f).mirror(0x2780).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
|
||||
map(0x4000, 0xffff).rom();
|
||||
}
|
||||
|
||||
@ -469,19 +459,19 @@ void atarisy1_state::sound_map(address_map &map)
|
||||
*************************************/
|
||||
|
||||
static INPUT_PORTS_START( marble )
|
||||
PORT_START("IN0") /* F20000 */
|
||||
PORT_START("IN0") // F20000
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(1)
|
||||
|
||||
PORT_START("IN1") /* F20002 */
|
||||
PORT_START("IN1") // F20002
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("IN2") /* F20004 */
|
||||
PORT_START("IN2") // F20004
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(2)
|
||||
|
||||
PORT_START("IN3") /* F20006 */
|
||||
PORT_START("IN3") // F20006
|
||||
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("F60000") /* F60000 */
|
||||
PORT_START("F60000") // F60000
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -489,38 +479,38 @@ static INPUT_PORTS_START( marble )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("1820") /* 1820 (sound) */
|
||||
PORT_START("1820") // 1820 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( peterpak )
|
||||
PORT_START("IN0") /* F40000 */
|
||||
PORT_START("IN0") // F40000
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
|
||||
|
||||
PORT_START("IN1") /* n/a */
|
||||
PORT_START("IN1") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN2") /* n/a */
|
||||
PORT_START("IN2") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN3") /* n/a */
|
||||
PORT_START("IN3") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("F60000") /* F60000 */
|
||||
PORT_START("F60000") // F60000
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Throw/P1 Start")
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Throw/P2 Start")
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Jump")
|
||||
@ -528,54 +518,54 @@ static INPUT_PORTS_START( peterpak )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("1820") /* 1820 (sound) */
|
||||
PORT_START("1820") // 1820 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( indytemp )
|
||||
PORT_START("IN0") /* F40000 */
|
||||
PORT_START("IN0") // F40000
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
|
||||
|
||||
PORT_START("IN1") /* n/a */
|
||||
PORT_START("IN1") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN2") /* n/a */
|
||||
PORT_START("IN2") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN3") /* n/a */
|
||||
PORT_START("IN3") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("F60000") /* F60000 */
|
||||
PORT_START("F60000") // F60000
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Whip/P1 Start")
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Whip/P2 Start")
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* freeze? */
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) // freeze?
|
||||
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("1820") /* 1820 (sound) */
|
||||
PORT_START("1820") // 1820 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
|
||||
INPUT_PORTS_END
|
||||
@ -584,7 +574,7 @@ INPUT_PORTS_END
|
||||
static INPUT_PORTS_START( indytemc )
|
||||
PORT_INCLUDE( indytemp )
|
||||
|
||||
PORT_MODIFY("IN0") /* F40000 */
|
||||
PORT_MODIFY("IN0") // F40000
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
@ -594,20 +584,20 @@ INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( roadrunn )
|
||||
PORT_START("IN0") /* F40000 */
|
||||
PORT_START("IN0") // F40000
|
||||
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("IN1") /* F40002 */
|
||||
PORT_START("IN1") // F40002
|
||||
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
|
||||
|
||||
PORT_START("IN2") /* n/a */
|
||||
PORT_START("IN2") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN3") /* n/a */
|
||||
PORT_START("IN3") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("F60000") /* F60000 */
|
||||
/* Note that "P1 Button 1' and 'P2 Start' both act as "Hop' Buttons" in game" */
|
||||
PORT_START("F60000") // F60000
|
||||
// Note that "P1 Button 1' and 'P2 Start' both act as "Hop' Buttons" in game"
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Left Hop/P1 Start")
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Right Hop/P2 Start")
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -615,34 +605,34 @@ static INPUT_PORTS_START( roadrunn )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("1820") /* 1820 (sound) */
|
||||
PORT_START("1820") // 1820 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( roadblst )
|
||||
PORT_START("IN0") /* F20000 */
|
||||
PORT_START("IN0") // F20000
|
||||
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE
|
||||
|
||||
PORT_START("IN1") /* F40000 */
|
||||
PORT_START("IN1") // F40000
|
||||
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(64)
|
||||
|
||||
PORT_START("IN2") /* n/a */
|
||||
PORT_START("IN2") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN3") /* n/a */
|
||||
PORT_START("IN3") // n/a
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("F60000") /* F60000 */
|
||||
PORT_START("F60000") // F60000
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Special Weapon")
|
||||
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lasers")
|
||||
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -650,15 +640,15 @@ static INPUT_PORTS_START( roadblst )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("1820") /* 1820 (sound) */
|
||||
PORT_START("1820") // 1820 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM )
|
||||
INPUT_PORTS_END
|
||||
@ -697,7 +687,7 @@ GFXDECODE_END
|
||||
|
||||
void atarisy1_state::add_adc(machine_config &config)
|
||||
{
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16);
|
||||
m_adc->eoc_callback().set(m_ajsint, FUNC(input_merger_device::in_w<1>));
|
||||
// IN7 = J102 pin 2
|
||||
// IN6 = J102 pin 3
|
||||
@ -714,16 +704,13 @@ void atarisy1_state::add_adc(machine_config &config)
|
||||
|
||||
void atarisy1_state::atarisy1(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68010(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
// basic machine hardware
|
||||
M68010(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &atarisy1_state::main_map);
|
||||
|
||||
M6502(config, m_audiocpu, ATARI_CLOCK_14MHz/8);
|
||||
M6502(config, m_audiocpu, 14.318181_MHz_XTAL/8);
|
||||
m_audiocpu->set_addrmap(AS_PROGRAM, &atarisy1_state::sound_map);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(atarisy1_state,atarisy1)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(atarisy1_state,atarisy1)
|
||||
|
||||
EEPROM_2804(config, "eeprom").lock_after_write(true);
|
||||
|
||||
LS259(config, m_outlatch); // 15H (TTL) or 14F (LSI)
|
||||
@ -733,13 +720,13 @@ void atarisy1_state::atarisy1(machine_config &config)
|
||||
m_outlatch->q_out_cb<6>().set(FUNC(atarisy1_state::coin_counter_right_w));
|
||||
m_outlatch->q_out_cb<7>().set(FUNC(atarisy1_state::coin_counter_left_w));
|
||||
|
||||
WATCHDOG_TIMER(config, "watchdog");
|
||||
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8);
|
||||
|
||||
TIMER(config, m_scanline_timer).configure_generic(FUNC(atarisy1_state::atarisy1_int3_callback));
|
||||
TIMER(config, m_int3off_timer).configure_generic(FUNC(atarisy1_state::atarisy1_int3off_callback));
|
||||
TIMER(config, m_yscroll_reset_timer).configure_generic(FUNC(atarisy1_state::atarisy1_reset_yscroll_callback));
|
||||
TIMER(config, m_scanline_timer).configure_generic(FUNC(atarisy1_state::int3_callback));
|
||||
TIMER(config, m_int3off_timer).configure_generic(FUNC(atarisy1_state::int3off_callback));
|
||||
TIMER(config, m_yscroll_reset_timer).configure_generic(FUNC(atarisy1_state::reset_yscroll_callback));
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
GFXDECODE(config, m_gfxdecode, m_palette, gfx_atarisy1);
|
||||
|
||||
PALETTE(config, m_palette).set_format(palette_device::IRGB_4444, 1024);
|
||||
@ -752,40 +739,41 @@ void atarisy1_state::atarisy1(machine_config &config)
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* video timing comes from an 82S163 (H) and an 82S129 (V) */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
// note: these parameters are from published specs, not derived
|
||||
// video timing comes from an 82S163 (H) and an 82S129 (V)
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(atarisy1_state::screen_update_atarisy1));
|
||||
m_screen->set_palette(m_palette);
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(atarisy1_state,atarisy1)
|
||||
|
||||
/* sound hardware */
|
||||
ATARI_SOUND_COMM(config, "soundcomm", "audiocpu")
|
||||
.int_callback().set_inputline("maincpu", M68K_IRQ_6);
|
||||
// sound hardware
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
||||
ym2151_device &ymsnd(YM2151(config, "ymsnd", ATARI_CLOCK_14MHz/4));
|
||||
ymsnd.irq_handler().set(m_soundcomm, FUNC(atari_sound_comm_device::ym2151_irq_gen));
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
m_mainlatch->data_pending_callback().set_inputline(m_maincpu, M68K_IRQ_6);
|
||||
|
||||
ym2151_device &ymsnd(YM2151(config, "ymsnd", 14.318181_MHz_XTAL/4));
|
||||
ymsnd.irq_handler().set_inputline(m_audiocpu, m6502_device::IRQ_LINE);
|
||||
ymsnd.add_route(0, "lspeaker", 0.80);
|
||||
ymsnd.add_route(1, "rspeaker", 0.80);
|
||||
|
||||
pokey_device &pokey(POKEY(config, "pokey", ATARI_CLOCK_14MHz/8));
|
||||
pokey_device &pokey(POKEY(config, "pokey", 14.318181_MHz_XTAL/8));
|
||||
pokey.add_route(ALL_OUTPUTS, "lspeaker", 0.40);
|
||||
pokey.add_route(ALL_OUTPUTS, "rspeaker", 0.40);
|
||||
|
||||
TMS5220C(config, m_tms, ATARI_CLOCK_14MHz/2/11);
|
||||
TMS5220C(config, m_tms, 14.318181_MHz_XTAL/2/11);
|
||||
m_tms->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
|
||||
m_tms->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
|
||||
|
||||
/* via */
|
||||
via6522_device &via(VIA6522(config, "via6522_0", ATARI_CLOCK_14MHz/8));
|
||||
via.readpa_handler().set(FUNC(atarisy1_state::via_pa_r));
|
||||
via.readpb_handler().set(FUNC(atarisy1_state::via_pb_r));
|
||||
via.writepa_handler().set(FUNC(atarisy1_state::via_pa_w));
|
||||
via.writepb_handler().set(FUNC(atarisy1_state::via_pb_w));
|
||||
VIA6522(config, m_via, 14.318181_MHz_XTAL/8);
|
||||
m_via->readpa_handler().set(m_tms, FUNC(tms5220_device::status_r));
|
||||
m_via->readpb_handler().set(FUNC(atarisy1_state::via_pb_r));
|
||||
m_via->writepa_handler().set(m_tms, FUNC(tms5220_device::data_w));
|
||||
m_via->writepb_handler().set(FUNC(atarisy1_state::via_pb_w));
|
||||
}
|
||||
|
||||
void atarisy1_state::marble(machine_config &config)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -186,7 +186,7 @@ GFXDECODE_END
|
||||
void batman_state::batman(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &batman_state::main_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -208,7 +208,7 @@ void batman_state::batman(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a VAD chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(batman_state::screen_update_batman));
|
||||
m_screen->set_palette("palette");
|
||||
|
||||
|
@ -336,7 +336,7 @@ INPUT_PORTS_END
|
||||
void beathead_state::beathead(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
ASAP(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
ASAP(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &beathead_state::main_map);
|
||||
|
||||
EEPROM_2804(config, "eeprom").lock_after_write(true);
|
||||
|
@ -182,7 +182,7 @@ GFXDECODE_END
|
||||
void blstroid_state::blstroid(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &blstroid_state::main_map);
|
||||
|
||||
EEPROM_2804(config, "eeprom").lock_after_write(true);
|
||||
@ -205,7 +205,7 @@ void blstroid_state::blstroid(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz, 456*2, 0, 320*2, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL, 456*2, 0, 320*2, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(blstroid_state::screen_update_blstroid));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE);
|
||||
|
@ -341,10 +341,10 @@ GFXDECODE_END
|
||||
void cyberbal_state::cyberbal_base(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &cyberbal_state::main_map);
|
||||
|
||||
M68000(config, m_extracpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_extracpu, 14.318181_MHz_XTAL/2);
|
||||
m_extracpu->set_addrmap(AS_PROGRAM, &cyberbal_state::extra_map);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(600));
|
||||
@ -379,7 +379,7 @@ void cyberbal_state::cyberbal_base(machine_config &config)
|
||||
m_lscreen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_lscreen->set_raw(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_lscreen->set_raw(14.318181_MHz_XTAL, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_lscreen->set_screen_update(FUNC(cyberbal_state::screen_update_cyberbal_left));
|
||||
m_lscreen->set_palette("lpalette");
|
||||
m_lscreen->screen_vblank().set(FUNC(cyberbal_state::video_int_write_line)); /* or is it "right?" har, har! */
|
||||
@ -388,7 +388,7 @@ void cyberbal_state::cyberbal_base(machine_config &config)
|
||||
m_rscreen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_rscreen->set_raw(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_rscreen->set_raw(14.318181_MHz_XTAL, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_rscreen->set_screen_update(FUNC(cyberbal_state::screen_update_cyberbal_right));
|
||||
m_rscreen->set_palette("rpalette");
|
||||
|
||||
@ -421,7 +421,7 @@ void cyberbal_state::cyberbalt(machine_config &config)
|
||||
void cyberbal2p_state::cyberbal2p(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &cyberbal2p_state::cyberbal2p_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -446,7 +446,7 @@ void cyberbal2p_state::cyberbal2p(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(cyberbal2p_state::screen_update_cyberbal2p));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set(FUNC(cyberbal2p_state::video_int_write_line));
|
||||
|
@ -225,7 +225,7 @@ GFXDECODE_END
|
||||
void cybstorm_state::round2(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68EC020(config, m_maincpu, ATARI_CLOCK_14MHz);
|
||||
M68EC020(config, m_maincpu, 14.318181_MHz_XTAL);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &cybstorm_state::main_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -250,7 +250,7 @@ void cybstorm_state::round2(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(cybstorm_state::screen_update_cybstorm));
|
||||
}
|
||||
|
||||
|
@ -368,17 +368,17 @@ GFXDECODE_END
|
||||
void eprom_state::eprom(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &eprom_state::main_map);
|
||||
|
||||
M68000(config, m_extra, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_extra, 14.318181_MHz_XTAL/2);
|
||||
m_extra->set_addrmap(AS_PROGRAM, &eprom_state::extra_map);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(6000));
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(eprom_state::scanline_update), m_screen, 0, 8);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16);
|
||||
m_adc->in_callback<0>().set_ioport("ADC0");
|
||||
m_adc->in_callback<1>().set_ioport("ADC1");
|
||||
m_adc->in_callback<2>().set_ioport("ADC2");
|
||||
@ -402,7 +402,7 @@ void eprom_state::eprom(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(eprom_state::screen_update_eprom));
|
||||
m_screen->set_palette(m_palette);
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
@ -424,7 +424,7 @@ void eprom_state::eprom(machine_config &config)
|
||||
void eprom_state::klaxp(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &eprom_state::main_map);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(600));
|
||||
@ -449,7 +449,7 @@ void eprom_state::klaxp(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(eprom_state::screen_update_eprom));
|
||||
m_screen->set_palette(m_palette);
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
@ -469,14 +469,14 @@ void eprom_state::klaxp(machine_config &config)
|
||||
void eprom_state::guts(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &eprom_state::guts_map);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(600));
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(eprom_state::scanline_update), m_screen, 0, 8);
|
||||
|
||||
ADC0809(config, m_adc, ATARI_CLOCK_14MHz/16);
|
||||
ADC0809(config, m_adc, 14.318181_MHz_XTAL/16);
|
||||
m_adc->in_callback<0>().set_ioport("ADC0");
|
||||
m_adc->in_callback<1>().set_ioport("ADC1");
|
||||
m_adc->in_callback<2>().set_ioport("ADC2");
|
||||
@ -500,7 +500,7 @@ void eprom_state::guts(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(eprom_state::screen_update_guts));
|
||||
m_screen->set_palette(m_palette);
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
|
@ -148,26 +148,23 @@ void gauntlet_state::video_int_ack_w(uint16_t data)
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(gauntlet_state::scanline_update)
|
||||
{
|
||||
/* sound IRQ is on 32V */
|
||||
// sound IRQ is on 32V
|
||||
if (param & 32)
|
||||
m_soundcomm->sound_irq_gen(*m_audiocpu);
|
||||
else
|
||||
m_soundcomm->sound_irq_ack_w();
|
||||
m_audiocpu->set_input_line(m6502_device::IRQ_LINE, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
void gauntlet_state::machine_start()
|
||||
uint8_t gauntlet_state::sound_irq_ack_r()
|
||||
{
|
||||
atarigen_state::machine_start();
|
||||
save_item(NAME(m_sound_reset_val));
|
||||
if (!machine().side_effects_disabled())
|
||||
m_audiocpu->set_input_line(m6502_device::IRQ_LINE, CLEAR_LINE);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
|
||||
void gauntlet_state::machine_reset()
|
||||
void gauntlet_state::sound_irq_ack_w(uint8_t data)
|
||||
{
|
||||
m_sound_reset_val = 1;
|
||||
|
||||
atarigen_state::machine_reset();
|
||||
m_audiocpu->set_input_line(m6502_device::IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -178,25 +175,14 @@ void gauntlet_state::machine_reset()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE16_MEMBER(gauntlet_state::sound_reset_w)
|
||||
WRITE_LINE_MEMBER(gauntlet_state::sound_reset_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_soundctl->clear_w(state);
|
||||
if (!state)
|
||||
{
|
||||
int oldword = m_sound_reset_val;
|
||||
COMBINE_DATA(&m_sound_reset_val);
|
||||
|
||||
if ((oldword ^ m_sound_reset_val) & 1)
|
||||
{
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, (m_sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_soundctl->clear_w(m_sound_reset_val & 1);
|
||||
m_soundcomm->sound_cpu_reset();
|
||||
if (m_sound_reset_val & 1)
|
||||
{
|
||||
m_ym2151->set_output_gain(ALL_OUTPUTS, 0.0f);
|
||||
m_pokey->set_output_gain(ALL_OUTPUTS, 0.0f);
|
||||
m_tms5220->set_output_gain(ALL_OUTPUTS, 0.0f);
|
||||
}
|
||||
}
|
||||
m_mainlatch->acknowledge_w();
|
||||
mixer_w(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,12 +194,12 @@ WRITE16_MEMBER(gauntlet_state::sound_reset_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(gauntlet_state::switch_6502_r)
|
||||
uint8_t gauntlet_state::switch_6502_r()
|
||||
{
|
||||
int temp = 0x30;
|
||||
|
||||
if (m_soundcomm->main_to_sound_ready()) temp ^= 0x80;
|
||||
if (m_soundcomm->sound_to_main_ready()) temp ^= 0x40;
|
||||
if (m_soundlatch->pending_r()) temp ^= 0x80;
|
||||
if (m_mainlatch->pending_r()) temp ^= 0x40;
|
||||
if (!m_tms5220->readyq_r()) temp ^= 0x20;
|
||||
if (!(ioport("803008")->read() & 0x0008)) temp ^= 0x10;
|
||||
|
||||
@ -230,7 +216,7 @@ READ8_MEMBER(gauntlet_state::switch_6502_r)
|
||||
WRITE_LINE_MEMBER(gauntlet_state::speech_squeak_w)
|
||||
{
|
||||
uint8_t data = 5 | (state ? 2 : 0);
|
||||
m_tms5220->set_unscaled_clock(ATARI_CLOCK_14MHz/2 / (16 - data));
|
||||
m_tms5220->set_unscaled_clock(14.318181_MHz_XTAL/2 / (16 - data));
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(gauntlet_state::coin_counter_left_w)
|
||||
@ -253,7 +239,7 @@ WRITE_LINE_MEMBER(gauntlet_state::coin_counter_right_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(gauntlet_state::mixer_w)
|
||||
void gauntlet_state::mixer_w(uint8_t data)
|
||||
{
|
||||
m_ym2151->set_output_gain(ALL_OUTPUTS, (data & 7) / 7.0f);
|
||||
m_pokey->set_output_gain(ALL_OUTPUTS, ((data >> 3) & 3) / 3.0f);
|
||||
@ -268,15 +254,15 @@ WRITE8_MEMBER(gauntlet_state::mixer_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/* full map verified from schematics */
|
||||
// full map verified from schematics
|
||||
void gauntlet_state::main_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x000000, 0x037fff).mirror(0x280000).rom();
|
||||
map(0x038000, 0x03ffff).mirror(0x280000).rom(); /* slapstic maps here */
|
||||
map(0x038000, 0x03ffff).mirror(0x280000).rom(); // slapstic maps here
|
||||
map(0x040000, 0x07ffff).mirror(0x280000).rom();
|
||||
|
||||
/* MBUS */
|
||||
// MBUS
|
||||
map(0x800000, 0x801fff).mirror(0x2fc000).ram();
|
||||
map(0x802000, 0x802fff).mirror(0x2fc000).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask16(0x00ff);
|
||||
map(0x803000, 0x803001).mirror(0x2fcef0).portr("803000");
|
||||
@ -284,14 +270,14 @@ void gauntlet_state::main_map(address_map &map)
|
||||
map(0x803004, 0x803005).mirror(0x2fcef0).portr("803004");
|
||||
map(0x803006, 0x803007).mirror(0x2fcef0).portr("803006");
|
||||
map(0x803008, 0x803009).mirror(0x2fcef0).portr("803008");
|
||||
map(0x80300f, 0x80300f).mirror(0x2fcef0).r(m_soundcomm, FUNC(atari_sound_comm_device::main_response_r));
|
||||
map(0x80300f, 0x80300f).mirror(0x2fcef0).r(m_mainlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0x803100, 0x803101).mirror(0x2fce8e).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
|
||||
map(0x803120, 0x803121).mirror(0x2fce8e).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_reset_w));
|
||||
map(0x803120, 0x80312f).mirror(0x2fce80).w("outlatch", FUNC(ls259_device::write_d0)).umask16(0x00ff);
|
||||
map(0x803140, 0x803141).mirror(0x2fce8e).w(FUNC(gauntlet_state::video_int_ack_w));
|
||||
map(0x803150, 0x803151).mirror(0x2fce8e).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write16));
|
||||
map(0x803171, 0x803171).mirror(0x2fce8e).w(m_soundcomm, FUNC(atari_sound_comm_device::main_command_w));
|
||||
map(0x803171, 0x803171).mirror(0x2fce8e).w(m_soundlatch, FUNC(generic_latch_8_device::write));
|
||||
|
||||
/* VBUS */
|
||||
// VBUS
|
||||
map(0x900000, 0x901fff).mirror(0x2c8000).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield");
|
||||
map(0x902000, 0x903fff).mirror(0x2c8000).ram().share("mob");
|
||||
map(0x904000, 0x904fff).mirror(0x2c8000).ram();
|
||||
@ -310,20 +296,20 @@ void gauntlet_state::main_map(address_map &map)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/* full map verified from schematics */
|
||||
// full map verified from schematics
|
||||
void gauntlet_state::sound_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x0000, 0x0fff).mirror(0x2000).ram();
|
||||
map(0x1000, 0x100f).mirror(0x27c0).w(m_soundcomm, FUNC(atari_sound_comm_device::sound_response_w));
|
||||
map(0x1010, 0x101f).mirror(0x27c0).r(m_soundcomm, FUNC(atari_sound_comm_device::sound_command_r));
|
||||
map(0x1000, 0x100f).mirror(0x27c0).w(m_mainlatch, FUNC(generic_latch_8_device::write));
|
||||
map(0x1010, 0x101f).mirror(0x27c0).r(m_soundlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0x1020, 0x102f).mirror(0x27c0).portr("COIN").w(FUNC(gauntlet_state::mixer_w));
|
||||
map(0x1030, 0x1030).mirror(0x27cf).r(FUNC(gauntlet_state::switch_6502_r));
|
||||
map(0x1030, 0x1037).mirror(0x27c8).w(m_soundctl, FUNC(ls259_device::write_d7));
|
||||
map(0x1800, 0x180f).mirror(0x27c0).rw(m_pokey, FUNC(pokey_device::read), FUNC(pokey_device::write));
|
||||
map(0x1810, 0x1811).mirror(0x27ce).rw(m_ym2151, FUNC(ym2151_device::read), FUNC(ym2151_device::write));
|
||||
map(0x1820, 0x182f).mirror(0x27c0).w(m_tms5220, FUNC(tms5220_device::data_w));
|
||||
map(0x1830, 0x183f).mirror(0x27c0).rw(m_soundcomm, FUNC(atari_sound_comm_device::sound_irq_ack_r), FUNC(atari_sound_comm_device::sound_irq_ack_w));
|
||||
map(0x1830, 0x183f).mirror(0x27c0).rw(FUNC(gauntlet_state::sound_irq_ack_r), FUNC(gauntlet_state::sound_irq_ack_w));
|
||||
map(0x4000, 0xffff).rom();
|
||||
}
|
||||
|
||||
@ -379,12 +365,12 @@ static INPUT_PORTS_START( gauntlet )
|
||||
PORT_START("803008")
|
||||
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("COIN") /* 1020 (sound) */
|
||||
PORT_START("COIN") // 1020 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
@ -427,12 +413,12 @@ static INPUT_PORTS_START( vindctr2 )
|
||||
PORT_START("803008")
|
||||
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
|
||||
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("mainlatch", generic_latch_8_device, pending_r) // SNDBUF
|
||||
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) // 68KBUF
|
||||
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("COIN") /* 1020 (sound) */
|
||||
PORT_START("COIN") // 1020 (sound)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
@ -487,20 +473,27 @@ GFXDECODE_END
|
||||
|
||||
void gauntlet_state::gauntlet_base(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68010(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
// basic machine hardware
|
||||
M68010(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &gauntlet_state::main_map);
|
||||
|
||||
M6502(config, m_audiocpu, ATARI_CLOCK_14MHz/8);
|
||||
M6502(config, m_audiocpu, 14.318181_MHz_XTAL/8);
|
||||
m_audiocpu->set_addrmap(AS_PROGRAM, &gauntlet_state::sound_map);
|
||||
|
||||
EEPROM_2804(config, "eeprom").lock_after_write(true);
|
||||
|
||||
ls259_device &outlatch(LS259(config, "outlatch")); // 14A
|
||||
//outlatch.q_out_cb<0>().set_output("led1").invert(); // LEDs not connected?
|
||||
//outlatch.q_out_cb<1>().set_output("led2").invert();
|
||||
//outlatch.q_out_cb<2>().set_output("led3").invert();
|
||||
//outlatch.q_out_cb<3>().set_output("led4").invert();
|
||||
outlatch.q_out_cb<7>().set(FUNC(gauntlet_state::sound_reset_w));
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(gauntlet_state::scanline_update), m_screen, 0, 32);
|
||||
|
||||
WATCHDOG_TIMER(config, "watchdog");
|
||||
WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 8);
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
GFXDECODE(config, m_gfxdecode, "palette", gfx_gauntlet);
|
||||
|
||||
PALETTE(config, "palette").set_format(palette_device::IRGB_4444, 1024);
|
||||
@ -513,28 +506,32 @@ void gauntlet_state::gauntlet_base(machine_config &config)
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
// note: these parameters are from published specs, not derived
|
||||
// the board uses a SYNGEN chip to generate video signals
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(gauntlet_state::screen_update_gauntlet));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE);
|
||||
|
||||
/* sound hardware */
|
||||
ATARI_SOUND_COMM(config, m_soundcomm, m_audiocpu)
|
||||
.int_callback().set_inputline(m_maincpu, M68K_IRQ_6);
|
||||
// sound hardware
|
||||
SPEAKER(config, "lspeaker").front_left();
|
||||
SPEAKER(config, "rspeaker").front_right();
|
||||
|
||||
YM2151(config, m_ym2151, ATARI_CLOCK_14MHz/4);
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
m_mainlatch->data_pending_callback().set_inputline(m_maincpu, M68K_IRQ_6);
|
||||
|
||||
YM2151(config, m_ym2151, 14.318181_MHz_XTAL/4);
|
||||
m_ym2151->add_route(1, "lspeaker", 0.48);
|
||||
m_ym2151->add_route(0, "rspeaker", 0.48);
|
||||
|
||||
POKEY(config, m_pokey, ATARI_CLOCK_14MHz/8);
|
||||
POKEY(config, m_pokey, 14.318181_MHz_XTAL/8);
|
||||
m_pokey->add_route(ALL_OUTPUTS, "lspeaker", 0.32);
|
||||
m_pokey->add_route(ALL_OUTPUTS, "rspeaker", 0.32);
|
||||
|
||||
TMS5220C(config, m_tms5220, ATARI_CLOCK_14MHz/2/11); /* potentially ATARI_CLOCK_14MHz/2/9 as well */
|
||||
TMS5220C(config, m_tms5220, 14.318181_MHz_XTAL/2/11); // potentially 14.318181_MHz_XTAL/2/9 as well
|
||||
m_tms5220->add_route(ALL_OUTPUTS, "lspeaker", 0.80);
|
||||
m_tms5220->add_route(ALL_OUTPUTS, "rspeaker", 0.80);
|
||||
|
||||
@ -1659,14 +1656,14 @@ void gauntlet_state::common_init(int vindctr2)
|
||||
uint8_t *rom = memregion("maincpu")->base();
|
||||
slapstic_configure(*m_maincpu, 0x038000, 0, memregion("maincpu")->base() + 0x38000);
|
||||
|
||||
/* swap the top and bottom halves of the main CPU ROM images */
|
||||
// swap the top and bottom halves of the main CPU ROM images
|
||||
swap_memory(rom + 0x000000, rom + 0x008000, 0x8000);
|
||||
swap_memory(rom + 0x040000, rom + 0x048000, 0x8000);
|
||||
swap_memory(rom + 0x050000, rom + 0x058000, 0x8000);
|
||||
swap_memory(rom + 0x060000, rom + 0x068000, 0x8000);
|
||||
swap_memory(rom + 0x070000, rom + 0x078000, 0x8000);
|
||||
|
||||
/* indicate whether or not we are vindicators 2 */
|
||||
// indicate whether or not we are vindicators 2
|
||||
m_vindctr2_screen_refresh = vindctr2;
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ GFXDECODE_END
|
||||
void offtwall_state::offtwall(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &offtwall_state::main_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -359,7 +359,7 @@ void offtwall_state::offtwall(machine_config &config)
|
||||
screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a VAD chip to generate video signals */
|
||||
screen.set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
screen.set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
screen.set_screen_update(FUNC(offtwall_state::screen_update_offtwall));
|
||||
screen.set_palette("palette");
|
||||
|
||||
|
@ -238,7 +238,7 @@ GFXDECODE_END
|
||||
void skullxbo_state::skullxbo(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &skullxbo_state::main_map);
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(skullxbo_state::scanline_timer), m_screen, 0, 8);
|
||||
@ -261,7 +261,7 @@ void skullxbo_state::skullxbo(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses an SOS-2 chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL, 456*2, 0, 336*2, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(skullxbo_state::screen_update_skullxbo));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE);
|
||||
|
@ -244,10 +244,10 @@ GFXDECODE_END
|
||||
void thunderj_state::thunderj(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &thunderj_state::main_map);
|
||||
|
||||
M68000(config, m_extra, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_extra, 14.318181_MHz_XTAL/2);
|
||||
m_extra->set_addrmap(AS_PROGRAM, &thunderj_state::extra_map);
|
||||
|
||||
EEPROM_2816(config, "eeprom").lock_after_write(true);
|
||||
@ -272,7 +272,7 @@ void thunderj_state::thunderj(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a VAD chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(thunderj_state::screen_update_thunderj));
|
||||
m_screen->set_palette("palette");
|
||||
|
||||
|
@ -189,7 +189,7 @@ GFXDECODE_END
|
||||
void vindictr_state::vindictr(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68010(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68010(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &vindictr_state::main_map);
|
||||
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(vindictr_state::scanline_update), m_screen, 0, 8);
|
||||
@ -212,7 +212,7 @@ void vindictr_state::vindictr(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(vindictr_state::screen_update_vindictr));
|
||||
m_screen->set_palette(m_palette);
|
||||
|
||||
|
@ -178,7 +178,7 @@ GFXDECODE_END
|
||||
void xybots_state::xybots(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M68000(config, m_maincpu, ATARI_CLOCK_14MHz/2);
|
||||
M68000(config, m_maincpu, 14.318181_MHz_XTAL/2);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &xybots_state::main_map);
|
||||
|
||||
SLAPSTIC(config, "slapstic", 107, true);
|
||||
@ -201,7 +201,7 @@ void xybots_state::xybots(machine_config &config)
|
||||
m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
|
||||
/* note: these parameters are from published specs, not derived */
|
||||
/* the board uses a SYNGEN chip to generate video signals */
|
||||
m_screen->set_raw(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(xybots_state::screen_update_xybots));
|
||||
m_screen->set_palette("palette");
|
||||
m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_1, ASSERT_LINE);
|
||||
|
@ -10,9 +10,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "machine/6522via.h"
|
||||
#include "machine/74259.h"
|
||||
#include "machine/adc0808.h"
|
||||
#include "machine/atarigen.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/input_merger.h"
|
||||
#include "machine/timer.h"
|
||||
#include "sound/tms5220.h"
|
||||
@ -27,25 +29,46 @@ public:
|
||||
atarisy1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: atarigen_state(mconfig, type, tag)
|
||||
, m_audiocpu(*this, "audiocpu")
|
||||
, m_soundcomm(*this, "soundcomm")
|
||||
, m_bankselect(*this, "bankselect")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
, m_mainlatch(*this, "mainlatch")
|
||||
, m_mob(*this, "mob")
|
||||
, m_palette(*this, "palette")
|
||||
, m_adc(*this, "adc")
|
||||
, m_ajsint(*this, "ajsint")
|
||||
, m_playfield_tilemap(*this, "playfield")
|
||||
, m_alpha_tilemap(*this, "alpha")
|
||||
, m_xscroll(*this, "xscroll")
|
||||
, m_yscroll(*this, "yscroll")
|
||||
, m_yscroll_reset_timer(*this, "yreset_timer")
|
||||
, m_scanline_timer(*this, "scan_timer")
|
||||
, m_int3off_timer(*this, "int3off_timer")
|
||||
, m_tms(*this, "tms")
|
||||
, m_outlatch(*this, "outlatch")
|
||||
, m_via(*this, "via")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<atari_sound_comm_device> m_soundcomm;
|
||||
void indytemp(machine_config &config);
|
||||
void roadb110(machine_config &config);
|
||||
void peterpak(machine_config &config);
|
||||
void roadrunn(machine_config &config);
|
||||
void roadb109(machine_config &config);
|
||||
void marble(machine_config &config);
|
||||
|
||||
void init_roadblst();
|
||||
void init_peterpak();
|
||||
void init_marble();
|
||||
void init_roadrunn();
|
||||
void init_indytemp();
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
required_device<generic_latch_8_device> m_mainlatch;
|
||||
|
||||
required_shared_ptr<uint16_t> m_bankselect;
|
||||
required_device<atari_motion_objects_device> m_mob;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
@ -58,6 +81,8 @@ public:
|
||||
/* playfield parameters */
|
||||
required_device<tilemap_device> m_playfield_tilemap;
|
||||
required_device<tilemap_device> m_alpha_tilemap;
|
||||
required_shared_ptr<uint16_t> m_xscroll;
|
||||
required_shared_ptr<uint16_t> m_yscroll;
|
||||
uint16_t m_playfield_lookup[256];
|
||||
uint8_t m_playfield_tile_bank;
|
||||
uint16_t m_playfield_priority_pens;
|
||||
@ -73,45 +98,37 @@ public:
|
||||
required_device<tms5220_device> m_tms;
|
||||
|
||||
required_device<ls259_device> m_outlatch;
|
||||
required_device<via6522_device> m_via;
|
||||
|
||||
/* graphics bank tracking */
|
||||
uint8_t m_bank_gfx[3][8];
|
||||
uint8_t m_bank_color_shift[MAX_GFX_ELEMENTS];
|
||||
uint8_t m_bankselect;
|
||||
|
||||
uint8_t m_cur[2][2];
|
||||
|
||||
void video_int_ack_w(uint16_t data = 0);
|
||||
template<int Input> DECLARE_READ8_MEMBER(digital_joystick_r);
|
||||
DECLARE_READ8_MEMBER(adc_r);
|
||||
DECLARE_WRITE8_MEMBER(adc_w);
|
||||
DECLARE_READ16_MEMBER(trakball_r);
|
||||
DECLARE_READ8_MEMBER(switch_6502_r);
|
||||
void video_int_ack_w(uint8_t data = 0);
|
||||
template<int Input> uint8_t digital_joystick_r();
|
||||
uint8_t adc_r(offs_t offset);
|
||||
void adc_w(offs_t offset, uint8_t data);
|
||||
uint16_t trakball_r(offs_t offset);
|
||||
uint8_t switch_6502_r();
|
||||
DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w);
|
||||
DECLARE_WRITE8_MEMBER(via_pa_w);
|
||||
DECLARE_READ8_MEMBER(via_pa_r);
|
||||
DECLARE_WRITE8_MEMBER(via_pb_w);
|
||||
DECLARE_READ8_MEMBER(via_pb_r);
|
||||
void init_roadblst();
|
||||
void init_peterpak();
|
||||
void init_marble();
|
||||
void init_roadrunn();
|
||||
void init_indytemp();
|
||||
void via_pb_w(uint8_t data);
|
||||
uint8_t via_pb_r();
|
||||
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_playfield_tile_info);
|
||||
DECLARE_MACHINE_START(atarisy1);
|
||||
DECLARE_MACHINE_RESET(atarisy1);
|
||||
DECLARE_VIDEO_START(atarisy1);
|
||||
uint32_t screen_update_atarisy1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_reset_yscroll_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3off_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(reset_yscroll_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(int3off_callback);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(int3_callback);
|
||||
virtual void update_timers(int scanline);
|
||||
void decode_gfx(uint16_t *pflookup, uint16_t *molookup);
|
||||
int get_bank(uint8_t prom1, uint8_t prom2, int bpp);
|
||||
DECLARE_READ16_MEMBER( atarisy1_int3state_r );
|
||||
DECLARE_WRITE16_MEMBER( atarisy1_spriteram_w );
|
||||
DECLARE_WRITE16_MEMBER( atarisy1_bankselect_w );
|
||||
void bankselect_w(uint8_t data);
|
||||
DECLARE_WRITE16_MEMBER( atarisy1_xscroll_w );
|
||||
DECLARE_WRITE16_MEMBER( atarisy1_yscroll_w );
|
||||
DECLARE_WRITE16_MEMBER( atarisy1_priority_w );
|
||||
@ -119,12 +136,7 @@ public:
|
||||
static const atari_motion_objects_config s_mob_config;
|
||||
void add_adc(machine_config &config);
|
||||
void atarisy1(machine_config &config);
|
||||
void indytemp(machine_config &config);
|
||||
void roadb110(machine_config &config);
|
||||
void peterpak(machine_config &config);
|
||||
void roadrunn(machine_config &config);
|
||||
void roadb109(machine_config &config);
|
||||
void marble(machine_config &config);
|
||||
|
||||
void main_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
};
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
#include "machine/atarigen.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "cpu/t11/t11.h"
|
||||
#include "machine/bankdev.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/ym2151.h"
|
||||
@ -17,22 +17,28 @@
|
||||
#include "sound/tms5220.h"
|
||||
#include "video/atarimo.h"
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "slapstic.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
class atarisy2_state : public atarigen_state
|
||||
class atarisy2_state : public driver_device
|
||||
{
|
||||
public:
|
||||
atarisy2_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_gfxdecode(*this, "gfxdecode")
|
||||
, m_screen(*this, "screen")
|
||||
, m_mob(*this, "mob")
|
||||
, m_slapstic_base(*this, "slapstic_base")
|
||||
, m_vrambank(*this, "vrambank")
|
||||
, m_playfield_tilemap(*this, "playfield")
|
||||
, m_alpha_tilemap(*this, "alpha")
|
||||
, m_soundcomm(*this, "soundcomm")
|
||||
, m_xscroll(*this, "xscroll")
|
||||
, m_yscroll(*this, "yscroll")
|
||||
, m_soundlatch(*this, "soundlatch")
|
||||
, m_mainlatch(*this, "mainlatch")
|
||||
, m_ym2151(*this, "ymsnd")
|
||||
, m_pokey(*this, "pokey%u", 1U)
|
||||
, m_tms5220(*this, "tms")
|
||||
@ -55,13 +61,18 @@ public:
|
||||
void csprint(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void device_post_load() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
void update_interrupts();
|
||||
|
||||
required_device<t11_device> m_maincpu;
|
||||
required_device<m6502_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<atari_motion_objects_device> m_mob;
|
||||
required_shared_ptr<uint16_t> m_slapstic_base;
|
||||
required_device<address_map_bank_device> m_vrambank;
|
||||
@ -70,10 +81,13 @@ private:
|
||||
|
||||
required_device<tilemap_device> m_playfield_tilemap;
|
||||
required_device<tilemap_device> m_alpha_tilemap;
|
||||
required_shared_ptr<uint16_t> m_xscroll;
|
||||
required_shared_ptr<uint16_t> m_yscroll;
|
||||
|
||||
int8_t m_pedal_count;
|
||||
|
||||
required_device<atari_sound_comm_device> m_soundcomm;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
required_device<generic_latch_8_device> m_mainlatch;
|
||||
required_device<ym2151_device> m_ym2151;
|
||||
required_device_array<pokey_device, 2> m_pokey;
|
||||
optional_device<tms5220_device> m_tms5220;
|
||||
@ -105,29 +119,28 @@ private:
|
||||
void scanline_int_ack_w(uint16_t data);
|
||||
void video_int_ack_w(uint16_t data);
|
||||
void int0_ack_w(uint16_t data);
|
||||
void int1_ack_w(uint8_t data);
|
||||
void sound_reset_w(uint8_t data);
|
||||
void int_enable_w(uint8_t data);
|
||||
DECLARE_WRITE16_MEMBER(bankselect_w);
|
||||
DECLARE_READ16_MEMBER(switch_r);
|
||||
DECLARE_READ8_MEMBER(switch_6502_r);
|
||||
DECLARE_WRITE8_MEMBER(switch_6502_w);
|
||||
DECLARE_READ8_MEMBER(leta_r);
|
||||
DECLARE_WRITE8_MEMBER(mixer_w);
|
||||
DECLARE_WRITE8_MEMBER(sound_reset_w);
|
||||
DECLARE_READ16_MEMBER(sound_r);
|
||||
DECLARE_WRITE8_MEMBER(sound_6502_w);
|
||||
DECLARE_READ8_MEMBER(sound_6502_r);
|
||||
DECLARE_WRITE8_MEMBER(tms5220_w);
|
||||
DECLARE_WRITE8_MEMBER(tms5220_strobe_w);
|
||||
DECLARE_WRITE8_MEMBER(coincount_w);
|
||||
INTERRUPT_GEN_MEMBER(sound_irq_gen);
|
||||
void sound_irq_ack_w(uint8_t data);
|
||||
void bankselect_w(offs_t offset, uint16_t data);
|
||||
uint16_t switch_r();
|
||||
uint8_t switch_6502_r();
|
||||
void switch_6502_w(uint8_t data);
|
||||
uint8_t leta_r(offs_t offset);
|
||||
void mixer_w(uint8_t data);
|
||||
void sndrst_6502_w(uint8_t data);
|
||||
uint16_t sound_r();
|
||||
void sound_6502_w(uint8_t data);
|
||||
uint8_t sound_6502_r();
|
||||
void tms5220_w(uint8_t data);
|
||||
void tms5220_strobe_w(offs_t offset, uint8_t data);
|
||||
void coincount_w(uint8_t data);
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_playfield_tile_info);
|
||||
DECLARE_MACHINE_START(atarisy2);
|
||||
DECLARE_MACHINE_RESET(atarisy2);
|
||||
DECLARE_VIDEO_START(atarisy2);
|
||||
uint32_t screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank_int);
|
||||
TIMER_CALLBACK_MEMBER(delayed_int_enable_w);
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "machine/atarigen.h"
|
||||
#include "machine/74259.h"
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/timer.h"
|
||||
#include "video/atarimo.h"
|
||||
#include "sound/ym2151.h"
|
||||
@ -25,13 +26,16 @@ public:
|
||||
gauntlet_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
atarigen_state(mconfig, type, tag),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_soundcomm(*this, "soundcomm"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_mainlatch(*this, "mainlatch"),
|
||||
m_ym2151(*this, "ymsnd"),
|
||||
m_pokey(*this, "pokey"),
|
||||
m_tms5220(*this, "tms"),
|
||||
m_soundctl(*this, "soundctl"),
|
||||
m_playfield_tilemap(*this, "playfield"),
|
||||
m_alpha_tilemap(*this, "alpha"),
|
||||
m_xscroll(*this, "xscroll"),
|
||||
m_yscroll(*this, "yscroll"),
|
||||
m_mob(*this, "mob")
|
||||
{ }
|
||||
|
||||
@ -43,19 +47,19 @@ public:
|
||||
void gauntlet2(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
private:
|
||||
void video_int_ack_w(uint16_t data = 0);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
|
||||
DECLARE_WRITE16_MEMBER(sound_reset_w);
|
||||
DECLARE_READ8_MEMBER(switch_6502_r);
|
||||
uint8_t sound_irq_ack_r();
|
||||
void sound_irq_ack_w(uint8_t data);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_reset_w);
|
||||
uint8_t switch_6502_r();
|
||||
DECLARE_WRITE_LINE_MEMBER(speech_squeak_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
|
||||
DECLARE_WRITE8_MEMBER(mixer_w);
|
||||
void mixer_w(uint8_t data);
|
||||
void swap_memory(void *ptr1, void *ptr2, int bytes);
|
||||
void common_init(int vindctr2);
|
||||
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
|
||||
@ -69,7 +73,8 @@ private:
|
||||
void sound_map(address_map &map);
|
||||
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<atari_sound_comm_device> m_soundcomm;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
required_device<generic_latch_8_device> m_mainlatch;
|
||||
required_device<ym2151_device> m_ym2151;
|
||||
required_device<pokey_device> m_pokey;
|
||||
required_device<tms5220_device> m_tms5220;
|
||||
@ -77,6 +82,8 @@ private:
|
||||
|
||||
required_device<tilemap_device> m_playfield_tilemap;
|
||||
required_device<tilemap_device> m_alpha_tilemap;
|
||||
required_shared_ptr<uint16_t> m_xscroll;
|
||||
required_shared_ptr<uint16_t> m_yscroll;
|
||||
required_device<atari_motion_objects_device> m_mob;
|
||||
|
||||
uint16_t m_sound_reset_val;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "audio/atarijsa.h"
|
||||
#include "includes/slapstic.h"
|
||||
|
||||
#include "bus/rs232/rs232.h"
|
||||
|
||||
|
@ -24,6 +24,8 @@ public:
|
||||
m_jsa(*this, "jsa"),
|
||||
m_playfield_tilemap(*this, "playfield"),
|
||||
m_alpha_tilemap(*this, "alpha"),
|
||||
m_xscroll(*this, "xscroll"),
|
||||
m_yscroll(*this, "yscroll"),
|
||||
m_mob(*this, "mob"),
|
||||
m_playfield_latch(-1),
|
||||
m_scanline_int_state(0)
|
||||
@ -58,6 +60,8 @@ private:
|
||||
required_device<atari_jsa_ii_device> m_jsa;
|
||||
required_device<tilemap_device> m_playfield_tilemap;
|
||||
required_device<tilemap_device> m_alpha_tilemap;
|
||||
required_shared_ptr<uint16_t> m_xscroll;
|
||||
required_shared_ptr<uint16_t> m_yscroll;
|
||||
required_device<atari_motion_objects_device> m_mob;
|
||||
int m_playfield_latch;
|
||||
|
||||
|
@ -9,315 +9,16 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "atarigen.h"
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
|
||||
#define SOUND_TIMER_RATE attotime::from_usec(5)
|
||||
#define SOUND_TIMER_BOOST attotime::from_usec(1000)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// SOUND COMMUNICATIONS DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ATARI_SOUND_COMM, atari_sound_comm_device, "atarscom", "Atari Sound Communications")
|
||||
|
||||
//-------------------------------------------------
|
||||
// atari_sound_comm_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ATARI_SOUND_COMM, tag, owner, clock)
|
||||
, m_main_int_cb(*this)
|
||||
, m_sound_cpu(*this, finder_base::DUMMY_TAG)
|
||||
, m_main_to_sound_ready(false)
|
||||
, m_sound_to_main_ready(false)
|
||||
, m_main_to_sound_data(0)
|
||||
, m_sound_to_main_data(0)
|
||||
, m_timed_int(0)
|
||||
, m_ym2151_int(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start: Start up the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_start()
|
||||
{
|
||||
// resolve callbacks
|
||||
m_main_int_cb.resolve_safe();
|
||||
|
||||
// register for save states
|
||||
save_item(NAME(m_main_to_sound_ready));
|
||||
save_item(NAME(m_sound_to_main_ready));
|
||||
save_item(NAME(m_main_to_sound_data));
|
||||
save_item(NAME(m_sound_to_main_data));
|
||||
save_item(NAME(m_timed_int));
|
||||
save_item(NAME(m_ym2151_int));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset: Handle a device reset by
|
||||
// clearing the interrupt lines and states
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_reset()
|
||||
{
|
||||
// reset the internal interrupts states
|
||||
m_timed_int = m_ym2151_int = 0;
|
||||
|
||||
// reset the sound I/O states
|
||||
m_main_to_sound_data = m_sound_to_main_data = 0;
|
||||
m_main_to_sound_ready = m_sound_to_main_ready = false;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer: Handle device-specific timer
|
||||
// calbacks
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TID_SOUND_RESET:
|
||||
delayed_sound_reset(param);
|
||||
break;
|
||||
|
||||
case TID_SOUND_WRITE:
|
||||
delayed_sound_write(param);
|
||||
break;
|
||||
|
||||
case TID_6502_WRITE:
|
||||
delayed_6502_write(param);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_irq_gen: Generates an IRQ signal to the
|
||||
// 6502 sound processor.
|
||||
//-------------------------------------------------
|
||||
|
||||
INTERRUPT_GEN_MEMBER(atari_sound_comm_device::sound_irq_gen)
|
||||
{
|
||||
sound_irq();
|
||||
}
|
||||
|
||||
void atari_sound_comm_device::sound_irq()
|
||||
{
|
||||
m_timed_int = 1;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_irq_ack_r: Resets the IRQ signal to the
|
||||
// 6502 sound processor. Both reads and writes
|
||||
// can be used.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_sound_comm_device::sound_irq_ack_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_timed_int = 0;
|
||||
update_sound_irq();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void atari_sound_comm_device::sound_irq_ack_w(u8 data)
|
||||
{
|
||||
m_timed_int = 0;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// atarigen_ym2151_irq_gen: Sets the state of the
|
||||
// YM2151's IRQ line.
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER(atari_sound_comm_device::ym2151_irq_gen)
|
||||
{
|
||||
m_ym2151_int = state;
|
||||
update_sound_irq();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_reset_w: Write handler which resets the
|
||||
// sound CPU in response.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::sound_reset_w(u16 data)
|
||||
{
|
||||
synchronize(TID_SOUND_RESET);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// main_command_w: Handles communication from the main CPU
|
||||
// to the sound CPU. Two versions are provided, one with the
|
||||
// data byte in the low 8 bits, and one with the data byte in
|
||||
// the upper 8 bits.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::main_command_w(u8 data)
|
||||
{
|
||||
synchronize(TID_SOUND_WRITE, data);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// main_response_r: Handles reading data communicated from the
|
||||
// sound CPU to the main CPU. Two versions are provided, one
|
||||
// with the data byte in the low 8 bits, and one with the data
|
||||
// byte in the upper 8 bits.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_sound_comm_device::main_response_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_sound_to_main_ready = false;
|
||||
m_main_int_cb(CLEAR_LINE);
|
||||
}
|
||||
return m_sound_to_main_data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_response_w: Handles communication from the
|
||||
// sound CPU to the main CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::sound_response_w(u8 data)
|
||||
{
|
||||
synchronize(TID_6502_WRITE, data);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_command_r: Handles reading data
|
||||
// communicated from the main CPU to the sound
|
||||
// CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_sound_comm_device::sound_command_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_main_to_sound_ready = false;
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
|
||||
}
|
||||
return m_main_to_sound_data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// update_sound_irq: Called whenever the IRQ state
|
||||
// changes. An interrupt is generated if either
|
||||
// sound_irq_gen() was called, or if the YM2151
|
||||
// generated an interrupt via the
|
||||
// ym2151_irq_gen() callback.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::update_sound_irq()
|
||||
{
|
||||
if (m_timed_int || m_ym2151_int)
|
||||
m_sound_cpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
|
||||
else
|
||||
m_sound_cpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_sound_reset: Synchronizes the sound
|
||||
// reset command between the two CPUs.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_sound_reset(int param)
|
||||
{
|
||||
// unhalt and reset the sound CPU
|
||||
if (param == 0)
|
||||
{
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
|
||||
m_sound_cpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
|
||||
}
|
||||
|
||||
// reset the sound write state
|
||||
m_sound_to_main_ready = false;
|
||||
m_main_int_cb(CLEAR_LINE);
|
||||
|
||||
// allocate a high frequency timer until a response is generated
|
||||
// the main CPU is *very* sensistive to the timing of the response
|
||||
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_sound_write: Synchronizes a data write
|
||||
// from the main CPU to the sound CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_sound_write(int data)
|
||||
{
|
||||
// warn if we missed something
|
||||
if (m_main_to_sound_ready)
|
||||
logerror("Missed command from 680x0\n");
|
||||
|
||||
// set up the states and signal an NMI to the sound CPU
|
||||
m_main_to_sound_data = data;
|
||||
m_main_to_sound_ready = true;
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
|
||||
// allocate a high frequency timer until a response is generated
|
||||
// the main CPU is *very* sensistive to the timing of the response
|
||||
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_6502_write: Synchronizes a data write
|
||||
// from the sound CPU to the main CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_6502_write(int data)
|
||||
{
|
||||
// warn if we missed something
|
||||
if (m_sound_to_main_ready)
|
||||
logerror("Missed result from 6502\n");
|
||||
|
||||
// set up the states and signal the sound interrupt to the main CPU
|
||||
m_sound_to_main_data = data;
|
||||
m_sound_to_main_ready = true;
|
||||
m_main_int_cb(ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
OVERALL INIT
|
||||
***************************************************************************/
|
||||
|
||||
atarigen_state::atarigen_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_xscroll(*this, "xscroll")
|
||||
, m_yscroll(*this, "yscroll")
|
||||
, m_slapstic_num(0)
|
||||
, m_slapstic(nullptr)
|
||||
, m_slapstic_bank(0)
|
||||
|
@ -12,109 +12,9 @@
|
||||
#define MAME_MACHINE_ATARIGEN_H
|
||||
|
||||
#include "includes/slapstic.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
|
||||
#define ATARI_CLOCK_14MHz XTAL(14'318'181)
|
||||
#define ATARI_CLOCK_20MHz XTAL(20'000'000)
|
||||
#define ATARI_CLOCK_32MHz XTAL(32'000'000)
|
||||
#define ATARI_CLOCK_50MHz XTAL(50'000'000)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
#define PORT_ATARI_COMM_SOUND_TO_MAIN_READY(_tag) \
|
||||
PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, sound_to_main_ready)
|
||||
|
||||
#define PORT_ATARI_COMM_MAIN_TO_SOUND_READY(_tag) \
|
||||
PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, main_to_sound_ready)
|
||||
|
||||
|
||||
// ======================> atari_sound_comm_device
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ATARI_SOUND_COMM, atari_sound_comm_device)
|
||||
|
||||
class atari_sound_comm_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
template <typename T>
|
||||
atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cputag)
|
||||
: atari_sound_comm_device(mconfig, tag, owner, (u32)0)
|
||||
{
|
||||
m_sound_cpu.set_tag(std::forward<T>(cputag));
|
||||
}
|
||||
|
||||
atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// configuration helpers
|
||||
auto int_callback() { return m_main_int_cb.bind(); }
|
||||
|
||||
// getters
|
||||
DECLARE_READ_LINE_MEMBER(main_to_sound_ready) { return m_main_to_sound_ready ? ASSERT_LINE : CLEAR_LINE; }
|
||||
DECLARE_READ_LINE_MEMBER(sound_to_main_ready) { return m_sound_to_main_ready ? ASSERT_LINE : CLEAR_LINE; }
|
||||
|
||||
// main cpu accessors (forward internally to the atari_sound_comm_device)
|
||||
void main_command_w(u8 data);
|
||||
u8 main_response_r();
|
||||
void sound_reset_w(u16 data = 0);
|
||||
|
||||
// sound cpu accessors
|
||||
void sound_cpu_reset() { synchronize(TID_SOUND_RESET, 1); }
|
||||
void sound_response_w(u8 data);
|
||||
u8 sound_command_r();
|
||||
void sound_irq_ack_w(u8 data = 0);
|
||||
u8 sound_irq_ack_r();
|
||||
INTERRUPT_GEN_MEMBER(sound_irq_gen);
|
||||
void sound_irq();
|
||||
|
||||
// additional helpers
|
||||
DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen);
|
||||
|
||||
protected:
|
||||
// sound I/O helpers
|
||||
void update_sound_irq();
|
||||
void delayed_sound_reset(int param);
|
||||
void delayed_sound_write(int data);
|
||||
void delayed_6502_write(int data);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
TID_SOUND_RESET,
|
||||
TID_SOUND_WRITE,
|
||||
TID_6502_WRITE
|
||||
};
|
||||
|
||||
// configuration state
|
||||
devcb_write_line m_main_int_cb;
|
||||
|
||||
// internal state
|
||||
required_device<m6502_device> m_sound_cpu;
|
||||
bool m_main_to_sound_ready;
|
||||
bool m_sound_to_main_ready;
|
||||
u8 m_main_to_sound_data;
|
||||
u8 m_sound_to_main_data;
|
||||
u8 m_timed_int;
|
||||
u8 m_ym2151_int;
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
TYPES & STRUCTURES
|
||||
***************************************************************************/
|
||||
@ -151,9 +51,6 @@ protected:
|
||||
TID_ATARIGEN_LAST
|
||||
};
|
||||
|
||||
optional_shared_ptr<u16> m_xscroll;
|
||||
optional_shared_ptr<u16> m_yscroll;
|
||||
|
||||
/* internal state */
|
||||
u8 m_slapstic_num;
|
||||
u16 * m_slapstic;
|
||||
|
234
src/mame/machine/atariscom.cpp
Normal file
234
src/mame/machine/atariscom.cpp
Normal file
@ -0,0 +1,234 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
/***************************************************************************
|
||||
|
||||
atariscom.cpp
|
||||
|
||||
Atari sound communications device.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "atariscom.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
|
||||
#define SOUND_TIMER_RATE attotime::from_usec(5)
|
||||
#define SOUND_TIMER_BOOST attotime::from_usec(1000)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// SOUND COMMUNICATIONS DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(ATARI_SOUND_COMM, atari_sound_comm_device, "atariscom", "Atari Sound Communications")
|
||||
|
||||
//-------------------------------------------------
|
||||
// atari_sound_comm_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
atari_sound_comm_device::atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, ATARI_SOUND_COMM, tag, owner, clock)
|
||||
, m_main_int_cb(*this)
|
||||
, m_sound_cpu(*this, finder_base::DUMMY_TAG)
|
||||
, m_main_to_sound_ready(false)
|
||||
, m_sound_to_main_ready(false)
|
||||
, m_main_to_sound_data(0)
|
||||
, m_sound_to_main_data(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start: Start up the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_start()
|
||||
{
|
||||
// resolve callbacks
|
||||
m_main_int_cb.resolve_safe();
|
||||
|
||||
// register for save states
|
||||
save_item(NAME(m_main_to_sound_ready));
|
||||
save_item(NAME(m_sound_to_main_ready));
|
||||
save_item(NAME(m_main_to_sound_data));
|
||||
save_item(NAME(m_sound_to_main_data));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset: Handle a device reset by
|
||||
// clearing the interrupt lines and states
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_reset()
|
||||
{
|
||||
// reset the sound I/O states
|
||||
m_main_to_sound_data = m_sound_to_main_data = 0;
|
||||
m_main_to_sound_ready = m_sound_to_main_ready = false;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer: Handle device-specific timer
|
||||
// calbacks
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TID_SOUND_RESET:
|
||||
delayed_sound_reset(param);
|
||||
break;
|
||||
|
||||
case TID_SOUND_WRITE:
|
||||
delayed_sound_write(param);
|
||||
break;
|
||||
|
||||
case TID_6502_WRITE:
|
||||
delayed_6502_write(param);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_reset_w: Write handler which resets the
|
||||
// sound CPU in response.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::sound_reset_w(u16 data)
|
||||
{
|
||||
synchronize(TID_SOUND_RESET);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// main_command_w: Handles communication from the main CPU
|
||||
// to the sound CPU. Two versions are provided, one with the
|
||||
// data byte in the low 8 bits, and one with the data byte in
|
||||
// the upper 8 bits.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::main_command_w(u8 data)
|
||||
{
|
||||
synchronize(TID_SOUND_WRITE, data);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// main_response_r: Handles reading data communicated from the
|
||||
// sound CPU to the main CPU. Two versions are provided, one
|
||||
// with the data byte in the low 8 bits, and one with the data
|
||||
// byte in the upper 8 bits.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_sound_comm_device::main_response_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_sound_to_main_ready = false;
|
||||
m_main_int_cb(CLEAR_LINE);
|
||||
}
|
||||
return m_sound_to_main_data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_response_w: Handles communication from the
|
||||
// sound CPU to the main CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::sound_response_w(u8 data)
|
||||
{
|
||||
synchronize(TID_6502_WRITE, data);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_command_r: Handles reading data
|
||||
// communicated from the main CPU to the sound
|
||||
// CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
u8 atari_sound_comm_device::sound_command_r()
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
m_main_to_sound_ready = false;
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
|
||||
}
|
||||
return m_main_to_sound_data;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_sound_reset: Synchronizes the sound
|
||||
// reset command between the two CPUs.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_sound_reset(int param)
|
||||
{
|
||||
// unhalt and reset the sound CPU
|
||||
if (param == 0)
|
||||
{
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
|
||||
m_sound_cpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
|
||||
}
|
||||
|
||||
// reset the sound write state
|
||||
m_sound_to_main_ready = false;
|
||||
m_main_int_cb(CLEAR_LINE);
|
||||
|
||||
// allocate a high frequency timer until a response is generated
|
||||
// the main CPU is *very* sensistive to the timing of the response
|
||||
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_sound_write: Synchronizes a data write
|
||||
// from the main CPU to the sound CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_sound_write(int data)
|
||||
{
|
||||
// warn if we missed something
|
||||
if (m_main_to_sound_ready)
|
||||
logerror("Missed command from 680x0\n");
|
||||
|
||||
// set up the states and signal an NMI to the sound CPU
|
||||
m_main_to_sound_data = data;
|
||||
m_main_to_sound_ready = true;
|
||||
m_sound_cpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
|
||||
// allocate a high frequency timer until a response is generated
|
||||
// the main CPU is *very* sensistive to the timing of the response
|
||||
machine().scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// delayed_6502_write: Synchronizes a data write
|
||||
// from the sound CPU to the main CPU.
|
||||
//-------------------------------------------------
|
||||
|
||||
void atari_sound_comm_device::delayed_6502_write(int data)
|
||||
{
|
||||
// warn if we missed something
|
||||
if (m_sound_to_main_ready)
|
||||
logerror("Missed result from 6502\n");
|
||||
|
||||
// set up the states and signal the sound interrupt to the main CPU
|
||||
m_sound_to_main_data = data;
|
||||
m_sound_to_main_ready = true;
|
||||
m_main_int_cb(ASSERT_LINE);
|
||||
}
|
95
src/mame/machine/atariscom.h
Normal file
95
src/mame/machine/atariscom.h
Normal file
@ -0,0 +1,95 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
/***************************************************************************
|
||||
|
||||
atariscom.h
|
||||
|
||||
Atari sound communications device.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_ATARISCOM_H
|
||||
#define MAME_MACHINE_ATARISCOM_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
#define PORT_ATARI_COMM_SOUND_TO_MAIN_READY(_tag) \
|
||||
PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, sound_to_main_ready)
|
||||
|
||||
#define PORT_ATARI_COMM_MAIN_TO_SOUND_READY(_tag) \
|
||||
PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, main_to_sound_ready)
|
||||
|
||||
|
||||
// ======================> atari_sound_comm_device
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(ATARI_SOUND_COMM, atari_sound_comm_device)
|
||||
|
||||
class atari_sound_comm_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
template <typename T>
|
||||
atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cputag)
|
||||
: atari_sound_comm_device(mconfig, tag, owner, (u32)0)
|
||||
{
|
||||
m_sound_cpu.set_tag(std::forward<T>(cputag));
|
||||
}
|
||||
|
||||
atari_sound_comm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
// configuration helpers
|
||||
auto int_callback() { return m_main_int_cb.bind(); }
|
||||
|
||||
// getters
|
||||
DECLARE_READ_LINE_MEMBER(main_to_sound_ready) { return m_main_to_sound_ready ? ASSERT_LINE : CLEAR_LINE; }
|
||||
DECLARE_READ_LINE_MEMBER(sound_to_main_ready) { return m_sound_to_main_ready ? ASSERT_LINE : CLEAR_LINE; }
|
||||
|
||||
// main cpu accessors (forward internally to the atari_sound_comm_device)
|
||||
void main_command_w(u8 data);
|
||||
u8 main_response_r();
|
||||
void sound_reset_w(u16 data = 0);
|
||||
|
||||
// sound cpu accessors
|
||||
void sound_cpu_reset() { synchronize(TID_SOUND_RESET, 1); }
|
||||
void sound_response_w(u8 data);
|
||||
u8 sound_command_r();
|
||||
|
||||
protected:
|
||||
// sound I/O helpers
|
||||
void delayed_sound_reset(int param);
|
||||
void delayed_sound_write(int data);
|
||||
void delayed_6502_write(int data);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
TID_SOUND_RESET,
|
||||
TID_SOUND_WRITE,
|
||||
TID_6502_WRITE
|
||||
};
|
||||
|
||||
// configuration state
|
||||
devcb_write_line m_main_int_cb;
|
||||
|
||||
// internal state
|
||||
required_device<cpu_device> m_sound_cpu;
|
||||
bool m_main_to_sound_ready;
|
||||
bool m_sound_to_main_ready;
|
||||
u8 m_main_to_sound_data;
|
||||
u8 m_sound_to_main_data;
|
||||
};
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_ATARISCOM_H
|
@ -144,18 +144,18 @@ const atari_motion_objects_config atarisy1_state::s_mob_config =
|
||||
0xffff /* resulting value to indicate "special" */
|
||||
};
|
||||
|
||||
VIDEO_START_MEMBER(atarisy1_state,atarisy1)
|
||||
void atarisy1_state::video_start()
|
||||
{
|
||||
/* first decode the graphics */
|
||||
// first decode the graphics
|
||||
uint16_t motable[256];
|
||||
decode_gfx(m_playfield_lookup, motable);
|
||||
|
||||
/* modify the motion object code lookup */
|
||||
// modify the motion object code lookup
|
||||
std::vector<uint32_t> &codelookup = m_mob->code_lookup();
|
||||
for (unsigned int i = 0; i < codelookup.size(); i++)
|
||||
codelookup[i] = (i & 0xff) | ((motable[i >> 8] & 0xff) << 8);
|
||||
|
||||
/* modify the motion object color and gfx lookups */
|
||||
// modify the motion object color and gfx lookups
|
||||
std::vector<uint8_t> &colorlookup = m_mob->color_lookup();
|
||||
std::vector<uint8_t> &gfxlookup = m_mob->gfx_lookup();
|
||||
for (unsigned int i = 0; i < colorlookup.size(); i++)
|
||||
@ -164,16 +164,18 @@ VIDEO_START_MEMBER(atarisy1_state,atarisy1)
|
||||
gfxlookup[i] = (motable[i] >> 8) & 15;
|
||||
}
|
||||
|
||||
/* reset the statics */
|
||||
// reset the statics
|
||||
m_mob->set_yscroll(256);
|
||||
m_next_timer_scanline = -1;
|
||||
m_scanline_int_state = 0;
|
||||
m_bankselect = 0xff;
|
||||
|
||||
/* save state */
|
||||
// save state
|
||||
save_item(NAME(m_playfield_tile_bank));
|
||||
save_item(NAME(m_playfield_priority_pens));
|
||||
save_item(NAME(m_next_timer_scanline));
|
||||
save_item(NAME(m_scanline_int_state));
|
||||
save_item(NAME(m_bankselect));
|
||||
}
|
||||
|
||||
|
||||
@ -184,41 +186,44 @@ VIDEO_START_MEMBER(atarisy1_state,atarisy1)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE16_MEMBER( atarisy1_state::atarisy1_bankselect_w )
|
||||
void atarisy1_state::bankselect_w(uint8_t data)
|
||||
{
|
||||
uint16_t oldselect = *m_bankselect;
|
||||
uint16_t newselect = oldselect, diff;
|
||||
uint8_t oldselect = m_bankselect;
|
||||
uint8_t newselect = data;
|
||||
int scanline = m_screen->vpos();
|
||||
|
||||
/* update memory */
|
||||
COMBINE_DATA(&newselect);
|
||||
diff = oldselect ^ newselect;
|
||||
// update memory
|
||||
uint8_t diff = oldselect ^ newselect;
|
||||
|
||||
/* sound CPU reset */
|
||||
// sound CPU reset
|
||||
if (BIT(diff, 7))
|
||||
{
|
||||
m_outlatch->clear_w(BIT(newselect, 7));
|
||||
m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(newselect, 7) ? CLEAR_LINE : ASSERT_LINE);
|
||||
if (!BIT(newselect, 7)) m_soundcomm->sound_cpu_reset();
|
||||
if (!BIT(newselect, 7))
|
||||
{
|
||||
m_mainlatch->acknowledge_w();
|
||||
m_via->reset();
|
||||
}
|
||||
}
|
||||
|
||||
/* if MO or playfield banks change, force a partial update */
|
||||
if (diff & 0x003c)
|
||||
// if MO or playfield banks change, force a partial update
|
||||
if (diff & 0x3c)
|
||||
m_screen->update_partial(scanline);
|
||||
|
||||
/* motion object bank select */
|
||||
// motion object bank select
|
||||
m_mob->set_bank((newselect >> 3) & 7);
|
||||
update_timers(scanline);
|
||||
|
||||
/* playfield bank select */
|
||||
if (diff & 0x0004)
|
||||
// playfield bank select
|
||||
if (diff & 0x04)
|
||||
{
|
||||
m_playfield_tile_bank = (newselect >> 2) & 1;
|
||||
m_playfield_tilemap->mark_all_dirty();
|
||||
}
|
||||
|
||||
/* stash the new value */
|
||||
*m_bankselect = newselect;
|
||||
// stash the new value
|
||||
m_bankselect = newselect;
|
||||
}
|
||||
|
||||
|
||||
@ -274,7 +279,7 @@ WRITE16_MEMBER( atarisy1_state::atarisy1_xscroll_w )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_reset_yscroll_callback)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::reset_yscroll_callback)
|
||||
{
|
||||
m_playfield_tilemap->set_scrolly(0, param);
|
||||
}
|
||||
@ -354,26 +359,26 @@ WRITE16_MEMBER( atarisy1_state::atarisy1_spriteram_w )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3off_callback)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::int3off_callback)
|
||||
{
|
||||
/* clear the state */
|
||||
// clear the state
|
||||
m_scanline_int_state = 0;
|
||||
m_maincpu->set_input_line(M68K_IRQ_3, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3_callback)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::int3_callback)
|
||||
{
|
||||
int scanline = param;
|
||||
|
||||
/* update the state */
|
||||
// update the state
|
||||
m_scanline_int_state = 1;
|
||||
m_maincpu->set_input_line(M68K_IRQ_3, ASSERT_LINE);
|
||||
|
||||
/* set a timer to turn it off */
|
||||
// set a timer to turn it off
|
||||
m_int3off_timer->adjust(m_screen->scan_period());
|
||||
|
||||
/* determine the time of the next one */
|
||||
// determine the time of the next one
|
||||
m_next_timer_scanline = -1;
|
||||
update_timers(scanline);
|
||||
}
|
||||
|
@ -77,13 +77,13 @@ const atari_motion_objects_config atarisy2_state::s_mob_config =
|
||||
0 /* resulting value to indicate "special" */
|
||||
};
|
||||
|
||||
VIDEO_START_MEMBER(atarisy2_state,atarisy2)
|
||||
void atarisy2_state::video_start()
|
||||
{
|
||||
/* reset the statics */
|
||||
// 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 states
|
||||
save_item(NAME(m_playfield_tile_bank));
|
||||
}
|
||||
|
||||
@ -239,13 +239,13 @@ uint32_t atarisy2_state::screen_update_atarisy2(screen_device &screen, bitmap_in
|
||||
bitmap_ind8 &priority_bitmap = screen.priority();
|
||||
priority_bitmap.fill(0, cliprect);
|
||||
|
||||
/* draw the playfield */
|
||||
// draw the playfield
|
||||
m_playfield_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_playfield_tilemap->draw(screen, bitmap, cliprect, 1, 1);
|
||||
m_playfield_tilemap->draw(screen, bitmap, cliprect, 2, 2);
|
||||
m_playfield_tilemap->draw(screen, bitmap, cliprect, 3, 3);
|
||||
|
||||
/* draw and merge the MO */
|
||||
// draw and merge the MO
|
||||
bitmap_ind16 &mobitmap = m_mob->bitmap();
|
||||
for (const sparse_dirty_rect *rect = m_mob->first_dirty_rect(cliprect); rect != nullptr; rect = rect->next())
|
||||
for (int y = rect->top(); y <= rect->bottom(); y++)
|
||||
@ -258,21 +258,21 @@ uint32_t atarisy2_state::screen_update_atarisy2(screen_device &screen, bitmap_in
|
||||
{
|
||||
int mopriority = mo[x] >> atari_motion_objects_device::PRIORITY_SHIFT;
|
||||
|
||||
/* high priority PF? */
|
||||
// high priority PF?
|
||||
if ((mopriority + pri[x]) & 2)
|
||||
{
|
||||
/* only gets priority if PF pen is less than 8 */
|
||||
// only gets priority if PF pen is less than 8
|
||||
if (!(pf[x] & 0x08))
|
||||
pf[x] = mo[x] & atari_motion_objects_device::DATA_MASK;
|
||||
}
|
||||
|
||||
/* low priority */
|
||||
// low priority
|
||||
else
|
||||
pf[x] = mo[x] & atari_motion_objects_device::DATA_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
/* add the alpha on top */
|
||||
// add the alpha on top
|
||||
m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user