mirror of
https://github.com/holub/mame
synced 2025-10-07 01:16:22 +03:00
igs017.cpp: Emulated the protection in iqblocka, iqblockf, genius6 [Luca Elia]
Machines promoted to working ---------------------------- Genius 6 (V110F) [Luca Elia, Fabrice Arzeno, The Dumping Union] Clones promoted to working -------------------------- Shuzi Leyuan (V127M, Gambling) [Luca Elia, Guru, Dyq, Bnathan] IQ Block (V113FR, Gambling) [Luca Elia, Guru, Dyq, Bnathan]
This commit is contained in:
parent
0f655b0eb7
commit
a7c50ae835
File diff suppressed because it is too large
Load Diff
@ -346,8 +346,8 @@ MACHINE_CONFIG_START(igs_m027_state::igs_majhong)
|
|||||||
// MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
|
// MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
||||||
|
MCFG_IGS017_IGS031_REVERSE_TEXT_BITS
|
||||||
MCFG_GFX_PALETTE("palette")
|
MCFG_GFX_PALETTE("palette")
|
||||||
MCFG_REVERSE_TEXT_BITS
|
|
||||||
|
|
||||||
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
||||||
|
|
||||||
@ -380,8 +380,8 @@ MACHINE_CONFIG_START(igs_m027_state::amazonia)
|
|||||||
// MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
|
// MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
||||||
|
MCFG_IGS017_IGS031_REVERSE_TEXT_BITS
|
||||||
MCFG_GFX_PALETTE("palette")
|
MCFG_GFX_PALETTE("palette")
|
||||||
MCFG_REVERSE_TEXT_BITS
|
|
||||||
|
|
||||||
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
||||||
|
|
||||||
|
@ -9,8 +9,6 @@ Driver by Nicola Salmoria and Ernesto Corvi
|
|||||||
TODO:
|
TODO:
|
||||||
- Who generates IRQ and NMI? How many should there be per frame?
|
- Who generates IRQ and NMI? How many should there be per frame?
|
||||||
|
|
||||||
- Sound chip is a UM3567. Is this compatible to something already in MAME? yes, YM2413
|
|
||||||
|
|
||||||
- Coin 2 doesn't work? DIP switch setting?
|
- Coin 2 doesn't work? DIP switch setting?
|
||||||
|
|
||||||
- Protection:
|
- Protection:
|
||||||
@ -271,19 +269,19 @@ static INPUT_PORTS_START( grndtour )
|
|||||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
// in Level test mode the following select the start level, do they have any effect during normal gameplay?
|
// in Level test mode the following select the start level, do they have any effect during normal gameplay?
|
||||||
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x02, 0x02, "Level Test +1" )
|
||||||
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x04, 0x04, "Level Test +2" )
|
||||||
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x08, 0x08, "Level Test +4" )
|
||||||
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x10, 0x10, "Level Test +8" )
|
||||||
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
|
PORT_DIPNAME( 0x20, 0x20, "Level Test +16" )
|
||||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0xc0, 0xc0, "Test Mode" )
|
PORT_DIPNAME( 0xc0, 0xc0, "Test Mode" )
|
||||||
@ -384,45 +382,23 @@ MACHINE_CONFIG_END
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IQ Block
|
IQ-Block
|
||||||
IGS, 1996
|
IGS 1993
|
||||||
|
|
||||||
PCB Layout
|
PCB 0036-5
|
||||||
----------
|
SW1 SW2
|
||||||
|
|
||||||
IGS PCB N0- 0131-4
|
12MHz W2466 8255
|
||||||
|---------------------------------------|
|
|
||||||
|uPD1242H VOL U3567 3.579545MHz|
|
IGS002 U24.5
|
||||||
| AR17961 |
|
U25.4 AMT001 6116-45
|
||||||
| HD64180RP8 |
|
6116-45
|
||||||
| 16MHz BATTERY|
|
Z80 U26.3
|
||||||
| |
|
U27.2
|
||||||
| SPEECH.U17 |
|
U7.V5 U28.1
|
||||||
| |
|
U8.6
|
||||||
|J 6264 |
|
W2466
|
||||||
|A |
|
UMC UM3567
|
||||||
|M 8255 V.U18 |
|
|
||||||
|M |
|
|
||||||
|A |
|
|
||||||
| |
|
|
||||||
| |
|
|
||||||
| |-------| |
|
|
||||||
| | | |
|
|
||||||
| CG.U7 |IGS017 | |
|
|
||||||
| | | |
|
|
||||||
| TEXT.U8 |-------| PAL |
|
|
||||||
| 22MHz 61256 |
|
|
||||||
| DSW1 DSW2 DSW3 |
|
|
||||||
|---------------------------------------|
|
|
||||||
Notes:
|
|
||||||
HD64180RP8 - Hitachi HD64180 CPU. Clocks 16MHz (pins 2 & 3), 8MHz (pin 64)
|
|
||||||
61256 - 32k x8 SRAM (DIP28)
|
|
||||||
6264 - 8k x8 SRAM (DIP28)
|
|
||||||
IGS017 - Custom IGS IC (QFP208)
|
|
||||||
AR17961 - == Oki M6295 (QFP44). Clock 1.000MHz [16/16]. pin 7 = high
|
|
||||||
U3567 - == YM2413. Clock 3.579545MHz
|
|
||||||
VSync - 60Hz
|
|
||||||
HSync - 15.31kHz
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ROM_START( iqblock )
|
ROM_START( iqblock )
|
||||||
@ -538,5 +514,5 @@ DRIVER_INIT_MEMBER(iqblock_state,grndtour)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
GAME( 1993, iqblock, 0, iqblock, iqblock, iqblock_state, iqblock, ROT0, "IGS", "IQ-Block", MACHINE_SUPPORTS_SAVE )
|
GAME( 1993, iqblock, 0, iqblock, iqblock, iqblock_state, iqblock, ROT0, "IGS", "IQ-Block (V100U)", MACHINE_SUPPORTS_SAVE )
|
||||||
GAME( 1993, grndtour, 0, iqblock, grndtour,iqblock_state, grndtour, ROT0, "IGS", "Grand Tour", MACHINE_SUPPORTS_SAVE )
|
GAME( 1993, grndtour, 0, iqblock, grndtour,iqblock_state, grndtour, ROT0, "IGS", "Grand Tour (V100U)", MACHINE_SUPPORTS_SAVE )
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
// license:BSD-3-Clause
|
// license:BSD-3-Clause
|
||||||
// copyright-holders:Pierpaolo Prazzoli, Luca Elia
|
// copyright-holders:Pierpaolo Prazzoli, Luca Elia
|
||||||
|
|
||||||
/* IGS017 / IGS031 video device */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
IGS017 / IGS031 video device
|
||||||
|
|
||||||
what's the difference between IGS017 and IGS031? encryption?
|
what's the difference between IGS017 and IGS031? encryption?
|
||||||
|
|
||||||
all the known IGS017 / IGS031 games use same memory map, is the IGS017 / IGS031
|
all the known IGS017 / IGS031 games use same memory map, is the IGS017 / IGS031
|
||||||
@ -12,13 +11,9 @@ providing the interface to the 8255, or is it coincidence?
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "igs017_igs031.h"
|
#include "igs017_igs031.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void igs017_igs031_device::map(address_map &map)
|
void igs017_igs031_device::map(address_map &map)
|
||||||
{
|
{
|
||||||
map(0x1000, 0x17ff).ram().share("spriteram");
|
map(0x1000, 0x17ff).ram().share("spriteram");
|
||||||
@ -42,8 +37,7 @@ READ8_MEMBER(igs017_igs031_device::i8255_r)
|
|||||||
if (m_i8255)
|
if (m_i8255)
|
||||||
return m_i8255->read(space, offset);
|
return m_i8255->read(space, offset);
|
||||||
|
|
||||||
logerror("igs017_igs031_device::i8255_r with no 8255 device %02x\n", offset);
|
logerror("igs017_igs031_device::i8255_r(%02x) with no 8255 device\n", offset);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,15 +90,12 @@ uint16_t igs017_igs031_device::palette_callback_straight(uint16_t bgr)
|
|||||||
return bgr;
|
return bgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void igs017_igs031_device::device_start()
|
void igs017_igs031_device::device_start()
|
||||||
{
|
{
|
||||||
m_palette_scramble_cb.bind_relative_to(*owner());
|
m_palette_scramble_cb.bind_relative_to(*owner());
|
||||||
|
|
||||||
m_fg_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(igs017_igs031_device::get_fg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
|
m_fg_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(igs017_igs031_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
|
||||||
m_bg_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(igs017_igs031_device::get_bg_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
|
m_bg_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(igs017_igs031_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8,8, 64,32);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_fg_tilemap->set_transparent_pen(0xf);
|
m_fg_tilemap->set_transparent_pen(0xf);
|
||||||
m_bg_tilemap->set_transparent_pen(0xf);
|
m_bg_tilemap->set_transparent_pen(0xf);
|
||||||
@ -112,22 +103,19 @@ void igs017_igs031_device::device_start()
|
|||||||
m_toggle = 0;
|
m_toggle = 0;
|
||||||
m_debug_addr = 0;
|
m_debug_addr = 0;
|
||||||
m_debug_width = 512;
|
m_debug_width = 512;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void igs017_igs031_device::video_start()
|
void igs017_igs031_device::video_start()
|
||||||
{
|
{
|
||||||
// make sure thie happens AFTER driver init, or things won't work
|
// make sure this happens AFTER driver init, or things won't work
|
||||||
expand_sprites();
|
expand_sprites();
|
||||||
|
|
||||||
if (m_revbits)
|
if (m_revbits)
|
||||||
{
|
{
|
||||||
uint8_t *rom = memregion("^tilemaps")->base();
|
uint8_t *rom = memregion("^tilemaps")->base();
|
||||||
int size = memregion("^tilemaps")->bytes();
|
int size = memregion("^tilemaps")->bytes();
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < size ; i++)
|
for (int i = 0; i < size ; i++)
|
||||||
{
|
{
|
||||||
rom[i] = bitswap<8>(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
rom[i] = bitswap<8>(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
||||||
// rom[i^1] = bitswap<8>(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
// rom[i^1] = bitswap<8>(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
||||||
@ -135,7 +123,6 @@ void igs017_igs031_device::video_start()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void igs017_igs031_device::device_reset()
|
void igs017_igs031_device::device_reset()
|
||||||
{
|
{
|
||||||
m_video_disable = 0;
|
m_video_disable = 0;
|
||||||
@ -153,7 +140,6 @@ WRITE8_MEMBER(igs017_igs031_device::write)
|
|||||||
space_w(offset, data);
|
space_w(offset, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void igs017_igs031_device::space_w(int offset, uint8_t data)
|
void igs017_igs031_device::space_w(int offset, uint8_t data)
|
||||||
{
|
{
|
||||||
space().write_byte(offset, data);
|
space().write_byte(offset, data);
|
||||||
@ -217,20 +203,17 @@ WRITE8_MEMBER(igs017_igs031_device::bg_w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000 (little endian!).
|
// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000 (little endian!).
|
||||||
// This routine expands each word into three bytes.
|
// This routine expands each word into three bytes.
|
||||||
void igs017_igs031_device::expand_sprites()
|
void igs017_igs031_device::expand_sprites()
|
||||||
{
|
{
|
||||||
uint8_t *rom = memregion("^sprites")->base();
|
uint8_t *rom = memregion("^sprites")->base();
|
||||||
int size = memregion("^sprites")->bytes();
|
int size = memregion("^sprites")->bytes();
|
||||||
int i;
|
|
||||||
|
|
||||||
m_sprites_gfx_size = size / 2 * 3;
|
m_sprites_gfx_size = size / 2 * 3;
|
||||||
m_sprites_gfx = std::make_unique<uint8_t[]>(m_sprites_gfx_size);
|
m_sprites_gfx = std::make_unique<uint8_t[]>(m_sprites_gfx_size);
|
||||||
|
|
||||||
for (i = 0; i < size / 2 ; i++)
|
for (int i = 0; i < size / 2 ; i++)
|
||||||
{
|
{
|
||||||
uint16_t pens = (rom[i*2+1] << 8) | rom[i*2];
|
uint16_t pens = (rom[i*2+1] << 8) | rom[i*2];
|
||||||
|
|
||||||
@ -240,7 +223,6 @@ void igs017_igs031_device::expand_sprites()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
Sprites Format
|
Sprites Format
|
||||||
|
|
||||||
@ -399,36 +381,16 @@ uint32_t igs017_igs031_device::screen_update_igs017(screen_device &screen, bitma
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
WRITE16_MEMBER(igs017_igs031_device::irq_enable_w)
|
|
||||||
{
|
|
||||||
if (ACCESSING_BITS_0_7)
|
|
||||||
m_irq_enable = data & 1;
|
|
||||||
|
|
||||||
if (data != 0 && data != 1 && data != 0xff)
|
|
||||||
logerror("%s: irq_enable = %04x\n", machine().describe_context(), data);
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITE16_MEMBER(igs017_igs031_device::nmi_enable_w)
|
|
||||||
{
|
|
||||||
if (ACCESSING_BITS_0_7)
|
|
||||||
m_nmi_enable = data & 1;
|
|
||||||
|
|
||||||
if (data != 0 && data != 1 && data != 0xff)
|
|
||||||
logerror("%s: nmi_enable = %04x\n", machine().describe_context(), data);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WRITE8_MEMBER(igs017_igs031_device::nmi_enable_w)
|
WRITE8_MEMBER(igs017_igs031_device::nmi_enable_w)
|
||||||
{
|
{
|
||||||
m_nmi_enable = data & 1;
|
m_nmi_enable = data & 1;
|
||||||
if (data & (~1))
|
if (data != 0 && data != 1 && data != 0xff)
|
||||||
logerror("%s: nmi_enable = %02x\n", machine().describe_context(), data);
|
logerror("%s: nmi_enable = %02x\n", machine().describe_context(), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER(igs017_igs031_device::irq_enable_w)
|
WRITE8_MEMBER(igs017_igs031_device::irq_enable_w)
|
||||||
{
|
{
|
||||||
m_irq_enable = data & 1;
|
m_irq_enable = data & 1;
|
||||||
if (data & (~1))
|
if (data != 0 && data != 1 && data != 0xff)
|
||||||
logerror("%s: irq_enable = %02x\n", machine().describe_context(), data);
|
logerror("%s: irq_enable = %02x\n", machine().describe_context(), data);
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
typedef device_delegate<uint16_t (uint16_t)> igs017_igs031_palette_scramble_delegate;
|
typedef device_delegate<uint16_t (uint16_t)> igs017_igs031_palette_scramble_delegate;
|
||||||
|
|
||||||
#define MCFG_PALETTE_SCRAMBLE_CB( _class, _method) \
|
#define MCFG_IGS017_IGS031_PALETTE_SCRAMBLE_CB( _class, _method) \
|
||||||
downcast<igs017_igs031_device &>(*device).set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
|
downcast<igs017_igs031_device &>(*device).set_palette_scramble_cb(igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
|
||||||
|
|
||||||
#define MCFG_REVERSE_TEXT_BITS \
|
#define MCFG_IGS017_IGS031_REVERSE_TEXT_BITS \
|
||||||
downcast<igs017_igs031_device &>(*device).set_text_reverse_bits();
|
downcast<igs017_igs031_device &>(*device).set_text_reverse_bits();
|
||||||
|
|
||||||
class igs017_igs031_device : public device_t,
|
class igs017_igs031_device : public device_t,
|
||||||
@ -23,7 +23,6 @@ class igs017_igs031_device : public device_t,
|
|||||||
public:
|
public:
|
||||||
igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
|
|
||||||
|
|
||||||
template <typename Object> void set_palette_scramble_cb(Object &&cb) { m_palette_scramble_cb = std::forward<Object>(cb); }
|
template <typename Object> void set_palette_scramble_cb(Object &&cb) { m_palette_scramble_cb = std::forward<Object>(cb); }
|
||||||
|
|
||||||
void set_text_reverse_bits()
|
void set_text_reverse_bits()
|
||||||
|
Loading…
Reference in New Issue
Block a user