-ui/filemngr.cpp: Show warnings at the bottom.

-dynax/royalmah.cpp: Improved DIP switch settings for ippatsu.

-dynax/royalmah.cpp, seibu/seibuspi.cpp: Use standard mahjong matrix.
This commit is contained in:
Vas Crabb 2024-12-21 03:13:29 +11:00
parent 38f49dbf31
commit 20f98477f6
3 changed files with 125 additions and 205 deletions

View File

@ -73,11 +73,13 @@ void menu_file_manager::recompute_metrics(uint32_t width, uint32_t height, float
float const max_width(1.0F - (4.0F * lr_border()));
m_warnings_layout.emplace(create_layout(max_width, text_layout::text_justify::LEFT));
m_warnings_layout->add_text(m_warnings, ui().colors().text_color());
}
set_custom_space(
m_warnings_layout ? ((m_warnings_layout->lines() * line_height()) + 3.0F * tb_border()) : 0.0F,
line_height() + 3.0F * tb_border());
set_custom_space(0.0F, (float(m_warnings_layout->lines() + 1) * line_height()) + (6.0F * tb_border()));
}
else
{
set_custom_space(0.0F, line_height() + (3.0F * tb_border()));
}
}
@ -87,23 +89,24 @@ void menu_file_manager::recompute_metrics(uint32_t width, uint32_t height, float
void menu_file_manager::custom_render(uint32_t flags, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
// access the path
if (m_selected_device && m_selected_device->exists())
extra_text_render(top, (3.0F * tb_border()) + line_height(), origx1, origy1, origx2, origy2, std::string_view(), m_selected_device->filename());
// show the warnings if any
if (m_warnings_layout)
{
ui().draw_outlined_box(
container(),
((1.0F + m_warnings_layout->actual_width()) * 0.5F) + lr_border(), origy1 - (3.0F * tb_border()) - (m_warnings_layout->lines() * line_height()),
((1.0F - m_warnings_layout->actual_width()) * 0.5F) - lr_border(), origy1 - tb_border(),
((1.0F + m_warnings_layout->actual_width()) * 0.5F) + lr_border(), origy2 + (4.0F * tb_border()) + line_height(),
((1.0F - m_warnings_layout->actual_width()) * 0.5F) - lr_border(), origy2 + bottom,
ui().colors().background_color());
m_warnings_layout->emit(
container(),
(1.0F - m_warnings_layout->actual_width()) * 0.5F,
origy1 - (2.0F * tb_border()) - (m_warnings_layout->lines() * line_height()));
origy2 + (5.0F * tb_border()) + line_height());
}
// access the path
std::string_view path = m_selected_device && m_selected_device->exists() ? m_selected_device->filename() : std::string_view();
extra_text_render(top, bottom, origx1, origy1, origx2, origy2, std::string_view(), path);
}
@ -136,7 +139,9 @@ void menu_file_manager::fill_image_line(device_image_interface &img, std::string
}
}
else
{
filename.assign("---");
}
}
//-------------------------------------------------

View File

@ -106,6 +106,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "mahjong.h"
#include "cpu/tlcs90/tlcs90.h"
#include "cpu/z80/tmpz84c015.h"
#include "cpu/z80/z80.h"
@ -1636,97 +1638,45 @@ void royalmah_prgbank_state::mjvegasa_map(address_map &map)
static INPUT_PORTS_START( mjctrl1 )
PORT_START("KEY0") // P1 IN0
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_OTHER ) PORT_NAME("P1 Credit Clear") PORT_CODE(KEYCODE_O)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Credit Clear") PORT_CODE(KEYCODE_8)
PORT_INCLUDE(mahjong_matrix_2p_bet_wup)
PORT_START("KEY1") // P1 IN1
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_MODIFY("KEY0") // P1 IN0
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Credit Clear") PORT_CODE(KEYCODE_MINUS)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Credit Clear") PORT_CODE(KEYCODE_EQUALS)
PORT_MODIFY("KEY1") // P1 IN1
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY2") // P1 IN2
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( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY3") // P1 IN3
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( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY4") // P1 IN4
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_MAHJONG_FLIP_FLOP )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
PORT_MODIFY("KEY2") // P1 IN2
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY5") // P2 IN0
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_MODIFY("KEY3") // P1 IN3
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY4") // P1 IN4
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY5") // P2 IN0
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY6") // P2 IN1
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
PORT_MODIFY("KEY6") // P2 IN1
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY7") // P2 IN2
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY7") // P2 IN2
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY8") // P2 IN3
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY8") // P2 IN3
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY9") // P2 IN4
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
PORT_MODIFY("KEY9") // P2 IN4
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM") // IN10
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) // "Note" ("Paper Money") = 10 Credits
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MEMORY_RESET ) // Memory Reset
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) // Analizer (Statistics)
PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) PORT_TOGGLE // Analizer (Statistics)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_TOGGLE PORT_NAME( DEF_STR(Service_Mode) )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
@ -1735,7 +1685,7 @@ static INPUT_PORTS_START( mjctrl2 )
PORT_INCLUDE( mjctrl1 )
PORT_MODIFY("KEY0")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Payout") PORT_CODE(KEYCODE_O)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@ -3347,7 +3297,7 @@ static INPUT_PORTS_START( ippatsu )
PORT_START("DSW1") // DSW (inport $10)
PORT_DIPNAME( 0x0f, 0x0f, "Pay Out Rate" )
PORT_DIPNAME( 0x0f, 0x0f, "Payout Rate" ) PORT_DIPLOCATION("MAIN SW:1,2,3,4") //   
PORT_DIPSETTING( 0x0f, "96%" )
PORT_DIPSETTING( 0x0e, "93%" )
PORT_DIPSETTING( 0x0d, "90%" )
@ -3364,65 +3314,64 @@ static INPUT_PORTS_START( ippatsu )
PORT_DIPSETTING( 0x02, "56%" )
PORT_DIPSETTING( 0x01, "53%" )
PORT_DIPSETTING( 0x00, "50%" )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x60, 0x60, "Maximum Bet" )
PORT_DIPNAME( 0x10, 0x10, DEF_STR(Unknown) ) PORT_DIPLOCATION("MAIN SW:5")
PORT_DIPSETTING( 0x10, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_DIPNAME( 0x60, 0x60, "Maximum Bet" ) PORT_DIPLOCATION("MAIN SW:6,7") //  
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x20, "5" )
PORT_DIPSETTING( 0x40, "7" )
PORT_DIPSETTING( 0x60, "10" )
PORT_DIPNAME( 0x80, 0x80, "First Chance" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
PORT_DIPNAME( 0x80, 0x80, "Open Reach" ) PORT_DIPLOCATION("MAIN SW:8") // OPEN リーチ
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ナシ
PORT_DIPSETTING( 0x80, DEF_STR(On) ) // アリ
PORT_START("DSW2") // DSW (inport $12)
PORT_DIPNAME( 0x03, 0x03, "Cut" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x02, "2 Bai" )
PORT_DIPSETTING( 0x01, "3 Bai" )
PORT_DIPSETTING( 0x03, "Yakuman" )
PORT_DIPNAME( 0x0c, 0x0c, "Yakuman Bonus" )
PORT_DIPSETTING( 0x00, "32" )
PORT_DIPSETTING( 0x04, "100" )
PORT_DIPSETTING( 0x08, "200" )
PORT_DIPSETTING( 0x0c, "300" )
PORT_DIPNAME( 0x30, 0x30, "Unknown 1-4&5*" )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x10, "4" )
PORT_DIPSETTING( 0x20, "5" )
PORT_DIPSETTING( 0x30, "6" )
PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6*" )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x40, "5" )
PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7" )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x03, 0x03, "Cut" ) PORT_DIPLOCATION("SUB SW-1:1,2")
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // CUT ナシ
PORT_DIPSETTING( 0x01, "Baiman" ) // バイマン      CUT
PORT_DIPSETTING( 0x02, "Sanbaiman" ) // 3バイマン     CUT
PORT_DIPSETTING( 0x03, "Yakuman" ) // ヤクマン      CUT
PORT_DIPNAME( 0x0c, 0x0c, "Yakuman Payout" ) PORT_DIPLOCATION("SUB SW-1:3,4") // ハイトウ
PORT_DIPSETTING( 0x00, "32" ) //     
PORT_DIPSETTING( 0x04, "100" ) //    
PORT_DIPSETTING( 0x08, "200" ) //    
PORT_DIPSETTING( 0x0c, "300" ) //    
PORT_DIPNAME( 0x30, 0x30, "Double-Up Count" ) PORT_DIPLOCATION("SUB SW-1:5,6") // ダブル UP
PORT_DIPSETTING( 0x00, "3" ) // 3カイ
PORT_DIPSETTING( 0x10, "4" ) // 4カイ
PORT_DIPSETTING( 0x20, "5" ) // 5カイ
PORT_DIPSETTING( 0x30, "6" ) // 6カイ
PORT_DIPNAME( 0x40, 0x40, "Last Chance Count" ) PORT_DIPLOCATION("SUB SW-1:7") // ラストチャンス
PORT_DIPSETTING( 0x00, "3" ) // 3カイ
PORT_DIPSETTING( 0x40, "5" ) // 5カイ
PORT_DIPNAME( 0x80, 0x80, DEF_STR(Unknown) ) PORT_DIPLOCATION("SUB SW-1:8") // (未使用)
PORT_DIPSETTING( 0x80, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_START("DSW3") // DSW (inport $13)
PORT_DIPNAME( 0x01, 0x01, "Unknown 2-0*" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x01, DEF_STR( Yes ) )
PORT_DIPNAME( 0x02, 0x02, "Second Bonus" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x02, DEF_STR( Yes ) )
PORT_DIPNAME( 0x04, 0x04, "Allow Bets" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
PORT_DIPNAME( 0x18, 0x18, "Unknown 2-3&4*" )
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x18, "2" )
PORT_DIPSETTING( 0x10, "4" )
PORT_DIPSETTING( 0x08, "8" )
PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x01, 0x01, "Double Chance (1/8)" ) PORT_DIPLOCATION("SUB SW-2:1") // DOUBLEチャンス(1/8)
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ナシ
PORT_DIPSETTING( 0x01, DEF_STR(On) ) // アリ
PORT_DIPNAME( 0x02, 0x02, "Second Bonus" ) PORT_DIPLOCATION("SUB SW-2:2") //  
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ナシ
PORT_DIPSETTING( 0x02, DEF_STR(On) ) // アリ
PORT_DIPNAME( 0x04, 0x04, "Double Bet" ) PORT_DIPLOCATION("SUB SW-2:3") //  
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ナシ
PORT_DIPSETTING( 0x04, DEF_STR(On) ) // アリ
PORT_DIPNAME( 0x18, 0x18, "Heart Chance" ) PORT_DIPLOCATION("SUB SW-2:4,5")
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ハートチャンス    ナシ
PORT_DIPSETTING( 0x08, "1/8 (12.5%)" ) //   (12.5%)   アリ
PORT_DIPSETTING( 0x10, "1/4 (25%)" ) //    (25%)   アリ
PORT_DIPSETTING( 0x18, "1/2 (50%)" ) //    (50%)   アリ
PORT_DIPNAME( 0x60, 0x60, "Payout Limit" ) PORT_DIPLOCATION("SUB SW-2:6,7") // ウチドメクレジト
PORT_DIPSETTING( 0x60, "300" )
PORT_DIPSETTING( 0x40, "500" )
PORT_DIPSETTING( 0x20, "800" )
PORT_DIPSETTING( 0x00, "1000" )
PORT_DIPNAME( 0x80, 0x80, "Show Payout Limit" ) PORT_DIPLOCATION("SUB SW-2:8") // メッセージ
PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // ナシ
PORT_DIPSETTING( 0x80, DEF_STR(On) ) // アリ
INPUT_PORTS_END
static INPUT_PORTS_START( mjdejavu )

View File

@ -879,6 +879,8 @@ Notes:
#include "emu.h"
#include "seibuspi.h"
#include "mahjong.h"
#include "cpu/i386/i386.h"
#include "cpu/z80/z80.h"
#include "machine/ds2404.h"
@ -982,10 +984,13 @@ u32 seibuspi_state::ejsakura_keyboard_r()
// coins/eeprom data
u32 ret = m_special->read();
// multiplexed inputs
for (int i = 0; i < 5; i++)
if (m_ejsakura_input_port >> i & 1)
ret &= m_key[i]->read();
// switch matrix
if (BIT(m_ejsakura_input_port, 0)) ret &= m_key[3]->read();
if (BIT(m_ejsakura_input_port, 1)) ret &= m_key[4]->read();
if (BIT(m_ejsakura_input_port, 2)) ret &= m_key[2]->read();
if (BIT(m_ejsakura_input_port, 3)) ret &= m_key[0]->read();
if (BIT(m_ejsakura_input_port, 4)) ret &= m_key[1]->read();
ret = (ret & ~u32(0x1f)) | bitswap<5>(ret, 0, 1, 2, 3, 4);
return ret;
}
@ -1231,12 +1236,13 @@ ioport_value seibuspi_state::ejanhs_encode()
RON - 110 port C
Start - 111 port A
*/
static const u8 encoding[] = { 6, 5, 4, 3, 2, 7 };
ioport_value state = ~m_key[N]->read();
ioport_value const state = m_key[N]->read();
for (int bit = 0; bit < std::size(encoding); bit++)
if (state & (1 << bit))
return encoding[bit];
for (int bit = 0; bit < 6; bit++)
{
if (!BIT(state, bit))
return bit + 2;
}
return 0;
}
@ -1337,61 +1343,15 @@ static INPUT_PORTS_START( sys386i )
INPUT_PORTS_END
static INPUT_PORTS_START( spi_mahjong_keyboard )
PORT_START("KEY.0")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0xffffffe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY.1")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY.2")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0xffffffe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY.3")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY.4")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( spi_ejanhs )
PORT_INCLUDE( spi_mahjong_keyboard )
PORT_INCLUDE( mahjong_matrix_1p )
PORT_INCLUDE( sxx2c )
PORT_START("INPUTS")
PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<3>))
PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<4>))
PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<0>))
PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<1>))
PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<2>))
PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<0>))
PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(seibuspi_state::ejanhs_encode<3>))
PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" )
PORT_BIT( 0xffff4000, IP_ACTIVE_LOW, IPT_UNUSED )
@ -1403,12 +1363,6 @@ static INPUT_PORTS_START( spi_ejanhs )
PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY.1")
PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) // Decoded but not recognized
PORT_MODIFY("KEY.4")
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED ) // Decoded but not recognized
PORT_START("EXCH") // Another set of mahjong inputs is decoded from here but not used
PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
@ -1420,13 +1374,25 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ejsakura )
PORT_INCLUDE( spi_mahjong_keyboard )
PORT_INCLUDE( mahjong_matrix_1p_bet_wup )
PORT_MODIFY("KEY.4")
PORT_MODIFY("KEY0")
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY1")
PORT_SERVICE_NO_TOGGLE( 0x00000200, IP_ACTIVE_LOW)
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q)
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_Q)
PORT_BIT( 0xfffff5c0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY2")
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY3")
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("KEY4")
PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL")
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_COIN2 )