summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2018-06-12 18:14:13 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2018-06-12 18:14:13 +0200
commit831222b40d3497b39055314668ad019585fd7ec0 (patch)
tree5b7b85bea5f1e3944584b1a39ce36c5d5c94d68a
parentd1d76492925c05c0111301f97a69c48c753c92dc (diff)
new working clone
--------------------------- Gran Rally (Spanish bootleg of Pole Position II) [Jordi Beltran Casany, Recreativas.org, The Dumping Union]
-rw-r--r--src/mame/drivers/polepos.cpp206
-rw-r--r--src/mame/includes/polepos.h77
-rw-r--r--src/mame/mame.lst1
-rw-r--r--src/mame/video/polepos.cpp111
4 files changed, 226 insertions, 169 deletions
diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp
index 30a9a5c46cc..144d30f39b7 100644
--- a/src/mame/drivers/polepos.cpp
+++ b/src/mame/drivers/polepos.cpp
@@ -212,7 +212,7 @@ Notes:
Todo:
-- the bootlegs without Namco devices (topracern, polepos2bi) still require
+- the bootlegs without Namco devices (i.e. topracern, polepos2bi) still require
our 06xx and 51xx emulation to boot, this is incorrect.
***************************************************************************/
@@ -226,7 +226,6 @@ Todo:
#include "cpu/z80/z80.h"
#include "cpu/z8000/z8000.h"
#include "cpu/mb88xx/mb88xx.h"
-#include "machine/74259.h"
#include "machine/namco06.h"
#include "machine/namco51.h"
#include "machine/namco53.h"
@@ -273,12 +272,12 @@ READ16_MEMBER(polepos_state::polepos2_ic25_r)
}
-READ8_MEMBER(polepos_state::polepos_adc_r)
+READ8_MEMBER(polepos_state::adc_r)
{
return ioport(m_adc_input ? "ACCEL" : "BRAKE")->read();
}
-READ8_MEMBER(polepos_state::polepos_ready_r)
+READ8_MEMBER(polepos_state::ready_r)
{
int ret = 0xff;
@@ -306,7 +305,7 @@ WRITE_LINE_MEMBER(polepos_state::sb0_w)
m_auto_start_mask = !state;
}
-template<bool sub1> WRITE16_MEMBER(polepos_state::polepos_z8002_nvi_enable_w)
+template<bool sub1> WRITE16_MEMBER(polepos_state::z8002_nvi_enable_w)
{
data &= 1;
@@ -380,7 +379,7 @@ READ8_MEMBER(polepos_state::steering_delta_r)
return m_steer_delta;
}
-TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::polepos_scanline)
+TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::scanline)
{
int scanline = param;
@@ -394,8 +393,19 @@ TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::polepos_scanline)
}
}
+void polepos_state::machine_start()
+{
+ save_item(NAME(m_steer_last));
+ save_item(NAME(m_steer_delta));
+ save_item(NAME(m_steer_accum));
+ save_item(NAME(m_last_result));
+ save_item(NAME(m_last_signed));
+ save_item(NAME(m_last_unsigned));
+ save_item(NAME(m_adc_input));
+ save_item(NAME(m_auto_start_mask));
+}
-MACHINE_RESET_MEMBER(polepos_state,polepos)
+void polepos_state::machine_reset()
{
/* set the interrupt vectors (this shouldn't be needed) */
m_subcpu->set_input_line_vector(0, Z8000_NVI);
@@ -412,17 +422,17 @@ void polepos_state::z80_map(address_map &map)
{
map(0x0000, 0x2fff).rom();
map(0x3000, 0x37ff).mirror(0x0800).ram().share("nvram"); /* Battery Backup */
- map(0x4000, 0x47ff).rw(FUNC(polepos_state::polepos_sprite_r), FUNC(polepos_state::polepos_sprite_w)); /* Motion Object */
- map(0x4800, 0x4bff).rw(FUNC(polepos_state::polepos_road_r), FUNC(polepos_state::polepos_road_w)); /* Road Memory */
- map(0x4c00, 0x4fff).rw(FUNC(polepos_state::polepos_alpha_r), FUNC(polepos_state::polepos_alpha_w)); /* Alphanumeric (char ram) */
- map(0x5000, 0x57ff).rw(FUNC(polepos_state::polepos_view_r), FUNC(polepos_state::polepos_view_w)); /* Background Memory */
+ map(0x4000, 0x47ff).rw(FUNC(polepos_state::sprite_r), FUNC(polepos_state::sprite_w)); /* Motion Object */
+ map(0x4800, 0x4bff).rw(FUNC(polepos_state::road_r), FUNC(polepos_state::road_w)); /* Road Memory */
+ map(0x4c00, 0x4fff).rw(FUNC(polepos_state::alpha_r), FUNC(polepos_state::alpha_w)); /* Alphanumeric (char ram) */
+ map(0x5000, 0x57ff).rw(FUNC(polepos_state::view_r), FUNC(polepos_state::view_w)); /* Background Memory */
map(0x8000, 0x83bf).mirror(0x0c00).ram(); /* Sound Memory */
map(0x83c0, 0x83ff).mirror(0x0c00).rw(m_namco_sound, FUNC(namco_device::polepos_sound_r), FUNC(namco_device::polepos_sound_w)); /* Sound data */
map(0x9000, 0x9000).mirror(0x0eff).rw("06xx", FUNC(namco_06xx_device::data_r), FUNC(namco_06xx_device::data_w));
map(0x9100, 0x9100).mirror(0x0eff).rw("06xx", FUNC(namco_06xx_device::ctrl_r), FUNC(namco_06xx_device::ctrl_w));
- map(0xa000, 0xa000).mirror(0x0cff).r(FUNC(polepos_state::polepos_ready_r)); /* READY */
+ map(0xa000, 0xa000).mirror(0x0cff).r(FUNC(polepos_state::ready_r)); /* READY */
map(0xa000, 0xa007).mirror(0x0cf8).w(m_latch, FUNC(ls259_device::write_d0));
map(0xa100, 0xa100).mirror(0x0cff).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0xa200, 0xa200).mirror(0x0cff).w("polepos", FUNC(polepos_sound_device::polepos_engine_sound_lsb_w)); /* Car Sound ( Lower Nibble ) */
@@ -432,7 +442,7 @@ void polepos_state::z80_map(address_map &map)
void polepos_state::z80_io(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x00).r(FUNC(polepos_state::polepos_adc_r)).nopw();
+ map(0x00, 0x00).r(FUNC(polepos_state::adc_r)).nopw();
}
@@ -440,24 +450,24 @@ void polepos_state::z80_io(address_map &map)
void polepos_state::z8002_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
- map(0x8000, 0x8fff).rw(FUNC(polepos_state::polepos_sprite16_r), FUNC(polepos_state::polepos_sprite16_w)).share("sprite16_memory"); /* Motion Object */
- map(0x9000, 0x97ff).rw(FUNC(polepos_state::polepos_road16_r), FUNC(polepos_state::polepos_road16_w)).share("road16_memory"); /* Road Memory */
- map(0x9800, 0x9fff).rw(FUNC(polepos_state::polepos_alpha16_r), FUNC(polepos_state::polepos_alpha16_w)).share("alpha16_memory"); /* Alphanumeric (char ram) */
- map(0xa000, 0xafff).rw(FUNC(polepos_state::polepos_view16_r), FUNC(polepos_state::polepos_view16_w)).share("view16_memory"); /* Background memory */
- map(0xc000, 0xc001).mirror(0x38fe).w(FUNC(polepos_state::polepos_view16_hscroll_w)); /* Background horz scroll position */
- map(0xc100, 0xc101).mirror(0x38fe).w(FUNC(polepos_state::polepos_road16_vscroll_w)); /* Road vertical position */
+ map(0x8000, 0x8fff).ram().share(m_sprite16_memory); /* Motion Object */
+ map(0x9000, 0x97ff).ram().share(m_road16_memory); /* Road Memory */
+ map(0x9800, 0x9fff).ram().w(FUNC(polepos_state::alpha16_w)).share(m_alpha16_memory); /* Alphanumeric (char ram) */
+ map(0xa000, 0xafff).ram().w(FUNC(polepos_state::view16_w)).share(m_view16_memory); /* Background memory */
+ map(0xc000, 0xc001).mirror(0x38fe).w(FUNC(polepos_state::view16_hscroll_w)); /* Background horz scroll position */
+ map(0xc100, 0xc101).mirror(0x38fe).w(FUNC(polepos_state::road16_vscroll_w)); /* Road vertical position */
}
void polepos_state::z8002_map_1(address_map &map)
{
z8002_map(map);
- map(0x6000, 0x6001).mirror(0x0ffe).w(FUNC(polepos_state::polepos_z8002_nvi_enable_w<true>)); /* NVI enable - *NOT* shared by the two CPUs */
+ map(0x6000, 0x6001).mirror(0x0ffe).w(FUNC(polepos_state::z8002_nvi_enable_w<true>)); /* NVI enable - *NOT* shared by the two CPUs */
}
void polepos_state::z8002_map_2(address_map &map)
{
z8002_map(map);
- map(0x6000, 0x6001).mirror(0x0ffe).w(FUNC(polepos_state::polepos_z8002_nvi_enable_w<false>)); /* NVI enable - *NOT* shared by the two CPUs */
+ map(0x6000, 0x6001).mirror(0x0ffe).w(FUNC(polepos_state::z8002_nvi_enable_w<false>)); /* NVI enable - *NOT* shared by the two CPUs */
}
@@ -842,14 +852,14 @@ GFXDECODE_END
MACHINE_CONFIG_START(polepos_state::polepos)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_maincpu, Z80, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z80_map)
MCFG_DEVICE_IO_MAP(z80_io)
- MCFG_DEVICE_ADD("sub", Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_subcpu, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_1)
- MCFG_DEVICE_ADD("sub2", Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_subcpu2, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_2)
MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
@@ -892,41 +902,39 @@ MACHINE_CONFIG_START(polepos_state::polepos)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* some interleaving */
- MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, scanline, "screen", 0, 1)
- MCFG_DEVICE_ADD("latch", LS259, 0) // at 8E on polepos
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE("maincpu", 0)) MCFG_DEVCB_INVERT
+ MCFG_DEVICE_ADD(m_latch, LS259, 0) // at 8E on polepos
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE(m_maincpu, 0)) MCFG_DEVCB_INVERT
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, polepos_state, iosel_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_namco_sound, namco_device, sound_enable_w))
MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("polepos", polepos_sound_device, clson_w))
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, polepos_state, gasel_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE(m_subcpu, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE(m_subcpu2, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, polepos_state, sb0_w))
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, polepos_state, chacl_w))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 384, 0, 256, 264, 16, 224+16)
- MCFG_SCREEN_UPDATE_DRIVER(polepos_state, screen_update_polepos)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_UPDATE_DRIVER(polepos_state, screen_update)
+ MCFG_SCREEN_PALETTE(m_palette)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_polepos)
- MCFG_PALETTE_ADD("palette", 0x0f00)
+ MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_polepos)
+ MCFG_PALETTE_ADD(m_palette, 0x0f00)
MCFG_PALETTE_INDIRECT_ENTRIES(128)
MCFG_DEFAULT_LAYOUT(layout_polepos)
MCFG_PALETTE_INIT_OWNER(polepos_state,polepos)
- MCFG_VIDEO_START_OVERRIDE(polepos_state,polepos)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("namco", NAMCO, MASTER_CLOCK/512)
+ MCFG_DEVICE_ADD(m_namco_sound, NAMCO, MASTER_CLOCK/512)
MCFG_NAMCO_AUDIO_VOICES(8)
MCFG_NAMCO_AUDIO_STEREO(1)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
@@ -978,17 +986,17 @@ void polepos_state::sound_z80_bootleg_iomap(address_map &map)
MACHINE_CONFIG_START(polepos_state::topracern)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_maincpu, Z80, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z80_map)
MCFG_DEVICE_IO_MAP(topracern_io)
- MCFG_DEVICE_ADD("sub", Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_subcpu, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_1)
- MCFG_DEVICE_ADD("sub2", Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
+ MCFG_DEVICE_ADD(m_subcpu2, Z8002, MASTER_CLOCK/8) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(z8002_map_2)
- /* todo, remove these devices too, this bootleg doesn't have them, but the emulation doesn't boot without them.. */
+ /* TODO, remove these devices too, this bootleg doesn't have them, but the emulation doesn't boot without them.. */
/* doesn't exist on the bootleg, but required for now or the game only boots in test mode!
they probably simulate some of the logic */
MCFG_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/8/2) /* 1.536 MHz */
@@ -1005,41 +1013,39 @@ MACHINE_CONFIG_START(polepos_state::topracern)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* some interleaving */
- MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, scanline, "screen", 0, 1)
- MCFG_DEVICE_ADD("latch", LS259, 0)
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE("maincpu", 0)) MCFG_DEVCB_INVERT
+ MCFG_DEVICE_ADD(m_latch, LS259, 0)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(CLEARLINE(m_maincpu, 0)) MCFG_DEVCB_INVERT
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, polepos_state, iosel_w))
- MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("namco", namco_device, sound_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_namco_sound, namco_device, sound_enable_w))
MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("polepos", polepos_sound_device, clson_w))
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, polepos_state, gasel_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE("sub", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE("sub2", INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(INPUTLINE(m_subcpu, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(INPUTLINE(m_subcpu2, INPUT_LINE_RESET)) MCFG_DEVCB_INVERT
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, polepos_state, sb0_w))
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, polepos_state, chacl_w))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 384, 0, 256, 264, 16, 224+16)
- MCFG_SCREEN_UPDATE_DRIVER(polepos_state, screen_update_polepos)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_UPDATE_DRIVER(polepos_state, screen_update)
+ MCFG_SCREEN_PALETTE(m_palette)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_polepos)
- MCFG_PALETTE_ADD("palette", 0x0f00)
+ MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_polepos)
+ MCFG_PALETTE_ADD(m_palette, 0x0f00)
MCFG_PALETTE_INDIRECT_ENTRIES(128)
MCFG_DEFAULT_LAYOUT(layout_topracer)
MCFG_PALETTE_INIT_OWNER(polepos_state,polepos)
- MCFG_VIDEO_START_OVERRIDE(polepos_state,polepos)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("namco", NAMCO, MASTER_CLOCK/512)
+ MCFG_DEVICE_ADD(m_namco_sound, NAMCO, MASTER_CLOCK/512)
MCFG_NAMCO_AUDIO_VOICES(8)
MCFG_NAMCO_AUDIO_STEREO(1)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.80)
@@ -1060,12 +1066,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(polepos_state::polepos2bi)
topracern(config);
- MCFG_DEVICE_ADD("soundz80bl", Z80, MASTER_CLOCK/8) /*? MHz */
+ MCFG_DEVICE_ADD(m_sound_z80, Z80, MASTER_CLOCK/8) /*? MHz */
MCFG_DEVICE_PROGRAM_MAP(sound_z80_bootleg_map)
MCFG_DEVICE_IO_MAP(sound_z80_bootleg_iomap)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundz80bl", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_sound_z80, INPUT_LINE_NMI))
MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MCFG_DEVICE_ADD("tms", TMS5220, 600000) /* ? Mhz */
@@ -1926,8 +1932,7 @@ ROM_END
CPU/Sound Board: A039185
Video Board: A039187
- Pole Position 2 uses the same hardware as Pole Position except there a
- couple of extra roms.
+ Pole Position 2 uses the same hardware as Pole Position except there are a couple of extra roms.
*/
ROM_START( polepos2a )
@@ -2357,7 +2362,85 @@ ROM_START( polepos2bs )
// ...not dumped yet...
ROM_END
+ROM_START( grally )
+ /* Z80 memory/ROM data */
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "gr_niemer_bboard-5p-2764.17f", 0x0000, 0x2000, CRC(1a6412a1) SHA1(ccc41e60aad6ed332f8f2582860e11f10937dffa) )
+ ROM_LOAD( "gr_niemer_bboard-6p-2732.16f", 0x2000, 0x1000, CRC(e7362148) SHA1(5a4ab037fa6a773b90c10ac4c4e9417183e0cfd8) )
+
+ /* Z8002 #1 memory/ROM data */
+ ROM_REGION( 0x10000, "sub", 0 )
+ ROM_LOAD16_BYTE( "gr_niemer_bboard-1p-2764.23f", 0x0001, 0x2000, CRC(41da3c28) SHA1(c9294d686282adfc72796511c3c9e186ad057374) )
+ ROM_LOAD16_BYTE( "gr_niemer_bboard-2p-2764.21f", 0x0000, 0x2000, CRC(2856d5b1) SHA1(96f5c3d67901a1abceca12b3448f381cc4852a33) )
+
+ /* Z8002 #2 memory/ROM data */
+ ROM_REGION( 0x10000, "sub2", 0 )
+ ROM_LOAD16_BYTE( "gr_niemer_bboard-3p-27128.20f", 0x0001, 0x4000, CRC(6c823932) SHA1(68ef9f70c4305c3a3bacf83a64b727fd3711f34f) )
+ ROM_LOAD16_BYTE( "gr_niemer_bboard-4p-27128.18f", 0x0000, 0x4000, CRC(fe9baeb6) SHA1(9a8ad2d8a69b4005f7abed278093fd57b9242bca) )
+
+ /* graphics data */
+ ROM_REGION( 0x02000, "gfx1", 0 ) /* 2bpp alpha layer */
+ ROM_LOAD( "gr_niemer_cboard-12f-2764.2j", 0x0000, 0x2000, CRC(4b0a3fe9) SHA1(b0c69df94ac41a2f0705db69500cd0a224b854ad) )
+
+ ROM_REGION( 0x02000, "gfx2", 0 ) /* 2bpp view layer */
+ ROM_LOAD( "gr_niemer_cboard-15f-2764.2l", 0x0000, 0x2000, CRC(ec3ec6e6) SHA1(ae905d0ae802d1010b2c1f1a13e88a1f0dbe57da) )
+
+ ROM_REGION( 0x04000, "gfx3", 0 ) /* 4bpp 16x16 sprites */
+ ROM_LOAD( "gr_niemer_cboard-6f-2764.5a", 0x0000, 0x2000, CRC(1c72041a) SHA1(b65b09c4251ee61d247f359615e7adc7c80bc8d5) ) /* 4bpp sm sprites, planes 0+1 */
+ ROM_LOAD( "gr_niemer_cboard-5f-2764.6a", 0x2000, 0x2000, CRC(1b38b257) SHA1(c7eec0692a31e1c8285bd1cba3ebd17ab253d2c9) ) /* 4bpp sm sprites, planes 2+3 */
+
+ ROM_REGION( 0x10000, "gfx4", 0 ) /* 4bpp 32x32 sprites */
+ ROM_LOAD( "gr_niemer_cboard-10f-2764.1a", 0x0000, 0x2000, CRC(613ab0df) SHA1(88aa4500275aae010fc9783c1d8d843feab89afa) ) /* 4bpp lg sprites, planes 0+1 */
+ ROM_LOAD( "gr_niemer_cboard-9f-2764.2a", 0x2000, 0x2000, CRC(2d11fc01) SHA1(0515df62073db993899dde3f9ad84334c5a12fc5) )
+ ROM_LOAD( "gr_niemer_cboard-8f-2764.3a", 0x4000, 0x2000, CRC(17c798b0) SHA1(ae2047bc0e4e8c85e1de09c39c200ea8f7c6a72e) )
+ ROM_LOAD( "gr_niemer_cboard-7f-2764.4a", 0x6000, 0x2000, CRC(ed6a8052) SHA1(dedd6d63f9a06a1edd57cb134e86c048cff7a3c1) )
+ ROM_LOAD( "gr_niemer_cboard-4f-2764.7a", 0x8000, 0x2000, CRC(5fd933e3) SHA1(5b27a8519234c935308f943cd58abc1efc463726) ) /* 4bpp lg sprites, planes 2+3 */
+ ROM_LOAD( "gr_niemer_cboard-3f-2764.8a", 0xa000, 0x2000, CRC(94a7155d) SHA1(c162e2b0e93745614475326905a30d2095101913) )
+ ROM_LOAD( "gr_niemer_cboard-2f-2764.9a", 0xc000, 0x2000, CRC(5fe9b365) SHA1(1a3ac099a6bb506a5f71c12c6fb14d014172371c) )
+ ROM_LOAD( "gr_niemer_cboard-1fr-2764.10a", 0xe000, 0x2000, CRC(1f553db8) SHA1(897e8103e8023918dae8b45b19ad1ecb34a92b3f) )
+
+ ROM_REGION( 0x5000, "gfx5", 0 ) /* road generation ROMs needed at runtime */
+ ROM_LOAD( "gr_niemer_cboard-14f-2764.8m", 0x0000, 0x2000, CRC(ee6b3315) SHA1(9cc26c6d3604c0f60d716f86e67e9d9c0487f87d) ) /* road control */
+ ROM_LOAD( "gr_niemer_cboard-13f-2764.9m", 0x2000, 0x2000, CRC(6d1e7042) SHA1(90113ff0c93ed86d95067290088705bb5e6608d1) ) /* road bits 1 */
+ ROM_LOAD( "gr_niemer_cboard-16f-2732.8r", 0x4000, 0x1000, CRC(4e97f101) SHA1(f377d053821c74aee93ebcd30a4d43e6156f3cfe) ) /* road bits 2 */
+
+ ROM_REGION( 0x1000, "gfx6", 0 ) /* sprite scaling */
+ ROM_LOAD( "gr_niemer_cboard-11f-2732.9c", 0x0000, 0x1000, CRC(a61bff15) SHA1(f7a59970831cdaaa7bf59c2221a38e4746c54244) ) /* vertical scaling */
+
+ /* graphics (P)ROM data */
+ ROM_REGION( 0x1040, "proms", 0 )
+ ROM_LOAD( "gr-niemer-cboard-f1-82s129.2u", 0x0000, 0x0100, CRC(16d69c31) SHA1(f24b345448e4f4ef4e2f3b057b81d399cf427f88) ) /* red palette */
+ ROM_LOAD( "gr-niemer-cboard-f2-82s129.2t", 0x0100, 0x0100, CRC(07340311) SHA1(3820d1fa99013ed18de5d9400ad376cc446d1217) ) /* green palette */
+ ROM_LOAD( "gr-niemer-cboard-f3-82s129.2s", 0x0200, 0x0100, CRC(1efc84d7) SHA1(6946e1c209eec0a4b75778ae88111e6cb63c63fb) ) /* blue palette */
+ ROM_LOAD( "gr-niemer-cboard-f4-82s129.2p", 0x0300, 0x0100, CRC(064d51a0) SHA1(d5baa29930530a8930b44a374e285de849c2a6ce) ) /* alpha color */
+ ROM_LOAD( "gr-niemer-cboard-f5-82s129.2n", 0x0400, 0x0100, CRC(7880c5af) SHA1(e4388e354420be3f99594a10c091e3d2f745cc04) ) /* background color */
+ ROM_LOAD( "gr-niemer-cboard-f8-82s129.13f", 0x0500, 0x0100, CRC(2d502464) SHA1(682b7dd22e51d5db52c0804b7e27e47641dfa6bd) ) /* vertical position low */
+ ROM_LOAD( "gr-niemer-cboard-f9-82s129.13e", 0x0600, 0x0100, CRC(027aa62c) SHA1(c7030d8b64b80e107c446f6fbdd63f560c0a91c0) ) /* vertical position med */
+ ROM_LOAD( "gr-niemer-cboard-f10-82s129.13d", 0x0700, 0x0100, CRC(1f8d0df3) SHA1(b8f17758f114f5e247b65b3f2922ca2660757e66) ) /* vertical position hi */
+ ROM_LOAD( "gr-niemer-cboard-f6-82s137.5p", 0x0800, 0x0400, CRC(8b270902) SHA1(27b3ebc92d3a2a5c0432bde018a0e43669041d50) ) /* road color */
+ ROM_LOAD( "gr-niemer-cboard-f7-82s137.7h", 0x0c00, 0x0400, CRC(a079ed19) SHA1(134b3d156a1ed0fa21cc5dc3cc84ea16ef7f84f7) ) /* sprite color */
+ ROM_LOAD( "gr-niemer-cboard-82s123.15s", 0x1000, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) ) /* video RAM address decoder (not used) */
+ ROM_LOAD( "gr-niemer-cboard-82s123.15t", 0x1020, 0x0020, CRC(4330a51b) SHA1(9531d18ce2de4eda9913d47ef8c5cd8f05791716) ) /* video RAM address decoder (not used) */
+
+ /* sound (P)ROM data */
+ ROM_REGION( 0x0100, "namco", 0 ) // not dumped for this board
+ ROM_LOAD( "bboard-2p.9e", 0x0000, 0x0100, CRC(8568decc) SHA1(0aac1fa082858d4d201e21511c609a989f9a1535) ) /* Namco sound */
+
+ ROM_REGION( 0x4000, "engine", 0 )
+ ROM_LOAD( "gr_niemer_bboard-8p-2764.8a", 0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) ) /* engine sound */
+ ROM_LOAD( "gr_niemer_bboard-7p-2764.9a", 0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) ) /* engine sound */
+
+ ROM_REGION( 0x6000, "52xx", ROMREGION_ERASEFF )
+ /* the bootleg has a TMS5220, NOT the Namco 52xx */
+
+ /* unknown or unused (P)ROM data */
+ ROM_REGION( 0x0100, "user1", 0 ) // not dumped for this board
+ ROM_LOAD( "bboard-1p.14c", 0x0000, 0x0100, CRC(0e742cb1) SHA1(3ae43270aab4848fdeece1648e7e040ab216b08e) ) /* sync chain */
+ /* this is used for the Spanish speech with a TMS5220 */
+ ROM_REGION( 0x2000, "soundz80bl", 0 )
+ ROM_LOAD( "gr_niemer_aboard-sp1-2764.11", 0x0000, 0x2000, CRC(47226cda) SHA1(03115ead04b11e7ef3ef08d32d4d61a56dc35190) )
+ROM_END
/*********************************************************************
* Initialization routines
@@ -2389,3 +2472,4 @@ GAME( 1983, polepos2a, polepos2, polepos, polepos2, polepos_state, init_pol
GAME( 1983, polepos2b, polepos2, polepos, polepos2, polepos_state, empty_init, ROT0, "bootleg", "Pole Position II (bootleg)", 0 )
GAME( 1984, polepos2bi, polepos2, polepos2bi, polepos2bi,polepos_state, empty_init, ROT0, "bootleg", "Gran Premio F1 (Italian bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND )
GAME( 1984, polepos2bs, polepos2, polepos2bi, polepos2bi,polepos_state, empty_init, ROT0, "bootleg (BCN Internacional S.A.)", "Gran Premio F1 (Spanish bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND )
+GAME( 1984, grally, polepos2, polepos2bi, polepos2bi,polepos_state, empty_init, ROT0, "bootleg (Niemer)", "Gran Rally (Spanish bootleg of Pole Position II)", MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h
index b7702b19237..5a3b553864e 100644
--- a/src/mame/includes/polepos.h
+++ b/src/mame/includes/polepos.h
@@ -37,6 +37,20 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
+ DECLARE_CUSTOM_INPUT_MEMBER(auto_start_r);
+
+ void init_polepos2();
+
+ void polepos2bi(machine_config &config);
+ void topracern(machine_config &config);
+ void polepos(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
+private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
required_device<cpu_device> m_subcpu2;
@@ -44,6 +58,14 @@ public:
optional_device<generic_latch_8_device> m_soundlatch;
optional_device<namco_device> m_namco_sound;
required_device<ls259_device> m_latch;
+ required_shared_ptr<uint16_t> m_sprite16_memory;
+ required_shared_ptr<uint16_t> m_road16_memory;
+ required_shared_ptr<uint16_t> m_alpha16_memory;
+ required_shared_ptr<uint16_t> m_view16_memory;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
uint8_t m_steer_last;
uint8_t m_steer_delta;
int16_t m_steer_accum;
@@ -52,13 +74,6 @@ public:
uint8_t m_last_unsigned;
int m_adc_input;
int m_auto_start_mask;
- required_shared_ptr<uint16_t> m_sprite16_memory;
- required_shared_ptr<uint16_t> m_road16_memory;
- required_shared_ptr<uint16_t> m_alpha16_memory;
- required_shared_ptr<uint16_t> m_view16_memory;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
uint16_t m_vertical_position_modifier[256];
uint16_t m_road16_vscroll;
@@ -67,33 +82,27 @@ public:
int m_chacl;
uint16_t m_scroll;
uint8_t m_sub_irq_mask;
+
DECLARE_READ16_MEMBER(polepos2_ic25_r);
- DECLARE_READ8_MEMBER(polepos_adc_r);
- DECLARE_READ8_MEMBER(polepos_ready_r);
+ DECLARE_READ8_MEMBER(adc_r);
+ DECLARE_READ8_MEMBER(ready_r);
DECLARE_WRITE_LINE_MEMBER(iosel_w);
DECLARE_WRITE_LINE_MEMBER(gasel_w);
DECLARE_WRITE_LINE_MEMBER(sb0_w);
DECLARE_WRITE_LINE_MEMBER(chacl_w);
- template<bool sub1> DECLARE_WRITE16_MEMBER(polepos_z8002_nvi_enable_w);
- DECLARE_READ16_MEMBER(polepos_sprite16_r);
- DECLARE_WRITE16_MEMBER(polepos_sprite16_w);
- DECLARE_READ8_MEMBER(polepos_sprite_r);
- DECLARE_WRITE8_MEMBER(polepos_sprite_w);
- DECLARE_READ16_MEMBER(polepos_road16_r);
- DECLARE_WRITE16_MEMBER(polepos_road16_w);
- DECLARE_READ8_MEMBER(polepos_road_r);
- DECLARE_WRITE8_MEMBER(polepos_road_w);
- DECLARE_WRITE16_MEMBER(polepos_road16_vscroll_w);
- DECLARE_READ16_MEMBER(polepos_view16_r);
- DECLARE_WRITE16_MEMBER(polepos_view16_w);
- DECLARE_READ8_MEMBER(polepos_view_r);
- DECLARE_WRITE8_MEMBER(polepos_view_w);
- DECLARE_WRITE16_MEMBER(polepos_view16_hscroll_w);
- DECLARE_READ16_MEMBER(polepos_alpha16_r);
- DECLARE_WRITE16_MEMBER(polepos_alpha16_w);
- DECLARE_READ8_MEMBER(polepos_alpha_r);
- DECLARE_WRITE8_MEMBER(polepos_alpha_w);
- DECLARE_CUSTOM_INPUT_MEMBER(auto_start_r);
+ template<bool sub1> DECLARE_WRITE16_MEMBER(z8002_nvi_enable_w);
+ DECLARE_READ8_MEMBER(sprite_r);
+ DECLARE_WRITE8_MEMBER(sprite_w);
+ DECLARE_READ8_MEMBER(road_r);
+ DECLARE_WRITE8_MEMBER(road_w);
+ DECLARE_WRITE16_MEMBER(road16_vscroll_w);
+ DECLARE_WRITE16_MEMBER(view16_w);
+ DECLARE_READ8_MEMBER(view_r);
+ DECLARE_WRITE8_MEMBER(view_w);
+ DECLARE_WRITE16_MEMBER(view16_hscroll_w);
+ DECLARE_WRITE16_MEMBER(alpha16_w);
+ DECLARE_READ8_MEMBER(alpha_r);
+ DECLARE_WRITE8_MEMBER(alpha_w);
DECLARE_WRITE8_MEMBER(out_0);
DECLARE_WRITE8_MEMBER(out_1);
DECLARE_READ8_MEMBER(namco_52xx_rom_r);
@@ -102,20 +111,14 @@ public:
DECLARE_READ8_MEMBER(steering_changed_r);
DECLARE_READ8_MEMBER(steering_delta_r);
DECLARE_WRITE8_MEMBER(bootleg_soundlatch_w);
- void init_polepos2();
TILE_GET_INFO_MEMBER(bg_get_tile_info);
TILE_GET_INFO_MEMBER(tx_get_tile_info);
- DECLARE_MACHINE_RESET(polepos);
- DECLARE_VIDEO_START(polepos);
DECLARE_PALETTE_INIT(polepos);
- uint32_t screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(polepos_scanline);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ TIMER_DEVICE_CALLBACK_MEMBER(scanline);
void draw_road(bitmap_ind16 &bitmap);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
void zoom_sprite(bitmap_ind16 &bitmap,int big,uint32_t code,uint32_t color,int flipx,int sx,int sy,int sizex,int sizey);
- void polepos2bi(machine_config &config);
- void topracern(machine_config &config);
- void polepos(machine_config &config);
void sound_z80_bootleg_iomap(address_map &map);
void sound_z80_bootleg_map(address_map &map);
void topracern_io(address_map &map);
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index ddb5ae412fd..9657fe83ffc 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -32109,6 +32109,7 @@ pokemini // Nintendo Pokemon Mini
poker72 //
@source:polepos.cpp
+grally // bootleg
polepos // (c) 1982
polepos2 // (c) 1983
polepos2a // 136014 (c) 1983 + Atari license
diff --git a/src/mame/video/polepos.cpp b/src/mame/video/polepos.cpp
index 355af8b52dc..6856771ddd8 100644
--- a/src/mame/video/polepos.cpp
+++ b/src/mame/video/polepos.cpp
@@ -30,7 +30,6 @@
PALETTE_INIT_MEMBER(polepos_state,polepos)
{
const uint8_t *color_prom = memregion("proms")->base();
- int i, j;
/*******************************************************
* Color PROMs
@@ -51,30 +50,28 @@ PALETTE_INIT_MEMBER(polepos_state,polepos)
* below the pixel or not. That would be tricky to emulate, and it's
* not needed because of course the two banks are the same.
*******************************************************/
- for (i = 0; i < 128; i++)
+ for (int i = 0; i < 128; i++)
{
- int bit0,bit1,bit2,bit3,r,g,b;
-
/* Sheet 15B: 136014-0137 red component */
- bit0 = (color_prom[0x000 + i] >> 0) & 1;
- bit1 = (color_prom[0x000 + i] >> 1) & 1;
- bit2 = (color_prom[0x000 + i] >> 2) & 1;
- bit3 = (color_prom[0x000 + i] >> 3) & 1;
- r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
+ int bit0 = (color_prom[0x000 + i] >> 0) & 1;
+ int bit1 = (color_prom[0x000 + i] >> 1) & 1;
+ int bit2 = (color_prom[0x000 + i] >> 2) & 1;
+ int bit3 = (color_prom[0x000 + i] >> 3) & 1;
+ int r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* Sheet 15B: 136014-0138 green component */
bit0 = (color_prom[0x100 + i] >> 0) & 1;
bit1 = (color_prom[0x100 + i] >> 1) & 1;
bit2 = (color_prom[0x100 + i] >> 2) & 1;
bit3 = (color_prom[0x100 + i] >> 3) & 1;
- g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
+ int g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* Sheet 15B: 136014-0139 blue component */
bit0 = (color_prom[0x200 + i] >> 0) & 1;
bit1 = (color_prom[0x200 + i] >> 1) & 1;
bit2 = (color_prom[0x200 + i] >> 2) & 1;
bit3 = (color_prom[0x200 + i] >> 3) & 1;
- b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
+ int b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette.set_indirect_color(i,rgb_t(r,g,b));
}
@@ -84,7 +81,7 @@ PALETTE_INIT_MEMBER(polepos_state,polepos)
* Sheet 15B: top left, 136014-140
* Inputs: SHFT0, SHFT1 and CHA8* ... CHA13*
*******************************************************/
- for (i = 0; i < 64*4; i++)
+ for (int i = 0; i < 64*4; i++)
{
int color = color_prom[0x300 + i];
palette.set_pen_indirect(0x0000 + i, (color != 15) ? (0x020 + color) : 0x2f);
@@ -97,7 +94,7 @@ PALETTE_INIT_MEMBER(polepos_state,polepos)
* Inputs: SHFT2, SHFT3 and CHA8 ... CHA13
* The background is only in the top half of the screen
*******************************************************/
- for (i = 0; i < 64*4; i++)
+ for (int i = 0; i < 64*4; i++)
{
int color = color_prom[0x400 + i];
palette.set_pen_indirect(0x0200 + i, 0x000 + color);
@@ -108,7 +105,7 @@ PALETTE_INIT_MEMBER(polepos_state,polepos)
* Sheet 14B: right, 136014-146
* Inputs: CUSTOM0 ... CUSTOM3 and DATA0 ... DATA5
*******************************************************/
- for (i = 0; i < 64*16; i++)
+ for (int i = 0; i < 64*16; i++)
{
int color = color_prom[0xc00 + i];
palette.set_pen_indirect(0x0300 + i, (color != 15) ? (0x010 + color) : 0x1f);
@@ -121,16 +118,16 @@ PALETTE_INIT_MEMBER(polepos_state,polepos)
* Inputs: R1 ... R6 and CHA0 ... CHA3
* The road is only in the bottom half of the screen
*******************************************************/
- for (i = 0; i < 64*16; i++)
+ for (int i = 0; i < 64*16; i++)
{
int color = color_prom[0x800 + i];
palette.set_pen_indirect(0x0b00 + i, 0x040 + color);
}
/* 136014-142, 136014-143, 136014-144 Vertical position modifiers */
- for (i = 0; i < 256; i++)
+ for (int i = 0; i < 256; i++)
{
- j = color_prom[0x500 + i] + (color_prom[0x600 + i] << 4) + (color_prom[0x700 + i] << 8);
+ int j = color_prom[0x500 + i] + (color_prom[0x600 + i] << 4) + (color_prom[0x700 + i] << 8);
m_vertical_position_modifier[i] = j;
}
}
@@ -187,12 +184,17 @@ TILE_GET_INFO_MEMBER(polepos_state::tx_get_tile_info)
***************************************************************************/
-VIDEO_START_MEMBER(polepos_state,polepos)
+void polepos_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(polepos_state::bg_get_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,16);
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(polepos_state::tx_get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32);
m_tx_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0x2f);
+
+ save_item(NAME(m_road16_vscroll));
+ save_item(NAME(m_chacl));
+ save_item(NAME(m_scroll));
+ save_item(NAME(m_sub_irq_mask));
}
@@ -202,22 +204,12 @@ VIDEO_START_MEMBER(polepos_state,polepos)
***************************************************************************/
-READ16_MEMBER(polepos_state::polepos_sprite16_r)
-{
- return m_sprite16_memory[offset];
-}
-
-WRITE16_MEMBER(polepos_state::polepos_sprite16_w)
-{
- COMBINE_DATA(&m_sprite16_memory[offset]);
-}
-
-READ8_MEMBER(polepos_state::polepos_sprite_r)
+READ8_MEMBER(polepos_state::sprite_r)
{
return m_sprite16_memory[offset] & 0xff;
}
-WRITE8_MEMBER(polepos_state::polepos_sprite_w)
+WRITE8_MEMBER(polepos_state::sprite_w)
{
m_sprite16_memory[offset] = (m_sprite16_memory[offset] & 0xff00) | data;
}
@@ -229,27 +221,17 @@ WRITE8_MEMBER(polepos_state::polepos_sprite_w)
***************************************************************************/
-READ16_MEMBER(polepos_state::polepos_road16_r)
-{
- return m_road16_memory[offset];
-}
-
-WRITE16_MEMBER(polepos_state::polepos_road16_w)
-{
- COMBINE_DATA(&m_road16_memory[offset]);
-}
-
-READ8_MEMBER(polepos_state::polepos_road_r)
+READ8_MEMBER(polepos_state::road_r)
{
return m_road16_memory[offset] & 0xff;
}
-WRITE8_MEMBER(polepos_state::polepos_road_w)
+WRITE8_MEMBER(polepos_state::road_w)
{
m_road16_memory[offset] = (m_road16_memory[offset] & 0xff00) | data;
}
-WRITE16_MEMBER(polepos_state::polepos_road16_vscroll_w)
+WRITE16_MEMBER(polepos_state::road16_vscroll_w)
{
COMBINE_DATA(&m_road16_vscroll);
}
@@ -261,31 +243,26 @@ WRITE16_MEMBER(polepos_state::polepos_road16_vscroll_w)
***************************************************************************/
-READ16_MEMBER(polepos_state::polepos_view16_r)
-{
- return m_view16_memory[offset];
-}
-
-WRITE16_MEMBER(polepos_state::polepos_view16_w)
+WRITE16_MEMBER(polepos_state::view16_w)
{
COMBINE_DATA(&m_view16_memory[offset]);
if (offset < 0x400)
m_bg_tilemap->mark_tile_dirty(offset);
}
-READ8_MEMBER(polepos_state::polepos_view_r)
+READ8_MEMBER(polepos_state::view_r)
{
return m_view16_memory[offset] & 0xff;
}
-WRITE8_MEMBER(polepos_state::polepos_view_w)
+WRITE8_MEMBER(polepos_state::view_w)
{
m_view16_memory[offset] = (m_view16_memory[offset] & 0xff00) | data;
if (offset < 0x400)
m_bg_tilemap->mark_tile_dirty(offset);
}
-WRITE16_MEMBER(polepos_state::polepos_view16_hscroll_w)
+WRITE16_MEMBER(polepos_state::view16_hscroll_w)
{
COMBINE_DATA(&m_scroll);
m_bg_tilemap->set_scrollx(0,m_scroll);
@@ -304,23 +281,18 @@ WRITE_LINE_MEMBER(polepos_state::chacl_w)
***************************************************************************/
-READ16_MEMBER(polepos_state::polepos_alpha16_r)
-{
- return m_alpha16_memory[offset];
-}
-
-WRITE16_MEMBER(polepos_state::polepos_alpha16_w)
+WRITE16_MEMBER(polepos_state::alpha16_w)
{
COMBINE_DATA(&m_alpha16_memory[offset]);
m_tx_tilemap->mark_tile_dirty(offset);
}
-READ8_MEMBER(polepos_state::polepos_alpha_r)
+READ8_MEMBER(polepos_state::alpha_r)
{
return m_alpha16_memory[offset] & 0xff;
}
-WRITE8_MEMBER(polepos_state::polepos_alpha_w)
+WRITE8_MEMBER(polepos_state::alpha_w)
{
m_alpha16_memory[offset] = (m_alpha16_memory[offset] & 0xff00) | data;
m_tx_tilemap->mark_tile_dirty(offset);
@@ -339,10 +311,9 @@ void polepos_state::draw_road(bitmap_ind16 &bitmap)
const uint8_t *road_control = memregion("gfx5")->base();
const uint8_t *road_bits1 = road_control + 0x2000;
const uint8_t *road_bits2 = road_control + 0x4000;
- int x, y, i;
/* loop over the lower half of the screen */
- for (y = 128; y < 256; y++)
+ for (int y = 128; y < 256; y++)
{
int xoffs, yoffs, xscroll, roadpal;
uint16_t scanline[256 + 8];
@@ -367,14 +338,14 @@ void polepos_state::draw_road(bitmap_ind16 &bitmap)
xoffs &= ~7;
/* loop over 8-pixel chunks */
- for (x = 0; x < 256 / 8 + 1; x++, xoffs += 8)
+ for (int x = 0; x < 256 / 8 + 1; x++, xoffs += 8)
{
/* if the 0x200 bit of the xoffset is set, a special pin on the custom */
/* chip is set and the /CE and /OE for the road chips is disabled */
if (xoffs & 0x200)
{
/* in this case, it looks like we just fill with 0 */
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
*dest++ = pen_base | 0;
}
@@ -394,7 +365,7 @@ void polepos_state::draw_road(bitmap_ind16 &bitmap)
int carin = control >> 7;
/* draw this 8-pixel chunk */
- for (i = 8; i > 0; i--)
+ for (int i = 8; i > 0; i--)
{
int bits = BIT(bits1,i) + (BIT(bits2,i) << 1);
if (!carin && bits) bits++;
@@ -418,11 +389,10 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big,
uint8_t *scaling_rom = memregion("gfx6")->base();
uint32_t transmask = m_palette->transpen_mask(*gfx, color, 0x1f);
int coloroffs = gfx->colorbase() + color * gfx->granularity();
- int x,y;
if (flipx) flipx = big ? 0x1f : 0x0f;
- for (y = 0;y <= sizey;y++)
+ for (int y = 0;y <= sizey;y++)
{
int yy = (sy + y) & 0x1ff;
@@ -438,7 +408,7 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big,
if (!big) dy >>= 1;
src = gfxdata + dy * gfx->rowbytes();
- for (x = (big ? 0x40 : 0x20);x > 0;x--)
+ for (int x = (big ? 0x40 : 0x20);x > 0;x--)
{
if (xx < 0x100)
{
@@ -464,9 +434,8 @@ void polepos_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect
{
uint16_t *posmem = &m_sprite16_memory[0x380];
uint16_t *sizmem = &m_sprite16_memory[0x780];
- int i;
- for (i = 0; i < 64; i++, posmem += 2, sizmem += 2)
+ for (int i = 0; i < 64; i++, posmem += 2, sizmem += 2)
{
int sx = (posmem[1] & 0x3ff) - 0x40 + 4;
int sy = 512 - (posmem[0] & 0x1ff) + 1; // sprites are buffered and delayed by one scanline
@@ -489,7 +458,7 @@ void polepos_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect
}
-uint32_t polepos_state::screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t polepos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
rectangle clip = cliprect;
clip.max_y = 127;