- namco/rallyx.cpp: reordered gutangtn sets [Brian Troha]

- olympia/monzagp.cpp: dumped a Monza GP original PCB which had the monzagpb romset. Dropped the bootleg designation from the title [Trol, Audiokit]

- snk/prehisle.cpp, snk/snk68.cpp: consolidated drivers in single files
This commit is contained in:
Ivan Vangelista 2024-07-12 22:23:52 +02:00
parent df3f64c6e9
commit 85d5baa838
11 changed files with 856 additions and 865 deletions

View File

@ -33340,8 +33340,8 @@ qncrasha // (c) 1999 Namco
commsega // (c) 1983 Sega
cottong // bootleg
dngrtrck // Petaco bootleg
gutangtn // GX359 (c) 1982 Konami + Sega license
gutangtnk // GX359 (c) 1982 Konami
gutangtn // GX359 (c) 1982 Konami
gutangtns // GX359 (c) 1982 Konami + Sega license
jackler // 1 9 8 2 (Jungler Bootleg)
jungler // GX327 (c) 1981 Konami
junglero // Olympia license

View File

@ -31,7 +31,7 @@ GekiToride-Jong Space (10011 Ver.A) (C
Golgo 13 Juusei no Requiem (GLT1 Ver.A) (C) Namco/8ing/Raizing, 2001
Gunbalina (GNN1 Ver. A) (C) Namco, 2000
*Hard Puncher Hajime no Ippo: The Fighting (C) Namco/Taito, 2001
Hard Puncher Hajime no Ippo 2 - The Fighting - Ouja e no chousen (VER.2.00J) (C) Namco/Taito, 2002
Hard Puncher Hajime no Ippo 2 - The Fighting! - Ouja e no chousen (VER.2.00J) (C) Namco/Taito, 2002
*Honne Hakkenki (C) Namco, 2001
Keroro Gunsou Pekopon Shinryaku Shirei De Arimasu! (KRG1 Ver.A) (C) Namco, 2006
**Knock Down 2001 / KO2001 (KD11 Ver.B) (C) Namco, 2001
@ -4170,4 +4170,4 @@ GAME( 2002, nicetsuk, 0, ns10_nicetsuk, nicetsuk, namcos10_memp3_st
GAME( 2003, squizchs, 0, ns10_squizchs, squizchs, namcos10_memp3_state, memn_driver_init, ROT0, "Namco", "Seishun-Quiz Colorful High School (CHS1 Ver.A)", MACHINE_IMPERFECT_SOUND )
// MEM/IO
GAME( 2002, ippo2, 0, ns10_ippo2, ippo2, namcos10_memio_state, memn_driver_init, ROT0, "Taito", "Hard Puncher Hajime no Ippo 2 - The Fighting - Ouja e no chousen (VER.2.00J)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // 2002/01/20 18:27:18
GAME( 2002, ippo2, 0, ns10_ippo2, ippo2, namcos10_memio_state, memn_driver_init, ROT0, "Taito", "Hard Puncher Hajime no Ippo 2 - The Fighting! - Ouja e no chousen (VER.2.00J)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // copyright 2001 but 2002/01/20 18:27:18 in ROM e 2002 on flyer

View File

@ -1372,6 +1372,31 @@ ROM_START( locomotn )
ROM_END
ROM_START( gutangtn )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "bimm_001.r1", 0x0000, 0x1000, CRC(dfa2089c) SHA1(ef2280578c33589d2831b21e22b0786f23eea881) )
ROM_LOAD( "bimm_002.r2", 0x1000, 0x1000, CRC(1de5e6a0) SHA1(8bb3408a510662ff3b9b7201d2d06fe70685bf7f) )
ROM_LOAD( "bimm_003.r3", 0x2000, 0x1000, CRC(01f909fe) SHA1(c80295e9f91ce25bfd28e72823b20ee6f6524a5c) )
ROM_LOAD( "bimm_004.r4", 0x3000, 0x1000, CRC(a89eb3e3) SHA1(058928ade909faba06f177750f914cf1dabaefc3) )
ROM_REGION( 0x10000, "timeplt_audio:tpsound", 0 )
ROM_LOAD( "bimm_007.b1", 0x0000, 0x1000, CRC(3d83f6d3) SHA1(e10ed6b6ce7280697c1bc9dbe6c6e6018e1d8be4) )
ROM_LOAD( "bimm_008.c1", 0x1000, 0x1000, CRC(323e1937) SHA1(75499d6c8a9032fac090a13cd4f36bd350f52dab) )
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "bimm_005.r9", 0x0000, 0x1000, CRC(992d079c) SHA1(b5acd30f2e8700cc4cd852b190bd1f4163b137e8) )
ROM_LOAD( "bimm_006.r10", 0x1000, 0x1000, CRC(f0414f1d) SHA1(c7795184e2c1701eddb914d7134bf2830c4a3781) )
ROM_REGION( 0x0100, "gfx2", 0 )
ROM_LOAD( "5.bpr", 0x0000, 0x0100, CRC(21fb583f) SHA1(b8c65fbdd5d8b70bf51341cd60fc2efeaab8bb82) ) // dots
ROM_REGION( 0x0160, "proms", 0 )
ROM_LOAD( "2.bpr", 0x0000, 0x0020, CRC(26f42e6f) SHA1(f51578216a5d588c4d0143ce7a23d695a15a3914) ) // palette
ROM_LOAD( "3.bpr", 0x0020, 0x0100, CRC(4aecc0c8) SHA1(3c1086a598d84b4bcb277556b716fd18c76c4364) ) // lookup table
ROM_LOAD( "7a.bpr", 0x0120, 0x0020, CRC(48c8f094) SHA1(61592209720fddc8991751edf08b6950388af42e) ) // video layout (not used)
ROM_LOAD( "10a.bpr", 0x0140, 0x0020, CRC(b8861096) SHA1(26fad384ed7a1a1e0ba719b5578e2dbb09334a25) ) // video timing (not used)
ROM_END
ROM_START( gutangtns )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "3d_1.bin", 0x0000, 0x1000, CRC(e9757395) SHA1(78e2f8988ed39d2ecfe1f874be370f603d5eecc1) )
ROM_LOAD( "3e_2.bin", 0x1000, 0x1000, CRC(11d21d2e) SHA1(fd17dd481bb7bb39234fa7e9946b1cb4fa18109e) )
@ -1396,44 +1421,19 @@ ROM_START( gutangtn )
ROM_LOAD( "10a.bpr", 0x0140, 0x0020, CRC(b8861096) SHA1(26fad384ed7a1a1e0ba719b5578e2dbb09334a25) ) // video timing (not used)
ROM_END
ROM_START( gutangtnk )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "bimm_001.r1", 0x0000, 0x1000, CRC(dfa2089c) SHA1(ef2280578c33589d2831b21e22b0786f23eea881) )
ROM_LOAD( "bimm_002.r2", 0x1000, 0x1000, CRC(1de5e6a0) SHA1(8bb3408a510662ff3b9b7201d2d06fe70685bf7f) )
ROM_LOAD( "bimm_003.r3", 0x2000, 0x1000, CRC(01f909fe) SHA1(c80295e9f91ce25bfd28e72823b20ee6f6524a5c) )
ROM_LOAD( "bimm_004.r4", 0x3000, 0x1000, CRC(a89eb3e3) SHA1(058928ade909faba06f177750f914cf1dabaefc3) )
ROM_REGION( 0x10000, "timeplt_audio:tpsound", 0 )
ROM_LOAD( "bimm_007.b1", 0x0000, 0x1000, CRC(3d83f6d3) SHA1(e10ed6b6ce7280697c1bc9dbe6c6e6018e1d8be4) )
ROM_LOAD( "bimm_008.c1", 0x1000, 0x1000, CRC(323e1937) SHA1(75499d6c8a9032fac090a13cd4f36bd350f52dab) )
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "bimm_005.r9", 0x0000, 0x1000, CRC(992d079c) SHA1(b5acd30f2e8700cc4cd852b190bd1f4163b137e8) )
ROM_LOAD( "bimm_006.r10", 0x1000, 0x1000, CRC(f0414f1d) SHA1(c7795184e2c1701eddb914d7134bf2830c4a3781) )
ROM_REGION( 0x0100, "gfx2", 0 ) // not dumped for this set, probably good but better have confirmation
ROM_LOAD( "5.bpr", 0x0000, 0x0100, BAD_DUMP CRC(21fb583f) SHA1(b8c65fbdd5d8b70bf51341cd60fc2efeaab8bb82) ) // dots
ROM_REGION( 0x0160, "proms", 0 ) // not dumped for this set, probably good but better have confirmation
ROM_LOAD( "2.bpr", 0x0000, 0x0020, BAD_DUMP CRC(26f42e6f) SHA1(f51578216a5d588c4d0143ce7a23d695a15a3914) ) // palette
ROM_LOAD( "3.bpr", 0x0020, 0x0100, BAD_DUMP CRC(4aecc0c8) SHA1(3c1086a598d84b4bcb277556b716fd18c76c4364) ) // lookup table
ROM_LOAD( "7a.bpr", 0x0120, 0x0020, BAD_DUMP CRC(48c8f094) SHA1(61592209720fddc8991751edf08b6950388af42e) ) // video layout (not used)
ROM_LOAD( "10a.bpr", 0x0140, 0x0020, BAD_DUMP CRC(b8861096) SHA1(26fad384ed7a1a1e0ba719b5578e2dbb09334a25) ) // video timing (not used)
ROM_END
ROM_START( cottong )
ROM_START( cottong ) // bootleg based on gutangtn set
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "c1", 0x0000, 0x1000, CRC(2c256fe6) SHA1(115594c616497eec998e4e3255ec6ab6299346fa) )
ROM_LOAD( "c2", 0x1000, 0x1000, CRC(1de5e6a0) SHA1(8bb3408a510662ff3b9b7201d2d06fe70685bf7f) )
ROM_LOAD( "c3", 0x2000, 0x1000, CRC(01f909fe) SHA1(c80295e9f91ce25bfd28e72823b20ee6f6524a5c) )
ROM_LOAD( "c4", 0x3000, 0x1000, CRC(a89eb3e3) SHA1(058928ade909faba06f177750f914cf1dabaefc3) )
ROM_LOAD( "c2", 0x1000, 0x1000, CRC(1de5e6a0) SHA1(8bb3408a510662ff3b9b7201d2d06fe70685bf7f) ) // == bimm_002.r2
ROM_LOAD( "c3", 0x2000, 0x1000, CRC(01f909fe) SHA1(c80295e9f91ce25bfd28e72823b20ee6f6524a5c) ) // == bimm_003.r3
ROM_LOAD( "c4", 0x3000, 0x1000, CRC(a89eb3e3) SHA1(058928ade909faba06f177750f914cf1dabaefc3) ) // == bimm_004.r4
ROM_REGION( 0x10000, "timeplt_audio:tpsound", 0 )
ROM_LOAD( "c7", 0x0000, 0x1000, CRC(3d83f6d3) SHA1(e10ed6b6ce7280697c1bc9dbe6c6e6018e1d8be4) )
ROM_LOAD( "c8", 0x1000, 0x1000, CRC(323e1937) SHA1(75499d6c8a9032fac090a13cd4f36bd350f52dab) )
ROM_LOAD( "c7", 0x0000, 0x1000, CRC(3d83f6d3) SHA1(e10ed6b6ce7280697c1bc9dbe6c6e6018e1d8be4) ) // == bimm_007.b1
ROM_LOAD( "c8", 0x1000, 0x1000, CRC(323e1937) SHA1(75499d6c8a9032fac090a13cd4f36bd350f52dab) ) // == bimm_008.c1
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "c5", 0x0000, 0x1000, CRC(992d079c) SHA1(b5acd30f2e8700cc4cd852b190bd1f4163b137e8) )
ROM_LOAD( "c5", 0x0000, 0x1000, CRC(992d079c) SHA1(b5acd30f2e8700cc4cd852b190bd1f4163b137e8) ) // == bimm_005.r9
ROM_LOAD( "c6", 0x1000, 0x1000, CRC(0149ef46) SHA1(58f684a9b7b9410236b3c54ea6c0fa9853a078c5) )
ROM_REGION( 0x0100, "gfx2", 0 )
@ -1525,8 +1525,8 @@ GAME( 1982, savanna, jungler, jungler, jungler, rallyx_state, empty_init, R
GAME( 1982, tactcian, 0, tactcian, tactcian, rallyx_state, empty_init, ROT90, "Konami (Sega license)", "Tactician (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, tactcian2, tactcian, tactcian, tactcian, rallyx_state, empty_init, ROT90, "Konami (Sega license)", "Tactician (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, locomotn, 0, locomotn, locomotn, rallyx_state, empty_init, ROT90, "Konami (Centuri license)", "Loco-Motion", MACHINE_SUPPORTS_SAVE )
GAME( 1982, gutangtn, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "Konami (Sega license)", "Guttang Gottong (Sega license)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, gutangtnk, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "Konami", "Guttang Gottong", MACHINE_SUPPORTS_SAVE )
GAME( 1982, gutangtn, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "Konami", "Guttang Gottong", MACHINE_SUPPORTS_SAVE )
GAME( 1982, gutangtns, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "Konami (Sega license)", "Guttang Gottong (Sega license)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, cottong, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "bootleg", "Cotocoto Cottong", MACHINE_SUPPORTS_SAVE )
GAME( 1982, locoboot, locomotn, locomotn, locomotn, rallyx_state, empty_init, ROT90, "bootleg", "Loco-Motion (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, commsega, 0, commsega, commsega, rallyx_state, empty_init, ROT90, "Sega", "Commando (Sega)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Tomasz Slanina
// copyright-holders: Tomasz Slanina
/***************************************************************************
Monza GP - Olympia
@ -30,11 +31,13 @@ Lower board (MGP_01):
***************************************************************************/
#include "emu.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/nvram.h"
#include "machine/timer.h"
#include "video/dp8350.h"
#include "video/resnet.h"
#include "emupal.h"
#include "screen.h"
@ -53,14 +56,13 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_nvram(*this, "nvram"),
m_gfx1(*this, "gfx1"),
m_gfx2(*this, "gfx2"),
m_gfx3(*this, "gfx3"),
m_tile_attr(*this, "unk1"),
m_vram(*this, "vram", 0x800, ENDIANNESS_LITTLE),
m_score_ram(*this, "score_ram", 0x100, ENDIANNESS_LITTLE),
m_gfx(*this, "gfx%u", 1U),
m_tile_attr(*this, "tile_attr"),
m_proms(*this, "proms"),
m_steering_wheel(*this, "WHEEL"),
m_in0(*this, "IN0"),
m_in1(*this, "IN1"),
m_in(*this, "IN%u", 0),
m_dsw(*this, "DSW"),
m_digits(*this, "digit%u%u", 0U, 0U)
{ }
@ -80,35 +82,32 @@ private:
void monzagp_palette(palette_device &palette) const;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void monzagp_io(address_map &map);
void monzagp_map(address_map &map);
void io_map(address_map &map);
void program_map(address_map &map);
required_device<i8035_device> m_maincpu;
required_device<dp8350_device> m_crtc;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<nvram_device> m_nvram;
required_memory_region m_gfx1;
required_memory_region m_gfx2;
required_memory_region m_gfx3;
required_memory_region m_tile_attr;
required_memory_region m_proms;
memory_share_creator<uint8_t> m_vram;
memory_share_creator<uint8_t> m_score_ram;
required_region_ptr_array<uint8_t, 3> m_gfx;
required_region_ptr<uint8_t> m_tile_attr;
required_region_ptr<uint8_t> m_proms;
required_ioport m_steering_wheel;
required_ioport m_in0;
required_ioport m_in1;
required_ioport_array<2> m_in;
required_ioport m_dsw;
output_finder<4, 7> m_digits;
uint8_t m_p1;
uint8_t m_p2;
uint8_t m_video_ctrl[2][8];
bool m_time_tick;
bool m_cp_ruote;
bool m_time_tick;
bool m_cp_ruote;
uint8_t m_collisions_ff;
uint8_t m_collisions_clk;
uint8_t m_mycar_pos;
std::unique_ptr<uint8_t[]> m_vram;
std::unique_ptr<uint8_t[]> m_score_ram;
};
@ -132,7 +131,7 @@ void monzagp_state::monzagp_palette(palette_device &palette) const
for (int i = 0; i < 0x100; i++)
{
uint8_t const d = m_proms->base()[0x400 + i] ^ 0x0f;
uint8_t const d = m_proms[0x400 + i] ^ 0x0f;
int bit0 = 0, bit1 = 0, bit2 = 0;
if (d & 0x08)
@ -159,17 +158,22 @@ void monzagp_state::monzagp_palette(palette_device &palette) const
void monzagp_state::machine_start()
{
m_vram = std::make_unique<uint8_t[]>(0x800);
m_score_ram = std::make_unique<uint8_t[]>(0x100);
m_time_tick = 0;
m_cp_ruote = 0;
m_mycar_pos = 0;
m_collisions_ff = 0;
m_collisions_clk = 0;
save_pointer(NAME(m_vram), 0x800);
save_pointer(NAME(m_score_ram), 0x100);
m_nvram->set_base(m_score_ram.get(), 0x100);
save_item(NAME(m_p1));
save_item(NAME(m_p2));
save_item(NAME(m_video_ctrl));
save_item(NAME(m_time_tick));
save_item(NAME(m_cp_ruote));
save_item(NAME(m_collisions_ff));
save_item(NAME(m_collisions_clk));
save_item(NAME(m_mycar_pos));
m_nvram->set_base(m_score_ram, 0x100);
m_digits.resolve();
}
@ -177,10 +181,10 @@ void monzagp_state::machine_start()
uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/*
for(int i=0;i<8;i++)
for (int i = 0; i < 8; i++)
printf("%02x ", m_video_ctrl[0][i]);
printf(" ---- ");
for(int i=0;i<8;i++)
for (int i = 0; i < 8; i++)
printf("%02x ", m_video_ctrl[1][i]);
printf("\n");
*/
@ -188,12 +192,12 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
bitmap.fill(0, cliprect);
// background tilemap
uint8_t *tile_table = m_proms->base() + 0x100;
uint8_t *collisions_prom = m_proms->base() + 0x200;
uint8_t const *tile_table = &m_proms[0x100];
uint8_t const *collisions_prom = &m_proms[0x200];
uint8_t start_tile = m_video_ctrl[0][0] ^ 0xff;
uint8_t inv_counter = m_video_ctrl[0][1] ^ 0xff;
uint8_t mycar_y = m_mycar_pos;
uint8_t const mycar_y = m_mycar_pos;
bool inv = false;
for (int y = 0; y < 240; y++, start_tile += inv ? -1 : +1)
@ -202,21 +206,21 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
inv = true;
uint16_t start_x = (((m_video_ctrl[0][3] << 8) | m_video_ctrl[0][2]) ^ 0xffff);
uint8_t mycar_x = m_video_ctrl[1][2];
uint8_t const mycar_x = m_video_ctrl[1][2];
for (int x = 0; x < 280; x++, start_x++)
{
uint8_t tile_attr = m_tile_attr->base()[((start_x >> 5) & 0x1ff) | ((m_video_ctrl[0][3] & 0x80) ? 0 : 0x200)];
uint8_t tile_attr = m_tile_attr[((start_x >> 5) & 0x1ff) | ((m_video_ctrl[0][3] & 0x80) ? 0 : 0x200)];
//if (tile_attr & 0x10) printf("dark on\n");
//if (tile_attr & 0x20) printf("light on\n");
//if (tile_attr & 0x40) printf("bridge\n");
int tile_idx = tile_table[((tile_attr & 0x0f) << 4) | (inv ? 0x08 : 0) | ((start_tile >> 5) & 0x07)];
int const tile_idx = tile_table[((tile_attr & 0x0f) << 4) | (inv ? 0x08 : 0) | ((start_tile >> 5) & 0x07)];
int bit_pos = 3 - (start_x & 3);
uint8_t tile_data = m_gfx3->base()[(tile_idx << 8) | (((start_x << 3) & 0xe0) ^ 0x80) | (start_tile & 0x1f)];
uint8_t tile_color = (BIT(tile_data, 4 + bit_pos) << 1) | BIT(tile_data, bit_pos);
int const bit_pos = 3 - (start_x & 3);
uint8_t const tile_data = m_gfx[2][(tile_idx << 8) | (((start_x << 3) & 0xe0) ^ 0x80) | (start_tile & 0x1f)];
uint8_t const tile_color = (BIT(tile_data, 4 + bit_pos) << 1) | BIT(tile_data, bit_pos);
int color = (tile_idx << 2) | tile_color;
@ -227,19 +231,19 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
// my car sprite
bool mycar = false;
int mycar_size = m_video_ctrl[1][3] & 0x20 ? 16 : 32;
if ((m_video_ctrl[1][3] & 0x18) && x >= m_video_ctrl[1][2] && x < m_video_ctrl[1][2] + 4*8 && y > m_mycar_pos - mycar_size && y < m_mycar_pos + mycar_size)
int const mycar_size = m_video_ctrl[1][3] & 0x20 ? 16 : 32;
if ((m_video_ctrl[1][3] & 0x18) && x >= m_video_ctrl[1][2] && x < m_video_ctrl[1][2] + 4 * 8 && y > m_mycar_pos - mycar_size && y < m_mycar_pos + mycar_size)
{
int hpos = x - mycar_x;
int vpos = y > mycar_y ? ((y - mycar_y) ^ 0x1f) : mycar_y - y;
int const hpos = x - mycar_x;
int const vpos = y > mycar_y ? ((y - mycar_y) ^ 0x1f) : mycar_y - y;
int sprite_idx = (((m_video_ctrl[1][3] & 0x18)) << 2) | (hpos & 0x1c) | (((m_video_ctrl[1][3] & 0x06) >> 1) ^ 0x03);
if (y <= mycar_y - 16 || y >= mycar_y + 16) sprite_idx ^= 0x61;
else if (m_cp_ruote && (m_video_ctrl[1][3] & 0x10)) sprite_idx ^= 0x01;
int bitpos = 3 - (hpos & 3);
uint8_t sprite_data = m_gfx2->base()[(sprite_idx << 5) | (vpos & 0x1f)];
uint8_t sprite_color = (BIT(sprite_data, 4 + bitpos) << 1) | BIT(sprite_data, bitpos);
int const bitpos = 3 - (hpos & 3);
uint8_t const sprite_data = m_gfx[1][(sprite_idx << 5) | (vpos & 0x1f)];
uint8_t const sprite_color = (BIT(sprite_data, 4 + bitpos) << 1) | BIT(sprite_data, bitpos);
if ((sprite_color & 3) != 3)
{
@ -255,8 +259,8 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
bitmap.pix(y, x * 2 + 1) = color;
// collisions
uint8_t coll_prom_addr = bitswap<8>(tile_idx, 7, 6, 5, 4, 2, 0, 1, 3);
uint8_t collisions = collisions_prom[((mycar && othercars) ? 0 : 0x80) | (inv ? 0x40 : 0) | (coll_prom_addr << 2) | (mycar ? 0 : 0x02) | (tile_color & 0x01)];
uint8_t const coll_prom_addr = bitswap<8>(tile_idx, 7, 6, 5, 4, 2, 0, 1, 3);
uint8_t const collisions = collisions_prom[((mycar && othercars) ? 0 : 0x80) | (inv ? 0x40 : 0) | (coll_prom_addr << 2) | (mycar ? 0 : 0x02) | (tile_color & 0x01)];
m_collisions_ff |= ((m_collisions_clk ^ collisions) & collisions);
m_collisions_clk = collisions;
}
@ -267,11 +271,11 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
{
for (int x = 0; x < 40; x++)
{
m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
m_vram[y*40+x],
m_gfxdecode->gfx(0)->zoom_transpen(bitmap, cliprect,
m_vram[y * 40 + x],
0,
0, 0,
x*14,y*10,
x * 14, y * 10,
0x20000, 0x10000,
1);
}
@ -280,7 +284,7 @@ uint32_t monzagp_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
return 0;
}
void monzagp_state::monzagp_map(address_map &map)
void monzagp_state::program_map(address_map &map)
{
map(0x0000, 0x0fff).rom();
}
@ -292,7 +296,7 @@ uint8_t monzagp_state::port_r(offs_t offset)
if (!(m_p1 & 0x01)) // 8350 videoram
{
//printf("ext 0 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
int addr = ((m_p2 & 0x3f) << 5) | (offset & 0x1f);
int const addr = ((m_p2 & 0x3f) << 5) | (offset & 0x1f);
data = m_vram[addr];
}
if (!(m_p1 & 0x02))
@ -302,18 +306,18 @@ uint8_t monzagp_state::port_r(offs_t offset)
if (!(m_p1 & 0x04)) // GFX
{
//printf("ext 2 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
int addr = ((m_p2 & 0x7f) << 5) | (offset & 0x1f);
data = m_gfx1->base()[addr];
int const addr = ((m_p2 & 0x7f) << 5) | (offset & 0x1f);
data = m_gfx[0][addr];
}
if (!(m_p1 & 0x08))
{
//printf("ext 3 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
data = m_in1->read();
data = m_in[1]->read();
}
if (!(m_p1 & 0x10))
{
//printf("ext 4 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
data = (m_dsw->read() & 0x1f) | (m_in0->read() & 0xe0);
data = (m_dsw->read() & 0x1f) | (m_in[0]->read() & 0xe0);
}
if (!(m_p1 & 0x20))
{
@ -321,7 +325,7 @@ uint8_t monzagp_state::port_r(offs_t offset)
}
if (!(m_p1 & 0x40)) // digits
{
data = m_score_ram[bitswap<8>(offset, 3,2,1,0,7,6,5,4)];
data = m_score_ram[bitswap<8>(offset, 3, 2, 1, 0, 7, 6, 5, 4)];
//printf("ext 6 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
}
if (!(m_p1 & 0x80))
@ -339,7 +343,7 @@ void monzagp_state::port_w(offs_t offset, uint8_t data)
{
//printf("ext 0 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
int addr = ((m_p2 & 0x3f) << 5) | (offset & 0x1f);
int const addr = ((m_p2 & 0x3f) << 5) | (offset & 0x1f);
m_vram[addr] = data;
}
if (!(m_p1 & 0x02))
@ -349,11 +353,11 @@ void monzagp_state::port_w(offs_t offset, uint8_t data)
if (!(m_p1 & 0x04)) // GFX
{
//printf("ext 2 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
int addr = ((m_p2 & 0x7f) << 5) | (offset & 0x1f);
int const addr = ((m_p2 & 0x7f) << 5) | (offset & 0x1f);
if (addr < 0x400)
{
static int pt[] = { 0x0e, 0x0c, 0x0d, 0x08, 0x09, 0x0a, 0x0b, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0f };
m_gfx1->base()[addr] = (pt[(data >> 4) & 0x0f] << 4) | pt[data & 0x0f];
m_gfx[0][addr] = (pt[(data >> 4) & 0x0f] << 4) | pt[data & 0x0f];
m_gfxdecode->gfx(0)->mark_dirty(addr >> 4);
}
}
@ -372,7 +376,7 @@ void monzagp_state::port_w(offs_t offset, uint8_t data)
if (!(m_p1 & 0x40)) // digits
{
//printf("ext 6 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
offs_t ram_offset = bitswap<8>(offset, 3,2,1,0,7,6,5,4);
offs_t const ram_offset = bitswap<8>(offset, 3, 2, 1, 0, 7, 6, 5, 4);
m_score_ram[ram_offset] = data & 0x0f;
if ((ram_offset & 0x07) == 0 && (ram_offset & 0x38) != 0x38)
@ -385,21 +389,21 @@ void monzagp_state::port_w(offs_t offset, uint8_t data)
if (!(m_p1 & 0x80))
{
//printf("ext 7 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
m_video_ctrl[0][(offset>>0) & 0x07] = data;
m_video_ctrl[1][(offset>>3) & 0x07] = data;
m_video_ctrl[0][(offset >> 0) & 0x07] = data;
m_video_ctrl[1][(offset >> 3) & 0x07] = data;
if (((offset>>0) & 0x07) == 0x04) m_collisions_ff = 0;
if (((offset>>3) & 0x07) == 0x04) m_mycar_pos = 0xbf;
if (((offset >> 0) & 0x07) == 0x04) m_collisions_ff = 0;
if (((offset >> 3) & 0x07) == 0x04) m_mycar_pos = 0xbf;
if ((m_video_ctrl[1][3] & 1) == 0)
{
if (((offset>>3) & 0x07) == 0x00) m_mycar_pos++;
if (((offset>>3) & 0x07) == 0x01) m_mycar_pos--;
if (((offset >> 3) & 0x07) == 0x00) m_mycar_pos++;
if (((offset >> 3) & 0x07) == 0x01) m_mycar_pos--;
}
if ((offset & 0x80) && (m_video_ctrl[1][3] & 0x01))
{
uint8_t steering_wheel = m_steering_wheel->read();
uint8_t const steering_wheel = m_steering_wheel->read();
if (steering_wheel & 0x01) m_mycar_pos--;
if (steering_wheel & 0x02) m_mycar_pos++;
}
@ -424,7 +428,7 @@ void monzagp_state::port2_w(uint8_t data)
}
void monzagp_state::monzagp_io(address_map &map)
void monzagp_state::io_map(address_map &map)
{
map(0x00, 0xff).rw(FUNC(monzagp_state::port_r), FUNC(monzagp_state::port_w));
}
@ -509,20 +513,20 @@ GFXDECODE_END
void monzagp_state::monzagp(machine_config &config)
{
I8035(config, m_maincpu, 12000000/4); /* 400KHz ??? - Main board Crystal is 12MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &monzagp_state::monzagp_map);
m_maincpu->set_addrmap(AS_IO, &monzagp_state::monzagp_io);
I8035(config, m_maincpu, 12'000'000 / 4); // 400KHz ??? - Main board Crystal is 12MHz
m_maincpu->set_addrmap(AS_PROGRAM, &monzagp_state::program_map);
m_maincpu->set_addrmap(AS_IO, &monzagp_state::io_map);
m_maincpu->p1_out_cb().set(FUNC(monzagp_state::port1_w));
m_maincpu->p2_in_cb().set(FUNC(monzagp_state::port2_r));
m_maincpu->p2_out_cb().set(FUNC(monzagp_state::port2_w));
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(10920000, 700, 0, 560, 312, 11, 240); // 11-line offset makes attract mode look symmetric
screen.set_raw(10'920'000, 700, 0, 560, 312, 11, 240); // 11-line offset makes attract mode look symmetric
screen.set_screen_update(FUNC(monzagp_state::screen_update));
screen.set_palette(m_palette);
DP8350(config, m_crtc, 10920000); // pins 21/22 connected to XTAL, 3 to GND, 5 to +5
DP8350(config, m_crtc, 10'920'000); // pins 21/22 connected to XTAL, 3 to GND, 5 to +5
m_crtc->set_screen("screen");
m_crtc->refresh_control(0);
m_crtc->vsync_callback().set_inputline(m_maincpu, MCS48_INPUT_IRQ).invert(); // active low; no inverter should be needed
@ -556,9 +560,9 @@ ROM_START( monzagp )
ROM_LOAD( "5.9f", 0x0000, 0x0400, CRC(5abd1ef6) SHA1(1bc79225c1be2821930fdb8e821a70c7ac8683ab) )
ROM_LOAD( "4.10f", 0x0400, 0x0400, CRC(a426a371) SHA1(d6023bebf6924d1820e631ee53896100e5b256a5) )
ROM_LOAD( "3.12f", 0x0800, 0x0400, CRC(e5591074) SHA1(ac756ee605d932d7c1c3eddbe2b9c6f78dad6ce8) )
ROM_LOAD( "2.13f", 0x0c00, 0x0400, BAD_DUMP CRC(1943122f) SHA1(3d343314fcb594560b4a280e795c8cea4a3200c9) ) /* missing, so use rom from below. Not confirmed to 100% same */
ROM_LOAD( "2.13f", 0x0c00, 0x0400, BAD_DUMP CRC(1943122f) SHA1(3d343314fcb594560b4a280e795c8cea4a3200c9) ) // missing, so use ROM from below. Not confirmed to be 100% same
ROM_REGION( 0x10000, "unk1", 0 )
ROM_REGION( 0x10000, "tile_attr", 0 )
ROM_LOAD( "1.9c", 0x0000, 0x0400, CRC(005d5fed) SHA1(145a860751ef7d99129b7242aacac7a4e1e14a51) )
ROM_REGION( 0x0700, "proms", 0 )
@ -571,7 +575,7 @@ ROM_START( monzagp )
ROM_LOAD( "74s287.7", 0x0600, 0x0100, CRC(3248ba56) SHA1(d449f4be8df1b4189afca55a4cf0cc2e19eb4dd4) )
ROM_END
// bootleg hardware seems identical, just bad quality pcb
// bootleg hardware seems identical, just bad quality PCB. Same set also found on original PCB.
ROM_START( monzagpb )
ROM_REGION( 0x1000, "maincpu", 0 )
ROM_LOAD( "m12c.6a", 0x0000, 0x0400, CRC(35715718) SHA1(aa64cedf1f5898b109f643975722cf15a1c752ba) )
@ -580,8 +584,8 @@ ROM_START( monzagpb )
ROM_LOAD( "m15bi.9a", 0x0c00, 0x0400, CRC(ee6d9cc6) SHA1(0aa9efe812c1d4865fee2bbb1764a135dd642790) )
ROM_REGION( 0x1000, "gfx1", 0 )
ROM_LOAD( "m10.7d", 0x0400, 0x0400, CRC(19db00af) SHA1(c73da9c2fdbdb1b52a7354ba169af43b26fcb4cc) ) /* differs from above */
ROM_LOAD( "m11.8d", 0x0800, 0x0400, CRC(5b4a7ffa) SHA1(50fa073437febe516065cd83fbaf85b596c4f3c8) ) /* differs from above */
ROM_LOAD( "m10.7d", 0x0400, 0x0400, CRC(19db00af) SHA1(c73da9c2fdbdb1b52a7354ba169af43b26fcb4cc) ) // differs from above
ROM_LOAD( "m11.8d", 0x0800, 0x0400, CRC(5b4a7ffa) SHA1(50fa073437febe516065cd83fbaf85b596c4f3c8) ) // differs from above
ROM_REGION( 0x1000, "gfx2", 0 )
ROM_LOAD( "m9.10j", 0x0000, 0x0400, CRC(474ab63f) SHA1(6ba623d1768ed92b39e8f76c2f2eed7874955f1b) )
@ -595,12 +599,12 @@ ROM_START( monzagpb )
ROM_LOAD( "m3.12f", 0x0800, 0x0400, CRC(e5591074) SHA1(ac756ee605d932d7c1c3eddbe2b9c6f78dad6ce8) )
ROM_LOAD( "m2.13f", 0x0c00, 0x0400, CRC(1943122f) SHA1(3d343314fcb594560b4a280e795c8cea4a3200c9) )
ROM_REGION( 0x10000, "unk1", 0 )
ROM_REGION( 0x10000, "tile_attr", 0 )
ROM_LOAD( "m1.9c", 0x0000, 0x0400, CRC(005d5fed) SHA1(145a860751ef7d99129b7242aacac7a4e1e14a51) )
ROM_REGION( 0x0700, "proms", 0 )
ROM_LOAD( "6300.1", 0x0000, 0x0100, CRC(5123c83e) SHA1(d8ff06af421d3dae65bc9b0a081ed56249ef61ab) )
ROM_LOAD( "6300.2", 0x0100, 0x0100, CRC(8274f838) SHA1(c3518c668bda98759b1b1d4690062ced6c639efe) ) /* differs from above */
ROM_LOAD( "6300.2", 0x0100, 0x0100, CRC(8274f838) SHA1(c3518c668bda98759b1b1d4690062ced6c639efe) ) // differs from above
ROM_LOAD( "6300.3", 0x0200, 0x0100, CRC(eebbe52a) SHA1(14af033871cad4e35c391bce4435e7cf1ba146f7) )
ROM_LOAD( "6300.4", 0x0300, 0x0100, CRC(b89961a3) SHA1(99070a12e66764d21fd38ce4318ee0929daea465) )
ROM_LOAD( "6300.5", 0x0400, 0x0100, CRC(82c92620) SHA1(51d65156ebb592ff9e6375da7aa279325482fd5f) )
@ -611,5 +615,5 @@ ROM_END
} // anonymous namespace
GAMEL( 1981, monzagp, 0, monzagp, monzagp, monzagp_state, empty_init, ROT270, "Olympia", "Monza GP", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NO_SOUND, layout_monzagp )
GAMEL( 1981, monzagpb, monzagp, monzagp, monzagp, monzagp_state, empty_init, ROT270, "bootleg", "Monza GP (bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NO_SOUND, layout_monzagp )
GAMEL( 1981, monzagp, 0, monzagp, monzagp, monzagp_state, empty_init, ROT270, "Olympia", "Monza GP (set 1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NO_SOUND, layout_monzagp )
GAMEL( 1981, monzagpb, monzagp, monzagp, monzagp, monzagp_state, empty_init, ROT270, "bootleg", "Monza GP (set 2)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NO_SOUND, layout_monzagp )

View File

@ -9007,11 +9007,12 @@ void seta_state::zingzipbl(machine_config &config)
m_spritegen->set_info(gfx_zingzipbl_sprites);
m_layers[0]->set_info(gfx_zingzipbl_layer1);
m_layers[1]->set_info(gfx_zingzipbl_layer2);
// TODO: layers x and y offsets' adjustments
M68000(config.replace(), m_maincpu, 16000000); // 16 MHz
m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::zingzipbl_map);
subdevice<screen_device>("screen")->screen_vblank().set_inputline(m_maincpu, 6, HOLD_LINE); // TODO: there's probably more then this
subdevice<screen_device>("screen")->screen_vblank().set_inputline(m_maincpu, 6, HOLD_LINE); // TODO: there's probably more than this
config.device_remove("x1snd");

View File

@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
// copyright-holders: Bryan McPhail
/***************************************************************************
Prehistoric Isle in 1930 (World) (c) 1989 SNK
@ -12,13 +13,261 @@
***************************************************************************/
#include "emu.h"
#include "prehisle.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "sound/upd7759.h"
#include "sound/ymopl.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"
namespace {
class prehisle_state : public driver_device
{
public:
prehisle_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_tx_vram(*this, "tx_vram"),
m_spriteram(*this, "spriteram"),
m_fg_vram(*this, "fg_vram"),
m_tilemap_rom(*this, "bgtilemap"),
m_io_p1(*this, "P1"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_upd7759(*this, "upd"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch")
{ }
void prehisle(machine_config &config);
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
void soundcmd_w(u16 data);
void fg_vram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void tx_vram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void upd_port_w(u8 data);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_tx_tile_info);
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void main_program_map(address_map &map);
void sound_io_map(address_map &map);
void sound_program_map(address_map &map);
required_shared_ptr<u16> m_tx_vram;
required_shared_ptr<u16> m_spriteram;
required_shared_ptr<u16> m_fg_vram;
required_region_ptr<u8> m_tilemap_rom;
required_ioport m_io_p1;
u8 m_invert_controls = 0;
u16 m_bg_scrollx = 0;
u16 m_bg_scrolly = 0;
u16 m_fg_scrollx = 0;
u16 m_fg_scrolly = 0;
tilemap_t *m_bg_tilemap = nullptr;
tilemap_t *m_fg_tilemap = nullptr;
tilemap_t *m_tx_tilemap = nullptr;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<upd7759_device> m_upd7759;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
};
void prehisle_state::fg_vram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_vram[offset]);
m_fg_tilemap->mark_tile_dirty(offset);
}
void prehisle_state::tx_vram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_tx_vram[offset]);
m_tx_tilemap->mark_tile_dirty(offset);
}
void prehisle_state::fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_scrolly);
m_fg_tilemap->set_scrolly(0, m_fg_scrolly);
}
void prehisle_state::fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_scrollx);
m_fg_tilemap->set_scrollx(0, m_fg_scrollx);
}
void prehisle_state::bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_bg_scrolly);
m_bg_tilemap->set_scrolly(0, m_bg_scrolly);
}
void prehisle_state::bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_bg_scrollx);
m_bg_tilemap->set_scrollx(0, m_bg_scrollx);
}
/* tile layout
0 xxxx.... color
0 ....x... flip x
0 .....xxx gfx code high bits
1 xxxxxxxx gfx code low bits
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_bg_tile_info)
{
int const offs = tile_index * 2;
int const attr = m_tilemap_rom[offs + 1] + (m_tilemap_rom[offs] << 8);
int const code = attr & 0x7ff;
int const color = attr >> 12;
int const flags = (attr & 0x800) ? TILE_FLIPX : 0;
tileinfo.set(1, code, color, flags);
}
/* tile layout
0 xxxx.... ........ color
0 ....x... ........ flip y
0 .....xxx xxxxxxxx gfx code
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info)
{
int const attr = m_fg_vram[tile_index];
int const code = attr & 0x7ff;
int const color = attr >> 12;
int const flags = (attr & 0x800) ? TILE_FLIPY : 0;
tileinfo.set(2, code, color, flags);
}
/* tile layout
0 xxxx.... ........ color
0 ....xxxx xxxxxxxx gfx code
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_tx_tile_info)
{
int const attr = m_tx_vram[tile_index];
int const code = attr & 0xfff;
int const color = attr >> 12;
tileinfo.set(0, code, color, 0);
}
void prehisle_state::video_start()
{
// ROM-based background layer
m_bg_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_bg_tile_info)),
TILEMAP_SCAN_COLS, // scan order
16, 16, // tile size
1024, 32); // tilemap size
// RAM-based foreground layer (overlays most sprites)
m_fg_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_fg_tile_info)),
TILEMAP_SCAN_COLS, // scan order
16, 16, // tile size
256, 32); // tilemap size
m_fg_tilemap->set_transparent_pen(15);
// text layer
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_tx_tile_info)),
TILEMAP_SCAN_ROWS, // scan order
8, 8, // tile size
32, 32); // tilemap size
m_tx_tilemap->set_transparent_pen(15);
// register for saving
save_item(NAME(m_bg_scrollx));
save_item(NAME(m_bg_scrolly));
save_item(NAME(m_fg_scrollx));
save_item(NAME(m_fg_scrolly));
}
/* sprite layout
0 .......x xxxxxxxx y, other bits unused?
1 .......x xxxxxxxx x, other bits unused?
2 x....... ........ flip y
2 .x...... ........ flip x
2 ..x..... ........ ?
2 ...xxxxx xxxxxxxx gfx code
3 xxxx.... ........ color+priority, other bits unknown
*/
void prehisle_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
for (int offs = 1024 - 4; offs >= 0; offs -= 4)
{
u16 const attr = m_spriteram[offs + 2];
u16 const code = attr & 0x1fff;
u16 const color = m_spriteram[offs + 3] >> 12;
u32 const priority = GFX_PMASK_4 | ((color < 0x4) ? 0 : GFX_PMASK_2); // correct?
bool flipx = attr & 0x4000;
bool flipy = attr & 0x8000;
s16 sx = m_spriteram[offs + 1] & 0x1ff;
s16 sy = m_spriteram[offs] & 0x1ff;
// coordinates are 9-bit signed
if (sx & 0x100) sx = -0x100 + (sx & 0xff);
if (sy & 0x100) sy = -0x100 + (sy & 0xff);
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(3)->prio_transpen(
bitmap, cliprect,
code, color,
flipx, flipy,
sx, sy,
screen.priority(), priority,
15); // transparent pen
}
}
u32 prehisle_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect);
return 0;
}
/******************************************************************************/
@ -31,19 +280,19 @@ void prehisle_state::soundcmd_w(u16 data)
/*******************************************************************************/
void prehisle_state::prehisle_map(address_map &map)
void prehisle_state::main_program_map(address_map &map)
{
map(0x000000, 0x03ffff).rom();
map(0x070000, 0x073fff).ram();
map(0x090000, 0x0907ff).ram().w(FUNC(prehisle_state::tx_vram_w)).share("tx_vram");
map(0x0a0000, 0x0a07ff).ram().share("spriteram");
map(0x0b0000, 0x0b3fff).ram().w(FUNC(prehisle_state::fg_vram_w)).share("fg_vram");
map(0x090000, 0x0907ff).ram().w(FUNC(prehisle_state::tx_vram_w)).share(m_tx_vram);
map(0x0a0000, 0x0a07ff).ram().share(m_spriteram);
map(0x0b0000, 0x0b3fff).ram().w(FUNC(prehisle_state::fg_vram_w)).share(m_fg_vram);
map(0x0d0000, 0x0d07ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x0e0010, 0x0e0011).portr("P2"); // Player 2
map(0x0e0020, 0x0e0021).portr("COIN"); // Coins, Tilt, Service
map(0x0e0041, 0x0e0041).lr8(NAME([this] () -> u8 { return m_io_p1->read() ^ m_invert_controls; })); // Player 1
map(0x0e0042, 0x0e0043).portr("DSW0"); // DIPs
map(0x0e0044, 0x0e0045).portr("DSW1"); // DIPs + VBLANK
map(0x0e0010, 0x0e0011).portr("P2");
map(0x0e0020, 0x0e0021).portr("COIN");
map(0x0e0041, 0x0e0041).lr8(NAME([this] () -> u8 { return m_io_p1->read() ^ m_invert_controls; }));
map(0x0e0042, 0x0e0043).portr("DSW0");
map(0x0e0044, 0x0e0045).portr("DSW1"); // and VBLANK
map(0x0f0000, 0x0f0001).w(FUNC(prehisle_state::fg_scrolly_w));
map(0x0f0010, 0x0f0011).w(FUNC(prehisle_state::fg_scrollx_w));
map(0x0f0020, 0x0f0021).w(FUNC(prehisle_state::bg_scrolly_w));
@ -64,7 +313,7 @@ void prehisle_state::upd_port_w(u8 data)
m_upd7759->start_w(1);
}
void prehisle_state::prehisle_sound_map(address_map &map)
void prehisle_state::sound_program_map(address_map &map)
{
map(0x0000, 0xefff).rom();
map(0xf000, 0xf7ff).ram();
@ -72,7 +321,7 @@ void prehisle_state::prehisle_sound_map(address_map &map)
map(0xf800, 0xf800).nopw(); // ???
}
void prehisle_state::prehisle_sound_io_map(address_map &map)
void prehisle_state::sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w));
@ -84,7 +333,7 @@ void prehisle_state::prehisle_sound_io_map(address_map &map)
/******************************************************************************/
static INPUT_PORTS_START( prehisle )
PORT_START("P1") /* Player 1 controls */
PORT_START("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
@ -94,7 +343,7 @@ static INPUT_PORTS_START( prehisle )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("P2") /* Player 2 controls */
PORT_START("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
@ -104,7 +353,7 @@ static INPUT_PORTS_START( prehisle )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("COIN") /* coin */
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
@ -112,7 +361,7 @@ static INPUT_PORTS_START( prehisle )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW0") /* Dip switches */
PORT_START("DSW0")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -171,7 +420,7 @@ GFXDECODE_END
void prehisle_state::machine_start()
{
/* register for saving */
// register for saving
save_item(NAME(m_invert_controls));
}
@ -179,33 +428,33 @@ void prehisle_state::machine_start()
void prehisle_state::prehisle(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(18'000'000)/2); /* verified on pcb */
m_maincpu->set_addrmap(AS_PROGRAM, &prehisle_state::prehisle_map);
// basic machine hardware
M68000(config, m_maincpu, XTAL(18'000'000) / 2); // verified on PCB
m_maincpu->set_addrmap(AS_PROGRAM, &prehisle_state::main_program_map);
m_maincpu->set_vblank_int("screen", FUNC(prehisle_state::irq4_line_hold));
Z80(config, m_audiocpu, XTAL(4'000'000)); /* verified on pcb */
m_audiocpu->set_addrmap(AS_PROGRAM, &prehisle_state::prehisle_sound_map);
m_audiocpu->set_addrmap(AS_IO, &prehisle_state::prehisle_sound_io_map);
Z80(config, m_audiocpu, XTAL(4'000'000)); // verified on PCB
m_audiocpu->set_addrmap(AS_PROGRAM, &prehisle_state::sound_program_map);
m_audiocpu->set_addrmap(AS_IO, &prehisle_state::sound_io_map);
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
// the screen parameters are guessed but should be accurate. They
// give a theoretical refresh rate of 59.1856Hz while the measured
// rate on a snk68.c with very similar hardware board is 59.16Hz.
screen.set_raw(XTAL(24'000'000)/4, 384, 0, 256, 264, 16, 240);
screen.set_raw(XTAL(24'000'000) / 4, 384, 0, 256, 264, 16, 240);
screen.set_screen_update(FUNC(prehisle_state::screen_update));
screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_prehisle);
PALETTE(config, m_palette).set_format(palette_device::RGBx_444, 1024);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(4'000'000))); /* verified on pcb */
ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(4'000'000))); // verified on PCB
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
@ -217,10 +466,10 @@ void prehisle_state::prehisle(machine_config &config)
ROM_START( prehisle )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "gt-e2.2h", 0x00000, 0x20000, CRC(7083245a) SHA1(c4f72440e3fb130c8c44224c958bf70c61e8c34e) ) /* red "E" stamped on printed label */
ROM_LOAD16_BYTE( "gt-e3.3h", 0x00001, 0x20000, CRC(6d8cdf58) SHA1(0078e54db899132d2b1244aed0b974173717f82e) ) /* red "E" stamped on printed label */
ROM_LOAD16_BYTE( "gt-e2.2h", 0x00000, 0x20000, CRC(7083245a) SHA1(c4f72440e3fb130c8c44224c958bf70c61e8c34e) ) // red "E" stamped on printed label
ROM_LOAD16_BYTE( "gt-e3.3h", 0x00001, 0x20000, CRC(6d8cdf58) SHA1(0078e54db899132d2b1244aed0b974173717f82e) ) // red "E" stamped on printed label
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "gt1.1", 0x000000, 0x10000, CRC(80a4c093) SHA1(abe59e43259eb80b504bd5541f58cd0e5eb998ab) )
ROM_REGION( 0x008000, "chars", 0 )
@ -236,19 +485,19 @@ ROM_START( prehisle )
ROM_LOAD( "pi8910.k14", 0x000000, 0x80000, CRC(5a101b0b) SHA1(9645ab1f8d058cf2c6c42ccb4ce92a9b5db10c51) )
ROM_LOAD( "gt5.5", 0x080000, 0x20000, CRC(3d3ab273) SHA1(b5706ada9eb2c22fcc0ac8ede2d2ee02ee853191) )
ROM_REGION( 0x10000, "bgtilemap", 0 ) /* background tilemaps */
ROM_REGION( 0x10000, "bgtilemap", 0 )
ROM_LOAD( "gt11.11", 0x000000, 0x10000, CRC(b4f0fcf0) SHA1(b81cc0b6e3e6f5616789bb3e77807dc0ef718a38) )
ROM_REGION( 0x20000, "upd", 0 ) /* ADPCM samples */
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD( "gt4.4", 0x000000, 0x20000, CRC(85dfb9ec) SHA1(78c865e7ccffddb71dcddccab358fa945f521f25) )
ROM_END
ROM_START( prehisleu )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "gt-u2.2h", 0x00000, 0x20000, CRC(a14f49bb) SHA1(6b39a894c3d3862be349a58c748d2d763d5a269c) ) /* red "U" stamped on printed label */
ROM_LOAD16_BYTE( "gt-u3.3h", 0x00001, 0x20000, CRC(f165757e) SHA1(26cf369fed1713deec182852d76fe014ed46d6ac) ) /* red "U" stamped on printed label */
ROM_LOAD16_BYTE( "gt-u2.2h", 0x00000, 0x20000, CRC(a14f49bb) SHA1(6b39a894c3d3862be349a58c748d2d763d5a269c) ) // red "U" stamped on printed label
ROM_LOAD16_BYTE( "gt-u3.3h", 0x00001, 0x20000, CRC(f165757e) SHA1(26cf369fed1713deec182852d76fe014ed46d6ac) ) // red "U" stamped on printed label
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "gt1.1", 0x000000, 0x10000, CRC(80a4c093) SHA1(abe59e43259eb80b504bd5541f58cd0e5eb998ab) )
ROM_REGION( 0x008000, "chars", 0 )
@ -264,19 +513,19 @@ ROM_START( prehisleu )
ROM_LOAD( "pi8910.k14", 0x000000, 0x80000, CRC(5a101b0b) SHA1(9645ab1f8d058cf2c6c42ccb4ce92a9b5db10c51) )
ROM_LOAD( "gt5.5", 0x080000, 0x20000, CRC(3d3ab273) SHA1(b5706ada9eb2c22fcc0ac8ede2d2ee02ee853191) )
ROM_REGION( 0x10000, "bgtilemap", 0 ) /* background tilemaps */
ROM_REGION( 0x10000, "bgtilemap", 0 )
ROM_LOAD( "gt11.11", 0x000000, 0x10000, CRC(b4f0fcf0) SHA1(b81cc0b6e3e6f5616789bb3e77807dc0ef718a38) )
ROM_REGION( 0x20000, "upd", 0 ) /* ADPCM samples */
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD( "gt4.4", 0x000000, 0x20000, CRC(85dfb9ec) SHA1(78c865e7ccffddb71dcddccab358fa945f521f25) )
ROM_END
ROM_START( prehislek )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "gt-k2.2h", 0x00000, 0x20000, CRC(f2d3544d) SHA1(28d41a81ac12ef951610ba0aa70945c069d69d75) ) /* red "K" stamped on printed label */
ROM_LOAD16_BYTE( "gt-k3.3h", 0x00001, 0x20000, CRC(ebf7439b) SHA1(76fcad47bc8ae371ecf265fd378e2c4856d39c7f) ) /* red "K" stamped on printed label */
ROM_LOAD16_BYTE( "gt-k2.2h", 0x00000, 0x20000, CRC(f2d3544d) SHA1(28d41a81ac12ef951610ba0aa70945c069d69d75) ) // red "K" stamped on printed label
ROM_LOAD16_BYTE( "gt-k3.3h", 0x00001, 0x20000, CRC(ebf7439b) SHA1(76fcad47bc8ae371ecf265fd378e2c4856d39c7f) ) // red "K" stamped on printed label
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "gt1.1", 0x000000, 0x10000, CRC(80a4c093) SHA1(abe59e43259eb80b504bd5541f58cd0e5eb998ab) )
ROM_REGION( 0x008000, "chars", 0 )
@ -292,19 +541,19 @@ ROM_START( prehislek )
ROM_LOAD( "pi8910.k14", 0x000000, 0x80000, CRC(5a101b0b) SHA1(9645ab1f8d058cf2c6c42ccb4ce92a9b5db10c51) )
ROM_LOAD( "gt5.5", 0x080000, 0x20000, CRC(3d3ab273) SHA1(b5706ada9eb2c22fcc0ac8ede2d2ee02ee853191) )
ROM_REGION( 0x10000, "bgtilemap", 0 ) /* background tilemaps */
ROM_REGION( 0x10000, "bgtilemap", 0 )
ROM_LOAD( "gt11.11", 0x000000, 0x10000, CRC(b4f0fcf0) SHA1(b81cc0b6e3e6f5616789bb3e77807dc0ef718a38) )
ROM_REGION( 0x20000, "upd", 0 ) /* ADPCM samples */
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD( "gt4.4", 0x000000, 0x20000, CRC(85dfb9ec) SHA1(78c865e7ccffddb71dcddccab358fa945f521f25) )
ROM_END
ROM_START( gensitou )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "gt-j2.2h", 0x00000, 0x20000, CRC(a2da0b6b) SHA1(d102118f83b96094fd4ea4b3468713c4946c949d) ) /* red "J" stamped on printed label */
ROM_LOAD16_BYTE( "gt-j3.3h", 0x00001, 0x20000, CRC(c1a0ae8e) SHA1(2c9643abfd71edf8612e63d69cea4fbc19aad19d) ) /* red "J" stamped on printed label */
ROM_LOAD16_BYTE( "gt-j2.2h", 0x00000, 0x20000, CRC(a2da0b6b) SHA1(d102118f83b96094fd4ea4b3468713c4946c949d) ) // red "J" stamped on printed label
ROM_LOAD16_BYTE( "gt-j3.3h", 0x00001, 0x20000, CRC(c1a0ae8e) SHA1(2c9643abfd71edf8612e63d69cea4fbc19aad19d) ) // red "J" stamped on printed label
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "gt1.1", 0x000000, 0x10000, CRC(80a4c093) SHA1(abe59e43259eb80b504bd5541f58cd0e5eb998ab) )
ROM_REGION( 0x008000, "chars", 0 )
@ -320,10 +569,10 @@ ROM_START( gensitou )
ROM_LOAD( "pi8910.k14", 0x000000, 0x80000, CRC(5a101b0b) SHA1(9645ab1f8d058cf2c6c42ccb4ce92a9b5db10c51) )
ROM_LOAD( "gt5.5", 0x080000, 0x20000, CRC(3d3ab273) SHA1(b5706ada9eb2c22fcc0ac8ede2d2ee02ee853191) )
ROM_REGION( 0x10000, "bgtilemap", 0 ) /* background tilemaps */
ROM_REGION( 0x10000, "bgtilemap", 0 )
ROM_LOAD( "gt11.11", 0x000000, 0x10000, CRC(b4f0fcf0) SHA1(b81cc0b6e3e6f5616789bb3e77807dc0ef718a38) )
ROM_REGION( 0x20000, "upd", 0 ) /* ADPCM samples */
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD( "gt4.4", 0x000000, 0x20000, CRC(85dfb9ec) SHA1(78c865e7ccffddb71dcddccab358fa945f521f25) )
ROM_END
@ -335,7 +584,7 @@ ROM_START( prehisleb )
ROM_LOAD16_BYTE( "u_j2.bin", 0x20000, 0x10000, CRC(7b12501d) SHA1(678d32f70d86807449ffe617c7c6e257d308d8af) )
ROM_LOAD16_BYTE( "u_j3.bin", 0x20001, 0x10000, CRC(2a86f7c4) SHA1(5bca393f6edfcd41e1803ea1062497752fd400a9) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "u_e12.bin", 0x00000, 0x10000, CRC(80a4c093) SHA1(abe59e43259eb80b504bd5541f58cd0e5eb998ab) )
ROM_REGION( 0x008000, "chars", 0 )
@ -365,14 +614,17 @@ ROM_START( prehisleb )
ROM_LOAD( "u_j12.bin" ,0x80000, 0x10000, CRC(5ba5bbed) SHA1(6af3503e0277a926815afb973d67c4ad7a0427d1) )
ROM_LOAD( "u_j13.bin", 0x90000, 0x10000, CRC(007dee47) SHA1(e45ce52a471783864cc2704b3b0462c32ddf7e52) ) // modified by bootleggers
ROM_REGION( 0x10000, "bgtilemap", 0 ) /* background tilemaps */
ROM_REGION( 0x10000, "bgtilemap", 0 )
ROM_LOAD( "l_a6.bin", 0x00000, 0x10000, CRC(e2b9a44b) SHA1(4a1be44c19a724727218bbdc120bafbbe095747a) ) // modified by bootleggers
ROM_REGION( 0x20000, "upd", 0 ) /* ADPCM samples */
ROM_REGION( 0x20000, "upd", 0 )
ROM_LOAD( "u_f14.bin", 0x00000, 0x10000, CRC(2fb32933) SHA1(2cea86dfe9a6a0b2de34c3c952c625ad30a7ebea) )
ROM_LOAD( "u_j14.bin", 0x10000, 0x10000, CRC(32d5f7c9) SHA1(23abc82f83296c62320a047b9f63032a7f07bf6d) )
ROM_END
} // anonymous namespace
/******************************************************************************/
//原始島(Shared Title GFX for Japan and Korea set, JP: げんしとう-Genshitō; KR: 원시도-Wonsido)/Prehistoric Isle in 1930(English)

View File

@ -1,80 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
#ifndef MAME_SNK_PREHISLE_H
#define MAME_SNK_PREHISLE_H
#pragma once
#include "machine/gen_latch.h"
#include "sound/upd7759.h"
#include "emupal.h"
#include "tilemap.h"
class prehisle_state : public driver_device
{
public:
prehisle_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_tx_vram(*this, "tx_vram"),
m_spriteram(*this, "spriteram"),
m_fg_vram(*this, "fg_vram"),
m_tilemap_rom(*this, "bgtilemap"),
m_io_p1(*this, "P1"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_upd7759(*this, "upd"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch")
{ }
void prehisle(machine_config &config);
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
void soundcmd_w(u16 data);
void fg_vram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void tx_vram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask);
void fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask);
void bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask);
void bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask);
void upd_port_w(u8 data);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_tx_tile_info);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void prehisle_map(address_map &map);
void prehisle_sound_io_map(address_map &map);
void prehisle_sound_map(address_map &map);
required_shared_ptr<uint16_t> m_tx_vram;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_fg_vram;
required_region_ptr<uint8_t> m_tilemap_rom;
required_ioport m_io_p1;
uint8_t m_invert_controls = 0;
uint16_t m_bg_scrollx = 0;
uint16_t m_bg_scrolly = 0;
uint16_t m_fg_scrollx = 0;
uint16_t m_fg_scrolly = 0;
tilemap_t *m_bg_tilemap = nullptr;
tilemap_t *m_fg_tilemap = nullptr;
tilemap_t *m_tx_tilemap = nullptr;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<upd7759_device> m_upd7759;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
};
#endif // MAME_SNK_PREHISLE_H

View File

@ -1,190 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
/***************************************************************************
Prehistoric Isle video routines
Emulation by Bryan McPhail, mish@tendril.co.uk
***************************************************************************/
#include "emu.h"
#include "prehisle.h"
#include "screen.h"
void prehisle_state::fg_vram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_vram[offset]);
m_fg_tilemap->mark_tile_dirty(offset);
}
void prehisle_state::tx_vram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_tx_vram[offset]);
m_tx_tilemap->mark_tile_dirty(offset);
}
void prehisle_state::fg_scrolly_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_scrolly);
m_fg_tilemap->set_scrolly(0, m_fg_scrolly);
}
void prehisle_state::fg_scrollx_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_fg_scrollx);
m_fg_tilemap->set_scrollx(0, m_fg_scrollx);
}
void prehisle_state::bg_scrolly_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_bg_scrolly);
m_bg_tilemap->set_scrolly(0, m_bg_scrolly);
}
void prehisle_state::bg_scrollx_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_bg_scrollx);
m_bg_tilemap->set_scrollx(0, m_bg_scrollx);
}
/* tile layout
0 xxxx.... color
0 ....x... flip x
0 .....xxx gfx code high bits
1 xxxxxxxx gfx code low bits
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_bg_tile_info)
{
int const offs = tile_index * 2;
int const attr = m_tilemap_rom[offs + 1] + (m_tilemap_rom[offs] << 8);
int const code = attr & 0x7ff;
int const color = attr >> 12;
int const flags = (attr & 0x800) ? TILE_FLIPX : 0;
tileinfo.set(1, code, color, flags);
}
/* tile layout
0 xxxx.... ........ color
0 ....x... ........ flip y
0 .....xxx xxxxxxxx gfx code
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info)
{
int const attr = m_fg_vram[tile_index];
int const code = attr & 0x7ff;
int const color = attr >> 12;
int const flags = (attr & 0x800) ? TILE_FLIPY : 0;
tileinfo.set(2, code, color, flags);
}
/* tile layout
0 xxxx.... ........ color
0 ....xxxx xxxxxxxx gfx code
*/
TILE_GET_INFO_MEMBER(prehisle_state::get_tx_tile_info)
{
int const attr = m_tx_vram[tile_index];
int const code = attr & 0xfff;
int const color = attr >> 12;
tileinfo.set(0, code, color, 0);
}
void prehisle_state::video_start()
{
// ROM-based background layer
m_bg_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_bg_tile_info)),
TILEMAP_SCAN_COLS, // scan order
16, 16, // tile size
1024, 32); // tilemap size
// RAM-based foreground layer (overlays most sprites)
m_fg_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_fg_tile_info)),
TILEMAP_SCAN_COLS, // scan order
16, 16, // tile size
256, 32); // tilemap size
m_fg_tilemap->set_transparent_pen(15);
// text layer
m_tx_tilemap = &machine().tilemap().create(
*m_gfxdecode,
tilemap_get_info_delegate(*this, FUNC(prehisle_state::get_tx_tile_info)),
TILEMAP_SCAN_ROWS, // scan order
8, 8, // tile size
32, 32); // tilemap size
m_tx_tilemap->set_transparent_pen(15);
/* register for saving */
save_item(NAME(m_bg_scrollx));
save_item(NAME(m_bg_scrolly));
save_item(NAME(m_fg_scrollx));
save_item(NAME(m_fg_scrolly));
}
/* sprite layout
0 .......x xxxxxxxx y, other bits unused?
1 .......x xxxxxxxx x, other bits unused?
2 x....... ........ flip y
2 .x...... ........ flip x
2 ..x..... ........ ?
2 ...xxxxx xxxxxxxx gfx code
3 xxxx.... ........ color+priority, other bits unknown
*/
void prehisle_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint16_t const *const spriteram16 = m_spriteram;
for (int offs = 1024 - 4; offs >= 0; offs -= 4)
{
uint16_t const attr = spriteram16[offs + 2];
uint16_t const code = attr & 0x1fff;
uint16_t const color = spriteram16[offs + 3] >> 12;
uint32_t const priority = GFX_PMASK_4 | ((color < 0x4) ? 0 : GFX_PMASK_2); // correct?
bool flipx = attr & 0x4000;
bool flipy = attr & 0x8000;
int16_t sx = spriteram16[offs + 1] & 0x1ff;
int16_t sy = spriteram16[offs] & 0x1ff;
// coordinates are 9-bit signed
if (sx & 0x100) sx = -0x100 + (sx & 0xff);
if (sy & 0x100) sy = -0x100 + (sy & 0xff);
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
flipy = !flipy;
}
m_gfxdecode->gfx(3)->prio_transpen(
bitmap, cliprect,
code, color,
flipx, flipy,
sx, sy,
screen.priority(), priority,
15); // transparent pen
}
}
uint32_t prehisle_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
draw_sprites(screen, bitmap, cliprect);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,124 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, Acho A. Tang, Nicola Salmoria
#ifndef MAME_SNK_SNK68K_H
#define MAME_SNK_SNK68K_H
#include "alpha68k_palette.h"
#include "snk68_spr.h"
#include "machine/gen_latch.h"
#include "sound/upd7759.h"
#include "screen.h"
#include "tilemap.h"
class snk68_state : public driver_device
{
public:
snk68_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_upd7759(*this, "upd"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_sprites(*this, "sprites"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
m_fg_videoram(*this, "fg_videoram"),
m_spriteram(*this, "spriteram"),
m_p1_io(*this, "P1"),
m_p2_io(*this, "P2"),
m_system_io(*this, "SYSTEM")
{
}
void streetsm(machine_config &config);
void pow(machine_config &config);
void powbl(machine_config &config);
void init_powbl();
protected:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
optional_device<upd7759_device> m_upd7759;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<snk68_spr_device> m_sprites;
required_device<alpha68k_palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<uint16_t> m_fg_videoram;
required_shared_ptr<uint16_t> m_spriteram;
optional_ioport m_p1_io;
optional_ioport m_p2_io;
optional_ioport m_system_io;
bool m_sprite_flip_axis;
tilemap_t *m_fg_tilemap;
// common
void sound_w(uint8_t data);
void D7759_write_port_0_w(uint8_t data);
virtual void video_start() override;
void common_video_start();
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void tile_callback_notpow(int &tile, int& fx, int& fy, int& region);
void sound_io_map(address_map &map);
void sound_map(address_map &map);
private:
uint32_t m_fg_tile_offset;
// pow and streetsm
uint16_t fg_videoram_r(offs_t offset);
void fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void flipscreen_w(uint8_t data);
TILE_GET_INFO_MEMBER(get_tile_info);
void tile_callback_pow(int &tile, int& fx, int& fy, int& region);
void pow_map(address_map &map);
void powbl_sound_io_map(address_map &map);
};
class searchar_state : public snk68_state
{
public:
searchar_state(const machine_config &mconfig, device_type type, const char *tag) :
snk68_state(mconfig, type, tag),
m_rotary_io(*this, "ROT%u", 1U)
{
}
void searchar(machine_config &config);
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
optional_ioport_array<2> m_rotary_io;
uint8_t m_invert_controls = 0;
// searchar and ikari3
void fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void flipscreen_w(uint8_t data);
uint16_t rotary_1_r();
uint16_t rotary_2_r();
uint16_t rotary_lsb_r();
TILE_GET_INFO_MEMBER(get_tile_info);
void searchar_map(address_map &map);
};
#endif // MAME_SNK_SNK68K_H

View File

@ -1,138 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, Acho A. Tang, Nicola Salmoria
/***************************************************************************
SNK 68000 video routines
Notes:
Search & Rescue uses Y flip on sprites only.
Street Smart uses X flip on sprites only.
Seems to be controlled in same byte as flipscreen.
Emulation by Bryan McPhail, mish@tendril.co.uk
***************************************************************************/
#include "emu.h"
#include "snk68.h"
/***************************************************************************
Callbacks for the TileMap code
***************************************************************************/
TILE_GET_INFO_MEMBER(snk68_state::get_tile_info)
{
int tile = m_fg_tile_offset + (m_fg_videoram[2*tile_index] & 0xff);
int color = m_fg_videoram[2*tile_index+1] & 0x07;
tileinfo.set(0, tile, color, 0);
}
TILE_GET_INFO_MEMBER(searchar_state::get_tile_info)
{
int data = m_fg_videoram[2*tile_index];
int tile = data & 0x7ff;
int color = (data & 0x7000) >> 12;
// used in the ikari3 intro
int flags = (data & 0x8000) ? TILE_FORCE_LAYER0 : 0;
tileinfo.set(0, tile, color, flags);
}
/***************************************************************************
Start the video hardware emulation.
***************************************************************************/
void snk68_state::common_video_start()
{
m_fg_tilemap->set_transparent_pen(0);
save_item(NAME(m_sprite_flip_axis));
}
void snk68_state::video_start()
{
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk68_state::get_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tile_offset = 0;
common_video_start();
save_item(NAME(m_fg_tile_offset));
}
void searchar_state::video_start()
{
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(searchar_state::get_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
snk68_state::common_video_start();
}
/***************************************************************************
Memory handlers
***************************************************************************/
uint16_t snk68_state::fg_videoram_r(offs_t offset)
{
// RAM is only 8-bit
return m_fg_videoram[offset] | 0xff00;
}
void snk68_state::fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
data |= 0xff00;
COMBINE_DATA(&m_fg_videoram[offset]);
m_fg_tilemap->mark_tile_dirty(offset >> 1);
}
void searchar_state::fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
// RAM is full 16-bit, though only half of it is used by the hardware
COMBINE_DATA(&m_fg_videoram[offset]);
m_fg_tilemap->mark_tile_dirty(offset >> 1);
}
void snk68_state::flipscreen_w(uint8_t data)
{
flip_screen_set(BIT(data, 3));
m_sprites->set_flip(BIT(data, 3));
m_sprite_flip_axis = BIT(data, 2); // for streetsm? though might not be present on this board
if (m_fg_tile_offset != ((data & 0x70) << 4))
{
m_fg_tile_offset = (data & 0x70) << 4;
m_fg_tilemap->mark_all_dirty();
}
}
void searchar_state::flipscreen_w(uint8_t data)
{
flip_screen_set(BIT(data, 3));
m_sprites->set_flip(BIT(data, 3));
m_sprite_flip_axis = BIT(data, 2);
}
/***************************************************************************
Display refresh
***************************************************************************/
uint32_t snk68_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->get_backdrop_pen(), cliprect);
m_sprites->draw_sprites_all(bitmap, cliprect);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}