summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2026-03-14 02:19:06 +1100
committer Vas Crabb <vas@vastheman.com>2026-03-14 02:19:06 +1100
commit467cb6be8610a12a0cbc74cdda60314f83aa475c (patch)
tree51cb92688ff2e0d392e5b0afb1a81f569d9c6dfa
parent9e700d51d2afbcbb5856535a9f20edc8df18059a (diff)
seta/seta2.cpp: Use standard mahjong matrix.
-rw-r--r--src/devices/video/x1_020_dx_101.cpp34
-rw-r--r--src/mame/seta/seta2.cpp94
2 files changed, 18 insertions, 110 deletions
diff --git a/src/devices/video/x1_020_dx_101.cpp b/src/devices/video/x1_020_dx_101.cpp
index 098efda5046..1ea98610836 100644
--- a/src/devices/video/x1_020_dx_101.cpp
+++ b/src/devices/video/x1_020_dx_101.cpp
@@ -474,13 +474,13 @@ inline void x1_020_dx_101_device::drawgfx_line(
if (flipy)
line = 7 - line;
- const uint8_t* const source = addr + line * 8;
+ const uint8_t *const source = addr + line * 8;
if (xzoom < 0x10000) // shrink
{
- const int x0 = flipx ? (base_sx + (8 * xzoom) - xzoom) : (base_sx);
+ const int x0 = flipx ? (base_sx + (8 * xzoom) - xzoom) : base_sx;
const int x1 = flipx ? (base_sx - xzoom) : (x0 + (8 * xzoom));
- const int dx = flipx ? (-xzoom) : (xzoom);
+ const int dx = flipx ? -xzoom : xzoom;
for (int sx = x0, column = 0; sx != x1; sx += dx, column++)
{
@@ -489,21 +489,11 @@ inline void x1_020_dx_101_device::drawgfx_line(
}
else // enlarge or no zoom
{
- const int x0 = (base_sx);
- const int x1 = (x0 + (8 * xzoom));
-
- int column, column_inc;
- if (!flipx)
- {
- column = 0;
- column_inc = 1;
- }
- else
- {
- column = 7;
- column_inc = -1;
- }
+ const int x0 = base_sx;
+ const int x1 = x0 + (8 * xzoom);
+ const int column_inc = flipx ? -1 : 1;
+ int column = flipx ? 7 : 0;
uint32_t countx = 0;
for (int sx = x0; sx < x1; sx += 0x10000)
{
@@ -574,10 +564,10 @@ inline void x1_020_dx_101_device::get_tile(
int x1_020_dx_101_device::calculate_global_xoffset(bool nozoom_fixedpalette_fixedposition)
{
- /*
+#if 0
int global_xoffset = (m_vregs[0x12/2] & 0x7ff); // and 0x10/2 for low bits
if (global_xoffset & 0x400)
- global_xoffset -= 0x800;
+ global_xoffset -= 0x800;
// funcube3 sets a global xoffset of -1 causing a single pixel shift, does something else compensate for it?
// note, it also writes a different address for the sprite buffering (related?) but doesn't also have the global zoom set to negative like Star Audition which also writes there.
@@ -588,9 +578,9 @@ int x1_020_dx_101_device::calculate_global_xoffset(bool nozoom_fixedpalette_fixe
// TODO: properly render negative zoom sprites
if (global_xzoom & 0x400)
{
- global_xoffset -= 0x14f;
+ global_xoffset -= 0x14f;
}
- */
+#endif
int global_xoffset = 0;
@@ -858,7 +848,7 @@ void x1_020_dx_101_device::draw_sprites_line(bitmap_ind16 &bitmap, const rectang
// see myangel, myangel2 and grdians
int basecode = (code &= ~((sizex + 1) * (sizey + 1) - 1)) +
- ((flipy ? sizey - y : y) * (sizex + 1)) + (flipx ? sizex : 0);
+ ((flipy ? (sizey - y) : y) * (sizex + 1)) + (flipx ? sizex : 0);
const int code_inc = flipx ? -1 : 1;
diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp
index 094d7ee006c..67451bfa780 100644
--- a/src/mame/seta/seta2.cpp
+++ b/src/mame/seta/seta2.cpp
@@ -81,6 +81,8 @@ blnctry:
#include "emu.h"
+#include "mahjong.h"
+
#include "cpu/m68000/mcf5206e.h"
#include "cpu/m68000/tmp68301.h"
#include "machine/eepromser.h"
@@ -213,7 +215,7 @@ class mj4simai_state : public seta2_state
public:
mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) :
seta2_state(mconfig, type, tag),
- m_keys{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } }
+ m_keys{ { *this, "KEY%u", 0U }, { *this, "KEY%u", 5U } }
{ }
void mj4simai(machine_config &config) ATTR_COLD;
@@ -428,13 +430,13 @@ void mj4simai_state::machine_start()
template <unsigned Which>
uint16_t mj4simai_state::mj4simai_key_r()
{
- uint16_t result = 0xffff;
+ uint16_t result = 0x3f;
for (int i = 0; i < 5; i++)
{
if (BIT(m_keyboard_row, i))
result &= m_keys[Which][i]->read();
}
- return result;
+ return 0xffc0 | result;
}
void mj4simai_state::mj4simai_map(address_map &map)
@@ -1123,91 +1125,7 @@ static INPUT_PORTS_START( mj4simai )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("P1_KEY0") // $600000(0)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P1_KEY1") // $600000(1)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B )
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
- PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN)
-
- PORT_START("P1_KEY2") // $600000(2)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C )
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
- PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P1_KEY3") // $600000(3)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D )
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
- PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P1_KEY4") // $600000(4)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
- PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P2_KEY0") // $600000(0)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P2_KEY1") // $600000(1)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)
- PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN)
-
- PORT_START("P2_KEY2") // $600000(2)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
- PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P2_KEY3") // $600000(3)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
- PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
- PORT_START("P2_KEY4") // $600000(4)
- PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
- PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2)
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)
- PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_INCLUDE(mahjong_matrix_2p_bet_wup); // $600000, $600002
INPUT_PORTS_END