mirror of
https://github.com/holub/mame
synced 2025-07-02 16:49:22 +03:00
-igs/igs_m027.cpp: Hooked up mahjong controls for lhdmg.
-igs/igs_fear.cpp, igs/pgmcrypt.cpp: Use uploaded XOR tables where available.
This commit is contained in:
parent
16bd6bc9db
commit
5ad001597f
@ -21,10 +21,13 @@
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#define LOG_DEBUG (1U << 1)
|
||||
#define VERBOSE (0)
|
||||
#include "logmacro.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class igs_fear_state : public driver_device
|
||||
@ -32,33 +35,35 @@ class igs_fear_state : public driver_device
|
||||
public:
|
||||
igs_fear_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_external_rom(*this, "user1"),
|
||||
m_gfxrom(*this, "gfx1"),
|
||||
m_sram(*this, "sram"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_xa(*this, "xa"),
|
||||
m_sram(*this, "sram"),
|
||||
m_ics(*this, "ics"),
|
||||
m_screen(*this, "screen"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_palette(*this, "palette"),
|
||||
m_gfxrom(*this, "gfx1"),
|
||||
m_ticket(*this, "ticket"),
|
||||
m_io_dsw(*this, "DSW%u", 1U),
|
||||
m_io_trackball(*this, "AN%u", 0)
|
||||
{ }
|
||||
|
||||
void igs_fear(machine_config &config);
|
||||
void igs_fear(machine_config &config) ATTR_COLD;
|
||||
void igs_fear_xor(machine_config &config) ATTR_COLD;
|
||||
|
||||
void init_igs_fear();
|
||||
void init_igs_icescape();
|
||||
void init_igs_superkds();
|
||||
void init_igs_fear() ATTR_COLD;
|
||||
void init_igs_icescape() ATTR_COLD;
|
||||
void init_igs_superkds() ATTR_COLD;
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void machine_start() override ATTR_COLD;
|
||||
virtual void machine_reset() override ATTR_COLD;
|
||||
virtual void video_start() override ATTR_COLD;
|
||||
|
||||
private:
|
||||
void main_map(address_map &map);
|
||||
void main_map(address_map &map) ATTR_COLD;
|
||||
void main_xor_map(address_map &map) ATTR_COLD;
|
||||
|
||||
void sound_irq(int state);
|
||||
void vblank_irq(int state);
|
||||
@ -67,6 +72,10 @@ private:
|
||||
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
u32 external_rom_r(offs_t offset);
|
||||
|
||||
void xor_table_w(offs_t offset, u8 data);
|
||||
|
||||
u32 igs027_gpio_r(offs_t offset, u32 mem_mask);
|
||||
void igs027_gpio_w(offs_t offset, u32 data, u32 mem_mask);
|
||||
|
||||
@ -93,6 +102,27 @@ private:
|
||||
|
||||
u16 xa_wait_r(offs_t offset);
|
||||
|
||||
required_region_ptr<u32> m_external_rom;
|
||||
required_region_ptr<u8> m_gfxrom;
|
||||
required_shared_ptr<uint32_t> m_sram;
|
||||
required_shared_ptr<u32> m_videoram;
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<mx10exa_cpu_device> m_xa;
|
||||
required_device<ics2115_device> m_ics;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_device<ticket_dispenser_device> m_ticket;
|
||||
|
||||
required_ioport_array<2> m_io_dsw;
|
||||
optional_ioport_array<2> m_io_trackball;
|
||||
|
||||
emu_timer *m_timer0;
|
||||
emu_timer *m_timer1;
|
||||
|
||||
u32 m_xor_table[0x100];
|
||||
|
||||
u8 m_port2_latch;
|
||||
u8 m_port0_latch;
|
||||
|
||||
@ -112,23 +142,6 @@ private:
|
||||
|
||||
int m_trackball_cnt;
|
||||
int m_trackball_axis[2], m_trackball_axis_pre[2], m_trackball_axis_diff[2];
|
||||
|
||||
emu_timer *m_timer0;
|
||||
emu_timer *m_timer1;
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<mx10exa_cpu_device> m_xa;
|
||||
required_shared_ptr<uint32_t> m_sram;
|
||||
required_device<ics2115_device> m_ics;
|
||||
required_device<screen_device> m_screen;
|
||||
required_shared_ptr<u32> m_videoram;
|
||||
required_device<palette_device> m_palette;
|
||||
required_region_ptr<u8> m_gfxrom;
|
||||
|
||||
required_device<ticket_dispenser_device> m_ticket;
|
||||
required_ioport_array<2> m_io_dsw;
|
||||
optional_ioport_array<2> m_io_trackball;
|
||||
};
|
||||
|
||||
|
||||
@ -139,6 +152,10 @@ void igs_fear_state::video_start()
|
||||
|
||||
void igs_fear_state::machine_start()
|
||||
{
|
||||
std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0);
|
||||
|
||||
save_item(NAME(m_xor_table));
|
||||
|
||||
save_item(NAME(m_port2_latch));
|
||||
save_item(NAME(m_port0_latch));
|
||||
|
||||
@ -238,24 +255,36 @@ u32 igs_fear_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
|
||||
void igs_fear_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x00000000, 0x00003fff).rom(); /* Internal ROM */
|
||||
map(0x08000000, 0x0807ffff).rom().region("user1", 0);/* Game ROM */
|
||||
map(0x00000000, 0x00003fff).rom(); // Internal ROM
|
||||
map(0x08000000, 0x0807ffff).rom().region("user1", 0); // Game ROM
|
||||
map(0x10000000, 0x100003ff).ram().share("iram");
|
||||
map(0x18000000, 0x1800ffff).ram().share("sram");
|
||||
map(0x40000000, 0x400003ff).rw(FUNC(igs_fear_state::igs027_gpio_r), FUNC(igs_fear_state::igs027_gpio_w));
|
||||
map(0x50000000, 0x500003ff).ram().share("xortab");
|
||||
map(0x70000000, 0x700003ff).rw(FUNC(igs_fear_state::igs027_periph_r), FUNC(igs_fear_state::igs027_periph_w));
|
||||
|
||||
map(0x18000000, 0x1800ffff).ram().share(m_sram);
|
||||
map(0x28000000, 0x28000003).rw("rtc", FUNC(v3021_device::read), FUNC(v3021_device::write));
|
||||
map(0x38000000, 0x38001fff).ram().share("videoram");
|
||||
|
||||
map(0x38000000, 0x38001fff).ram().share(m_videoram);
|
||||
map(0x38004000, 0x38007fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0x38008500, 0x380085ff).rw(FUNC(igs_fear_state::xa_r), FUNC(igs_fear_state::xa_w));
|
||||
|
||||
map(0x40000000, 0x400003ff).rw(FUNC(igs_fear_state::igs027_gpio_r), FUNC(igs_fear_state::igs027_gpio_w));
|
||||
|
||||
map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_fear_state::xor_table_w));
|
||||
|
||||
map(0x58000000, 0x58000003).portr("IN0");
|
||||
map(0x58100000, 0x58100003).portr("IN1");
|
||||
|
||||
map(0x68000000, 0x6800000f).w(FUNC(igs_fear_state::cpld_w));
|
||||
|
||||
map(0x70000000, 0x700003ff).rw(FUNC(igs_fear_state::igs027_periph_r), FUNC(igs_fear_state::igs027_periph_w));
|
||||
}
|
||||
|
||||
void igs_fear_state::main_xor_map(address_map &map)
|
||||
{
|
||||
main_map(map);
|
||||
|
||||
map(0x08000000, 0x0807ffff).r(FUNC(igs_fear_state::external_rom_r)); // Game ROM
|
||||
}
|
||||
|
||||
|
||||
static INPUT_PORTS_START( fear )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -404,6 +433,19 @@ void igs_fear_state::vblank_irq(int state)
|
||||
m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time());
|
||||
}
|
||||
|
||||
|
||||
u32 igs_fear_state::external_rom_r(offs_t offset)
|
||||
{
|
||||
return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff];
|
||||
}
|
||||
|
||||
|
||||
void igs_fear_state::xor_table_w(offs_t offset, u8 data)
|
||||
{
|
||||
m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8);
|
||||
}
|
||||
|
||||
|
||||
u32 igs_fear_state::igs027_gpio_r(offs_t offset, u32 mem_mask)
|
||||
{
|
||||
u32 data = ~u32(0);
|
||||
@ -708,6 +750,7 @@ void igs_fear_state::mcu_p3_w(uint8_t data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void igs_fear_state::igs_fear(machine_config &config)
|
||||
{
|
||||
ARM7(config, m_maincpu, 50000000/2);
|
||||
@ -750,6 +793,13 @@ void igs_fear_state::igs_fear(machine_config &config)
|
||||
m_ics->add_route(ALL_OUTPUTS, "mono", 5.0);
|
||||
}
|
||||
|
||||
void igs_fear_state::igs_fear_xor(machine_config &config)
|
||||
{
|
||||
igs_fear(config);
|
||||
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &igs_fear_state::main_xor_map);
|
||||
}
|
||||
|
||||
|
||||
ROM_START( fearless )
|
||||
ROM_REGION( 0x04000, "maincpu", 0 ) // Internal rom of IGS027A ARM based MCU
|
||||
@ -835,6 +885,6 @@ void igs_fear_state::init_igs_icescape()
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
GAME( 2005, superkds, 0, igs_fear, superkds, igs_fear_state, init_igs_superkds, ROT0, "IGS (Golden Dragon Amusement license)", "Super Kids / Jiu Nan Xiao Yingxiong (S019CN)", 0 )
|
||||
GAME( 2006, fearless, 0, igs_fear, fear, igs_fear_state, init_igs_fear, ROT0, "IGS (American Alpha license)", "Fearless Pinocchio (V101US)", 0 )
|
||||
GAME( 2006, icescape, 0, igs_fear, fear, igs_fear_state, init_igs_icescape, ROT0, "IGS", "Icescape (V104FA)", MACHINE_IS_SKELETON ) // IGS FOR V104FA 2006-11-02
|
||||
GAME( 2005, superkds, 0, igs_fear_xor, superkds, igs_fear_state, init_igs_superkds, ROT0, "IGS (Golden Dragon Amusement license)", "Super Kids / Jiu Nan Xiao Yingxiong (S019CN)", 0 )
|
||||
GAME( 2006, fearless, 0, igs_fear_xor, fear, igs_fear_state, init_igs_fear, ROT0, "IGS (American Alpha license)", "Fearless Pinocchio (V101US)", 0 )
|
||||
GAME( 2006, icescape, 0, igs_fear, fear, igs_fear_state, init_igs_icescape, ROT0, "IGS", "Icescape (V104FA)", MACHINE_IS_SKELETON ) // IGS FOR V104FA 2006-11-02
|
||||
|
@ -53,11 +53,14 @@ public:
|
||||
m_igs017_igs031(*this, "igs017_igs031"),
|
||||
m_screen(*this, "screen"),
|
||||
m_oki(*this, "oki"),
|
||||
m_dsw(*this, "DSW%u", 1U)
|
||||
m_io_kbd(*this, "KBD%u", 1U),
|
||||
m_io_dsw(*this, "DSW%u", 1U),
|
||||
m_io_test(*this, "TEST")
|
||||
{ }
|
||||
|
||||
void igs_mahjong(machine_config &config) ATTR_COLD;
|
||||
void igs_mahjong_xor(machine_config &config) ATTR_COLD;
|
||||
void m027(machine_config &config) ATTR_COLD;
|
||||
void m027_xor(machine_config &config) ATTR_COLD;
|
||||
void mahjong_xor(machine_config &config) ATTR_COLD;
|
||||
void extradraw(machine_config &config) ATTR_COLD;
|
||||
|
||||
void init_sdwx() ATTR_COLD;
|
||||
@ -94,21 +97,26 @@ private:
|
||||
required_device<igs017_igs031_device> m_igs017_igs031;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<okim6295_device> m_oki;
|
||||
required_ioport_array<3> m_dsw;
|
||||
optional_ioport_array<5> m_io_kbd;
|
||||
required_ioport_array<3> m_io_dsw;
|
||||
required_ioport m_io_test;
|
||||
|
||||
u32 m_xor_table[0x100];
|
||||
u32 m_dsw_io_select;
|
||||
u8 m_kbd_io_select;
|
||||
u8 m_dsw_io_select;
|
||||
u32 m_unk2_write_count;
|
||||
|
||||
u8 ppi_porta_r();
|
||||
u8 ppi_portc_mahjong_r();
|
||||
|
||||
void dsw_io_select_w(u32 data);
|
||||
void kbd_io_select_w(u8 data);
|
||||
void dsw_io_select_w(u8 data);
|
||||
|
||||
u32 external_rom_r(offs_t offset);
|
||||
|
||||
void xor_table_w(offs_t offset, u8 data);
|
||||
|
||||
u32 unk_r();
|
||||
u8 test_r();
|
||||
u32 unk2_r();
|
||||
u32 lhdmg_unk2_r();
|
||||
void unk2_w(u32 data);
|
||||
@ -156,11 +164,12 @@ void igs_m027_state::igs_mahjong_map(address_map &map)
|
||||
|
||||
map(0x38008000, 0x38008003).umask32(0x000000ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
|
||||
|
||||
map(0x38009000, 0x38009003).r(FUNC(igs_m027_state::unk_r));
|
||||
map(0x38009000, 0x38009003).umask32(0x000000ff).r(FUNC(igs_m027_state::test_r));
|
||||
map(0x38009000, 0x38009003).umask32(0x0000ff00).w(FUNC(igs_m027_state::kbd_io_select_w));
|
||||
|
||||
map(0x40000008, 0x4000000b).w(FUNC(igs_m027_state::unk2_w));
|
||||
map(0x4000000c, 0x4000000f).r(FUNC(igs_m027_state::unk2_r));
|
||||
map(0x40000018, 0x4000001b).w(FUNC(igs_m027_state::dsw_io_select_w));
|
||||
map(0x40000018, 0x4000001b).umask32(0x000000ff).w(FUNC(igs_m027_state::dsw_io_select_w));
|
||||
|
||||
map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_m027_state::xor_table_w)); // uploads XOR table to external ROM here
|
||||
map(0x70000200, 0x70000203).ram(); // ??????????????
|
||||
@ -172,7 +181,6 @@ void igs_m027_state::igs_mahjong_xor_map(address_map &map)
|
||||
igs_mahjong_map(map);
|
||||
|
||||
map(0x08000000, 0x0807ffff).r(FUNC(igs_m027_state::external_rom_r)); // Game ROM
|
||||
|
||||
}
|
||||
|
||||
void igs_m027_state::extradraw_map(address_map &map)
|
||||
@ -270,6 +278,61 @@ static INPUT_PORTS_START( base )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
|
||||
PORT_START("TEST")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( mahjong )
|
||||
PORT_START("KBD1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("KBD2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("KBD3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("KBD4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("KBD5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( jking02 )
|
||||
@ -315,6 +378,27 @@ static INPUT_PORTS_START( qlgs )
|
||||
PORT_DIPSETTING( 0x00, "Standalone" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( lhdmg )
|
||||
PORT_INCLUDE(base)
|
||||
PORT_INCLUDE(mahjong)
|
||||
|
||||
PORT_MODIFY("DSW1")
|
||||
PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2")
|
||||
PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR(1C_3C) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(1C_5C) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:8")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR(Off) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR(On) )
|
||||
|
||||
PORT_MODIFY("TEST")
|
||||
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // TODO: default assignment clashes with mahjong I, using it hangs waiting for hopper to respond
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( amazonia )
|
||||
PORT_INCLUDE(base)
|
||||
|
||||
@ -398,19 +482,37 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_state::interrupt)
|
||||
m_maincpu->pulse_input_line(ARM7_FIRQ_LINE, m_maincpu->minimum_quantum_time()); // vbl?
|
||||
}
|
||||
|
||||
|
||||
u8 igs_m027_state::ppi_porta_r()
|
||||
{
|
||||
u8 data = 0xff;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (!BIT(m_dsw_io_select, i))
|
||||
data &= m_dsw[i]->read();
|
||||
data &= m_io_dsw[i]->read();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
u8 igs_m027_state::ppi_portc_mahjong_r()
|
||||
{
|
||||
u8 data = 0xff;
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
if (!BIT(m_kbd_io_select, i + 3))
|
||||
data &= m_io_kbd[i].read_safe(0xff);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
void igs_m027_state::dsw_io_select_w(u32 data)
|
||||
void igs_m027_state::kbd_io_select_w(u8 data)
|
||||
{
|
||||
m_kbd_io_select = data;
|
||||
}
|
||||
|
||||
|
||||
void igs_m027_state::dsw_io_select_w(u8 data)
|
||||
{
|
||||
m_dsw_io_select = data;
|
||||
}
|
||||
@ -428,14 +530,11 @@ void igs_m027_state::xor_table_w(offs_t offset, u8 data)
|
||||
}
|
||||
|
||||
|
||||
// IO? maybe serial?
|
||||
// I/O? maybe serial?
|
||||
|
||||
u32 igs_m027_state::unk_r()
|
||||
u8 igs_m027_state::test_r()
|
||||
{
|
||||
// this is accessed as a byte, lower 2 bytes are read?
|
||||
// slqz3 reads test switch in here? writes to the address look like key matrix?
|
||||
logerror("%s: unk_r\n", machine().describe_context());
|
||||
return 0xffffffff;
|
||||
return m_io_test->read();
|
||||
}
|
||||
|
||||
u32 igs_m027_state::unk2_r()
|
||||
@ -466,7 +565,7 @@ void igs_m027_state::unk2_w(u32 data)
|
||||
}
|
||||
|
||||
|
||||
void igs_m027_state::igs_mahjong(machine_config &config)
|
||||
void igs_m027_state::m027(machine_config &config)
|
||||
{
|
||||
ARM7(config, m_maincpu, 22000000); // Jungle King 2002 has a 22Mhz Xtal, what about the others?
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::igs_mahjong_map);
|
||||
@ -497,16 +596,23 @@ void igs_m027_state::igs_mahjong(machine_config &config)
|
||||
OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5);
|
||||
}
|
||||
|
||||
void igs_m027_state::igs_mahjong_xor(machine_config &config)
|
||||
void igs_m027_state::m027_xor(machine_config &config)
|
||||
{
|
||||
igs_mahjong(config);
|
||||
m027(config);
|
||||
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::igs_mahjong_xor_map);
|
||||
}
|
||||
|
||||
void igs_m027_state::mahjong_xor(machine_config &config)
|
||||
{
|
||||
m027_xor(config);
|
||||
|
||||
m_ppi->in_pc_callback().set(FUNC(igs_m027_state::ppi_portc_mahjong_r));
|
||||
}
|
||||
|
||||
void igs_m027_state::extradraw(machine_config &config)
|
||||
{
|
||||
igs_mahjong(config);
|
||||
m027(config);
|
||||
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::extradraw_map);
|
||||
}
|
||||
@ -1582,35 +1688,35 @@ void igs_m027_state::init_lhdmg()
|
||||
***************************************************************************/
|
||||
|
||||
// Complete dumps
|
||||
GAME( 1999, slqz3, 0, igs_mahjong_xor, base, igs_m027_state, init_slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, qlgs, 0, igs_mahjong_xor, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gao Shou", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, fruitpar, 0, igs_mahjong_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, fruitpara, fruitpar, igs_mahjong_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, lhdmg, 0, igs_mahjong_xor, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Man Guan", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, lhdmgp, lhdmg, igs_mahjong_xor, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Man Guan Plus", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, lhzb3, 0, igs_mahjong_xor, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Zhengba III", MACHINE_NOT_WORKING ) // 龙虎争霸Ⅲ
|
||||
GAME( 2004, lhzb4, 0, igs_mahjong_xor, base, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", MACHINE_NOT_WORKING ) // 龙虎争霸4
|
||||
GAME( 1999, lthy, 0, igs_mahjong_xor, base, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_NOT_WORKING )
|
||||
GAME( 2000, zhongguo, 0, igs_mahjong_xor, base, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhong Guo Chu Da D", MACHINE_NOT_WORKING )
|
||||
GAME( 200?, jking02, 0, igs_mahjong_xor, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NOT_WORKING )
|
||||
GAME( 2003, mgzz, 0, igs_mahjong_xor, base, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V101CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 2000, mgzza, mgzz, igs_mahjong_xor, base, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V100CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 2007, mgcs3, 0, igs_mahjong_xor, base, igs_m027_state, init_mgcs3, ROT0, "IGS", "Man Guan Caishen 3 (V101CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, oceanpar, 0, igs_mahjong_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM
|
||||
GAME( 1999, oceanpara, oceanpar, igs_mahjong_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM
|
||||
GAME( 200?, cjddz, 0, igs_mahjong_xor, base, igs_m027_state, init_cjddz, ROT0, "IGS", "Chao Ji Dou Di Zhu", MACHINE_NOT_WORKING )
|
||||
GAME( 200?, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, slqz3, 0, m027_xor, base, igs_m027_state, init_slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, qlgs, 0, m027_xor, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gao Shou", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, fruitpar, 0, m027_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, fruitpara, fruitpar, m027_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, lhdmg, 0, mahjong_xor, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan", MACHINE_NOT_WORKING ) // 龙虎大满贯
|
||||
GAME( 1999, lhdmgp, lhdmg, m027_xor, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan Plus", MACHINE_NOT_WORKING ) // 龙虎大满贯
|
||||
GAME( 1999, lhzb3, 0, m027_xor, base, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Zhengba III", MACHINE_NOT_WORKING ) // 龙虎争霸Ⅲ
|
||||
GAME( 2004, lhzb4, 0, m027_xor, base, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", MACHINE_NOT_WORKING ) // 龙虎争霸4
|
||||
GAME( 1999, lthy, 0, m027_xor, base, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_NOT_WORKING )
|
||||
GAME( 2000, zhongguo, 0, m027_xor, base, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D", MACHINE_NOT_WORKING ) // 中国锄大D
|
||||
GAME( 200?, jking02, 0, m027_xor, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NOT_WORKING )
|
||||
GAME( 2003, mgzz, 0, m027_xor, base, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V101CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 2000, mgzza, mgzz, m027_xor, base, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V100CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 2007, mgcs3, 0, m027_xor, base, igs_m027_state, init_mgcs3, ROT0, "IGS", "Man Guan Caishen 3 (V101CN)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, oceanpar, 0, m027_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM
|
||||
GAME( 1999, oceanpara, oceanpar, m027_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM
|
||||
GAME( 200?, cjddz, 0, m027_xor, base, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu", MACHINE_NOT_WORKING ) // 超级斗地主
|
||||
GAME( 200?, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING )
|
||||
// these have an IGS025 protection device instead of the 8255
|
||||
GAME( 2002, chessc2, 0, igs_mahjong_xor, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING )
|
||||
GAME( 2002, chessc2, 0, m027_xor, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING )
|
||||
|
||||
// Incomplete dumps
|
||||
GAME( 1999, amazonia, 0, igs_mahjong, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, amazonkp, amazonia, igs_mahjong, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 2005, olympic5, 0, igs_mahjong, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_NOT_WORKING ) // IGS FOR V112US 2005 02 14
|
||||
GAME( 2003, olympic5a, olympic5, igs_mahjong, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_NOT_WORKING ) // IGS FOR V107US 2003 10 2
|
||||
GAME( 200?, luckycrs, 0, igs_mahjong, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_NOT_WORKING )
|
||||
GAME( 2003, amazoni2, 0, igs_mahjong, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 2002, sdwx, 0, igs_mahjong, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?)
|
||||
GAME( 200?, klxyj, 0, igs_mahjong, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, amazonia, 0, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 1999, amazonkp, amazonia, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 2005, olympic5, 0, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_NOT_WORKING ) // IGS FOR V112US 2005 02 14
|
||||
GAME( 2003, olympic5a, olympic5, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_NOT_WORKING ) // IGS FOR V107US 2003 10 2
|
||||
GAME( 200?, luckycrs, 0, m027, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_NOT_WORKING )
|
||||
GAME( 2003, amazoni2, 0, m027, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING )
|
||||
GAME( 2002, sdwx, 0, m027, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?)
|
||||
GAME( 200?, klxyj, 0, m027, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_NOT_WORKING )
|
||||
// these have an IGS025 protection device instead of the 8255
|
||||
GAME( 200?, gonefsh2, 0, igs_mahjong, base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING )
|
||||
GAME( 200?, gonefsh2, 0, m027, base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING )
|
||||
|
@ -1183,7 +1183,7 @@ void cjddz_decrypt(running_machine &machine)
|
||||
|
||||
for (int i = 0; i < rom_size / 2; i++)
|
||||
{
|
||||
uint16_t x = src[i];
|
||||
uint16_t x = 0;
|
||||
|
||||
IGS27_CRYPT1_ALT;
|
||||
IGS27_CRYPT2_ALT
|
||||
@ -1194,7 +1194,7 @@ void cjddz_decrypt(running_machine &machine)
|
||||
IGS27_CRYPT7
|
||||
IGS27_CRYPT8
|
||||
|
||||
src[i] = x;
|
||||
src[i] ^= x;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1227,25 +1227,6 @@ void lhzb4_decrypt(running_machine &machine)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
static const uint8_t superkds_tab[256] = {
|
||||
0x49, 0x47, 0x53, 0x30, 0x32, 0x30, 0x32, 0x52, 0x44, 0x32, 0x30, 0x35, 0x30, 0x31, 0x30, 0x33,
|
||||
0x0a, 0x68, 0x3c, 0x24, 0x56, 0x67, 0xed, 0xe3, 0x3a, 0x99, 0x20, 0x24, 0x09, 0x4d, 0x0c, 0xb6,
|
||||
0x0d, 0xbb, 0xe0, 0xe4, 0x93, 0x79, 0x6c, 0x10, 0x3b, 0x3b, 0x10, 0x91, 0x7e, 0xcf, 0xe5, 0xc9,
|
||||
0x80, 0x58, 0x2b, 0x8b, 0x18, 0xca, 0xf3, 0xac, 0x1d, 0xa6, 0x0d, 0xe7, 0xf4, 0xf7, 0x34, 0xf6,
|
||||
0x57, 0x8d, 0x79, 0xef, 0x67, 0x79, 0xed, 0xdc, 0xf5, 0xca, 0x92, 0x9e, 0x0d, 0x86, 0x84, 0x04,
|
||||
0xc5, 0xeb, 0x64, 0x27, 0x44, 0xe7, 0x05, 0x09, 0x15, 0xd5, 0x5a, 0x6d, 0xae, 0x7a, 0xa0, 0xf9,
|
||||
0x3c, 0x40, 0xc8, 0x8b, 0xb1, 0xb1, 0x27, 0xd8, 0x10, 0x37, 0x61, 0x4b, 0xf8, 0x12, 0x92, 0x1d,
|
||||
0x70, 0x9a, 0xbf, 0xb0, 0xf2, 0xb7, 0x7d, 0x32, 0xba, 0x9e, 0xe0, 0x6f, 0x4f, 0xce, 0xa6, 0xf6,
|
||||
0x53, 0x4a, 0xa5, 0x70, 0x88, 0x18, 0x72, 0x3c, 0x24, 0xfa, 0x53, 0x50, 0x57, 0x6b, 0x67, 0x4c,
|
||||
0x19, 0xdd, 0x14, 0xdf, 0x39, 0x32, 0xb1, 0x5f, 0xa2, 0x79, 0x75, 0xa4, 0xf1, 0xea, 0xa0, 0x25,
|
||||
0x35, 0x24, 0xe8, 0x56, 0x05, 0xa5, 0x26, 0x41, 0xc8, 0x8a, 0x41, 0x63, 0x41, 0x89, 0x5b, 0xc9,
|
||||
0x59, 0x2c, 0x3b, 0x6c, 0x31, 0x50, 0xfb, 0xc9, 0x68, 0xdd, 0xf2, 0xc4, 0xa9, 0xc7, 0xe4, 0xbf,
|
||||
0x79, 0x46, 0x69, 0xf6, 0x3f, 0x51, 0x9b, 0x1e, 0x95, 0x61, 0x04, 0x3e, 0xce, 0x64, 0xc6, 0xcd,
|
||||
0xc8, 0xff, 0x0c, 0x0d, 0xf3, 0x08, 0xb1, 0xa7, 0xa2, 0x44, 0x30, 0x88, 0x92, 0x5d, 0xcc, 0xfb,
|
||||
0xb8, 0x27, 0x00, 0x07, 0x4f, 0x14, 0x29, 0x0b, 0x22, 0xf5, 0x72, 0x98, 0x17, 0xf3, 0x00, 0x8f,
|
||||
0xfd, 0xcd, 0x60, 0x7c, 0x97, 0x54, 0x2d, 0x32, 0xe9, 0x24, 0x05, 0xa7, 0xc1, 0xa4, 0xaf, 0x11
|
||||
};
|
||||
|
||||
void superkds_decrypt(running_machine &machine)
|
||||
{
|
||||
memory_region *const region = machine.root_device().memregion("user1");
|
||||
@ -1265,8 +1246,6 @@ void superkds_decrypt(running_machine &machine)
|
||||
IGS27_CRYPT7
|
||||
IGS27_CRYPT8
|
||||
|
||||
x ^= superkds_tab[(i >> 1) & 0xff] << 8;
|
||||
|
||||
src[i] ^= x;
|
||||
}
|
||||
}
|
||||
@ -1279,7 +1258,7 @@ void fearless_decrypt(running_machine &machine)
|
||||
|
||||
for (int i = 0; i < rom_size / 2; i++)
|
||||
{
|
||||
uint16_t x = src[i];
|
||||
uint16_t x = 0;
|
||||
|
||||
IGS27_CRYPT1
|
||||
// IGS27_CRYPT2
|
||||
@ -1290,9 +1269,7 @@ void fearless_decrypt(running_machine &machine)
|
||||
IGS27_CRYPT7
|
||||
IGS27_CRYPT8
|
||||
|
||||
x ^= superkds_tab[(i >> 1) & 0xff] << 8;
|
||||
|
||||
src[i] = x;
|
||||
src[i] ^= x;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user