mirror of
https://github.com/holub/mame
synced 2025-07-04 01:18:59 +03:00
fantland.cpp : Minor cleanups (#4215)
* fantland.cpp : Minor cleanups Reduce ACCESSING_BITs, Runtime tag map lookups, duplicates, Fix some namings, Spacings, remove unnecessary MACHINE_START_CALL_MEMBER, MACHINE_RESET_CALL_MEMBER * fantland.cpp : Split borntofi state related to ADPCM, input Fix naming/spacing, Reduce/correct ROM region usage, Reduce some trampoline * fantland.cpp : Minor correction
This commit is contained in:
parent
02e83bfa02
commit
c71e942d95
@ -64,7 +64,7 @@ Year + Game Main CPU Sound CPU Sound Video
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
WRITE8_MEMBER(fantland_state::fantland_nmi_enable_w)
|
||||
WRITE8_MEMBER(fantland_state::nmi_enable_w)
|
||||
{
|
||||
m_nmi_enable = data;
|
||||
|
||||
@ -72,72 +72,53 @@ WRITE8_MEMBER(fantland_state::fantland_nmi_enable_w)
|
||||
logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", m_maincpu->pc(), data);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(fantland_state::fantland_nmi_enable_16_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
fantland_nmi_enable_w(space, offset * 2, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(fantland_state::fantland_soundlatch_w)
|
||||
WRITE8_MEMBER(fantland_state::soundlatch_w)
|
||||
{
|
||||
m_soundlatch->write(space, 0, data);
|
||||
m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(fantland_state::fantland_soundlatch_16_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
fantland_soundlatch_w(space, offset * 2, data);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Fantasy Land
|
||||
***************************************************************************/
|
||||
|
||||
READ16_MEMBER(fantland_state::spriteram_16_r)
|
||||
READ8_MEMBER(fantland_state::spriteram_r)
|
||||
{
|
||||
uint8_t *spriteram = m_spriteram;
|
||||
return spriteram[2 * offset + 0] | (spriteram[2 * offset + 1] << 8);
|
||||
return m_spriteram[offset];
|
||||
}
|
||||
|
||||
READ16_MEMBER(fantland_state::spriteram2_16_r)
|
||||
READ8_MEMBER(fantland_state::spriteram2_r)
|
||||
{
|
||||
uint8_t *spriteram_2 = m_spriteram2;
|
||||
return spriteram_2[2 * offset + 0] | (spriteram_2[2 * offset + 1] << 8);
|
||||
return m_spriteram2[offset];
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(fantland_state::spriteram_16_w)
|
||||
WRITE8_MEMBER(fantland_state::spriteram_w)
|
||||
{
|
||||
uint8_t *spriteram = m_spriteram;
|
||||
if (ACCESSING_BITS_0_7)
|
||||
spriteram[2 * offset + 0] = data;
|
||||
if (ACCESSING_BITS_8_15)
|
||||
spriteram[2 * offset + 1] = data >> 8;
|
||||
COMBINE_DATA(&m_spriteram[offset]);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(fantland_state::spriteram2_16_w)
|
||||
WRITE8_MEMBER(fantland_state::spriteram2_w)
|
||||
{
|
||||
uint8_t *spriteram_2 = m_spriteram2;
|
||||
if (ACCESSING_BITS_0_7)
|
||||
spriteram_2[2 * offset + 0] = data;
|
||||
if (ACCESSING_BITS_8_15)
|
||||
spriteram_2[2 * offset + 1] = data >> 8;
|
||||
COMBINE_DATA(&m_spriteram2[offset]);
|
||||
}
|
||||
|
||||
void fantland_state::fantland_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x07fff).ram();
|
||||
map(0x08000, 0x7ffff).rom();
|
||||
map(0x08000, 0x3ffff).rom().region("maincpu", 0x08000);
|
||||
map(0x40000, 0x7ffff).rom().region("maincpu", 0x00000);
|
||||
|
||||
map(0xa2000, 0xa21ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
|
||||
map(0xa3000, 0xa3001).portr("a3000").w(FUNC(fantland_state::fantland_nmi_enable_16_w));
|
||||
map(0xa3002, 0xa3003).portr("a3002").w(FUNC(fantland_state::fantland_soundlatch_16_w));
|
||||
map(0xa3000, 0xa3000).w(FUNC(fantland_state::nmi_enable_w));
|
||||
map(0xa3000, 0xa3001).portr("a3000");
|
||||
map(0xa3002, 0xa3002).w(FUNC(fantland_state::soundlatch_w));
|
||||
map(0xa3002, 0xa3003).portr("a3002");
|
||||
|
||||
map(0xa4000, 0xa67ff).rw(FUNC(fantland_state::spriteram_16_r), FUNC(fantland_state::spriteram_16_w)).share("spriteram");
|
||||
map(0xc0000, 0xcffff).rw(FUNC(fantland_state::spriteram2_16_r), FUNC(fantland_state::spriteram2_16_w)).share("spriteram2");
|
||||
map(0xa4000, 0xa67ff).rw(FUNC(fantland_state::spriteram_r), FUNC(fantland_state::spriteram_w)).share("spriteram");
|
||||
map(0xc0000, 0xcffff).rw(FUNC(fantland_state::spriteram2_r), FUNC(fantland_state::spriteram2_w)).share("spriteram2");
|
||||
|
||||
map(0xe0000, 0xfffff).rom();
|
||||
map(0xe0000, 0xfffff).rom().region("maincpu", 0xe0000);
|
||||
}
|
||||
|
||||
|
||||
@ -148,20 +129,19 @@ void fantland_state::fantland_map(address_map &map)
|
||||
void fantland_state::galaxygn_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x07fff).ram();
|
||||
map(0x10000, 0x2ffff).rom();
|
||||
map(0x10000, 0x2ffff).rom().region("maincpu", 0x10000);
|
||||
|
||||
map(0x52000, 0x521ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
|
||||
|
||||
map(0x53000, 0x53000).portr("P1").w(FUNC(fantland_state::fantland_nmi_enable_w));
|
||||
map(0x53000, 0x53000).portr("P1").w(FUNC(fantland_state::nmi_enable_w));
|
||||
map(0x53001, 0x53001).portr("P2");
|
||||
map(0x53002, 0x53002).portr("DSW1").w(FUNC(fantland_state::fantland_soundlatch_w));
|
||||
map(0x53002, 0x53002).portr("DSW1").w(FUNC(fantland_state::soundlatch_w));
|
||||
map(0x53003, 0x53003).portr("DSW2");
|
||||
|
||||
map(0x54000, 0x567ff).ram().share("spriteram");
|
||||
map(0x60000, 0x6ffff).ram().share("spriteram2");
|
||||
|
||||
map(0x70000, 0x7ffff).rom();
|
||||
map(0xf0000, 0xfffff).rom();
|
||||
map(0x70000, 0x7ffff).rom().region("maincpu", 0x70000).mirror(0x80000);
|
||||
}
|
||||
|
||||
|
||||
@ -169,20 +149,21 @@ void fantland_state::galaxygn_map(address_map &map)
|
||||
Born To Fight
|
||||
***************************************************************************/
|
||||
|
||||
WRITE8_MEMBER(fantland_state::borntofi_nmi_enable_w)
|
||||
// data & 0x31 changes when lightgun fires
|
||||
#if 0
|
||||
WRITE8_MEMBER(borntofi_state::nmi_enable_w)
|
||||
{
|
||||
m_nmi_enable = data;
|
||||
|
||||
// data & 0x31 changes when lightgun fires
|
||||
|
||||
if ((m_nmi_enable != 0) && (m_nmi_enable != 8))
|
||||
logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", m_maincpu->pc(), data);
|
||||
|
||||
// popmessage("%02X", data);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Trackball doesn't work correctly
|
||||
READ8_MEMBER(fantland_state::borntofi_inputs_r)
|
||||
READ8_MEMBER(borntofi_state::inputs_r)
|
||||
{
|
||||
int x, y, f;
|
||||
|
||||
@ -238,14 +219,14 @@ READ8_MEMBER(fantland_state::borntofi_inputs_r)
|
||||
return m_input_ret[offset];
|
||||
}
|
||||
|
||||
void fantland_state::borntofi_map(address_map &map)
|
||||
void borntofi_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x07fff).ram();
|
||||
map(0x10000, 0x2ffff).rom();
|
||||
map(0x10000, 0x2ffff).rom().region("maincpu", 0x10000);
|
||||
|
||||
map(0x52000, 0x521ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
|
||||
map(0x53000, 0x53001).rw(FUNC(fantland_state::borntofi_inputs_r), FUNC(fantland_state::borntofi_nmi_enable_w));
|
||||
map(0x53002, 0x53002).portr("DSW").w(FUNC(fantland_state::fantland_soundlatch_w));
|
||||
map(0x53000, 0x53001).rw(FUNC(borntofi_state::inputs_r), FUNC(borntofi_state::nmi_enable_w));
|
||||
map(0x53002, 0x53002).portr("DSW").w(FUNC(borntofi_state::soundlatch_w));
|
||||
map(0x53003, 0x53003).portr("Controls");
|
||||
|
||||
map(0x54000, 0x567ff).ram().share("spriteram");
|
||||
@ -257,8 +238,7 @@ void fantland_state::borntofi_map(address_map &map)
|
||||
|
||||
map(0x60000, 0x6ffff).ram().share("spriteram2");
|
||||
|
||||
map(0x70000, 0x7ffff).rom();
|
||||
map(0xf0000, 0xfffff).rom();
|
||||
map(0x70000, 0x7ffff).rom().region("maincpu", 0x70000).mirror(0x80000);
|
||||
}
|
||||
|
||||
|
||||
@ -270,20 +250,19 @@ void fantland_state::wheelrun_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x07fff).ram();
|
||||
|
||||
map(0x30000, 0x3ffff).rom();
|
||||
map(0x70000, 0x7ffff).rom();
|
||||
map(0x30000, 0x3ffff).rom().region("maincpu", 0x30000);
|
||||
|
||||
map(0x52000, 0x521ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette");
|
||||
|
||||
map(0x53000, 0x53000).portr("53000").w(FUNC(fantland_state::borntofi_nmi_enable_w));
|
||||
map(0x53000, 0x53000).portr("53000").w(FUNC(fantland_state::nmi_enable_w));
|
||||
map(0x53001, 0x53001).portr("53001");
|
||||
map(0x53002, 0x53002).portr("53002").w(FUNC(fantland_state::fantland_soundlatch_w));
|
||||
map(0x53002, 0x53002).portr("53002").w(FUNC(fantland_state::soundlatch_w));
|
||||
map(0x53003, 0x53003).portr("53003").nopw();
|
||||
|
||||
map(0x54000, 0x567ff).ram().share("spriteram");
|
||||
map(0x60000, 0x6ffff).ram().share("spriteram2");
|
||||
|
||||
map(0xf0000, 0xfffff).rom();
|
||||
map(0x70000, 0x7ffff).rom().region("maincpu", 0x70000).mirror(0x80000);
|
||||
}
|
||||
|
||||
|
||||
@ -298,7 +277,7 @@ void fantland_state::fantland_sound_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x01fff).ram();
|
||||
map(0x80000, 0x9ffff).rom();
|
||||
map(0xc0000, 0xfffff).rom();
|
||||
map(0xc0000, 0xfffff).rom().region("maincpu", 0xc0000);
|
||||
}
|
||||
|
||||
void fantland_state::fantland_sound_iomap(address_map &map)
|
||||
@ -319,42 +298,32 @@ void fantland_state::galaxygn_sound_iomap(address_map &map)
|
||||
Born To Fight
|
||||
***************************************************************************/
|
||||
|
||||
void fantland_state::borntofi_adpcm_start( msm5205_device *device, int voice )
|
||||
void borntofi_state::adpcm_start(int voice)
|
||||
{
|
||||
device->reset_w(0);
|
||||
m_msm[voice]->reset_w(0);
|
||||
m_adpcm_playing[voice] = 1;
|
||||
m_adpcm_nibble[voice] = 0;
|
||||
// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine().describe_context(), m_adpcm_addr[0][voice], m_adpcm_addr[1][voice]);
|
||||
}
|
||||
|
||||
void fantland_state::borntofi_adpcm_stop( msm5205_device *device, int voice )
|
||||
void borntofi_state::adpcm_stop(int voice)
|
||||
{
|
||||
device->reset_w(1);
|
||||
m_msm[voice]->reset_w(1);
|
||||
m_adpcm_playing[voice] = 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(fantland_state::borntofi_msm5205_w)
|
||||
WRITE8_MEMBER(borntofi_state::msm5205_w)
|
||||
{
|
||||
int voice = offset / 8;
|
||||
int reg = offset % 8;
|
||||
msm5205_device *msm;
|
||||
|
||||
switch (voice)
|
||||
{
|
||||
default:
|
||||
case 0: msm = m_msm1; break;
|
||||
case 1: msm = m_msm2; break;
|
||||
case 2: msm = m_msm3; break;
|
||||
case 3: msm = m_msm4; break;
|
||||
}
|
||||
|
||||
if (reg == 0)
|
||||
{
|
||||
// Play / Stop
|
||||
switch(data)
|
||||
{
|
||||
case 0x00: borntofi_adpcm_stop(msm, voice); break;
|
||||
case 0x03: borntofi_adpcm_start(msm, voice); break;
|
||||
case 0x00: adpcm_stop(voice); break;
|
||||
case 0x03: adpcm_start(voice); break;
|
||||
default: logerror("CPU #0 PC = %04X: adpcm reg %d <- %02x\n", m_audiocpu->pc(), reg, data);
|
||||
}
|
||||
}
|
||||
@ -368,52 +337,43 @@ WRITE8_MEMBER(fantland_state::borntofi_msm5205_w)
|
||||
}
|
||||
}
|
||||
|
||||
void fantland_state::borntofi_adpcm_int( msm5205_device *device, int voice )
|
||||
template<int Voice>
|
||||
WRITE_LINE_MEMBER(borntofi_state::adpcm_int)
|
||||
{
|
||||
uint8_t *rom;
|
||||
size_t len;
|
||||
int start, stop;
|
||||
|
||||
if (!m_adpcm_playing[voice])
|
||||
if (!m_adpcm_playing[Voice])
|
||||
return;
|
||||
|
||||
rom = memregion("adpcm")->base();
|
||||
len = memregion("adpcm")->bytes() * 2;
|
||||
size_t const len = m_adpcm_rom.bytes() * 2;
|
||||
|
||||
start = m_adpcm_addr[0][voice] + m_adpcm_nibble[voice];
|
||||
stop = m_adpcm_addr[1][voice];
|
||||
int const start = m_adpcm_addr[0][Voice] + m_adpcm_nibble[Voice];
|
||||
int const stop = m_adpcm_addr[1][Voice];
|
||||
|
||||
if (start >= len)
|
||||
{
|
||||
borntofi_adpcm_stop(device, voice);
|
||||
adpcm_stop(Voice);
|
||||
logerror("adpcm address out of range: %06x\n", start);
|
||||
return;
|
||||
}
|
||||
|
||||
if (start >= stop)
|
||||
{
|
||||
borntofi_adpcm_stop(device, voice);
|
||||
adpcm_stop(Voice);
|
||||
}
|
||||
else
|
||||
{
|
||||
device->write_data(rom[start / 2] >> ((start & 1) * 4));
|
||||
m_adpcm_nibble[voice]++;
|
||||
m_msm[Voice]->write_data(m_adpcm_rom[start / 2] >> ((start & 1) * 4));
|
||||
m_adpcm_nibble[Voice]++;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_0) { borntofi_adpcm_int(m_msm1, 0); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_1) { borntofi_adpcm_int(m_msm2, 1); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_2) { borntofi_adpcm_int(m_msm3, 2); }
|
||||
WRITE_LINE_MEMBER(fantland_state::borntofi_adpcm_int_3) { borntofi_adpcm_int(m_msm4, 3); }
|
||||
|
||||
|
||||
void fantland_state::borntofi_sound_map(address_map &map)
|
||||
void borntofi_state::sound_map(address_map &map)
|
||||
{
|
||||
map(0x00000, 0x003ff).ram();
|
||||
map(0x04000, 0x04000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
|
||||
map(0x04000, 0x0401f).w(FUNC(fantland_state::borntofi_msm5205_w));
|
||||
map(0x08000, 0x0ffff).rom();
|
||||
map(0xf8000, 0xfffff).rom();
|
||||
map(0x04000, 0x0401f).w(FUNC(borntofi_state::msm5205_w));
|
||||
map(0x08000, 0x0ffff).rom().region("audiocpu", 0x08000);
|
||||
map(0xf8000, 0xfffff).rom().region("audiocpu", 0x08000);
|
||||
}
|
||||
|
||||
|
||||
@ -827,17 +787,17 @@ GFXDECODE_END
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
MACHINE_START_MEMBER(fantland_state,fantland)
|
||||
void fantland_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_nmi_enable));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(fantland_state,fantland)
|
||||
void fantland_state::machine_reset()
|
||||
{
|
||||
m_nmi_enable = 0;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(fantland_state::fantland_irq)
|
||||
WRITE_LINE_MEMBER(fantland_state::vblank_irq)
|
||||
{
|
||||
if (state && BIT(m_nmi_enable, 3))
|
||||
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
@ -860,9 +820,6 @@ MACHINE_CONFIG_START(fantland_state::fantland)
|
||||
MCFG_DEVICE_PERIODIC_INT_DRIVER(fantland_state, fantland_sound_irq, 8000)
|
||||
// NMI when soundlatch is written
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(fantland_state,fantland)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(fantland_state,fantland)
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(8000)) // sound irq must feed the DAC at 8kHz
|
||||
|
||||
/* video hardware */
|
||||
@ -871,9 +828,9 @@ MACHINE_CONFIG_START(fantland_state::fantland)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(352,256)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update_fantland)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, fantland_irq))
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, vblank_irq))
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fantland)
|
||||
MCFG_PALETTE_ADD("palette", 256)
|
||||
@ -910,18 +867,15 @@ MACHINE_CONFIG_START(fantland_state::galaxygn)
|
||||
MCFG_DEVICE_IO_MAP(galaxygn_sound_iomap)
|
||||
// IRQ by YM2151, NMI when soundlatch is written
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(fantland_state,fantland)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(fantland_state,fantland)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(352,256)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update_fantland)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, fantland_irq))
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, vblank_irq))
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fantland)
|
||||
MCFG_PALETTE_ADD("palette", 256)
|
||||
@ -939,9 +893,9 @@ MACHINE_CONFIG_START(fantland_state::galaxygn)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
MACHINE_START_MEMBER(fantland_state,borntofi)
|
||||
void borntofi_state::machine_start()
|
||||
{
|
||||
MACHINE_START_CALL_MEMBER(fantland);
|
||||
fantland_state::machine_start();
|
||||
|
||||
save_item(NAME(m_old_x));
|
||||
save_item(NAME(m_old_y));
|
||||
@ -953,11 +907,11 @@ MACHINE_START_MEMBER(fantland_state,borntofi)
|
||||
save_item(NAME(m_adpcm_nibble));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(fantland_state,borntofi)
|
||||
void borntofi_state::machine_reset()
|
||||
{
|
||||
int i;
|
||||
|
||||
MACHINE_RESET_CALL_MEMBER(fantland);
|
||||
fantland_state::machine_reset();
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
@ -975,23 +929,20 @@ MACHINE_RESET_MEMBER(fantland_state,borntofi)
|
||||
m_adpcm_nibble[i] = 0;
|
||||
}
|
||||
|
||||
borntofi_adpcm_stop(m_msm1, 0);
|
||||
borntofi_adpcm_stop(m_msm2, 1);
|
||||
borntofi_adpcm_stop(m_msm3, 2);
|
||||
borntofi_adpcm_stop(m_msm4, 3);
|
||||
adpcm_stop(0);
|
||||
adpcm_stop(1);
|
||||
adpcm_stop(2);
|
||||
adpcm_stop(3);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(fantland_state::borntofi)
|
||||
MACHINE_CONFIG_START(borntofi_state::borntofi)
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", V20, 16000000/2) // D701080C-8 - NEC D70108C-8 V20 CPU, running at 8.000MHz [16/2]
|
||||
MCFG_DEVICE_PROGRAM_MAP(borntofi_map)
|
||||
MCFG_DEVICE_PROGRAM_MAP(main_map)
|
||||
|
||||
MCFG_DEVICE_ADD("audiocpu", I8088, 18432000/3) // 8088 - AMD P8088-2 CPU, running at 6.144MHz [18.432/3]
|
||||
MCFG_DEVICE_PROGRAM_MAP(borntofi_sound_map)
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(fantland_state,borntofi)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(fantland_state,borntofi)
|
||||
MCFG_DEVICE_PROGRAM_MAP(sound_map)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
@ -999,9 +950,9 @@ MACHINE_CONFIG_START(fantland_state::borntofi)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(352,256)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 352-1, 0, 256-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update_fantland)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(borntofi_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, fantland_irq))
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, borntofi_state, vblank_irq))
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fantland)
|
||||
MCFG_PALETTE_ADD("palette", 256)
|
||||
@ -1014,22 +965,22 @@ MACHINE_CONFIG_START(fantland_state::borntofi)
|
||||
|
||||
// OKI M5205 running at 384kHz [18.432/48]. Sample rate = 384000 / 48
|
||||
MCFG_DEVICE_ADD("msm1", MSM5205, 384000)
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, fantland_state, borntofi_adpcm_int_0)) /* IRQ handler */
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, borntofi_state, adpcm_int<0>)) /* IRQ handler */
|
||||
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz, 4 Bits */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
|
||||
|
||||
MCFG_DEVICE_ADD("msm2", MSM5205, 384000)
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, fantland_state, borntofi_adpcm_int_1)) /* IRQ handler */
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, borntofi_state, adpcm_int<1>)) /* IRQ handler */
|
||||
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz, 4 Bits */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
|
||||
|
||||
MCFG_DEVICE_ADD("msm3", MSM5205, 384000)
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, fantland_state, borntofi_adpcm_int_2)) /* IRQ handler */
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, borntofi_state, adpcm_int<2>)) /* IRQ handler */
|
||||
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz, 4 Bits */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
|
||||
|
||||
MCFG_DEVICE_ADD("msm4", MSM5205, 384000)
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, fantland_state, borntofi_adpcm_int_3)) /* IRQ handler */
|
||||
MCFG_MSM5205_VCLK_CB(WRITELINE(*this, borntofi_state, adpcm_int<3>)) /* IRQ handler */
|
||||
MCFG_MSM5205_PRESCALER_SELECTOR(S48_4B) /* 8 kHz, 4 Bits */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
@ -1045,18 +996,15 @@ MACHINE_CONFIG_START(fantland_state::wheelrun)
|
||||
MCFG_DEVICE_PROGRAM_MAP(wheelrun_sound_map)
|
||||
// IRQ by YM3526, NMI when soundlatch is written
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(fantland_state,fantland)
|
||||
MCFG_MACHINE_RESET_OVERRIDE(fantland_state,fantland)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(256,224)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update_fantland)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(fantland_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, fantland_irq))
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, fantland_state, vblank_irq))
|
||||
|
||||
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_fantland)
|
||||
MCFG_PALETTE_ADD("palette", 256)
|
||||
@ -1106,14 +1054,13 @@ ROM_START( fantland )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // Main CPU
|
||||
ROM_LOAD16_BYTE( "fantasyl.ev2", 0x00000, 0x20000, CRC(f5bdca0e) SHA1(d05cf6f68d4d1a3dcc0171f7cf220c4920bd47bb) )
|
||||
ROM_LOAD16_BYTE( "fantasyl.od2", 0x00001, 0x20000, CRC(9db35023) SHA1(81e2accd67dcf8563a68b2c4e35526f23a40150c) )
|
||||
ROM_COPY( "maincpu", 0x000000, 0x40000, 0x40000 )
|
||||
ROM_LOAD16_BYTE( "fantasyl.ev1", 0xe0000, 0x10000, CRC(70e0ee30) SHA1(5253213da56b3f97e2811f2b10927d0e542447f0) )
|
||||
ROM_LOAD16_BYTE( "fantasyl.od1", 0xe0001, 0x10000, CRC(577b4bd7) SHA1(1f08202d99c3e39e0dd1ed4947b928b695a5b411) )
|
||||
|
||||
ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound CPU
|
||||
ROM_LOAD( "fantasyl.s2", 0x80000, 0x20000, CRC(f23837d8) SHA1(4048784f759781e50ae445ea61f1ca908e8e6ac1) ) // samples (8 bit unsigned)
|
||||
ROM_LOAD( "fantasyl.s1", 0xc0000, 0x20000, CRC(1a324a69) SHA1(06f6877af6cd19bfaac8a4ea8057ef8faee276f5) )
|
||||
ROM_COPY( "audiocpu", 0xc0000, 0xe0000, 0x20000 )
|
||||
ROM_COPY( "audiocpu", 0xc0000, 0xe0000, 0x20000 )
|
||||
|
||||
ROM_REGION( 0x480000, "gfx1", 0 ) // Sprites
|
||||
ROMX_LOAD( "fantasyl.m00", 0x000000, 0x80000, CRC(82d819ff) SHA1(2b5b0759de8260eaa84ddded9dc2d12a6e0f5ec9) , ROM_GROUPWORD | ROM_SKIP(1) )
|
||||
@ -1135,14 +1082,13 @@ ROM_START( fantlanda )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // Main CPU
|
||||
ROM_LOAD16_BYTE( "fantasyl.ev2", 0x00000, 0x20000, CRC(f5bdca0e) SHA1(d05cf6f68d4d1a3dcc0171f7cf220c4920bd47bb) ) // 04.bin (was first half only)
|
||||
ROM_LOAD16_BYTE( "fantasyl.od2", 0x00001, 0x20000, CRC(9db35023) SHA1(81e2accd67dcf8563a68b2c4e35526f23a40150c) ) // 03.bin (was first half only)
|
||||
ROM_COPY( "maincpu", 0x000000, 0x40000, 0x40000 )
|
||||
ROM_LOAD16_BYTE( "02.bin", 0xe0000, 0x10000, CRC(8b835eed) SHA1(6a6b3fe116145f685b91dcd5301165f17973697c) )
|
||||
ROM_LOAD16_BYTE( "01.bin", 0xe0001, 0x10000, CRC(4fa3eb8b) SHA1(56da42a4e2972a696ef28811116cbc20bb5ba3e8) )
|
||||
|
||||
ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound CPU
|
||||
ROM_LOAD( "fantasyl.s2", 0x80000, 0x20000, CRC(f23837d8) SHA1(4048784f759781e50ae445ea61f1ca908e8e6ac1) ) // 05.bin (was first half only)
|
||||
ROM_LOAD( "fantasyl.s1", 0xc0000, 0x20000, CRC(1a324a69) SHA1(06f6877af6cd19bfaac8a4ea8057ef8faee276f5) ) // 06.bin (was first half only)
|
||||
ROM_COPY( "audiocpu", 0xc0000, 0xe0000, 0x20000 )
|
||||
ROM_COPY( "audiocpu", 0xc0000, 0xe0000, 0x20000 )
|
||||
|
||||
ROM_REGION( 0x480000, "gfx1", 0 ) // Sprites
|
||||
ROMX_LOAD( "fantasyl.m00", 0x000000, 0x80000, CRC(82d819ff) SHA1(2b5b0759de8260eaa84ddded9dc2d12a6e0f5ec9) , ROM_GROUPWORD | ROM_SKIP(1) )
|
||||
@ -1164,11 +1110,10 @@ ROM_END
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( galaxygn )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // Main CPU
|
||||
ROM_REGION( 0x80000, "maincpu", 0 ) // Main CPU
|
||||
ROM_LOAD( "gg03.bin", 0x10000, 0x10000, CRC(9e469189) SHA1(07e5d36ca9665bdd13e3bb4241d34b9042371b79) )
|
||||
ROM_LOAD( "gg02.bin", 0x20000, 0x10000, CRC(b87a438f) SHA1(96c39cc4d51a2fc0779f148971220117967173c0) )
|
||||
ROM_LOAD( "gg01.bin", 0xf0000, 0x10000, CRC(ad0e5b29) SHA1(f9a7ebce9f47a009af213e4e10811bb1c26f891a) )
|
||||
ROM_COPY( "maincpu",0xf0000, 0x70000, 0x10000 )
|
||||
ROM_LOAD( "gg01.bin", 0x70000, 0x10000, CRC(ad0e5b29) SHA1(f9a7ebce9f47a009af213e4e10811bb1c26f891a) )
|
||||
|
||||
ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound CPU
|
||||
ROM_LOAD( "gg20.bin", 0xc0000, 0x10000, CRC(f5c65a85) SHA1(a094fa9531ea4e68ec0a448568e7d4b2307c8185) )
|
||||
@ -1285,15 +1230,13 @@ Notes:
|
||||
*/
|
||||
|
||||
ROM_START( borntofi )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) /* V20 */
|
||||
ROM_REGION( 0x80000, "maincpu", 0 ) /* V20 */
|
||||
ROM_LOAD( "3.bin", 0x10000, 0x10000, CRC(5f07f4a2) SHA1(240864d1d5d9e26d229bc21aa39ee03f4bd25814) )
|
||||
ROM_LOAD( "2.bin", 0x20000, 0x10000, CRC(5d2b3395) SHA1(ac87f352f380b67802c26232824663063549ac7b) )
|
||||
ROM_LOAD( "1.bin", 0xf0000, 0x10000, CRC(0a5e2f32) SHA1(5167a85329e5ea35c686af85e44d62227cf5800e) )
|
||||
ROM_COPY( "maincpu", 0xf0000, 0x70000, 0x10000 )
|
||||
ROM_LOAD( "1.bin", 0x70000, 0x10000, CRC(0a5e2f32) SHA1(5167a85329e5ea35c686af85e44d62227cf5800e) )
|
||||
|
||||
ROM_REGION( 0x100000, "audiocpu", 0 ) /* 8088 */
|
||||
ROM_LOAD( "5.bin", 0xf8000, 0x08000, CRC(b5d587ce) SHA1(07687abd264ec80a6eb473cb3f3ab97ec6b365a2) )
|
||||
ROM_COPY( "audiocpu", 0xf8000, 0x08000, 0x08000 )
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 8088 */
|
||||
ROM_LOAD( "5.bin", 0x08000, 0x08000, CRC(b5d587ce) SHA1(07687abd264ec80a6eb473cb3f3ab97ec6b365a2) )
|
||||
|
||||
ROM_REGION( 0xc0000, "adpcm", 0 ) /* m5205 samples */
|
||||
ROM_LOAD( "6.bin", 0x00000, 0x10000, CRC(731c523b) SHA1(b649a838ce70d5af607f8b9faf8b012e2ff1104b) )
|
||||
@ -1381,12 +1324,11 @@ Hardware info by f205v
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( wheelrun )
|
||||
ROM_REGION( 0x100000, "maincpu", 0 ) // V20
|
||||
ROM_REGION( 0x80000, "maincpu", 0 ) // V20
|
||||
ROM_LOAD( "4.4", 0x30000, 0x10000, CRC(359303df) SHA1(583b70f65b775e99856ffda61334be3b85046ed1) )
|
||||
ROM_LOAD( "3.3", 0x70000, 0x10000, CRC(c28d0b31) SHA1(add8c4ffe529755c101b72a3b0530e796948876b) )
|
||||
ROM_COPY( "maincpu", 0x70000, 0xf0000, 0x10000 )
|
||||
|
||||
ROM_REGION( 0x100000, "audiocpu", 0 ) // Z80
|
||||
ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80
|
||||
ROM_LOAD( "1.1", 0x00000, 0x10000, CRC(67b5f31f) SHA1(5553b132077686221fb7a21a0246fd55cb443332) ) // 1xxxxxxxxxxxxxxx = 0xFF
|
||||
|
||||
ROM_REGION( 0xc0000, "gfx1",0 ) // gfx
|
||||
@ -1425,7 +1367,7 @@ ROM_START( wheelrun )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAME( 19??, borntofi, 0, borntofi, borntofi, fantland_state, empty_init, ROT0, "International Games", "Born To Fight", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 19??, borntofi, 0, borntofi, borntofi, borntofi_state, empty_init, ROT0, "International Games", "Born To Fight", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 19??, fantland, 0, fantland, fantland, fantland_state, empty_init, ROT0, "Electronic Devices Italy", "Fantasy Land (set 1)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 19??, fantlanda, fantland, fantland, fantland, fantland_state, empty_init, ROT0, "Electronic Devices Italy", "Fantasy Land (set 2)", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 19??, wheelrun, 0, wheelrun, wheelrun, fantland_state, empty_init, ROT0, "International Games", "Wheels Runner", MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -9,42 +9,30 @@
|
||||
class fantland_state : public driver_device
|
||||
{
|
||||
public:
|
||||
fantland_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
fantland_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_soundlatch(*this, "soundlatch"),
|
||||
m_msm1(*this, "msm1"),
|
||||
m_msm2(*this, "msm2"),
|
||||
m_msm3(*this, "msm3"),
|
||||
m_msm4(*this, "msm4"),
|
||||
m_spriteram(*this, "spriteram", 0),
|
||||
m_spriteram2(*this, "spriteram2", 0) { }
|
||||
|
||||
void fantland(machine_config &config);
|
||||
void wheelrun(machine_config &config);
|
||||
void borntofi(machine_config &config);
|
||||
void galaxygn(machine_config &config);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(wheelrun_wheel_r);
|
||||
|
||||
private:
|
||||
protected:
|
||||
/* memory pointers */
|
||||
// uint8_t * m_spriteram; // currently directly used in a 16bit map...
|
||||
// uint8_t * m_spriteram_2; // currently directly used in a 16bit map...
|
||||
|
||||
/* misc */
|
||||
uint8_t m_nmi_enable;
|
||||
int m_old_x[2];
|
||||
int m_old_y[2];
|
||||
int m_old_f[2];
|
||||
uint8_t m_input_ret[2];
|
||||
int m_adpcm_playing[4];
|
||||
int m_adpcm_addr[2][4];
|
||||
int m_adpcm_nibble[4];
|
||||
uint8_t m_nmi_enable;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -53,42 +41,24 @@ private:
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
optional_device<msm5205_device> m_msm1;
|
||||
optional_device<msm5205_device> m_msm2;
|
||||
optional_device<msm5205_device> m_msm3;
|
||||
optional_device<msm5205_device> m_msm4;
|
||||
|
||||
optional_shared_ptr<uint8_t> m_spriteram;
|
||||
optional_shared_ptr<uint8_t> m_spriteram2;
|
||||
DECLARE_WRITE_LINE_MEMBER(galaxygn_sound_irq);
|
||||
DECLARE_WRITE8_MEMBER(fantland_nmi_enable_w);
|
||||
DECLARE_WRITE16_MEMBER(fantland_nmi_enable_16_w);
|
||||
DECLARE_WRITE8_MEMBER(fantland_soundlatch_w);
|
||||
DECLARE_WRITE16_MEMBER(fantland_soundlatch_16_w);
|
||||
DECLARE_READ16_MEMBER(spriteram_16_r);
|
||||
DECLARE_READ16_MEMBER(spriteram2_16_r);
|
||||
DECLARE_WRITE16_MEMBER(spriteram_16_w);
|
||||
DECLARE_WRITE16_MEMBER(spriteram2_16_w);
|
||||
DECLARE_WRITE8_MEMBER(borntofi_nmi_enable_w);
|
||||
DECLARE_READ8_MEMBER(borntofi_inputs_r);
|
||||
DECLARE_WRITE8_MEMBER(borntofi_msm5205_w);
|
||||
DECLARE_MACHINE_START(fantland);
|
||||
DECLARE_MACHINE_RESET(fantland);
|
||||
DECLARE_MACHINE_START(borntofi);
|
||||
DECLARE_MACHINE_RESET(borntofi);
|
||||
uint32_t screen_update_fantland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(fantland_irq);
|
||||
INTERRUPT_GEN_MEMBER(fantland_sound_irq);
|
||||
required_shared_ptr<uint8_t> m_spriteram;
|
||||
required_shared_ptr<uint8_t> m_spriteram2;
|
||||
DECLARE_WRITE8_MEMBER(nmi_enable_w);
|
||||
DECLARE_WRITE8_MEMBER(soundlatch_w);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank_irq);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_0);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_1);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_2);
|
||||
DECLARE_WRITE_LINE_MEMBER(borntofi_adpcm_int_3);
|
||||
void borntofi_adpcm_start( msm5205_device *device, int voice );
|
||||
void borntofi_adpcm_stop( msm5205_device *device, int voice );
|
||||
void borntofi_adpcm_int( msm5205_device *device, int voice );
|
||||
void borntofi_map(address_map &map);
|
||||
void borntofi_sound_map(address_map &map);
|
||||
|
||||
private:
|
||||
DECLARE_READ8_MEMBER(spriteram_r);
|
||||
DECLARE_READ8_MEMBER(spriteram2_r);
|
||||
DECLARE_WRITE8_MEMBER(spriteram_w);
|
||||
DECLARE_WRITE8_MEMBER(spriteram2_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(galaxygn_sound_irq);
|
||||
INTERRUPT_GEN_MEMBER(fantland_sound_irq);
|
||||
void fantland_map(address_map &map);
|
||||
void fantland_sound_iomap(address_map &map);
|
||||
void fantland_sound_map(address_map &map);
|
||||
@ -97,3 +67,40 @@ private:
|
||||
void wheelrun_map(address_map &map);
|
||||
void wheelrun_sound_map(address_map &map);
|
||||
};
|
||||
|
||||
class borntofi_state : public fantland_state
|
||||
{
|
||||
public:
|
||||
borntofi_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
fantland_state(mconfig, type, tag),
|
||||
m_msm(*this, "msm%u", 1U),
|
||||
m_adpcm_rom(*this, "adpcm")
|
||||
{
|
||||
}
|
||||
|
||||
void borntofi(machine_config &config);
|
||||
|
||||
private:
|
||||
/* misc */
|
||||
int m_old_x[2];
|
||||
int m_old_y[2];
|
||||
int m_old_f[2];
|
||||
uint8_t m_input_ret[2];
|
||||
int m_adpcm_playing[4];
|
||||
int m_adpcm_addr[2][4];
|
||||
int m_adpcm_nibble[4];
|
||||
|
||||
/* devices */
|
||||
required_device_array<msm5205_device, 4> m_msm;
|
||||
required_region_ptr<uint8_t> m_adpcm_rom;
|
||||
|
||||
DECLARE_READ8_MEMBER(inputs_r);
|
||||
DECLARE_WRITE8_MEMBER(msm5205_w);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
template<int Voice> DECLARE_WRITE_LINE_MEMBER(adpcm_int);
|
||||
void adpcm_start(int voice);
|
||||
void adpcm_stop(int voice);
|
||||
void main_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
};
|
||||
|
@ -65,9 +65,8 @@
|
||||
|
||||
void fantland_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
uint8_t *spriteram_2 = m_spriteram2;
|
||||
uint8_t *indx_ram = m_spriteram + 0x2000, // this ram contains indexes into offs_ram
|
||||
*offs_ram = m_spriteram + 0x2400, // this ram contains x,y offsets or indexes into spriteram_2
|
||||
uint8_t *indx_ram = m_spriteram + 0x2000, // this ram contains indexes into offs_ram
|
||||
*offs_ram = m_spriteram + 0x2400, // this ram contains x,y offsets or indexes into m_spriteram2
|
||||
*ram = m_spriteram, // current sprite pointer in spriteram
|
||||
*ram2 = indx_ram; // current sprite pointer in indx_ram
|
||||
|
||||
@ -100,12 +99,12 @@ void fantland_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
||||
|
||||
if (offs_ram[idx + 2] & 0x80)
|
||||
{
|
||||
// x,y & code offset is in spriteram_2, this is its index
|
||||
// x,y & code offset is in m_spriteram2, this is its index
|
||||
|
||||
idx = (((offs_ram[idx + 2] << 8) + offs_ram[idx + 3]) & 0x3fff) * 4;
|
||||
|
||||
yoffs = spriteram_2[idx + 0] + (spriteram_2[idx + 1] << 8);
|
||||
xoffs = spriteram_2[idx + 2] + (spriteram_2[idx + 3] << 8);
|
||||
yoffs = m_spriteram2[idx + 0] + (m_spriteram2[idx + 1] << 8);
|
||||
xoffs = m_spriteram2[idx + 2] + (m_spriteram2[idx + 3] << 8);
|
||||
|
||||
code += (yoffs & 0x3e00) >> 9;
|
||||
flipy ^= (yoffs & 0x4000) ? 1 : 0;
|
||||
@ -140,7 +139,7 @@ void fantland_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t fantland_state::screen_update_fantland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
uint32_t fantland_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
|
Loading…
Reference in New Issue
Block a user