Added save states to equites.c, exedexes.c, exerion.c and exprraid.c

This commit is contained in:
Fabio Priuli 2009-11-25 21:07:22 +00:00
parent c8178c6b75
commit e021bc1c14
13 changed files with 696 additions and 437 deletions

2
.gitattributes vendored
View File

@ -2423,9 +2423,11 @@ src/mame/includes/eprom.h svneol=native#text/plain
src/mame/includes/equites.h svneol=native#text/plain
src/mame/includes/espial.h svneol=native#text/plain
src/mame/includes/esripsys.h svneol=native#text/plain
src/mame/includes/exedexes.h svneol=native#text/plain
src/mame/includes/exerion.h svneol=native#text/plain
src/mame/includes/exidy.h svneol=native#text/plain
src/mame/includes/exidy440.h svneol=native#text/plain
src/mame/includes/exprraid.h svneol=native#text/plain
src/mame/includes/exterm.h svneol=native#text/plain
src/mame/includes/f1gp.h svneol=native#text/plain
src/mame/includes/fastfred.h svneol=native#text/plain

View File

@ -385,61 +385,43 @@ D
#define MSM5232_MIN_CLOCK 214000 // unstable
/******************************************************************************/
static UINT16 *equites_workram;
static UINT8 *mcu_ram;
static int equites_sound_prom_address;
static UINT8 equites_dac_latch;
static UINT8 equites_8155_portb;
static UINT8 eq8155_port_a,eq8155_port_c,ay_port_a,ay_port_b,eq_cymbal_ctrl;
static MACHINE_RESET(equites)
{
flip_screen_set(machine, 0);
}
/******************************************************************************/
// Sound
/******************************************************************************/
static emu_timer *nmi_timer, *adjuster_timer;
static TIMER_CALLBACK( equites_nmi_callback )
{
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
}
static float cymvol,hihatvol;
static TIMER_CALLBACK( equites_frq_adjuster_callback )
{
const device_config *msm = devtag_get_device(machine, "msm");
equites_state *state = (equites_state *)machine->driver_data;
UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
msm5232_set_clock(msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", eq8155_port_c,eq8155_port_a,ay_port_a,ay_port_b,eq_cymbal_ctrl&15);
msm5232_set_clock(state->msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
//popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", state->eq8155_port_c, state->eq8155_port_a, state->ay_port_a, state->ay_port_b, state->eq_cymbal_ctrl & 15);
cymvol *= 0.94f;
hihatvol *= 0.94f;
state->cymvol *= 0.94f;
state->hihatvol *= 0.94f;
sound_set_output_gain(msm, 10, hihatvol + cymvol * (ay_port_b & 3) * 0.33); /* NO from msm5232 */
sound_set_output_gain(state->msm, 10, state->hihatvol + state->cymvol * (state->ay_port_b & 3) * 0.33); /* NO from msm5232 */
}
static SOUND_START(equites)
{
nmi_timer = timer_alloc(machine, equites_nmi_callback, NULL);
equites_state *state = (equites_state *)machine->driver_data;
state->nmi_timer = timer_alloc(machine, equites_nmi_callback, NULL);
adjuster_timer = timer_alloc(machine, equites_frq_adjuster_callback, NULL);
timer_adjust_periodic(adjuster_timer, ATTOTIME_IN_HZ(60), 0, ATTOTIME_IN_HZ(60));
state->adjuster_timer = timer_alloc(machine, equites_frq_adjuster_callback, NULL);
timer_adjust_periodic(state->adjuster_timer, ATTOTIME_IN_HZ(60), 0, ATTOTIME_IN_HZ(60));
}
static WRITE8_HANDLER(equites_c0f8_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
switch (offset)
{
case 0: // c0f8: NMI ack (written by NMI handler)
@ -448,7 +430,7 @@ static WRITE8_HANDLER(equites_c0f8_w)
case 1: // c0f9: RST75 trigger (written by NMI handler)
// Note: solder pad CP3 on the pcb would allow to disable this
generic_pulse_irq_line(cputag_get_cpu(space->machine, "audiocpu"), I8085_RST75_LINE);
generic_pulse_irq_line(state->audio_cpu, I8085_RST75_LINE);
break;
case 2: // c0fa: INTR trigger (written by NMI handler)
@ -461,7 +443,7 @@ static WRITE8_HANDLER(equites_c0f8_w)
break;
case 4: // c0fc: increment PROM address (written by NMI handler)
equites_sound_prom_address = (equites_sound_prom_address + 1) & 0x1f;
state->sound_prom_address = (state->sound_prom_address + 1) & 0x1f;
// at this point, the 5-bit value
// goes to an op-amp and to the base of a transistor. The transistor is part
// of a resonator that is used to generate the M5232 clock. The PROM doesn't
@ -479,106 +461,108 @@ static WRITE8_HANDLER(equites_c0f8_w)
case 7: // c0ff: sound command latch clear
// Note: solder pad CP1 on the pcb would allow to disable this
soundlatch_clear_w(space,0,0);
soundlatch_clear_w(space, 0, 0);
break;
}
}
#define POPDRUMKIT 0
#if POPDRUMKIT
static int hihat,cymbal;
#endif
static WRITE8_DEVICE_HANDLER(equites_8910porta_w)
static WRITE8_DEVICE_HANDLER( equites_8910porta_w )
{
equites_state *state = (equites_state *)device->machine->driver_data;
// bongo 1
sample_set_volume(device, 0, ((data & 0x30)>>4) * 0.33);
if (data & ~ay_port_a & 0x80)
sample_set_volume(device, 0, ((data & 0x30) >> 4) * 0.33);
if (data & ~state->ay_port_a & 0x80)
sample_start(device, 0, 0, 0);
// bongo 2
sample_set_volume(device, 1, (data & 0x03) * 0.33);
if (data & ~ay_port_a & 0x08)
if (data & ~state->ay_port_a & 0x08)
sample_start(device, 1, 1, 0);
ay_port_a = data;
state->ay_port_a = data;
#if POPDRUMKIT
popmessage("HH %d(%d) CYM %d(%d)",hihat,BIT(ay_port_b,6),cymbal,ay_port_b&3);
popmessage("HH %d(%d) CYM %d(%d)", state->hihat, BIT(state->ay_port_b, 6), state->cymbal, state->ay_port_b & 3);
#endif
}
static WRITE8_DEVICE_HANDLER(equites_8910portb_w)
static WRITE8_DEVICE_HANDLER( equites_8910portb_w )
{
equites_state *state = (equites_state *)device->machine->driver_data;
#if POPDRUMKIT
if (data & ~ay_port_b & 0x08) cymbal++;
if (data & ~ay_port_b & 0x04) hihat++;
if (data & ~state->ay_port_b & 0x08) state->cymbal++;
if (data & ~state->ay_port_b & 0x04) state->hihat++;
#endif
// bongo 3
sample_set_volume(device, 2, ((data & 0x30)>>4) * 0.33);
if (data & ~ay_port_b & 0x80)
if (data & ~state->ay_port_b & 0x80)
sample_start(device, 2, 2, 0);
// FIXME I'm just enabling the MSM5232 Noise Output for now. Proper emulation
// of the analog circuitry should be done instead.
// if (data & ~ay_port_b & 0x08) cymbal hit trigger
// if (data & ~ay_port_b & 0x04) hi-hat hit trigger
// if (data & ~state->ay_port_b & 0x08) cymbal hit trigger
// if (data & ~state->ay_port_b & 0x04) hi-hat hit trigger
// data & 3 cymbal volume
// data & 0x40 hi-hat enable
if (data & ~ay_port_b & 0x08)
cymvol = 1.0f;
if (data & ~state->ay_port_b & 0x08)
state->cymvol = 1.0f;
if (data & ~ay_port_b & 0x04)
hihatvol = 0.8f;
if (data & ~state->ay_port_b & 0x04)
state->hihatvol = 0.8f;
if (~data & 0x40)
hihatvol = 0.0f;
state->hihatvol = 0.0f;
ay_port_b = data;
state->ay_port_b = data;
#if POPDRUMKIT
popmessage("HH %d(%d) CYM %d(%d)",hihat,BIT(ay_port_b,6),cymbal,ay_port_b&3);
popmessage("HH %d(%d) CYM %d(%d)",state->hihat,BIT(state->ay_port_b,6),state->cymbal,state->ay_port_b & 3);
#endif
}
static WRITE8_HANDLER(equites_cymbal_ctrl_w)
{
eq_cymbal_ctrl++;
equites_state *state = (equites_state *)space->machine->driver_data;
state->eq_cymbal_ctrl++;
}
static void equites_update_dac(running_machine *machine)
static void equites_update_dac( running_machine *machine )
{
equites_state *state = (equites_state *)machine->driver_data;
// there is only one latch, which is used to drive two DAC channels.
// When the channel is enabled in the 4066, it goes to a series of
// low-pass filters. The channel is kept enabled only for a short time,
// then it's disabled again.
// Note that PB0 goes through three filters while PB1 only goes through one.
if (equites_8155_portb & 1)
dac_signed_data_w(devtag_get_device(machine, "dac1"), equites_dac_latch);
if (state->eq8155_port_b & 1)
dac_signed_data_w(state->dac_1, state->dac_latch);
if (equites_8155_portb & 2)
dac_signed_data_w(devtag_get_device(machine, "dac2"), equites_dac_latch);
if (state->eq8155_port_b & 2)
dac_signed_data_w(state->dac_2, state->dac_latch);
}
static WRITE8_HANDLER(equites_dac_latch_w)
static WRITE8_HANDLER( equites_dac_latch_w )
{
equites_dac_latch = data<<2;
equites_state *state = (equites_state *)space->machine->driver_data;
state->dac_latch = data << 2;
equites_update_dac(space->machine);
}
static WRITE8_HANDLER(equites_8155_portb_w)
static WRITE8_HANDLER( equites_8155_portb_w )
{
equites_8155_portb = data;
equites_state *state = (equites_state *)space->machine->driver_data;
state->eq8155_port_b = data;
equites_update_dac(space->machine);
}
static void equites_msm5232_gate(const device_config *device, int state)
static void equites_msm5232_gate( const device_config *device, int state )
{
}
@ -599,49 +583,43 @@ static INTERRUPT_GEN( equites_interrupt )
static WRITE8_HANDLER(equites_8155_w)
{
static int timer_count;
const device_config *device;
equites_state *state = (equites_state *)space->machine->driver_data;
// FIXME proper 8155 emulation must be implemented
switch( offset )
{
case 0: //logerror( "8155 Command register write %x, timer command = %x, interrupt enable = %x, ports = %x\n", data, (data >> 6) & 3, (data >> 4) & 3, data & 0xf );
if (((data >> 6) & 3) == 3)
timer_adjust_periodic(nmi_timer, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / timer_count), 0, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / timer_count));
timer_adjust_periodic(state->nmi_timer, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / state->timer_count), 0, ATTOTIME_IN_HZ(XTAL_6_144MHz/2 / state->timer_count));
break;
case 1: //logerror( "8155 I/O Port A write %x\n", data );
eq8155_port_a = data;
device = devtag_get_device(space->machine, "msm");
sound_set_output_gain(device, 0, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(device, 1, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(device, 2, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(device, 3, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(device, 4, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(device, 5, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(device, 6, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(device, 7, (data & 0x0f) / 15.0); /* group2 from msm5232 */
state->eq8155_port_a = data;
sound_set_output_gain(state->msm, 0, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(state->msm, 1, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(state->msm, 2, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(state->msm, 3, (data >> 4) / 15.0); /* group1 from msm5232 */
sound_set_output_gain(state->msm, 4, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(state->msm, 5, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(state->msm, 6, (data & 0x0f) / 15.0); /* group2 from msm5232 */
sound_set_output_gain(state->msm, 7, (data & 0x0f) / 15.0); /* group2 from msm5232 */
break;
case 2: //logerror( "8155 I/O Port B write %x\n", data );
equites_8155_portb_w(space,0,data);
equites_8155_portb_w(space, 0, data);
break;
case 3: //logerror( "8155 I/O Port C (or control) write %x\n", data );
eq8155_port_c = data;
device = devtag_get_device(space->machine, "msm");
sound_set_output_gain(device, 8, (data & 0x0f) / 15.0); /* SOLO 8' from msm5232 */
state->eq8155_port_c = data;
sound_set_output_gain(state->msm, 8, (data & 0x0f) / 15.0); /* SOLO 8' from msm5232 */
if (data & 0x20)
sound_set_output_gain(device, 9, (data & 0x0f) / 15.0); /* SOLO 16' from msm5232 */
sound_set_output_gain(state->msm, 9, (data & 0x0f) / 15.0); /* SOLO 16' from msm5232 */
else
sound_set_output_gain(device, 9, 0); /* SOLO 16' from msm5232 */
sound_set_output_gain(state->msm, 9, 0); /* SOLO 16' from msm5232 */
break;
case 4: //logerror( "8155 Timer low 8 bits write %x\n", data );
timer_count = (timer_count & 0xff00) | data;
state->timer_count = (state->timer_count & 0xff00) | data;
break;
case 5: //logerror( "8155 Timer high 6 bits write %x, timer mode %x\n", data & 0x3f, (data >> 6) & 3);
timer_count = (timer_count & 0x00ff) | ((data & 0x3f) << 8);
state->timer_count = (state->timer_count & 0x00ff) | ((data & 0x3f) << 8);
break;
}
}
@ -657,22 +635,22 @@ static READ16_HANDLER(hvoltage_debug_r)
#endif
// Gekisou special handling
static int unknown_bit;
static CUSTOM_INPUT( gekisou_unknown_status )
{
return unknown_bit;
equites_state *state = (equites_state *)field->port->machine->driver_data;
return state->unknown_bit;
}
static WRITE16_HANDLER( gekisou_unknown_0_w )
{
unknown_bit = 0;
equites_state *state = (equites_state *)space->machine->driver_data;
state->unknown_bit = 0;
}
static WRITE16_HANDLER( gekisou_unknown_1_w )
{
unknown_bit = 1;
equites_state *state = (equites_state *)space->machine->driver_data;
state->unknown_bit = 1;
}
/******************************************************************************/
@ -681,21 +659,24 @@ static WRITE16_HANDLER( gekisou_unknown_1_w )
static READ16_HANDLER(equites_spriteram_kludge_r)
{
if (spriteram16[0] == 0x5555)
equites_state *state = (equites_state *)space->machine->driver_data;
if (state->spriteram[0] == 0x5555)
return 0;
else
return spriteram16[0];
return state->spriteram[0];
}
static READ16_HANDLER(mcu_r)
{
return 0xff00 | mcu_ram[offset];
equites_state *state = (equites_state *)space->machine->driver_data;
return 0xff00 | state->mcu_ram[offset];
}
static WRITE16_HANDLER(mcu_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
if (ACCESSING_BITS_0_7)
mcu_ram[offset] = data & 0xff;
state->mcu_ram[offset] = data & 0xff;
}
static WRITE16_HANDLER( mcu_halt_assert_w )
@ -714,10 +695,10 @@ static ADDRESS_MAP_START( equites_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x00ffff) AM_ROM // ROM area is written several times (dev system?)
AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size) // nvram is for gekisou only
AM_RANGE(0x080000, 0x080fff) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit
AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_BASE(&equites_bg_videoram)
AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_BASE_MEMBER(equites_state, bg_videoram)
AM_RANGE(0x0c0200, 0x0c0fff) AM_RAM
AM_RANGE(0x100000, 0x100001) AM_READ(equites_spriteram_kludge_r)
AM_RANGE(0x100000, 0x1001ff) AM_RAM AM_BASE(&spriteram16)
AM_RANGE(0x100000, 0x1001ff) AM_RAM AM_BASE_MEMBER(equites_state, spriteram)
AM_RANGE(0x140000, 0x1407ff) AM_READWRITE(mcu_r, mcu_w) // 8-bit
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN1") AM_WRITE(soundlatch_word_w) // LSB: sound latch
AM_RANGE(0x184000, 0x184001) AM_WRITE(equites_flip0_w)
@ -735,7 +716,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( splndrbt_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x00ffff) AM_ROM
AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE(&equites_workram) // work RAM
AM_RANGE(0x040000, 0x040fff) AM_RAM AM_BASE_MEMBER(equites_state, workram) // work RAM
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") // joyport [2211]
AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN1") AM_WRITE(splndrbt_flip0_w) // [MMLL] MM: bg color register, LL: normal screen
AM_RANGE(0x0c4000, 0x0c4001) AM_WRITE(mcu_halt_clear_w) // 8404 control port1
@ -750,10 +731,10 @@ static ADDRESS_MAP_START( splndrbt_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(splndrbt_bg_scrolly_w)
AM_RANGE(0x180000, 0x1807ff) AM_READWRITE(mcu_r, mcu_w) // 8-bit
AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit
AM_RANGE(0x400000, 0x4007ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_BASE(&equites_bg_videoram)
AM_RANGE(0x400000, 0x4007ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_BASE_MEMBER(equites_state, bg_videoram)
AM_RANGE(0x400800, 0x400fff) AM_RAM
AM_RANGE(0x600000, 0x6000ff) AM_RAM AM_BASE(&spriteram16) // sprite RAM 0,1
AM_RANGE(0x600100, 0x6001ff) AM_RAM AM_BASE(&spriteram16_2) // sprite RAM 2 (8-bit)
AM_RANGE(0x600000, 0x6000ff) AM_RAM AM_BASE_MEMBER(equites_state, spriteram) // sprite RAM 0,1
AM_RANGE(0x600100, 0x6001ff) AM_RAM AM_BASE_MEMBER(equites_state, spriteram_2) // sprite RAM 2 (8-bit)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
@ -775,7 +756,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&mcu_ram) /* main CPU shared RAM */
AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE_MEMBER(equites_state, mcu_ram) /* main CPU shared RAM */
ADDRESS_MAP_END
/******************************************************************************/
@ -1197,8 +1178,70 @@ MACHINE_DRIVER_END
/******************************************************************************/
static MACHINE_START( equites )
{
equites_state *state = (equites_state *)machine->driver_data;
state->audio_cpu = devtag_get_device(machine, "audiocpu");
state->msm = devtag_get_device(machine, "msm");
state->dac_1 = devtag_get_device(machine, "dac1");
state->dac_2 = devtag_get_device(machine, "dac2");
state_save_register_global(machine, state->fg_char_bank);
state_save_register_global(machine, state->bgcolor);
state_save_register_global(machine, state->splndrbt_bg_scrollx);
state_save_register_global(machine, state->splndrbt_bg_scrolly);
state_save_register_global(machine, state->sound_prom_address);
state_save_register_global(machine, state->dac_latch);
state_save_register_global(machine, state->eq8155_port_b);
state_save_register_global(machine, state->eq8155_port_a);
state_save_register_global(machine, state->eq8155_port_c);
state_save_register_global(machine, state->ay_port_a);
state_save_register_global(machine, state->ay_port_b);
state_save_register_global(machine, state->eq_cymbal_ctrl);
state_save_register_global(machine, state->cymvol);
state_save_register_global(machine, state->hihatvol);
state_save_register_global(machine, state->timer_count);
state_save_register_global(machine, state->unknown_bit);
#if POPDRUMKIT
state_save_register_global(machine, state->hihat);
state_save_register_global(machine, state->cymbal);
#endif
}
static MACHINE_RESET( equites )
{
equites_state *state = (equites_state *)machine->driver_data;
flip_screen_set(machine, 0);
state->fg_char_bank = 0;
state->bgcolor = 0;
state->splndrbt_bg_scrollx = 0;
state->splndrbt_bg_scrolly = 0;
state->sound_prom_address = 0;
state->dac_latch = 0;
state->eq8155_port_b = 0;
state->eq8155_port_a = 0;
state->eq8155_port_c = 0;
state->ay_port_a = 0;
state->ay_port_b = 0;
state->eq_cymbal_ctrl = 0;
state->cymvol = 0.0;
state->hihatvol = 0.0;
state->timer_count = 0;
state->unknown_bit = 0;
#if POPDRUMKIT
state->hihat = state->cymbal = 0;
#endif
}
static MACHINE_DRIVER_START( equites )
/* driver data */
MDRV_DRIVER_DATA(equites_state)
/* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */
MDRV_CPU_PROGRAM_MAP(equites_map)
@ -1222,6 +1265,7 @@ static MACHINE_DRIVER_START( equites )
MDRV_VIDEO_START(equites)
MDRV_VIDEO_UPDATE(equites)
MDRV_MACHINE_START(equites)
MDRV_MACHINE_RESET(equites)
MACHINE_DRIVER_END
@ -1237,6 +1281,9 @@ MACHINE_DRIVER_END
static MACHINE_DRIVER_START( splndrbt )
/* driver data */
MDRV_DRIVER_DATA(equites_state)
/* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
MDRV_CPU_PROGRAM_MAP(splndrbt_map)
@ -1260,6 +1307,7 @@ static MACHINE_DRIVER_START( splndrbt )
MDRV_VIDEO_START(splndrbt)
MDRV_VIDEO_UPDATE(splndrbt)
MDRV_MACHINE_START(equites)
MDRV_MACHINE_RESET(equites)
MACHINE_DRIVER_END
@ -1805,7 +1853,7 @@ ROM_END
/******************************************************************************/
// Initializations
static void unpack_block(running_machine *machine, const char *region, int offset, int size)
static void unpack_block( running_machine *machine, const char *region, int offset, int size )
{
UINT8 *rom = memory_region(machine, region);
int i;
@ -1817,7 +1865,7 @@ static void unpack_block(running_machine *machine, const char *region, int offse
}
}
static void unpack_region(running_machine *machine, const char *region)
static void unpack_region( running_machine *machine, const char *region )
{
unpack_block(machine, region, 0x0000, 0x2000);
unpack_block(machine, region, 0x4000, 0x2000);
@ -1871,13 +1919,13 @@ static DRIVER_INIT( hvoltage )
// Game Entries
// Equites Hardware
GAME( 1984, equites, 0, equites, equites, equites, ROT90, "Alpha Denshi Co.", "Equites", GAME_IMPERFECT_SOUND )
GAME( 1984, equitess, equites, equites, equites, equites, ROT90, "Alpha Denshi Co. (Sega license)", "Equites (Sega)", GAME_IMPERFECT_SOUND )
GAME( 1984, bullfgtr, 0, equites, bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co.", "Bull Fighter", GAME_IMPERFECT_SOUND )
GAME( 1984, bullfgtrs,bullfgtr, equites, bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", GAME_IMPERFECT_SOUND )
GAME( 1985, kouyakyu, 0, equites, kouyakyu, kouyakyu, ROT0, "Alpha Denshi Co.", "The Koukouyakyuh", GAME_IMPERFECT_SOUND )
GAME( 1985, gekisou, 0, gekisou, gekisou, gekisou, ROT90, "Eastern Corp.", "Gekisou (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1984, equites, 0, equites, equites, equites, ROT90, "Alpha Denshi Co.", "Equites", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1984, equitess, equites, equites, equites, equites, ROT90, "Alpha Denshi Co. (Sega license)", "Equites (Sega)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1984, bullfgtr, 0, equites, bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co.", "Bull Fighter", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1984, bullfgtrs,bullfgtr, equites, bullfgtr, bullfgtr, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1985, kouyakyu, 0, equites, kouyakyu, kouyakyu, ROT0, "Alpha Denshi Co.", "The Koukouyakyuh", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1985, gekisou, 0, gekisou, gekisou, gekisou, ROT90, "Eastern Corp.", "Gekisou (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
// Splendor Blast Hardware
GAME( 1985, splndrbt, 0, splndrbt, splndrbt, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1985, hvoltage, 0, splndrbt, hvoltage, hvoltage, ROT0, "Alpha Denshi Co.", "High Voltage", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1985, splndrbt, 0, splndrbt, splndrbt, splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1985, hvoltage, 0, splndrbt, hvoltage, hvoltage, ROT0, "Alpha Denshi Co.", "High Voltage", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )

View File

@ -1,11 +1,11 @@
/***************************************************************************
Exed Exes
Exed Exes
Notes:
- Flip screen is not supported, but doesn't seem to be used (no flip screen
dip switch and no cocktail mode)
- Some writes to unknown memory locations (always 0?)
Notes:
- Flip screen is not supported, but doesn't seem to be used (no flip screen
dip switch and no cocktail mode)
- Some writes to unknown memory locations (always 0?)
***************************************************************************/
@ -14,22 +14,7 @@ Notes:
#include "deprecat.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
extern UINT8 *exedexes_bg_scroll;
extern UINT8 *exedexes_nbg_yscroll;
extern UINT8 *exedexes_nbg_xscroll;
extern WRITE8_HANDLER( exedexes_videoram_w );
extern WRITE8_HANDLER( exedexes_colorram_w );
extern WRITE8_HANDLER( exedexes_c804_w );
extern WRITE8_HANDLER( exedexes_gfxctrl_w );
extern PALETTE_INIT( exedexes );
extern VIDEO_START( exedexes );
extern VIDEO_UPDATE( exedexes );
extern VIDEO_EOF( exedexes );
#include "exedexes.h"
static INTERRUPT_GEN( exedexes_interrupt )
@ -41,7 +26,6 @@ static INTERRUPT_GEN( exedexes_interrupt )
}
static ADDRESS_MAP_START( exedexes_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
@ -52,11 +36,11 @@ static ADDRESS_MAP_START( exedexes_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0xc800, 0xc800) AM_WRITE(soundlatch_w)
AM_RANGE(0xc804, 0xc804) AM_WRITE(exedexes_c804_w) /* coin counters + text layer enable */
AM_RANGE(0xc806, 0xc806) AM_WRITENOP /* Watchdog ?? */
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(exedexes_videoram_w) AM_BASE(&videoram) /* Video RAM */
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(exedexes_colorram_w) AM_BASE(&colorram) /* Color RAM */
AM_RANGE(0xd800, 0xd801) AM_WRITE(SMH_RAM) AM_BASE(&exedexes_nbg_yscroll)
AM_RANGE(0xd802, 0xd803) AM_WRITE(SMH_RAM) AM_BASE(&exedexes_nbg_xscroll)
AM_RANGE(0xd804, 0xd805) AM_WRITE(SMH_RAM) AM_BASE(&exedexes_bg_scroll)
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(exedexes_videoram_w) AM_BASE_MEMBER(exedexes_state, videoram) /* Video RAM */
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(exedexes_colorram_w) AM_BASE_MEMBER(exedexes_state, colorram) /* Color RAM */
AM_RANGE(0xd800, 0xd801) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(exedexes_state, nbg_yscroll)
AM_RANGE(0xd802, 0xd803) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(exedexes_state, nbg_xscroll)
AM_RANGE(0xd804, 0xd805) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(exedexes_state, bg_scroll)
AM_RANGE(0xd807, 0xd807) AM_WRITE(exedexes_gfxctrl_w) /* layer enables */
AM_RANGE(0xe000, 0xefff) AM_RAM /* Work RAM */
AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* Sprite RAM */
@ -208,8 +192,31 @@ GFXDECODE_END
static MACHINE_START( exedexes )
{
exedexes_state *state = (exedexes_state *)machine->driver_data;
state_save_register_global(machine, state->chon);
state_save_register_global(machine, state->objon);
state_save_register_global(machine, state->sc1on);
state_save_register_global(machine, state->sc2on);
}
static MACHINE_RESET( exedexes )
{
exedexes_state *state = (exedexes_state *)machine->driver_data;
state->chon = 0;
state->objon = 0;
state->sc1on = 0;
state->sc2on = 0;
}
static MACHINE_DRIVER_START( exedexes )
/* driver data */
MDRV_DRIVER_DATA(exedexes_state)
/* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz (?) */
MDRV_CPU_PROGRAM_MAP(exedexes_map)
@ -219,6 +226,9 @@ static MACHINE_DRIVER_START( exedexes )
MDRV_CPU_PROGRAM_MAP(sound_map)
MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)
MDRV_MACHINE_START(exedexes)
MDRV_MACHINE_RESET(exedexes)
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
@ -243,10 +253,10 @@ static MACHINE_DRIVER_START( exedexes )
MDRV_SOUND_ADD("aysnd", AY8910, 1500000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
MDRV_SOUND_ADD("sn1", SN76489, 3000000)
MDRV_SOUND_ADD("sn1", SN76489, 3000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.36)
MDRV_SOUND_ADD("sn2", SN76489, 3000000)
MDRV_SOUND_ADD("sn2", SN76489, 3000000)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.36)
MACHINE_DRIVER_END
@ -338,5 +348,5 @@ ROM_END
GAME( 1985, exedexes, 0, exedexes, exedexes, 0, ROT270, "Capcom", "Exed Exes", 0 )
GAME( 1985, savgbees, exedexes, exedexes, exedexes, 0, ROT270, "Capcom (Memetron license)", "Savage Bees", 0 )
GAME( 1985, exedexes, 0, exedexes, exedexes, 0, ROT270, "Capcom", "Exed Exes", GAME_SUPPORTS_SAVE )
GAME( 1985, savgbees, exedexes, exedexes, exedexes, 0, ROT270, "Capcom (Memetron license)", "Savage Bees", GAME_SUPPORTS_SAVE )

View File

@ -19,10 +19,6 @@
#include "sound/ay8910.h"
static UINT8 *exerion_ram;
/*************************************
*
* Interrupts & inputs
@ -31,8 +27,9 @@ static UINT8 *exerion_ram;
static READ8_HANDLER( exerion_port01_r )
{
exerion_state *state = (exerion_state *)space->machine->driver_data;
/* the cocktail flip bit muxes between ports 0 and 1 */
return exerion_cocktail_flip ? input_port_read(space->machine, "IN1") : input_port_read(space->machine, "IN0");
return state->cocktail_flip ? input_port_read(space->machine, "IN1") : input_port_read(space->machine, "IN0");
}
@ -52,21 +49,21 @@ static INPUT_CHANGED( coin_inserted )
/* This is the first of many Exerion "features." No clue if it's */
/* protection or some sort of timer. */
static UINT8 porta;
static UINT8 portb;
static READ8_DEVICE_HANDLER( exerion_porta_r )
{
porta ^= 0x40;
return porta;
exerion_state *state = (exerion_state *)device->machine->driver_data;
state->porta ^= 0x40;
return state->porta;
}
static WRITE8_DEVICE_HANDLER( exerion_portb_w )
{
exerion_state *state = (exerion_state *)device->machine->driver_data;
/* pull the expected value from the ROM */
porta = memory_region(device->machine, "maincpu")[0x5f76];
portb = data;
state->porta = memory_region(device->machine, "maincpu")[0x5f76];
state->portb = data;
logerror("Port B = %02X\n", data);
}
@ -74,10 +71,12 @@ static WRITE8_DEVICE_HANDLER( exerion_portb_w )
static READ8_HANDLER( exerion_protection_r )
{
exerion_state *state = (exerion_state *)space->machine->driver_data;
if (cpu_get_pc(space->cpu) == 0x4143)
return memory_region(space->machine, "maincpu")[0x33c0 + (exerion_ram[0xd] << 2) + offset];
return memory_region(space->machine, "maincpu")[0x33c0 + (state->main_ram[0xd] << 2) + offset];
else
return exerion_ram[0x8 + offset];
return state->main_ram[0x8 + offset];
}
@ -91,9 +90,9 @@ static READ8_HANDLER( exerion_protection_r )
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0x6008, 0x600b) AM_READ(exerion_protection_r)
AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&exerion_ram)
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
AM_RANGE(0x8800, 0x887f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE_MEMBER(exerion_state, main_ram)
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE_MEMBER(exerion_state, videoram) AM_SIZE(&videoram_size)
AM_RANGE(0x8800, 0x887f) AM_RAM AM_BASE_MEMBER(exerion_state, spriteram) AM_SIZE(&spriteram_size)
AM_RANGE(0x8800, 0x8bff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_READ(exerion_port01_r)
AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW0")
@ -275,14 +274,49 @@ static const ay8910_interface ay8910_config =
*
*************************************/
static MACHINE_START( exerion )
{
exerion_state *state = (exerion_state *)machine->driver_data;
state_save_register_global(machine, state->porta);
state_save_register_global(machine, state->portb);
state_save_register_global(machine, state->cocktail_flip);
state_save_register_global(machine, state->char_palette);
state_save_register_global(machine, state->sprite_palette);
state_save_register_global(machine, state->char_bank);
state_save_register_global_array(machine, state->background_latches);
}
static MACHINE_RESET( exerion )
{
exerion_state *state = (exerion_state *)machine->driver_data;
int i;
state->porta = 0;
state->portb = 0;
state->cocktail_flip = 0;
state->char_palette = 0;
state->sprite_palette = 0;
state->char_bank = 0;
for (i = 0; i < 13; i++)
state->background_latches[i] = 0;
}
static MACHINE_DRIVER_START( exerion )
/* driver data */
MDRV_DRIVER_DATA(exerion_state)
MDRV_CPU_ADD("maincpu", Z80, EXERION_CPU_CLOCK)
MDRV_CPU_PROGRAM_MAP(main_map)
MDRV_CPU_ADD("sub", Z80, EXERION_CPU_CLOCK)
MDRV_CPU_PROGRAM_MAP(sub_map)
MDRV_MACHINE_START(exerion)
MDRV_MACHINE_RESET(exerion)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
@ -481,6 +515,6 @@ static DRIVER_INIT( exerionb )
*
*************************************/
GAME( 1983, exerion, 0, exerion, exerion, exerion, ROT90, "Jaleco", "Exerion", 0 )
GAME( 1983, exeriont, exerion, exerion, exerion, exerion, ROT90, "Jaleco (Taito America license)", "Exerion (Taito)", 0 )
GAME( 1983, exerionb, exerion, exerion, exerion, exerionb, ROT90, "bootleg", "Exerion (bootleg)", 0 )
GAME( 1983, exerion, 0, exerion, exerion, exerion, ROT90, "Jaleco", "Exerion", GAME_SUPPORTS_SAVE )
GAME( 1983, exeriont, exerion, exerion, exerion, exerion, ROT90, "Jaleco (Taito America license)", "Exerion (Taito)", GAME_SUPPORTS_SAVE )
GAME( 1983, exerionb, exerion, exerion, exerion, exerionb, ROT90, "bootleg", "Exerion (bootleg)", GAME_SUPPORTS_SAVE )

View File

@ -210,31 +210,20 @@ Stephh's notes (based on the games M6502 code and some tests) :
#include "cpu/m6809/m6809.h"
#include "sound/2203intf.h"
#include "sound/3526intf.h"
extern WRITE8_HANDLER( exprraid_videoram_w );
extern WRITE8_HANDLER( exprraid_colorram_w );
extern WRITE8_HANDLER( exprraid_flipscreen_w );
extern WRITE8_HANDLER( exprraid_bgselect_w );
extern WRITE8_HANDLER( exprraid_scrollx_w );
extern WRITE8_HANDLER( exprraid_scrolly_w );
extern VIDEO_START( exprraid );
extern VIDEO_UPDATE( exprraid );
#include "exprraid.h"
/*****************************************************************************************/
/* Emulate Protection ( only for original express raider, code is cracked on the bootleg */
/*****************************************************************************************/
static UINT8 *main_ram;
static READ8_HANDLER( exprraid_protection_r )
{
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
switch (offset)
{
case 0:
return main_ram[0x02a9];
return state->main_ram[0x02a9];
case 1:
return 0x02;
}
@ -244,8 +233,8 @@ static READ8_HANDLER( exprraid_protection_r )
static WRITE8_HANDLER( sound_cpu_command_w )
{
soundlatch_w(space, 0, data);
cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, PULSE_LINE);
soundlatch_w(space, 0, data);
cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( vblank_r )
@ -254,26 +243,26 @@ static READ8_HANDLER( vblank_r )
}
static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x05ff) AM_RAM AM_BASE(&main_ram)
AM_RANGE(0x0600, 0x07ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(exprraid_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(exprraid_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x0000, 0x05ff) AM_RAM AM_BASE_MEMBER(exprraid_state, main_ram)
AM_RANGE(0x0600, 0x07ff) AM_RAM AM_BASE_MEMBER(exprraid_state, spriteram) AM_SIZE(&spriteram_size)
AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(exprraid_videoram_w) AM_BASE_MEMBER(exprraid_state, videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(exprraid_colorram_w) AM_BASE_MEMBER(exprraid_state, colorram)
AM_RANGE(0x1317, 0x1317) AM_READNOP // ???
AM_RANGE(0x1700, 0x1700) AM_READNOP // ???
AM_RANGE(0x1800, 0x1800) AM_READ_PORT("DSW0") /* DSW 0 */
AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") /* Controls */
AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") /* Coins */
AM_RANGE(0x1803, 0x1803) AM_READ_PORT("DSW1") /* DSW 1 */
AM_RANGE(0x1800, 0x1800) AM_READ_PORT("DSW0") /* DSW 0 */
AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") /* Controls */
AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") /* Coins */
AM_RANGE(0x1803, 0x1803) AM_READ_PORT("DSW1") /* DSW 1 */
AM_RANGE(0x2000, 0x2000) AM_WRITENOP // ???
AM_RANGE(0x2001, 0x2001) AM_WRITE(sound_cpu_command_w)
AM_RANGE(0x2001, 0x2001) AM_WRITE(sound_cpu_command_w)
AM_RANGE(0x2002, 0x2002) AM_WRITE(exprraid_flipscreen_w)
AM_RANGE(0x2003, 0x2003) AM_WRITENOP // ???
AM_RANGE(0x2800, 0x2801) AM_READ(exprraid_protection_r)
AM_RANGE(0x2800, 0x2803) AM_WRITE(exprraid_bgselect_w)
AM_RANGE(0x2804, 0x2804) AM_WRITE(exprraid_scrolly_w)
AM_RANGE(0x2805, 0x2806) AM_WRITE(exprraid_scrollx_w)
AM_RANGE(0x2807, 0x2807) AM_WRITENOP // Scroll related ?
AM_RANGE(0x4000, 0xffff) AM_ROM
AM_RANGE(0x2800, 0x2803) AM_WRITE(exprraid_bgselect_w)
AM_RANGE(0x2804, 0x2804) AM_WRITE(exprraid_scrolly_w)
AM_RANGE(0x2805, 0x2806) AM_WRITE(exprraid_scrollx_w)
AM_RANGE(0x2807, 0x2807) AM_WRITENOP // Scroll related ?
AM_RANGE(0x4000, 0xffff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( master_io_map, ADDRESS_SPACE_IO, 8 )
@ -281,11 +270,11 @@ static ADDRESS_MAP_START( master_io_map, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_END
static ADDRESS_MAP_START( slave_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym1", ym2203_r, ym2203_w)
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ym2", ym3526_r, ym3526_w)
AM_RANGE(0x0000, 0x1fff) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym1", ym2203_r, ym2203_w)
AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ym2", ym3526_r, ym3526_w)
AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)
AM_RANGE(0x8000, 0xffff) AM_ROM
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_deco16 )
@ -299,10 +288,10 @@ static INPUT_CHANGED( coin_inserted_nmi )
}
static INPUT_PORTS_START( exprraid )
PORT_START("IN0") /* IN 0 - 0x3800 */
PORT_START("IN0") /* 0x3800 */
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_START("DSW0") /* DSW 0 - 0x1800 */
PORT_START("DSW0") /* 0x1800 */
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW0",0x10,PORTCOND_EQUALS,0x10)
@ -332,7 +321,7 @@ static INPUT_PORTS_START( exprraid )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:8" )
PORT_START("IN1") /* IN 1 - 0x1801 */
PORT_START("IN1") /* 0x1801 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
@ -342,7 +331,7 @@ static INPUT_PORTS_START( exprraid )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2") /* IN 2 - 0x1802 */
PORT_START("IN2") /* 0x1802 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
@ -352,7 +341,7 @@ static INPUT_PORTS_START( exprraid )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) PORT_CHANGED(coin_inserted_deco16, 0)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) PORT_CHANGED(coin_inserted_deco16, 0)
PORT_START("DSW1") /* DSW 1 - 0x1803 */
PORT_START("DSW1") /* 0x1803 */
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x03, "3" )
@ -377,7 +366,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( exprboot )
PORT_INCLUDE( exprraid )
PORT_MODIFY("IN2") /* IN 2 - 0x1802 */
PORT_MODIFY("IN2") /* 0x1802 */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted_nmi, 0)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted_nmi, 0)
INPUT_PORTS_END
@ -447,7 +436,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler(const device_config *device, int linestate)
static void irqhandler( const device_config *device, int linestate )
{
cputag_set_input_line_and_vector(device->machine, "slave", 0, linestate, 0xff);
}
@ -460,13 +449,13 @@ static const ym3526_interface ym3526_config =
#if 0
static INTERRUPT_GEN( exprraid_interrupt )
{
static int coin = 0;
exprraid_state *state = (exprraid_state *)device->machine->driver_data;
if ((~input_port_read(device->machine, "IN2")) & 0xc0 )
if ((~input_port_read(device->machine, "IN2")) & 0xc0)
{
if ( coin == 0 )
if (state->coin == 0)
{
coin = 1;
state->coin = 1;
//cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
cpu_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
}
@ -474,13 +463,34 @@ static INTERRUPT_GEN( exprraid_interrupt )
else
{
cpu_set_input_line(device, DECO16_IRQ_LINE, CLEAR_LINE);
coin = 0;
state->coin = 0;
}
}
#endif
static MACHINE_START( exprraid )
{
exprraid_state *state = (exprraid_state *)machine->driver_data;
state_save_register_global_array(machine, state->bg_index);
}
static MACHINE_RESET( exprraid )
{
exprraid_state *state = (exprraid_state *)machine->driver_data;
state->bg_index[0] = 0;
state->bg_index[1] = 0;
state->bg_index[2] = 0;
state->bg_index[3] = 0;
}
static MACHINE_DRIVER_START( exprraid )
/* driver data */
MDRV_DRIVER_DATA(exprraid_state)
/* basic machine hardware */
MDRV_CPU_ADD("maincpu", DECO16, 4000000) /* 4 MHz ??? */
MDRV_CPU_PROGRAM_MAP(master_map)
@ -489,6 +499,8 @@ static MACHINE_DRIVER_START( exprraid )
MDRV_CPU_ADD("slave", M6809, 2000000) /* 2 MHz ??? */
MDRV_CPU_PROGRAM_MAP(slave_map)
/* IRQs are caused by the YM3526 */
MDRV_MACHINE_START(exprraid)
MDRV_MACHINE_RESET(exprraid)
/* video hardware */
MDRV_SCREEN_ADD("screen", RASTER)
@ -724,17 +736,17 @@ static void exprraid_gfx_expand(running_machine *machine)
/* Expand the background rom so we can use regular decode routines */
UINT8 *gfx = memory_region(machine, "gfx3");
int offs = 0x10000-0x1000;
int i;
int offs = 0x10000 - 0x1000;
int i;
for ( i = 0x8000-0x1000; i >= 0; i-= 0x1000 )
for ( i = 0x8000 - 0x1000; i >= 0; i-= 0x1000 )
{
memcpy( &(gfx[offs]), &(gfx[i]), 0x1000 );
memcpy(&(gfx[offs]), &(gfx[i]), 0x1000);
offs -= 0x1000;
memcpy( &(gfx[offs]), &(gfx[i]), 0x1000 );
memcpy(&(gfx[offs]), &(gfx[i]), 0x1000);
offs -= 0x1000;
}
@ -775,8 +787,8 @@ static DRIVER_INIT( wexpresc )
}
GAME( 1986, exprraid, 0, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 1)", 0 )
GAME( 1986, exprraida, exprraid, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 2)", 0 )
GAME( 1986, wexpress, exprraid, exprraid, exprraid, wexpress, ROT0, "Data East Corporation", "Western Express (World?)", 0 )
GAME( 1986, wexpressb, exprraid, exprboot, exprboot, wexpresb, ROT0, "bootleg", "Western Express (bootleg set 1)", 0 )
GAME( 1986, wexpressb2,exprraid, exprboot, exprboot, wexpresc, ROT0, "bootleg", "Western Express (bootleg set 2)", 0 )
GAME( 1986, exprraid, 0, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 1)", GAME_SUPPORTS_SAVE )
GAME( 1986, exprraida, exprraid, exprraid, exprraid, exprraid, ROT0, "Data East USA", "Express Raider (US set 2)", GAME_SUPPORTS_SAVE )
GAME( 1986, wexpress, exprraid, exprraid, exprraid, wexpress, ROT0, "Data East Corporation", "Western Express (World?)", GAME_SUPPORTS_SAVE )
GAME( 1986, wexpressb, exprraid, exprboot, exprboot, wexpresb, ROT0, "bootleg", "Western Express (bootleg set 1)", GAME_SUPPORTS_SAVE )
GAME( 1986, wexpressb2,exprraid, exprboot, exprboot, wexpresc, ROT0, "bootleg", "Western Express (bootleg set 2)", GAME_SUPPORTS_SAVE )

View File

@ -1,6 +1,47 @@
/*----------- defined in video/equites.c -----------*/
extern UINT16 *equites_bg_videoram;
#define POPDRUMKIT 0
typedef struct _equites_state equites_state;
struct _equites_state
{
/* memory pointers */
UINT16 * bg_videoram;
UINT8 * fg_videoram; // 8bits
UINT16 * spriteram;
UINT16 * spriteram_2;
UINT16 * workram;
UINT8 * mcu_ram; // 8bits
// UINT16 * nvram; // currently this uses generic nvram handling
/* video-related */
tilemap *fg_tilemap, *bg_tilemap;
int fg_char_bank;
UINT8 bgcolor;
UINT16 splndrbt_bg_scrollx, splndrbt_bg_scrolly;
/* misc */
int sound_prom_address;
UINT8 dac_latch;
UINT8 eq8155_port_b;
UINT8 eq8155_port_a,eq8155_port_c,ay_port_a,ay_port_b,eq_cymbal_ctrl;
emu_timer *nmi_timer, *adjuster_timer;
float cymvol,hihatvol;
int timer_count;
int unknown_bit; // Gekisou special handling
#if POPDRUMKIT
int hihat,cymbal;
#endif
/* devices */
const device_config *audio_cpu;
const device_config *msm;
const device_config *dac_1;
const device_config *dac_2;
};
/*----------- defined in video/equites.c -----------*/
extern READ16_HANDLER(equites_fg_videoram_r);
extern WRITE16_HANDLER(equites_fg_videoram_w);
@ -15,6 +56,7 @@ extern WRITE16_HANDLER(splndrbt_flip0_w);
extern WRITE16_HANDLER(splndrbt_flip1_w);
extern WRITE16_HANDLER(splndrbt_bg_scrollx_w);
extern WRITE16_HANDLER(splndrbt_bg_scrolly_w);
extern PALETTE_INIT( equites );
extern VIDEO_START( equites );
extern VIDEO_UPDATE( equites );

View File

@ -0,0 +1,36 @@
/*************************************************************************
Exed Exes
*************************************************************************/
typedef struct _exedexes_state exedexes_state;
struct _exedexes_state
{
/* memory pointers */
UINT8 * videoram;
UINT8 * colorram;
UINT8 * bg_scroll;
UINT8 * nbg_yscroll;
UINT8 * nbg_xscroll;
// UINT8 * spriteram; // currently this uses generic buffered_spriteram
/* video-related */
tilemap *bg_tilemap, *fg_tilemap, *tx_tilemap;
int chon, objon, sc1on, sc2on;
};
/*----------- defined in video/exedexes.c -----------*/
extern WRITE8_HANDLER( exedexes_videoram_w );
extern WRITE8_HANDLER( exedexes_colorram_w );
extern WRITE8_HANDLER( exedexes_c804_w );
extern WRITE8_HANDLER( exedexes_gfxctrl_w );
extern PALETTE_INIT( exedexes );
extern VIDEO_START( exedexes );
extern VIDEO_UPDATE( exedexes );
extern VIDEO_EOF( exedexes );

View File

@ -5,17 +5,40 @@
*************************************************************************/
#define EXERION_MASTER_CLOCK (XTAL_19_968MHz) /* verified on pcb */
#define EXERION_CPU_CLOCK (EXERION_MASTER_CLOCK / 6)
#define EXERION_AY8910_CLOCK (EXERION_CPU_CLOCK / 2)
#define EXERION_PIXEL_CLOCK (EXERION_MASTER_CLOCK / 3)
#define EXERION_HCOUNT_START (0x58)
#define EXERION_HTOTAL (512-EXERION_HCOUNT_START)
#define EXERION_HBEND (12*8) /* ?? */
#define EXERION_HBSTART (52*8) /* ?? */
#define EXERION_VTOTAL (256)
#define EXERION_VBEND (16)
#define EXERION_VBSTART (240)
#define EXERION_MASTER_CLOCK (XTAL_19_968MHz) /* verified on pcb */
#define EXERION_CPU_CLOCK (EXERION_MASTER_CLOCK / 6)
#define EXERION_AY8910_CLOCK (EXERION_CPU_CLOCK / 2)
#define EXERION_PIXEL_CLOCK (EXERION_MASTER_CLOCK / 3)
#define EXERION_HCOUNT_START (0x58)
#define EXERION_HTOTAL (512-EXERION_HCOUNT_START)
#define EXERION_HBEND (12*8) /* ?? */
#define EXERION_HBSTART (52*8) /* ?? */
#define EXERION_VTOTAL (256)
#define EXERION_VBEND (16)
#define EXERION_VBSTART (240)
typedef struct _exerion_state exerion_state;
struct _exerion_state
{
/* memory pointers */
UINT8 * main_ram;
UINT8 * videoram;
UINT8 * spriteram;
/* video-related */
UINT8 cocktail_flip;
UINT8 char_palette, sprite_palette;
UINT8 char_bank;
UINT16 *background_gfx[4];
UINT8 *background_mixer;
UINT8 background_latches[13];
/* protection? */
UINT8 porta;
UINT8 portb;
};
/*----------- defined in video/exerion.c -----------*/
@ -27,5 +50,3 @@ VIDEO_UPDATE( exerion );
WRITE8_HANDLER( exerion_videoreg_w );
WRITE8_HANDLER( exerion_video_latch_w );
READ8_HANDLER( exerion_video_timing_r );
extern UINT8 exerion_cocktail_flip;

View File

@ -0,0 +1,36 @@
/*************************************************************************
Express Raider
*************************************************************************/
typedef struct _exprraid_state exprraid_state;
struct _exprraid_state
{
/* memory pointers */
UINT8 * main_ram;
UINT8 * videoram;
UINT8 * colorram;
UINT8 * spriteram;
/* video-related */
tilemap *bg_tilemap, *fg_tilemap;
int bg_index[4];
/* misc */
//int coin; // used in the commented out INTERRUPT_GEN - can this be removed?
};
/*----------- defined in video/exprraid.c -----------*/
extern WRITE8_HANDLER( exprraid_videoram_w );
extern WRITE8_HANDLER( exprraid_colorram_w );
extern WRITE8_HANDLER( exprraid_flipscreen_w );
extern WRITE8_HANDLER( exprraid_bgselect_w );
extern WRITE8_HANDLER( exprraid_scrollx_w );
extern WRITE8_HANDLER( exprraid_scrolly_w );
extern VIDEO_START( exprraid );
extern VIDEO_UPDATE( exprraid );

View File

@ -2,16 +2,6 @@
#include "equites.h"
UINT16 *equites_bg_videoram;
static UINT8 *equites_fg_videoram;
static tilemap *fg_tilemap, *bg_tilemap;
static int fg_char_bank;
static UINT8 bgcolor;
static UINT16 splndrbt_bg_scrollx, splndrbt_bg_scrolly;
/*************************************
*
* Palette handling
@ -25,7 +15,7 @@ PALETTE_INIT( equites )
machine->colortable = colortable_alloc(machine, 256);
for (i = 0; i < 256; i++)
colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i+0x100]), pal4bit(color_prom[i+0x200])));
colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
// point to the CLUT
color_prom += 0x380;
@ -34,7 +24,7 @@ PALETTE_INIT( equites )
colortable_entry_set_value(machine->colortable, i, i);
for (i = 0; i < 0x80; i++)
colortable_entry_set_value(machine->colortable, i+0x100, color_prom[i]);
colortable_entry_set_value(machine->colortable, i + 0x100, color_prom[i]);
}
PALETTE_INIT( splndrbt )
@ -44,7 +34,7 @@ PALETTE_INIT( splndrbt )
machine->colortable = colortable_alloc(machine, 256);
for (i = 0; i < 0x100; i++)
colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i+0x100]), pal4bit(color_prom[i+0x200])));
colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
for (i = 0; i < 0x100; i++)
colortable_entry_set_value(machine->colortable, i, i);
@ -72,8 +62,9 @@ PALETTE_INIT( splndrbt )
static TILE_GET_INFO( equites_fg_info )
{
int tile = equites_fg_videoram[2*tile_index];
int color = equites_fg_videoram[2*tile_index+1] & 0x1f;
equites_state *state = (equites_state *)machine->driver_data;
int tile = state->fg_videoram[2 * tile_index];
int color = state->fg_videoram[2 * tile_index + 1] & 0x1f;
SET_TILE_INFO(0, tile, color, 0);
if (color & 0x10)
@ -82,8 +73,9 @@ static TILE_GET_INFO( equites_fg_info )
static TILE_GET_INFO( splndrbt_fg_info )
{
int tile = equites_fg_videoram[2*tile_index] + (fg_char_bank << 8);
int color = equites_fg_videoram[2*tile_index+1] & 0x3f;
equites_state *state = (equites_state *)machine->driver_data;
int tile = state->fg_videoram[2 * tile_index] + (state->fg_char_bank << 8);
int color = state->fg_videoram[2 * tile_index + 1] & 0x3f;
SET_TILE_INFO(0, tile, color, 0);
if (color & 0x10)
@ -92,7 +84,8 @@ static TILE_GET_INFO( splndrbt_fg_info )
static TILE_GET_INFO( equites_bg_info )
{
int data = equites_bg_videoram[tile_index];
equites_state *state = (equites_state *)machine->driver_data;
int data = state->bg_videoram[tile_index];
int tile = data & 0x1ff;
int color = (data & 0xf000) >> 12;
int fxy = (data & 0x0600) >> 9;
@ -102,7 +95,8 @@ static TILE_GET_INFO( equites_bg_info )
static TILE_GET_INFO( splndrbt_bg_info )
{
int data = equites_bg_videoram[tile_index];
equites_state *state = (equites_state *)machine->driver_data;
int data = state->bg_videoram[tile_index];
int tile = data & 0x1ff;
int color = (data & 0xf800) >> 11;
int fxy = (data & 0x0600) >> 9;
@ -121,30 +115,32 @@ static TILE_GET_INFO( splndrbt_bg_info )
VIDEO_START( equites )
{
equites_fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
equites_state *state = (equites_state *)machine->driver_data;
state->fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
state_save_register_global_pointer(machine, state->fg_videoram, 0x800);
fg_tilemap = tilemap_create(machine, equites_fg_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(fg_tilemap, 0);
state->fg_tilemap = tilemap_create(machine, equites_fg_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
bg_tilemap = tilemap_create(machine, equites_bg_info, tilemap_scan_rows, 16, 16, 16, 16);
tilemap_set_transparent_pen(bg_tilemap, 0);
tilemap_set_scrolldx(bg_tilemap, 0, -10);
state->bg_tilemap = tilemap_create(machine, equites_bg_info, tilemap_scan_rows, 16, 16, 16, 16);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
tilemap_set_scrolldx(state->bg_tilemap, 0, -10);
}
VIDEO_START( splndrbt )
{
equites_state *state = (equites_state *)machine->driver_data;
assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_INDEXED16);
equites_fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
state->fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
state_save_register_global_pointer(machine, state->fg_videoram, 0x800);
fg_tilemap = tilemap_create(machine, splndrbt_fg_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(fg_tilemap, 0);
tilemap_set_scrolldx(fg_tilemap, 8, -8);
state->fg_tilemap = tilemap_create(machine, splndrbt_fg_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_set_scrolldx(state->fg_tilemap, 8, -8);
bg_tilemap = tilemap_create(machine, splndrbt_bg_info, tilemap_scan_rows, 16, 16, 32, 32);
colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0x10);
fg_char_bank = 0;
state->bg_tilemap = tilemap_create(machine, splndrbt_bg_info, tilemap_scan_rows, 16, 16, 32, 32);
colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[1], 0x10);
}
@ -157,56 +153,63 @@ VIDEO_START( splndrbt )
READ16_HANDLER(equites_fg_videoram_r)
{
return 0xff00 | equites_fg_videoram[offset];
equites_state *state = (equites_state *)space->machine->driver_data;
return 0xff00 | state->fg_videoram[offset];
}
WRITE16_HANDLER(equites_fg_videoram_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
if (ACCESSING_BITS_0_7)
{
equites_fg_videoram[offset] = data & 0xff;
state->fg_videoram[offset] = data & 0xff;
tilemap_mark_tile_dirty(fg_tilemap, offset>>1);
tilemap_mark_tile_dirty(state->fg_tilemap, offset >> 1);
}
}
WRITE16_HANDLER(equites_bg_videoram_w)
{
COMBINE_DATA(equites_bg_videoram + offset);
equites_state *state = (equites_state *)space->machine->driver_data;
COMBINE_DATA(state->bg_videoram + offset);
tilemap_mark_tile_dirty(bg_tilemap, offset);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE16_HANDLER(equites_bgcolor_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
if (ACCESSING_BITS_8_15)
bgcolor = data >> 8;
state->bgcolor = data >> 8;
}
WRITE16_HANDLER(equites_scrollreg_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
if (ACCESSING_BITS_0_7)
tilemap_set_scrolly(bg_tilemap, 0, data & 0xff);
tilemap_set_scrolly(state->bg_tilemap, 0, data & 0xff);
if (ACCESSING_BITS_8_15)
tilemap_set_scrollx(bg_tilemap, 0, data >> 8);
tilemap_set_scrollx(state->bg_tilemap, 0, data >> 8);
}
WRITE16_HANDLER(splndrbt_selchar0_w)
{
if (fg_char_bank != 0)
equites_state *state = (equites_state *)space->machine->driver_data;
if (state->fg_char_bank != 0)
{
fg_char_bank = 0;
tilemap_mark_all_tiles_dirty(fg_tilemap);
state->fg_char_bank = 0;
tilemap_mark_all_tiles_dirty(state->fg_tilemap);
}
}
WRITE16_HANDLER(splndrbt_selchar1_w)
{
if (fg_char_bank != 1)
equites_state *state = (equites_state *)space->machine->driver_data;
if (state->fg_char_bank != 1)
{
fg_char_bank = 1;
tilemap_mark_all_tiles_dirty(fg_tilemap);
state->fg_char_bank = 1;
tilemap_mark_all_tiles_dirty(state->fg_tilemap);
}
}
@ -222,11 +225,12 @@ WRITE16_HANDLER(equites_flip1_w)
WRITE16_HANDLER(splndrbt_flip0_w)
{
equites_state *state = (equites_state *)space->machine->driver_data;
if (ACCESSING_BITS_0_7)
flip_screen_set(space->machine, 0);
if (ACCESSING_BITS_8_15)
bgcolor = data >> 8;
state->bgcolor = data >> 8;
}
WRITE16_HANDLER(splndrbt_flip1_w)
@ -237,12 +241,14 @@ WRITE16_HANDLER(splndrbt_flip1_w)
WRITE16_HANDLER(splndrbt_bg_scrollx_w)
{
COMBINE_DATA(&splndrbt_bg_scrollx);
equites_state *state = (equites_state *)space->machine->driver_data;
COMBINE_DATA(&state->splndrbt_bg_scrollx);
}
WRITE16_HANDLER(splndrbt_bg_scrolly_w)
{
COMBINE_DATA(&splndrbt_bg_scrolly);
equites_state *state = (equites_state *)space->machine->driver_data;
COMBINE_DATA(&state->splndrbt_bg_scrolly);
}
@ -252,21 +258,22 @@ WRITE16_HANDLER(splndrbt_bg_scrolly_w)
*
*************************************/
static void equites_draw_sprites_block(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end)
static void equites_draw_sprites_block( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end )
{
equites_state *state = (equites_state *)machine->driver_data;
int offs;
for (offs = end-2; offs >= start; offs -= 2)
for (offs = end - 2; offs >= start; offs -= 2)
{
int attr = spriteram16[offs + 1];
int attr = state->spriteram[offs + 1];
if (!(attr & 0x800)) // disable or x MSB?
{
int tile = attr & 0x1ff;
int fx = ~attr & 0x400;
int fy = ~attr & 0x200;
int color = (~attr & 0xf000) >> 12;
int sx = (spriteram16[offs] & 0xff00) >> 8;
int sy = (spriteram16[offs] & 0x00ff);
int sx = (state->spriteram[offs] & 0xff00) >> 8;
int sy = (state->spriteram[offs] & 0x00ff);
int transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0);
if (flip_screen_get(machine))
@ -325,8 +332,9 @@ Also, note that sprites are 30x30, not 32x32.
03020303 03030303 03030303 03030303
*/
static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
static void splndrbt_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
equites_state *state = (equites_state *)machine->driver_data;
const UINT8 * const xrom = memory_region(machine, "user2");
const UINT8 * const yrom = xrom + 0x100;
const gfx_element* const gfx = machine->gfx[2];
@ -336,16 +344,16 @@ static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
for (offs = 0x3f; offs < 0x6f; offs += 2) // 24 sprites
{
int data = spriteram16[offs];
int data = state->spriteram[offs];
int fx = (data & 0x2000) >> 13;
int fy = (data & 0x1000) >> 12;
int tile = data & 0x007f;
int scaley = (data & 0x0f00) >> 8;
int data2 = spriteram16[offs+1];
int data2 = state->spriteram[offs + 1];
int color = (data2 & 0x1f00) >> 8;
int sx = data2 & 0x00ff;
int sy = spriteram16_2[offs+0] & 0x00ff;
int scalex = spriteram16_2[offs+1] & 0x000f;
int sy = state->spriteram_2[offs + 0] & 0x00ff;
int scalex = state->spriteram_2[offs + 1] & 0x000f;
int transmask = colortable_get_transpen_mask(machine->colortable, gfx, color, 0);
// const UINT8 * const xromline = xrom + (scalex << 4);
@ -400,14 +408,15 @@ static void splndrbt_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
}
static void splndrbt_copy_bg(running_machine *machine, bitmap_t *dst_bitmap, const rectangle *cliprect)
static void splndrbt_copy_bg( running_machine *machine, bitmap_t *dst_bitmap, const rectangle *cliprect )
{
bitmap_t * const src_bitmap = tilemap_get_pixmap(bg_tilemap);
bitmap_t * const flags_bitmap = tilemap_get_flagsmap(bg_tilemap);
equites_state *state = (equites_state *)machine->driver_data;
bitmap_t * const src_bitmap = tilemap_get_pixmap(state->bg_tilemap);
bitmap_t * const flags_bitmap = tilemap_get_flagsmap(state->bg_tilemap);
const UINT8 * const xrom = memory_region(machine, "user1");
const UINT8 * const yrom = xrom + 0x2000;
int scroll_x = splndrbt_bg_scrollx;
int scroll_y = splndrbt_bg_scrolly;
int scroll_x = state->splndrbt_bg_scrollx;
int scroll_y = state->splndrbt_bg_scrolly;
int const dinvert = flip_screen_get(machine) ? 0xff : 0x00;
int src_y = 0;
int dst_y;
@ -456,30 +465,32 @@ static void splndrbt_copy_bg(running_machine *machine, bitmap_t *dst_bitmap, con
VIDEO_UPDATE( equites )
{
bitmap_fill(bitmap, cliprect, bgcolor);
equites_state *state = (equites_state *)screen->machine->driver_data;
bitmap_fill(bitmap, cliprect, state->bgcolor);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
equites_draw_sprites(screen->machine, bitmap, cliprect);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
VIDEO_UPDATE( splndrbt )
{
bitmap_fill(bitmap, cliprect, bgcolor);
equites_state *state = (equites_state *)screen->machine->driver_data;
bitmap_fill(bitmap, cliprect, state->bgcolor);
splndrbt_copy_bg(screen->machine, bitmap, cliprect);
if (fg_char_bank)
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
if (state->fg_char_bank)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
splndrbt_draw_sprites(screen->machine, bitmap, cliprect);
if (!fg_char_bank)
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
if (!state->fg_char_bank)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}

View File

@ -7,18 +7,12 @@
***************************************************************************/
#include "driver.h"
#include "exedexes.h"
UINT8 *exedexes_bg_scroll;
UINT8 *exedexes_nbg_yscroll;
UINT8 *exedexes_nbg_xscroll;
static int chon,objon,sc1on,sc2on;
#define TileMap(offs) (memory_region(machine, "gfx5")[offs])
#define BackTileMap(offs) (memory_region(machine, "gfx5")[offs+0x4000])
static tilemap *bg_tilemap, *fg_tilemap, *tx_tilemap;
/***************************************************************************
@ -36,6 +30,7 @@ static tilemap *bg_tilemap, *fg_tilemap, *tx_tilemap;
bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE
***************************************************************************/
PALETTE_INIT( exedexes )
{
int i;
@ -87,18 +82,24 @@ PALETTE_INIT( exedexes )
WRITE8_HANDLER( exedexes_videoram_w )
{
videoram[offset] = data;
tilemap_mark_tile_dirty(tx_tilemap, offset);
exedexes_state *state = (exedexes_state *)space->machine->driver_data;
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
WRITE8_HANDLER( exedexes_colorram_w )
{
colorram[offset] = data;
tilemap_mark_tile_dirty(tx_tilemap, offset);
exedexes_state *state = (exedexes_state *)space->machine->driver_data;
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
WRITE8_HANDLER( exedexes_c804_w )
{
exedexes_state *state = (exedexes_state *)space->machine->driver_data;
/* bits 0 and 1 are coin counters */
coin_counter_w(0, data & 0x01);
coin_counter_w(1, data & 0x02);
@ -107,21 +108,23 @@ WRITE8_HANDLER( exedexes_c804_w )
coin_lockout_w(1, data & 0x08);
/* bit 7 is text enable */
chon = data & 0x80;
state->chon = data & 0x80;
/* other bits seem to be unused */
}
WRITE8_HANDLER( exedexes_gfxctrl_w )
{
exedexes_state *state = (exedexes_state *)space->machine->driver_data;
/* bit 4 is bg enable */
sc2on = data & 0x10;
state->sc2on = data & 0x10;
/* bit 5 is fg enable */
sc1on = data & 0x20;
state->sc1on = data & 0x20;
/* bit 6 is sprite enable */
objon = data & 0x40;
state->objon = data & 0x40;
/* other bits seem to be unused */
}
@ -148,8 +151,9 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
int code = videoram[tile_index] + 2 * (colorram[tile_index] & 0x80);
int color = colorram[tile_index] & 0x3f;
exedexes_state *state = (exedexes_state *)machine->driver_data;
int code = state->videoram[tile_index] + 2 * (state->colorram[tile_index] & 0x80);
int color = state->colorram[tile_index] & 0x3f;
tileinfo->group = color;
@ -170,24 +174,23 @@ static TILEMAP_MAPPER( exedexes_fg_tilemap_scan )
VIDEO_START( exedexes )
{
bg_tilemap = tilemap_create(machine, get_bg_tile_info, exedexes_bg_tilemap_scan,
32, 32, 64, 64);
exedexes_state *state = (exedexes_state *)machine->driver_data;
fg_tilemap = tilemap_create(machine, get_fg_tile_info, exedexes_fg_tilemap_scan,
16, 16, 128, 128);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, exedexes_bg_tilemap_scan, 32, 32, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, exedexes_fg_tilemap_scan, 16, 16, 128, 128);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
tilemap_set_transparent_pen(fg_tilemap, 0);
colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0xcf);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
colortable_configure_tilemap_groups(machine->colortable, state->tx_tilemap, machine->gfx[0], 0xcf);
}
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
exedexes_state *state = (exedexes_state *)machine->driver_data;
int offs;
if (!objon) return;
if (!state->objon)
return;
priority = priority ? 0x40 : 0x00;
@ -195,7 +198,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if ((buffered_spriteram[offs + 1] & 0x40) == priority)
{
int code,color,flipx,flipy,sx,sy;
int code, color, flipx, flipy, sx, sy;
code = buffered_spriteram[offs];
color = buffered_spriteram[offs + 1] & 0x0f;
@ -215,27 +218,28 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( exedexes )
{
if (sc2on)
exedexes_state *state = (exedexes_state *)screen->machine->driver_data;
if (state->sc2on)
{
tilemap_set_scrollx(bg_tilemap, 0, ((exedexes_bg_scroll[1]) << 8) + exedexes_bg_scroll[0]);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->bg_scroll[1]) << 8) + state->bg_scroll[0]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
else
bitmap_fill(bitmap, cliprect, 0);
draw_sprites(screen->machine, bitmap, cliprect, 1);
if (sc1on)
if (state->sc1on)
{
tilemap_set_scrollx(fg_tilemap, 0, ((exedexes_nbg_yscroll[1]) << 8) + exedexes_nbg_yscroll[0]);
tilemap_set_scrolly(fg_tilemap, 0, ((exedexes_nbg_xscroll[1]) << 8) + exedexes_nbg_xscroll[0]);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_set_scrollx(state->fg_tilemap, 0, ((state->nbg_yscroll[1]) << 8) + state->nbg_yscroll[0]);
tilemap_set_scrolly(state->fg_tilemap, 0, ((state->nbg_xscroll[1]) << 8) + state->nbg_xscroll[0]);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
draw_sprites(screen->machine, bitmap, cliprect, 0);
if (chon)
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
if (state->chon)
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}

View File

@ -17,17 +17,6 @@
#define VISIBLE_Y_MAX (30*8)
UINT8 exerion_cocktail_flip;
static UINT8 char_palette, sprite_palette;
static UINT8 char_bank;
static UINT16 *background_gfx[4];
static UINT8 background_latches[13];
static UINT8 *background_mixer;
/***************************************************************************
Convert the color PROMs into a more useable format.
@ -116,17 +105,20 @@ PALETTE_INIT( exerion )
VIDEO_START( exerion )
{
exerion_state *state = (exerion_state *)machine->driver_data;
int i;
UINT8 *gfx;
/* get pointers to the mixing and lookup PROMs */
background_mixer = memory_region(machine, "proms") + 0x320;
state->background_mixer = memory_region(machine, "proms") + 0x320;
/* allocate memory for the decoded background graphics */
background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
background_gfx[1] = background_gfx[0] + 256 * 256;
background_gfx[2] = background_gfx[1] + 256 * 256;
background_gfx[3] = background_gfx[2] + 256 * 256;
state->background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
state->background_gfx[1] = state->background_gfx[0] + 256 * 256;
state->background_gfx[2] = state->background_gfx[1] + 256 * 256;
state->background_gfx[3] = state->background_gfx[2] + 256 * 256;
state_save_register_global_pointer(machine, state->background_gfx[0], 256 * 256 * 4);
/*---------------------------------
* Decode the background graphics
@ -149,7 +141,7 @@ VIDEO_START( exerion )
int y;
UINT8 *src = gfx + i * 0x2000;
UINT16 *dst = background_gfx[i];
UINT16 *dst = state->background_gfx[i];
for (y = 0; y < 0x100; y++)
{
@ -193,28 +185,31 @@ VIDEO_START( exerion )
WRITE8_HANDLER( exerion_videoreg_w )
{
exerion_state *state = (exerion_state *)space->machine->driver_data;
/* bit 0 = flip screen and joystick input multiplexer */
exerion_cocktail_flip = data & 1;
state->cocktail_flip = data & 1;
/* bits 1-2 char lookup table bank */
char_palette = (data & 0x06) >> 1;
state->char_palette = (data & 0x06) >> 1;
/* bits 3 char bank */
char_bank = (data & 0x08) >> 3;
state->char_bank = (data & 0x08) >> 3;
/* bits 4-5 unused */
/* bits 6-7 sprite lookup table bank */
sprite_palette = (data & 0xc0) >> 6;
state->sprite_palette = (data & 0xc0) >> 6;
}
WRITE8_HANDLER( exerion_video_latch_w )
{
exerion_state *state = (exerion_state *)space->machine->driver_data;
int scanline = video_screen_get_vpos(space->machine->primary_screen);
if (scanline > 0)
video_screen_update_partial(space->machine->primary_screen, scanline - 1);
background_latches[offset] = data;
state->background_latches[offset] = data;
}
@ -239,35 +234,36 @@ READ8_HANDLER( exerion_video_timing_r )
*
*************************************/
static void draw_background(bitmap_t *bitmap, const rectangle *cliprect)
static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
exerion_state *state = (exerion_state *)machine->driver_data;
int x, y;
/* loop over all visible scanlines */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
UINT16 *src0 = &background_gfx[0][background_latches[1] * 256];
UINT16 *src1 = &background_gfx[1][background_latches[3] * 256];
UINT16 *src2 = &background_gfx[2][background_latches[5] * 256];
UINT16 *src3 = &background_gfx[3][background_latches[7] * 256];
int xoffs0 = background_latches[0];
int xoffs1 = background_latches[2];
int xoffs2 = background_latches[4];
int xoffs3 = background_latches[6];
int start0 = background_latches[8] & 0x0f;
int start1 = background_latches[9] & 0x0f;
int start2 = background_latches[10] & 0x0f;
int start3 = background_latches[11] & 0x0f;
int stop0 = background_latches[8] >> 4;
int stop1 = background_latches[9] >> 4;
int stop2 = background_latches[10] >> 4;
int stop3 = background_latches[11] >> 4;
UINT8 *mixer = &background_mixer[(background_latches[12] << 4) & 0xf0];
UINT16 *src0 = &state->background_gfx[0][state->background_latches[1] * 256];
UINT16 *src1 = &state->background_gfx[1][state->background_latches[3] * 256];
UINT16 *src2 = &state->background_gfx[2][state->background_latches[5] * 256];
UINT16 *src3 = &state->background_gfx[3][state->background_latches[7] * 256];
int xoffs0 = state->background_latches[0];
int xoffs1 = state->background_latches[2];
int xoffs2 = state->background_latches[4];
int xoffs3 = state->background_latches[6];
int start0 = state->background_latches[8] & 0x0f;
int start1 = state->background_latches[9] & 0x0f;
int start2 = state->background_latches[10] & 0x0f;
int start3 = state->background_latches[11] & 0x0f;
int stop0 = state->background_latches[8] >> 4;
int stop1 = state->background_latches[9] >> 4;
int stop2 = state->background_latches[10] >> 4;
int stop3 = state->background_latches[11] >> 4;
UINT8 *mixer = &state->background_mixer[(state->background_latches[12] << 4) & 0xf0];
UINT16 scanline[VISIBLE_X_MAX];
pen_t pen_base = 0x200 + ((background_latches[12] >> 4) << 4);
pen_t pen_base = 0x200 + ((state->background_latches[12] >> 4) << 4);
/* the cocktail flip flag controls whether we count up or down in X */
if (!exerion_cocktail_flip)
if (!state->cocktail_flip)
{
/* skip processing anything that's not visible */
for (x = BACKGROUND_X_START; x < cliprect->min_x; x++)
@ -356,18 +352,19 @@ static void draw_background(bitmap_t *bitmap, const rectangle *cliprect)
VIDEO_UPDATE( exerion )
{
exerion_state *state = (exerion_state *)screen->machine->driver_data;
int sx, sy, offs, i;
/* draw background */
draw_background(bitmap, cliprect);
draw_background(screen->machine, bitmap, cliprect);
/* draw sprites */
for (i = 0; i < spriteram_size; i += 4)
{
int flags = spriteram[i + 0];
int y = spriteram[i + 1] ^ 255;
int code = spriteram[i + 2];
int x = spriteram[i + 3] * 2 + 72;
int flags = state->spriteram[i + 0];
int y = state->spriteram[i + 1] ^ 255;
int code = state->spriteram[i + 2];
int x = state->spriteram[i + 3] * 2 + 72;
int xflip = flags & 0x80;
int yflip = flags & 0x40;
@ -375,10 +372,10 @@ VIDEO_UPDATE( exerion )
int wide = flags & 0x08;
int code2 = code;
int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (sprite_palette * 16);
int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->sprite_palette * 16);
const gfx_element *gfx = doubled ? screen->machine->gfx[2] : screen->machine->gfx[1];
if (exerion_cocktail_flip)
if (state->cocktail_flip)
{
x = 64*8 - gfx->width - x;
y = 32*8 - gfx->height - y;
@ -408,14 +405,14 @@ VIDEO_UPDATE( exerion )
for (sy = cliprect->min_y/8; sy <= cliprect->max_y/8; sy++)
for (sx = VISIBLE_X_MIN/8; sx < VISIBLE_X_MAX/8; sx++)
{
int x = exerion_cocktail_flip ? (63*8 - 8*sx) : 8*sx;
int y = exerion_cocktail_flip ? (31*8 - 8*sy) : 8*sy;
int x = state->cocktail_flip ? (63*8 - 8*sx) : 8*sx;
int y = state->cocktail_flip ? (31*8 - 8*sy) : 8*sy;
offs = sx + sy * 64;
drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
videoram[offs] + 256 * char_bank,
((videoram[offs] & 0xf0) >> 4) + char_palette * 16,
exerion_cocktail_flip, exerion_cocktail_flip, x, y, 0);
state->videoram[offs] + 256 * state->char_bank,
((state->videoram[offs] & 0xf0) >> 4) + state->char_palette * 16,
state->cocktail_flip, state->cocktail_flip, x, y, 0);
}
return 0;

View File

@ -1,19 +1,19 @@
#include "driver.h"
#include "exprraid.h"
static int bg_index[4];
static tilemap *bg_tilemap, *fg_tilemap;
WRITE8_HANDLER( exprraid_videoram_w )
{
videoram[offset] = data;
tilemap_mark_tile_dirty(fg_tilemap, offset);
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( exprraid_colorram_w )
{
colorram[offset] = data;
tilemap_mark_tile_dirty(fg_tilemap, offset);
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( exprraid_flipscreen_w )
@ -27,25 +27,29 @@ WRITE8_HANDLER( exprraid_flipscreen_w )
WRITE8_HANDLER( exprraid_bgselect_w )
{
if (bg_index[offset] != data)
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
if (state->bg_index[offset] != data)
{
bg_index[offset] = data;
tilemap_mark_all_tiles_dirty(bg_tilemap);
state->bg_index[offset] = data;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
}
WRITE8_HANDLER( exprraid_scrollx_w )
{
tilemap_set_scrollx(bg_tilemap, offset, data);
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
tilemap_set_scrollx(state->bg_tilemap, offset, data);
}
WRITE8_HANDLER( exprraid_scrolly_w )
{
tilemap_set_scrolly(bg_tilemap, 0, data);
exprraid_state *state = (exprraid_state *)space->machine->driver_data;
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static TILE_GET_INFO( get_bg_tile_info )
{
exprraid_state *state = (exprraid_state *)machine->driver_data;
UINT8 *tilerom = memory_region(machine, "gfx4");
int data, attr, bank, code, color, flags;
@ -57,7 +61,7 @@ static TILE_GET_INFO( get_bg_tile_info )
if (sx >= 16) quadrant++;
if (sy >= 16) quadrant += 2;
offs = (sy % 16) * 16 + (sx % 16) + (bg_index[quadrant] & 0x3f) * 0x100;
offs = (sy % 16) * 16 + (sx % 16) + (state->bg_index[quadrant] & 0x3f) * 0x100;
data = tilerom[offs];
attr = tilerom[offs + 0x4000];
@ -73,8 +77,9 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
int attr = colorram[tile_index];
int code = videoram[tile_index] + ((attr & 0x07) << 8);
exprraid_state *state = (exprraid_state *)machine->driver_data;
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x07) << 8);
int color = (attr & 0x10) >> 4;
SET_TILE_INFO(0, code, color, 0);
@ -82,29 +87,29 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( exprraid )
{
bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
16, 16, 32, 32);
exprraid_state *state = (exprraid_state *)machine->driver_data;
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(bg_tilemap, 2);
tilemap_set_transparent_pen(fg_tilemap, 0);
tilemap_set_scroll_rows(state->bg_tilemap, 2);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
exprraid_state *state = (exprraid_state *)machine->driver_data;
int offs;
for (offs = 0;offs < spriteram_size;offs += 4)
for (offs = 0; offs < spriteram_size; offs += 4)
{
int attr = spriteram[offs + 1];
int code = spriteram[offs + 3] + ((attr & 0xe0) << 3);
int attr = state->spriteram[offs + 1];
int code = state->spriteram[offs + 3] + ((attr & 0xe0) << 3);
int color = (attr & 0x03) + ((attr & 0x08) >> 1);
int flipx = (attr & 0x04);
int flipy = 0;
int sx = ((248 - spriteram[offs + 2]) & 0xff) - 8;
int sy = spriteram[offs];
int sx = ((248 - state->spriteram[offs + 2]) & 0xff) - 8;
int sy = state->spriteram[offs];
if (flip_screen_get(machine))
{
@ -133,9 +138,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( exprraid )
{
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
exprraid_state *state = (exprraid_state *)screen->machine->driver_data;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
draw_sprites(screen->machine, bitmap, cliprect);
tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}