mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
itech8.c: preparation for save state support. Not enabled yet since ninclown maincpu goes complete crazy after loading. I suspect something similar to the namcos86 problem (nw)
This commit is contained in:
parent
78c06fc1cf
commit
1d5c876310
@ -505,7 +505,6 @@
|
||||
#include "machine/6522via.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/ticket.h"
|
||||
#include "video/tlc34076.h"
|
||||
#include "includes/itech8.h"
|
||||
#include "sound/2203intf.h"
|
||||
#include "sound/2608intf.h"
|
||||
@ -526,7 +525,7 @@
|
||||
*
|
||||
*************************************/
|
||||
|
||||
void itech8_state::itech8_update_interrupts(int periodic, int tms34061, int blitter)
|
||||
void itech8_state::update_interrupts(int periodic, int tms34061, int blitter)
|
||||
{
|
||||
device_type main_cpu_type = m_maincpu->type();
|
||||
|
||||
@ -562,21 +561,21 @@ void itech8_state::itech8_update_interrupts(int periodic, int tms34061, int blit
|
||||
|
||||
TIMER_CALLBACK_MEMBER(itech8_state::irq_off)
|
||||
{
|
||||
itech8_update_interrupts(0, -1, -1);
|
||||
update_interrupts(0, -1, -1);
|
||||
}
|
||||
|
||||
|
||||
INTERRUPT_GEN_MEMBER(itech8_state::generate_nmi)
|
||||
{
|
||||
/* signal the NMI */
|
||||
itech8_update_interrupts(1, -1, -1);
|
||||
machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(itech8_state::irq_off),this));
|
||||
update_interrupts(1, -1, -1);
|
||||
m_irq_off_timer->adjust(attotime::from_usec(1));
|
||||
|
||||
if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", m_screen->vpos());
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(itech8_state::itech8_nmi_ack_w)
|
||||
WRITE8_MEMBER(itech8_state::nmi_ack_w)
|
||||
{
|
||||
/* doesn't seem to hold for every game (e.g., hstennis) */
|
||||
/* m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);*/
|
||||
@ -596,7 +595,28 @@ WRITE8_MEMBER(itech8_state::itech8_nmi_ack_w)
|
||||
MACHINE_START_MEMBER(itech8_state,sstrike)
|
||||
{
|
||||
/* we need to update behind the beam as well */
|
||||
machine().scheduler().timer_set(m_screen->time_until_pos(0), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), 32);
|
||||
m_behind_beam_update_timer = timer_alloc(TIMER_BEHIND_BEAM_UPDATE);
|
||||
m_behind_beam_update_timer->adjust(m_screen->time_until_pos(0), 32);
|
||||
|
||||
itech8_state::machine_start();
|
||||
}
|
||||
|
||||
void itech8_state::machine_start()
|
||||
{
|
||||
if (membank("bank1"))
|
||||
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000);
|
||||
|
||||
m_irq_off_timer = timer_alloc(TIMER_IRQ_OFF);
|
||||
m_delayed_sound_data_timer = timer_alloc(TIMER_DELAYED_SOUND_DATA);
|
||||
m_blitter_done_timer = timer_alloc(TIMER_BLITTER_DONE);
|
||||
|
||||
save_item(NAME(m_grom_bank));
|
||||
save_item(NAME(m_blitter_int));
|
||||
save_item(NAME(m_tms34061_int));
|
||||
save_item(NAME(m_periodic_int));
|
||||
save_item(NAME(m_sound_data));
|
||||
save_item(NAME(m_pia_porta_data));
|
||||
save_item(NAME(m_pia_portb_data));
|
||||
}
|
||||
|
||||
void itech8_state::machine_reset()
|
||||
@ -606,7 +626,7 @@ void itech8_state::machine_reset()
|
||||
/* make sure bank 0 is selected */
|
||||
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
|
||||
{
|
||||
membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000]);
|
||||
membank("bank1")->set_entry(0);
|
||||
m_maincpu->reset();
|
||||
}
|
||||
|
||||
@ -619,6 +639,30 @@ void itech8_state::machine_reset()
|
||||
}
|
||||
|
||||
|
||||
void itech8_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_IRQ_OFF:
|
||||
irq_off(ptr, param);
|
||||
break;
|
||||
case TIMER_BEHIND_BEAM_UPDATE:
|
||||
behind_the_beam_update(ptr, param);
|
||||
break;
|
||||
case TIMER_DELAYED_SOUND_DATA:
|
||||
delayed_sound_data_w(ptr, param);
|
||||
break;
|
||||
case TIMER_BLITTER_DONE:
|
||||
blitter_done(ptr, param);
|
||||
break;
|
||||
case TIMER_DELAYED_Z80_CONTROL:
|
||||
delayed_z80_control_w(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(FALSE, "Unknown id in itech8_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -639,7 +683,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update)
|
||||
if (scanline >= 256) scanline = 0;
|
||||
|
||||
/* set a new timer */
|
||||
machine().scheduler().timer_set(m_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), (scanline << 8) + interval);
|
||||
m_behind_beam_update_timer->adjust(m_screen->time_until_pos(scanline), (scanline << 8) + interval);
|
||||
}
|
||||
|
||||
|
||||
@ -650,21 +694,21 @@ TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(itech8_state::blitter_w)
|
||||
WRITE8_MEMBER(itech8_state::blitter_bank_w)
|
||||
{
|
||||
/* bit 0x20 on address 7 controls CPU banking */
|
||||
if (offset / 2 == 7)
|
||||
membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
|
||||
membank("bank1")->set_entry((data >> 5) & 1);
|
||||
|
||||
/* the rest is handled by the video hardware */
|
||||
itech8_blitter_w(space, offset, data);
|
||||
blitter_w(space, offset, data);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(itech8_state::rimrockn_bank_w)
|
||||
{
|
||||
/* banking is controlled here instead of by the blitter output */
|
||||
membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
|
||||
membank("bank1")->set_entry(data & 3);
|
||||
}
|
||||
|
||||
|
||||
@ -738,7 +782,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::delayed_sound_data_w)
|
||||
|
||||
WRITE8_MEMBER(itech8_state::sound_data_w)
|
||||
{
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data);
|
||||
synchronize(TIMER_DELAYED_SOUND_DATA, data);
|
||||
}
|
||||
|
||||
|
||||
@ -749,7 +793,7 @@ WRITE8_MEMBER(itech8_state::gtg2_sound_data_w)
|
||||
((data & 0x5d) << 1) |
|
||||
((data & 0x20) >> 3) |
|
||||
((data & 0x02) << 5);
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data);
|
||||
synchronize(TIMER_DELAYED_SOUND_DATA, data);
|
||||
}
|
||||
|
||||
|
||||
@ -783,14 +827,14 @@ WRITE16_MEMBER(itech8_state::grom_bank16_w)
|
||||
WRITE16_MEMBER(itech8_state::display_page16_w)
|
||||
{
|
||||
if (ACCESSING_BITS_8_15)
|
||||
itech8_page_w(space, 0, ~data >> 8);
|
||||
page_w(space, 0, ~data >> 8);
|
||||
}
|
||||
|
||||
|
||||
WRITE16_MEMBER(itech8_state::palette16_w)
|
||||
{
|
||||
if (ACCESSING_BITS_8_15)
|
||||
itech8_palette_w(space, offset / 8, data >> 8);
|
||||
palette_w(space, offset / 8, data >> 8);
|
||||
}
|
||||
|
||||
|
||||
@ -803,15 +847,15 @@ WRITE16_MEMBER(itech8_state::palette16_w)
|
||||
|
||||
/*------ common layout with TMS34061 at 0000 ------*/
|
||||
static ADDRESS_MAP_START( tmslo_map, AS_PROGRAM, 8, itech8_state )
|
||||
AM_RANGE(0x0000, 0x0fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
|
||||
AM_RANGE(0x0000, 0x0fff) AM_READWRITE(tms34061_r, tms34061_w)
|
||||
AM_RANGE(0x1100, 0x1100) AM_WRITENOP
|
||||
AM_RANGE(0x1120, 0x1120) AM_WRITE(sound_data_w)
|
||||
AM_RANGE(0x1140, 0x1140) AM_READ_PORT("40") AM_WRITE(grom_bank_w)
|
||||
AM_RANGE(0x1160, 0x1160) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
|
||||
AM_RANGE(0x1160, 0x1160) AM_READ_PORT("60") AM_WRITE(page_w)
|
||||
AM_RANGE(0x1180, 0x1180) AM_READ_PORT("80") AM_DEVWRITE("tms34061", tms34061_device, latch_w)
|
||||
AM_RANGE(0x11a0, 0x11a0) AM_WRITE(itech8_nmi_ack_w)
|
||||
AM_RANGE(0x11c0, 0x11df) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
|
||||
AM_RANGE(0x11e0, 0x11ff) AM_WRITE(itech8_palette_w)
|
||||
AM_RANGE(0x11a0, 0x11a0) AM_WRITE(nmi_ack_w)
|
||||
AM_RANGE(0x11c0, 0x11df) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
|
||||
AM_RANGE(0x11e0, 0x11ff) AM_WRITE(palette_w)
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
|
||||
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
|
||||
ADDRESS_MAP_END
|
||||
@ -819,15 +863,15 @@ ADDRESS_MAP_END
|
||||
|
||||
/*------ common layout with TMS34061 at 1000 ------*/
|
||||
static ADDRESS_MAP_START( tmshi_map, AS_PROGRAM, 8, itech8_state )
|
||||
AM_RANGE(0x1000, 0x1fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
|
||||
AM_RANGE(0x1000, 0x1fff) AM_READWRITE(tms34061_r, tms34061_w)
|
||||
AM_RANGE(0x0100, 0x0100) AM_WRITENOP
|
||||
AM_RANGE(0x0120, 0x0120) AM_WRITE(sound_data_w)
|
||||
AM_RANGE(0x0140, 0x0140) AM_READ_PORT("40") AM_WRITE(grom_bank_w)
|
||||
AM_RANGE(0x0160, 0x0160) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
|
||||
AM_RANGE(0x0160, 0x0160) AM_READ_PORT("60") AM_WRITE(page_w)
|
||||
AM_RANGE(0x0180, 0x0180) AM_READ_PORT("80") AM_DEVWRITE("tms34061", tms34061_device, latch_w)
|
||||
AM_RANGE(0x01a0, 0x01a0) AM_WRITE(itech8_nmi_ack_w)
|
||||
AM_RANGE(0x01c0, 0x01df) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
|
||||
AM_RANGE(0x01e0, 0x01ff) AM_WRITE(itech8_palette_w)
|
||||
AM_RANGE(0x01a0, 0x01a0) AM_WRITE(nmi_ack_w)
|
||||
AM_RANGE(0x01c0, 0x01df) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
|
||||
AM_RANGE(0x01e0, 0x01ff) AM_WRITE(palette_w)
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
|
||||
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
|
||||
ADDRESS_MAP_END
|
||||
@ -835,15 +879,15 @@ ADDRESS_MAP_END
|
||||
|
||||
/*------ Golden Tee Golf II 1992 layout ------*/
|
||||
static ADDRESS_MAP_START( gtg2_map, AS_PROGRAM, 8, itech8_state )
|
||||
AM_RANGE(0x0100, 0x0100) AM_READ_PORT("40") AM_WRITE(itech8_nmi_ack_w)
|
||||
AM_RANGE(0x0120, 0x0120) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
|
||||
AM_RANGE(0x0140, 0x015f) AM_WRITE(itech8_palette_w)
|
||||
AM_RANGE(0x0100, 0x0100) AM_READ_PORT("40") AM_WRITE(nmi_ack_w)
|
||||
AM_RANGE(0x0120, 0x0120) AM_READ_PORT("60") AM_WRITE(page_w)
|
||||
AM_RANGE(0x0140, 0x015f) AM_WRITE(palette_w)
|
||||
AM_RANGE(0x0140, 0x0140) AM_READ_PORT("80")
|
||||
AM_RANGE(0x0160, 0x0160) AM_WRITE(grom_bank_w)
|
||||
AM_RANGE(0x0180, 0x019f) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
|
||||
AM_RANGE(0x0180, 0x019f) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
|
||||
AM_RANGE(0x01c0, 0x01c0) AM_WRITE(gtg2_sound_data_w)
|
||||
AM_RANGE(0x01e0, 0x01e0) AM_DEVWRITE("tms34061", tms34061_device, latch_w)
|
||||
AM_RANGE(0x1000, 0x1fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
|
||||
AM_RANGE(0x1000, 0x1fff) AM_READWRITE(tms34061_r, tms34061_w)
|
||||
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
|
||||
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
|
||||
ADDRESS_MAP_END
|
||||
@ -859,9 +903,9 @@ static ADDRESS_MAP_START( ninclown_map, AS_PROGRAM, 16, itech8_state )
|
||||
AM_RANGE(0x100180, 0x100181) AM_READ_PORT("60") AM_WRITE(display_page16_w)
|
||||
AM_RANGE(0x100240, 0x100241) AM_DEVWRITE8("tms34061", tms34061_device, latch_w, 0xff00)
|
||||
AM_RANGE(0x100280, 0x100281) AM_READ_PORT("80") AM_WRITENOP
|
||||
AM_RANGE(0x100300, 0x10031f) AM_READWRITE8(itech8_blitter_r, itech8_blitter_w, 0xffff)
|
||||
AM_RANGE(0x100300, 0x10031f) AM_READWRITE8(blitter_r, blitter_w, 0xffff)
|
||||
AM_RANGE(0x100380, 0x1003ff) AM_WRITE(palette16_w)
|
||||
AM_RANGE(0x110000, 0x110fff) AM_READWRITE8(itech8_tms34061_r, itech8_tms34061_w, 0xffff)
|
||||
AM_RANGE(0x110000, 0x110fff) AM_READWRITE8(tms34061_r, tms34061_w, 0xffff)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -1586,7 +1630,7 @@ INPUT_PORTS_END
|
||||
|
||||
WRITE_LINE_MEMBER(itech8_state::generate_tms34061_interrupt)
|
||||
{
|
||||
itech8_update_interrupts(-1, state, -1);
|
||||
update_interrupts(-1, state, -1);
|
||||
|
||||
if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", m_screen->vpos());
|
||||
}
|
||||
@ -1722,7 +1766,7 @@ static MACHINE_CONFIG_DERIVED( wfortune, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
|
||||
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
@ -1736,7 +1780,7 @@ static MACHINE_CONFIG_DERIVED( grmatch, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_grmatch)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_grmatch)
|
||||
|
||||
/* palette updater */
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("palette_timer", itech8_state, grmatch_palette_update, "screen", 0, 0)
|
||||
@ -1752,7 +1796,7 @@ static MACHINE_CONFIG_DERIVED( stratab_hi, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -1765,7 +1809,7 @@ static MACHINE_CONFIG_DERIVED( stratab_lo, itech8_core_lo )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1811,7 +1855,7 @@ static MACHINE_CONFIG_DERIVED( slikshot_lo_noz80, itech8_core_lo )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1831,7 +1875,7 @@ static MACHINE_CONFIG_DERIVED( hstennis_hi, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1843,7 +1887,7 @@ static MACHINE_CONFIG_DERIVED( hstennis_lo, itech8_core_lo )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1859,7 +1903,7 @@ static MACHINE_CONFIG_DERIVED( rimrockn, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(24, 375, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1875,7 +1919,7 @@ static MACHINE_CONFIG_DERIVED( ninclown, itech8_core_hi )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(64, 423, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1890,7 +1934,7 @@ static MACHINE_CONFIG_DERIVED( gtg2, itech8_core_lo )
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2567,6 +2611,10 @@ DRIVER_INIT_MEMBER(itech8_state,grmatch)
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x0160, 0x0160, write8_delegate(FUNC(itech8_state::grmatch_palette_w),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x0180, 0x0180, write8_delegate(FUNC(itech8_state::grmatch_xscroll_w),this));
|
||||
m_maincpu->space(AS_PROGRAM).unmap_write(0x01e0, 0x01ff);
|
||||
|
||||
save_item(NAME(m_grmatch_palcontrol));
|
||||
save_item(NAME(m_grmatch_xscroll));
|
||||
save_item(NAME(m_grmatch_palette));
|
||||
}
|
||||
|
||||
|
||||
@ -2575,6 +2623,25 @@ DRIVER_INIT_MEMBER(itech8_state,slikshot)
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler (0x0180, 0x0180, read8_delegate(FUNC(itech8_state::slikshot_z80_r),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler (0x01cf, 0x01cf, read8_delegate(FUNC(itech8_state::slikshot_z80_control_r),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01cf, 0x01cf, write8_delegate(FUNC(itech8_state::slikshot_z80_control_w),this));
|
||||
|
||||
m_delayed_z80_control_timer = timer_alloc(TIMER_DELAYED_Z80_CONTROL);
|
||||
|
||||
save_item(NAME(m_z80_ctrl));
|
||||
save_item(NAME(m_z80_port_val));
|
||||
save_item(NAME(m_z80_clear_to_send));
|
||||
save_item(NAME(m_sensor0));
|
||||
save_item(NAME(m_sensor1));
|
||||
save_item(NAME(m_sensor2));
|
||||
save_item(NAME(m_sensor3));
|
||||
save_item(NAME(m_curvx));
|
||||
save_item(NAME(m_curvy));
|
||||
save_item(NAME(m_curx));
|
||||
save_item(NAME(m_xbuffer));
|
||||
save_item(NAME(m_ybuffer));
|
||||
save_item(NAME(m_ybuffer_next));
|
||||
save_item(NAME(m_curxpos));
|
||||
save_item(NAME(m_last_ytotal));
|
||||
save_item(NAME(m_crosshair_vis));
|
||||
}
|
||||
|
||||
|
||||
@ -2620,8 +2687,9 @@ DRIVER_INIT_MEMBER(itech8_state,rimrockn)
|
||||
m_maincpu->space(AS_PROGRAM).install_read_port (0x0165, 0x0165, "165");
|
||||
|
||||
/* different banking mechanism (disable the old one) */
|
||||
membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x4000, 0xc000);
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01a0, 0x01a0, write8_delegate(FUNC(itech8_state::rimrockn_bank_w),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::itech8_blitter_w),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::blitter_w),this));
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,18 +22,28 @@ public:
|
||||
m_subcpu(*this, "sub"),
|
||||
m_tms34061(*this, "tms34061"),
|
||||
m_tlc34076(*this, "tlc34076"),
|
||||
m_visarea(0, 0, 0, 0),
|
||||
m_screen(*this, "screen") { }
|
||||
m_screen(*this, "screen"),
|
||||
m_visarea(0, 0, 0, 0) { }
|
||||
|
||||
enum
|
||||
{
|
||||
TIMER_IRQ_OFF,
|
||||
TIMER_BEHIND_BEAM_UPDATE,
|
||||
TIMER_DELAYED_SOUND_DATA,
|
||||
TIMER_BLITTER_DONE,
|
||||
TIMER_DELAYED_Z80_CONTROL
|
||||
};
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_soundcpu;
|
||||
optional_device<cpu_device> m_subcpu;
|
||||
required_device<tms34061_device> m_tms34061;
|
||||
required_device<tlc34076_device> m_tlc34076;
|
||||
rectangle m_visarea;
|
||||
required_device<screen_device> m_screen;
|
||||
UINT8 m_grom_bank;
|
||||
|
||||
rectangle m_visarea;
|
||||
|
||||
UINT8 m_grom_bank;
|
||||
UINT8 m_blitter_int;
|
||||
UINT8 m_tms34061_int;
|
||||
UINT8 m_periodic_int;
|
||||
@ -63,15 +73,21 @@ public:
|
||||
UINT8 m_fetch_rle_count;
|
||||
UINT8 m_fetch_rle_value;
|
||||
UINT8 m_fetch_rle_literal;
|
||||
struct tms34061_display m_tms_state;
|
||||
UINT8 *m_grom_base;
|
||||
UINT32 m_grom_size;
|
||||
UINT8 m_grmatch_palcontrol;
|
||||
UINT8 m_grmatch_xscroll;
|
||||
rgb_t m_grmatch_palette[2][16];
|
||||
emu_timer *m_irq_off_timer;
|
||||
emu_timer *m_behind_beam_update_timer;
|
||||
emu_timer *m_delayed_sound_data_timer;
|
||||
emu_timer *m_blitter_done_timer;
|
||||
emu_timer *m_delayed_z80_control_timer;
|
||||
|
||||
// common
|
||||
DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt);
|
||||
DECLARE_WRITE8_MEMBER(itech8_nmi_ack_w);
|
||||
DECLARE_WRITE8_MEMBER(blitter_w);
|
||||
DECLARE_WRITE8_MEMBER(nmi_ack_w);
|
||||
DECLARE_WRITE8_MEMBER(blitter_bank_w);
|
||||
DECLARE_WRITE8_MEMBER(rimrockn_bank_w);
|
||||
DECLARE_WRITE8_MEMBER(pia_portb_out);
|
||||
DECLARE_WRITE8_MEMBER(sound_data_w);
|
||||
@ -81,18 +97,20 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(grom_bank16_w);
|
||||
DECLARE_WRITE16_MEMBER(display_page16_w);
|
||||
DECLARE_WRITE16_MEMBER(palette16_w);
|
||||
DECLARE_WRITE8_MEMBER(itech8_palette_w);
|
||||
DECLARE_WRITE8_MEMBER(itech8_page_w);
|
||||
DECLARE_READ8_MEMBER(itech8_blitter_r);
|
||||
DECLARE_WRITE8_MEMBER(itech8_blitter_w);
|
||||
DECLARE_WRITE8_MEMBER(itech8_tms34061_w);
|
||||
DECLARE_READ8_MEMBER(itech8_tms34061_r);
|
||||
DECLARE_WRITE8_MEMBER(palette_w);
|
||||
DECLARE_WRITE8_MEMBER(page_w);
|
||||
DECLARE_READ8_MEMBER(blitter_r);
|
||||
DECLARE_WRITE8_MEMBER(blitter_w);
|
||||
DECLARE_WRITE8_MEMBER(tms34061_w);
|
||||
DECLARE_READ8_MEMBER(tms34061_r);
|
||||
DECLARE_WRITE8_MEMBER(grmatch_palette_w);
|
||||
DECLARE_WRITE8_MEMBER(grmatch_xscroll_w);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(special_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux);
|
||||
DECLARE_WRITE8_MEMBER(pia_porta_out);
|
||||
DECLARE_WRITE8_MEMBER(ym2203_portb_out);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(special_r);
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux);
|
||||
|
||||
DECLARE_DRIVER_INIT(rimrockn);
|
||||
DECLARE_DRIVER_INIT(grmatch);
|
||||
DECLARE_DRIVER_INIT(peggle);
|
||||
@ -101,27 +119,31 @@ public:
|
||||
DECLARE_DRIVER_INIT(arligntn);
|
||||
DECLARE_DRIVER_INIT(hstennis);
|
||||
DECLARE_DRIVER_INIT(sstrike);
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
DECLARE_VIDEO_START(slikshot);
|
||||
DECLARE_MACHINE_START(sstrike);
|
||||
UINT32 screen_update_itech8_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_itech8_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
UINT32 screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(generate_nmi);
|
||||
TIMER_CALLBACK_MEMBER(irq_off);
|
||||
TIMER_CALLBACK_MEMBER(behind_the_beam_update);
|
||||
TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
|
||||
TIMER_CALLBACK_MEMBER(blitter_done);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update);
|
||||
|
||||
inline UINT8 fetch_next_raw();
|
||||
inline void consume_raw(int count);
|
||||
inline UINT8 fetch_next_rle();
|
||||
inline void consume_rle(int count);
|
||||
void perform_blit(address_space &space);
|
||||
void itech8_update_interrupts(int periodic, int tms34061, int blitter);
|
||||
void update_interrupts(int periodic, int tms34061, int blitter);
|
||||
|
||||
/*----------- defined in machine/slikshot.c -----------*/
|
||||
|
||||
@ -143,4 +165,7 @@ public:
|
||||
UINT16 *sens0, UINT16 *sens1, UINT16 *sens2, UINT16 *sens3);
|
||||
void compute_sensors();
|
||||
TIMER_CALLBACK_MEMBER( delayed_z80_control_w );
|
||||
|
||||
protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
};
|
||||
|
@ -509,7 +509,7 @@ TIMER_CALLBACK_MEMBER( itech8_state::delayed_z80_control_w )
|
||||
|
||||
WRITE8_MEMBER(itech8_state::slikshot_z80_control_w )
|
||||
{
|
||||
machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_z80_control_w),this), data);
|
||||
synchronize(TIMER_DELAYED_Z80_CONTROL, data);
|
||||
}
|
||||
|
||||
|
||||
@ -543,7 +543,7 @@ UINT32 itech8_state::screen_update_slikshot(screen_device &screen, bitmap_rgb32
|
||||
int temp, i;
|
||||
|
||||
/* draw the normal video first */
|
||||
screen_update_itech8_2page(screen, bitmap, cliprect);
|
||||
screen_update_2page(screen, bitmap, cliprect);
|
||||
|
||||
/* add the current X,Y positions to the list */
|
||||
m_xbuffer[m_ybuffer_next % YBUFFER_COUNT] = ioport("FAKEX")->read_safe(0);
|
||||
|
@ -90,7 +90,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/tlc34076.h"
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "includes/itech8.h"
|
||||
|
||||
@ -112,18 +111,18 @@
|
||||
*
|
||||
*************************************/
|
||||
|
||||
#define BLITTER_ADDRHI blitter_data[0]
|
||||
#define BLITTER_ADDRLO blitter_data[1]
|
||||
#define BLITTER_FLAGS blitter_data[2]
|
||||
#define BLITTER_STATUS blitter_data[3]
|
||||
#define BLITTER_WIDTH blitter_data[4]
|
||||
#define BLITTER_HEIGHT blitter_data[5]
|
||||
#define BLITTER_MASK blitter_data[6]
|
||||
#define BLITTER_OUTPUT blitter_data[7]
|
||||
#define BLITTER_XSTART blitter_data[8]
|
||||
#define BLITTER_YCOUNT blitter_data[9]
|
||||
#define BLITTER_XSTOP blitter_data[10]
|
||||
#define BLITTER_YSKIP blitter_data[11]
|
||||
#define BLITTER_ADDRHI m_blitter_data[0]
|
||||
#define BLITTER_ADDRLO m_blitter_data[1]
|
||||
#define BLITTER_FLAGS m_blitter_data[2]
|
||||
#define BLITTER_STATUS m_blitter_data[3]
|
||||
#define BLITTER_WIDTH m_blitter_data[4]
|
||||
#define BLITTER_HEIGHT m_blitter_data[5]
|
||||
#define BLITTER_MASK m_blitter_data[6]
|
||||
#define BLITTER_OUTPUT m_blitter_data[7]
|
||||
#define BLITTER_XSTART m_blitter_data[8]
|
||||
#define BLITTER_YCOUNT m_blitter_data[9]
|
||||
#define BLITTER_XSTOP m_blitter_data[10]
|
||||
#define BLITTER_YSKIP m_blitter_data[11]
|
||||
|
||||
#define BLITFLAG_SHIFT 0x01
|
||||
#define BLITFLAG_XFLIP 0x02
|
||||
@ -150,6 +149,14 @@ void itech8_state::video_start()
|
||||
/* fetch the GROM base */
|
||||
m_grom_base = memregion("grom")->base();
|
||||
m_grom_size = memregion("grom")->bytes();
|
||||
|
||||
save_item(NAME(m_blitter_data));
|
||||
save_item(NAME(m_blit_in_progress));
|
||||
save_item(NAME(m_page_select));
|
||||
save_item(NAME(m_fetch_offset));
|
||||
save_item(NAME(m_fetch_rle_count));
|
||||
save_item(NAME(m_fetch_rle_value));
|
||||
save_item(NAME(m_fetch_rle_literal));
|
||||
}
|
||||
|
||||
|
||||
@ -160,7 +167,7 @@ void itech8_state::video_start()
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(itech8_state::itech8_palette_w)
|
||||
WRITE8_MEMBER(itech8_state::palette_w)
|
||||
{
|
||||
m_tlc34076->write(space, offset/2, data);
|
||||
}
|
||||
@ -173,7 +180,7 @@ WRITE8_MEMBER(itech8_state::itech8_palette_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(itech8_state::itech8_page_w)
|
||||
WRITE8_MEMBER(itech8_state::page_w)
|
||||
{
|
||||
m_screen->update_partial(m_screen->vpos());
|
||||
logerror("%04x:display_page = %02X (%d)\n", space.device().safe_pc(), data, m_screen->vpos());
|
||||
@ -256,7 +263,6 @@ inline void itech8_state::consume_rle(int count)
|
||||
|
||||
void itech8_state::perform_blit(address_space &space)
|
||||
{
|
||||
UINT8 *blitter_data = m_blitter_data;
|
||||
offs_t addr = m_tms34061->m_display.regs[TMS34061_XYADDRESS] | ((m_tms34061->m_display.regs[TMS34061_XYOFFSET] & 0x300) << 8);
|
||||
UINT8 shift = (BLITTER_FLAGS & BLITFLAG_SHIFT) ? 4 : 0;
|
||||
int transparent = (BLITTER_FLAGS & BLITFLAG_TRANSPARENT);
|
||||
@ -395,7 +401,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
|
||||
{
|
||||
/* turn off blitting and generate an interrupt */
|
||||
m_blit_in_progress = 0;
|
||||
itech8_update_interrupts(-1, -1, 1);
|
||||
update_interrupts(-1, -1, 1);
|
||||
|
||||
if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", m_screen->vpos());
|
||||
}
|
||||
@ -408,7 +414,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER(itech8_state::itech8_blitter_r)
|
||||
READ8_MEMBER(itech8_state::blitter_r)
|
||||
{
|
||||
int result = m_blitter_data[offset / 2];
|
||||
static const char *const portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" };
|
||||
@ -422,7 +428,7 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
|
||||
/* a read from offset 3 clears the interrupt and returns the status */
|
||||
if (offset == 3)
|
||||
{
|
||||
itech8_update_interrupts(-1, -1, 0);
|
||||
update_interrupts(-1, -1, 0);
|
||||
if (m_blit_in_progress)
|
||||
result |= 0x80;
|
||||
else
|
||||
@ -437,13 +443,11 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(itech8_state::itech8_blitter_w)
|
||||
WRITE8_MEMBER(itech8_state::blitter_w)
|
||||
{
|
||||
UINT8 *blitter_data = m_blitter_data;
|
||||
|
||||
/* low bit seems to be ignored */
|
||||
offset /= 2;
|
||||
blitter_data[offset] = data;
|
||||
m_blitter_data[offset] = data;
|
||||
|
||||
/* a write to offset 3 starts things going */
|
||||
if (offset == 3)
|
||||
@ -453,18 +457,18 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
|
||||
{
|
||||
logerror("Blit: XY=%1X%04X SRC=%02X%02X%02X SIZE=%3dx%3d FLAGS=%02x",
|
||||
(m_tms34061->m_display.regs[TMS34061_XYOFFSET] >> 8) & 0x0f, m_tms34061->m_display.regs[TMS34061_XYADDRESS],
|
||||
m_grom_bank, blitter_data[0], blitter_data[1],
|
||||
blitter_data[4], blitter_data[5],
|
||||
blitter_data[2]);
|
||||
m_grom_bank, m_blitter_data[0], m_blitter_data[1],
|
||||
m_blitter_data[4], m_blitter_data[5],
|
||||
m_blitter_data[2]);
|
||||
logerror(" %02X %02X %02X [%02X] %02X %02X %02X [%02X]-%02X %02X %02X %02X [%02X %02X %02X %02X]\n",
|
||||
blitter_data[0], blitter_data[1],
|
||||
blitter_data[2], blitter_data[3],
|
||||
blitter_data[4], blitter_data[5],
|
||||
blitter_data[6], blitter_data[7],
|
||||
blitter_data[8], blitter_data[9],
|
||||
blitter_data[10], blitter_data[11],
|
||||
blitter_data[12], blitter_data[13],
|
||||
blitter_data[14], blitter_data[15]);
|
||||
m_blitter_data[0], m_blitter_data[1],
|
||||
m_blitter_data[2], m_blitter_data[3],
|
||||
m_blitter_data[4], m_blitter_data[5],
|
||||
m_blitter_data[6], m_blitter_data[7],
|
||||
m_blitter_data[8], m_blitter_data[9],
|
||||
m_blitter_data[10], m_blitter_data[11],
|
||||
m_blitter_data[12], m_blitter_data[13],
|
||||
m_blitter_data[14], m_blitter_data[15]);
|
||||
}
|
||||
|
||||
/* perform the blit */
|
||||
@ -472,7 +476,7 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
|
||||
m_blit_in_progress = 1;
|
||||
|
||||
/* set a timer to go off when we're done */
|
||||
machine().scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), timer_expired_delegate(FUNC(itech8_state::blitter_done),this));
|
||||
m_blitter_done_timer->adjust(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12));
|
||||
}
|
||||
|
||||
/* debugging */
|
||||
@ -487,7 +491,7 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(itech8_state::itech8_tms34061_w)
|
||||
WRITE8_MEMBER(itech8_state::tms34061_w)
|
||||
{
|
||||
int func = (offset >> 9) & 7;
|
||||
int col = offset & 0xff;
|
||||
@ -502,7 +506,7 @@ WRITE8_MEMBER(itech8_state::itech8_tms34061_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(itech8_state::itech8_tms34061_r)
|
||||
READ8_MEMBER(itech8_state::tms34061_r)
|
||||
{
|
||||
int func = (offset >> 9) & 7;
|
||||
int col = offset & 0xff;
|
||||
@ -570,7 +574,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(itech8_state::grmatch_palette_update)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
UINT32 itech8_state::screen_update_itech8_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
UINT32 itech8_state::screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
UINT32 page_offset;
|
||||
int x, y;
|
||||
@ -606,7 +610,7 @@ UINT32 itech8_state::screen_update_itech8_2layer(screen_device &screen, bitmap_r
|
||||
}
|
||||
|
||||
|
||||
UINT32 itech8_state::screen_update_itech8_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
UINT32 itech8_state::screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
UINT32 page_offset;
|
||||
int x, y;
|
||||
@ -653,7 +657,7 @@ UINT32 itech8_state::screen_update_itech8_grmatch(screen_device &screen, bitmap_
|
||||
}
|
||||
|
||||
|
||||
UINT32 itech8_state::screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
UINT32 itech8_state::screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
UINT32 page_offset;
|
||||
int x, y;
|
||||
@ -684,7 +688,7 @@ UINT32 itech8_state::screen_update_itech8_2page(screen_device &screen, bitmap_rg
|
||||
}
|
||||
|
||||
|
||||
UINT32 itech8_state::screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
UINT32 itech8_state::screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
UINT32 page_offset;
|
||||
int x, y;
|
||||
|
Loading…
Reference in New Issue
Block a user