-igs/igs_m027_023vid.cpp: Hooked up I/O for Mingxing San Que Yi.

-igs/igs017.cpp, igs/igs_m027.cpp: Added notes about game controls.
This commit is contained in:
Vas Crabb 2024-10-19 06:33:54 +11:00
parent b34b632087
commit 8b46595df8
3 changed files with 236 additions and 113 deletions

View File

@ -46,29 +46,35 @@ Notes:
- Test mode is usually accessed by keeping test (F2) pressed during boot.
- The sound test is often accessed by holding test (F2) and bookkeeping (0) at the I/O test screen.
- The default bookkeeping password is often Start eight times.
- Some games (e.g. Tarzan Chuan Tian Guan) refer to the double-up game as (literally "Continue Play"),
so settings like refer to the double-up game, not a conventional "continue" feature.
- iqblocka: keep start (1) pressed during boot for DSWs & input test. Keep test (F2) pressed for bookkeeping / setup [pass: press deal (2)].
- iqblockf/genius6: press service1 (9) then press deal (2) eight times to switch to gambling. Then test (F2) enters book-keeping / setup.
- lhzb2, mgcs, slqz2, tjsb: press test (F2) + book (0) during inputs test for sound test.
- mgdh, sdmg2: press keys A + B during test mode for sound test (B1 + B2 + B3 when using a joystick in mgdh).
- spkrform: to switch from poker to Formosa press service1 (9). To switch back, press in sequence:
service3 (right of 0) then Bet (M) then press "Hold 1".."Hold 5" (Z, X, C, V, B)
- Tarzan Chuang Tian Guan controls:
Start Start Stop All Take Score
Mahjong Bet Bet
Mahjong A Show Odds Stop 1 Double Up (twice winnings)
Mahjong B Stop 2
Mahjong C Stop 3 Double Up (winnings)
Mahjong D Stop 4
Mahjong E Double Up (half winnings)
Mahjong K Big
Mahjong M Small
Up Stop 1
Down Stop 2
Left Stop 3
Right Stop 4
Button 1 Show Odds Big Double Up (twice winnings)
Button 2 Bet Double Up (winnings)
Button 3 Small Double Up (half winnings)
- Tarzan Chuang Tian Guan mahjong controls:
Mahjong keyboard:
Start Start Stop All Take Score
Mahjong Bet Bet
Mahjong A Show Odds Stop 1 Double Up (twice winnings)
Mahjong B Stop 2
Mahjong C Stop 3 Double Up (winnings)
Mahjong D Stop 4
Mahjong E Double Up (half winnings)
Mahjong K Big
Mahjong M Small
Joystick:
Up Stop 1
Down Stop 2
Left Stop 3
Right Stop 4
Start Start Stop All Take Score
Button 1 Show Odds Big Double Up (twice winnings)
Button 2 Bet Double Up (winnings)
Button 3 Small Double Up (half winnings)
************************************************************************************************************/
@ -3958,7 +3964,7 @@ static INPUT_PORTS_START( tarzan )
PORT_START("MATRIX")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x01) PORT_CUSTOM_MEMBER(NAME((&igs017_state::keys_ipt_r<ioport_value, 3>)))
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Start / Stop All") // 开始
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Start / Stop All / Take Score") // 开始
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Up / Stop 1") // 上
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Down / Stop 2") // 下
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Left / Stop 3") // 左
@ -4314,7 +4320,7 @@ void igs017_state::tarzan(machine_config &config)
m_maincpu->set_addrmap(AS_OPCODES, &igs017_state::decrypted_opcodes_map);
TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1);
// i/o
// I/O
m_igs_mux->set_addrmap(0, &igs017_state::tarzan_mux_map);
m_igs017_igs031->in_pa_callback().set_ioport("COINS");

View File

@ -38,9 +38,46 @@
Ron, Take Score, Big and Small, respectively (as shown on-screen), but
there doesn't seem to be an alternate button to cancel all.
Most of the games with joystick controls show instructions after
coining up. The controls are fairly consistent between games.
Mahjong joystick controls:
Left select tile to draw/discard
Right select tile to draw/discard
Up select chi/pon/kan/reach/ron
Down select chi/pon/kan/reach/ron
Start start
take score
Button 1 draw/discard /
double up (×2)
big
Button 2 bet
double up (×1)
Button 3 confirm (chi/pon/kan/reach/ron) ()
double up (×½)
small
Dou Dizhu joystick controls:
Left choose card
Right choose card
Start start
play cards
take score
Button 1 select/deselect card
double up (×2)
confirm
big
Button 2 bet
bid 1
deselect all
double up (×1)
Button 3 pass
double up (×½)
small
cancel
TODO:
* I/O for remaining games
* Coin lockout (zhongguo displays a coin error on unexpected coins)
*/
#include "emu.h"

View File

@ -52,15 +52,26 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_video(*this, "igs023"),
m_ics(*this, "ics")
m_ics(*this, "ics"),
m_hopper(*this, "hopper"),
m_io_clearmem(*this, "CLEARMEM"),
m_io_in(*this, "IN%u", 0U),
m_io_out(*this, "OUT%u", 0U),
m_io_dsw(*this, "DSW%u", 1U),
m_io_kbd(*this, "KEY%u", 0U)
{ }
void m027_023vid(machine_config &config) ATTR_COLD;
void init_mxsqy() ATTR_COLD;
ioport_value kbd_r();
template <unsigned N> void counter_w(int state) { machine().bookkeeping().coin_counter_w(N, state); }
protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
private:
required_region_ptr<u32> m_external_rom;
@ -71,14 +82,32 @@ private:
required_device<palette_device> m_palette;
required_device<igs023_video_device> m_video;
required_device<ics2115_device> m_ics;
required_device<hopper_device> m_hopper;
required_ioport m_io_clearmem;
required_ioport_array<3> m_io_in;
required_ioport_array<2> m_io_out;
required_ioport_array<3> m_io_dsw;
required_ioport_array<5> m_io_kbd;
u32 m_xor_table[0x100];
bool m_irq_source;
u32 external_rom_r(offs_t offset);
u8 m_gpio_out;
u8 m_kbd_sel;
bool m_first_start;
u32 external_rom_r(offs_t offset);
void xor_table_w(offs_t offset, u8 data);
template <unsigned N> u16 in_r() { return m_io_in[N]->read(); }
template <unsigned N> void out_w(u16 data) { return m_io_out[N]->write(data); }
u16 dsw_r();
void kbd_w(u16 data);
void gpio_out_w(u8 data);
TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -90,18 +119,32 @@ private:
template <unsigned N>
void irq_w(int state);
u32 gpio_r();
u32 unk0_r() { return 0xffffffff; }
u32 unk1_r() { return 0xffffffff; }
};
void igs_m027_023vid_state::machine_start()
{
std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0);
m_irq_source = 0;
m_gpio_out = 0x1f;
m_kbd_sel = 0x1f;
m_first_start = true;
save_item(NAME(m_xor_table));
save_item(NAME(m_irq_source));
save_item(NAME(m_gpio_out));
save_item(NAME(m_kbd_sel));
save_item(NAME(m_first_start));
}
void igs_m027_023vid_state::machine_reset()
{
if (m_first_start)
{
if (!BIT(m_io_clearmem->read(), 0))
std::fill(std::begin(m_nvram), std::end(m_nvram), 0);
m_first_start = false;
}
}
@ -136,20 +179,20 @@ void igs_m027_023vid_state::m027_map(address_map &map)
map(0x2800'0000, 0x2800'0fff).ram();
map(0x3890'0000, 0x3890'7fff).rw(m_video, FUNC(igs023_video_device::videoram_r), FUNC(igs023_video_device::videoram_w)).umask32(0xffffffff);
map(0x38a0'0000, 0x38a0'11ff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
map(0x38b0'0000, 0x38b0'ffff).rw(m_video, FUNC(igs023_video_device::videoregs_r), FUNC(igs023_video_device::videoregs_w)).umask32(0xffffffff);
map(0x4000'0008, 0x4000'000b).nopw();
map(0x4800'0000, 0x4800'0003).r(FUNC(igs_m027_023vid_state::unk0_r));
map(0x4800'0004, 0x4800'0007).r(FUNC(igs_m027_023vid_state::unk1_r));
map(0x4800'0000, 0x4800'0001).r(FUNC(igs_m027_023vid_state::in_r<0>));
map(0x4800'0002, 0x4800'0003).r(FUNC(igs_m027_023vid_state::in_r<1>));
map(0x4800'0004, 0x4800'0005).r(FUNC(igs_m027_023vid_state::in_r<2>));
map(0x4800'0006, 0x4800'0007).rw(FUNC(igs_m027_023vid_state::dsw_r), FUNC(igs_m027_023vid_state::out_w<0>));
map(0x5000'0000, 0x5000'03ff).umask32(0x0000'00ff).w(FUNC(igs_m027_023vid_state::xor_table_w)); // uploads XOR table to external ROM here
map(0x5800'0000, 0x5800'0007).rw("ics", FUNC(ics2115_device::read), FUNC(ics2115_device::write)).umask32(0x00ff00ff);
map(0x5800'0000, 0x5800'0007).rw(m_ics, FUNC(ics2115_device::read), FUNC(ics2115_device::write)).umask32(0x00ff00ff);
map(0x7000'0108, 0x7000'010b).nopw();
map(0x6800'0000, 0x6800'0001).w(FUNC(igs_m027_023vid_state::kbd_w));
map(0x6800'0002, 0x6800'0003).w(FUNC(igs_m027_023vid_state::out_w<1>));
}
@ -159,91 +202,89 @@ void igs_m027_023vid_state::m027_map(address_map &map)
***************************************************************************/
INPUT_PORTS_START( base )
INPUT_PORTS_START( mxsqy )
PORT_INCLUDE(igs_mahjong_matrix)
PORT_START("IN0")
PORT_BIT(0x07ff, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
PORT_BIT(0x003f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_023vid_state::kbd_r))
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) // 哈巴
PORT_SERVICE_NO_TOGGLE(0x0080, IP_ACTIVE_LOW) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 测试
PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_COIN1) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 投币
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 洗分
PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 査帐
PORT_BIT(0xf800, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_START("IN1")
PORT_BIT(0x0007, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 査帐
PORT_SERVICE_NO_TOGGLE(0x0010, IP_ACTIVE_LOW) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 测试
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01)
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_COIN1) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 投币
PORT_BIT(0x0078, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN) // 开分
PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_START1) // 开始
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) // 上
PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) // 下
PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) // 左
PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) // 右
PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_BUTTON1) // S1
PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON2) // S2
PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON3) // S3
PORT_START("IN2")
PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT) // 退币
PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 洗分
PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) // HPSW.
PORT_BIT(0x0006, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00)
PORT_BIT(0xfff8, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_START("OUT0")
PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w))
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<0>)) // coin or key-in
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<2>)) // payout or key-out
PORT_START("OUT1")
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<0>)) // coin
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<2>)) // payout
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<1>)) // key-in
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<3>)) // key-out
PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w))
PORT_START("CLEARMEM")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE
PORT_START("DSW1")
PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" )
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" )
PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" )
PORT_DIPNAME(0x01, 0x01, DEF_STR(Controls)) PORT_DIPLOCATION("SW1:1") // PLAY MODE
PORT_DIPSETTING( 0x01, DEF_STR(Joystick)) // JAMMA
PORT_DIPSETTING( 0x00, "Mahjong") // MJ
PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2")
PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3")
PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4")
PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5")
PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6")
PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7")
PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8")
PORT_START("DSW2")
PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" )
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" )
PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" )
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" )
PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1")
PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2")
PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3")
PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4")
PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5")
PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6")
PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7")
PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8")
PORT_START("DSW3")
PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" )
PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" )
PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" )
PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" )
PORT_START("PORTB") // buttons?
PORT_DIPNAME( 0x01, 0x01, "PORTB")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("PORTC") // buttons?
PORT_DIPNAME( 0x01, 0x01, "PORTC")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW3:1")
PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW3:2")
PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW3:3")
PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW3:4")
PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW3:5")
PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW3:6")
PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW3:7")
PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8")
INPUT_PORTS_END
@ -259,13 +300,48 @@ u32 igs_m027_023vid_state::external_rom_r(offs_t offset)
return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff];
}
void igs_m027_023vid_state::xor_table_w(offs_t offset, u8 data)
{
m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8);
}
ioport_value igs_m027_023vid_state::kbd_r()
{
ioport_value result = 0x3f;
for (unsigned i = 0; m_io_kbd.size() > i; ++i)
{
if (!BIT(m_kbd_sel, i))
result &= m_io_kbd[i]->read();
}
return result;
}
u16 igs_m027_023vid_state::dsw_r()
{
u16 result = 0x00ff;
for (unsigned i = 0; m_io_dsw.size() > i; ++i)
{
if (!BIT(m_gpio_out, i))
result &= m_io_dsw[i]->read();
}
return 0xff00 | result;
}
void igs_m027_023vid_state::kbd_w(u16 data)
{
m_kbd_sel = data & 0x001f;
}
void igs_m027_023vid_state::gpio_out_w(u8 data)
{
// bits 0-2 select DIP switch banks 1-3, respectively
// the game constantly toggles bit 3
m_gpio_out = data;
}
TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_023vid_state::interrupt)
{
int scanline = param;
@ -288,7 +364,7 @@ u16 igs_m027_023vid_state::sprites_r(offs_t offset)
// there does seem to be a spritelist at the start of mainram like PGM
// it is also copied to a secondary RAM area, which seems to be our datasource in this case
address_space& mem = m_maincpu->space(AS_PROGRAM);
address_space &mem = m_maincpu->space(AS_PROGRAM);
u16 sprdata = mem.read_word(0x28000000 + offset * 2);
return sprdata;
}
@ -319,6 +395,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config)
IGS027A(config, m_maincpu, 33_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_023vid_state::m027_map);
m_maincpu->in_port().set(FUNC(igs_m027_023vid_state::gpio_r));
m_maincpu->out_port().set(FUNC(igs_m027_023vid_state::gpio_out_w));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@ -328,7 +405,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config)
m_screen->set_size(512, 256);
m_screen->set_visarea(0, 448-1, 0, 224-1);
m_screen->set_screen_update(FUNC(igs_m027_023vid_state::screen_update));
m_screen->set_palette("palette");
m_screen->set_palette(m_palette);
m_screen->screen_vblank().set(FUNC(igs_m027_023vid_state::screen_vblank));
PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 0x1200/2);
@ -346,6 +423,8 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config)
ICS2115(config, m_ics, 33.8688_MHz_XTAL);
m_ics->irq().set(FUNC(igs_m027_023vid_state::irq_w<1>));
m_ics->add_route(ALL_OUTPUTS, "mono", 5.0);
HOPPER(config, m_hopper, attotime::from_msec(50));
}
@ -356,6 +435,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config)
***************************************************************************/
// 明星三缺一 (Míngxīng sān quē yī)
ROM_START( mxsqy )
ROM_REGION( 0x04000, "maincpu", 0 )
// Internal ROM of IGS027A type G ARM based MCU
@ -393,4 +473,4 @@ void igs_m027_023vid_state::init_mxsqy()
***************************************************************************/
// internal ROM is 2003
GAME( 2003, mxsqy, 0, m027_023vid, base, igs_m027_023vid_state, init_mxsqy, ROT0, "IGS", "Ming Xing San Que Yi (China)", MACHINE_IS_SKELETON )
GAME( 2003, mxsqy, 0, m027_023vid, mxsqy, igs_m027_023vid_state, init_mxsqy, ROT0, "IGS", "Mingxing San Que Yi (China, V201CN)", MACHINE_IS_SKELETON )