funworld/supercrd.cpp: preliminary XOR tables for the gampo and supst sets, some fixes to the one for the fruitstr sets

This commit is contained in:
Ivan Vangelista 2023-06-23 18:57:38 +02:00
parent e071da1a6f
commit 8e7c91f0d2
3 changed files with 137 additions and 10 deletions

View File

@ -230,7 +230,9 @@ public:
void supercrd(machine_config &config); void supercrd(machine_config &config);
void init_fruitstr(); void init_fruitstr();
void init_gampo();
void init_supercrd(); void init_supercrd();
void init_supst();
protected: protected:
virtual void machine_start() override; virtual void machine_start() override;
@ -886,8 +888,8 @@ void supercrd_state::init_fruitstr() // TODO: check unknown opcodes
{ 0x11, 0x00, 0x02, 0x43, 0x40, 0x10, 0x02, 0x40 }, // 0x1x and 0x3x { 0x11, 0x00, 0x02, 0x43, 0x40, 0x10, 0x02, 0x40 }, // 0x1x and 0x3x
{ 0x40, 0x03, 0x10, 0x02, 0x02, 0x00, 0x40, 0x43 }, // 0x4x and 0x6x { 0x40, 0x03, 0x10, 0x02, 0x02, 0x00, 0x40, 0x43 }, // 0x4x and 0x6x
{ 0x52, 0x12, 0x41, 0x50, 0x02, 0x00, 0x43, 0x40 }, // 0x5x and 0x7x { 0x52, 0x12, 0x41, 0x50, 0x02, 0x00, 0x43, 0x40 }, // 0x5x and 0x7x
{ 0x03, unkn, 0x12, 0x42, 0x51, 0x53, unkn, 0x01 }, // 0x8x and 0xax { 0x03, unkn, 0x12, 0x42, 0x51, 0x53, 0x51, 0x01 }, // 0x8x and 0xax
{ 0x43, 0x52, 0x50, 0x01, unkn, unkn, 0x00, unkn }, // 0x9x and 0xbx { 0x43, 0x52, 0x50, 0x01, 0x50, unkn, 0x00, unkn }, // 0x9x and 0xbx
{ 0x11, 0x13, 0x53, 0x50, 0x02, 0x00, 0x41, unkn }, // 0xcx and 0xex { 0x11, 0x13, 0x53, 0x50, 0x02, 0x00, 0x41, unkn }, // 0xcx and 0xex
{ 0x50, 0x50, 0x12, unkn, unkn, 0x41, 0x43, 0x40 } // 0xdx and 0xfx { 0x50, 0x50, 0x12, unkn, unkn, 0x41, 0x43, 0x40 } // 0xdx and 0xfx
}, },
@ -902,9 +904,9 @@ void supercrd_state::init_fruitstr() // TODO: check unknown opcodes
{ 0x13, unkn, 0x10, 0x00, 0x40, 0x01, 0x51, 0x02 } // 0xdx and 0xfx { 0x13, unkn, 0x10, 0x00, 0x40, 0x01, 0x51, 0x02 } // 0xdx and 0xfx
}, },
{ {
{ unkn, 0x12, 0x50, 0x41, 0x53, 0x11, 0x03, 0x51 }, // 0x0x and 0x2x { 0x43, 0x12, 0x50, 0x41, 0x53, 0x11, 0x03, 0x51 }, // 0x0x and 0x2x
{ 0x11, 0x40, 0x10, 0x01, 0x01, 0x11, 0x42, 0x01 }, // 0x1x and 0x3x { 0x11, 0x40, 0x10, 0x01, 0x01, 0x11, 0x42, 0x01 }, // 0x1x and 0x3x
{ 0x00, 0x51, unkn, 0x40, 0x03, 0x00, 0x02, 0x50 }, // 0x4x and 0x6x { 0x00, 0x51, 0x03, 0x40, 0x03, 0x00, 0x02, 0x50 }, // 0x4x and 0x6x
{ 0x03, 0x51, 0x43, 0x03, 0x01, 0x53, 0x10, 0x50 }, // 0x5x and 0x7x { 0x03, 0x51, 0x43, 0x03, 0x01, 0x53, 0x10, 0x50 }, // 0x5x and 0x7x
{ 0x51, 0x40, 0x51, 0x02, 0x02, 0x52, 0x40, 0x13 }, // 0x8x and 0xax { 0x51, 0x40, 0x51, 0x02, 0x02, 0x52, 0x40, 0x13 }, // 0x8x and 0xax
{ unkn, unkn, 0x02, 0x41, 0x42, 0x51, unkn, 0x13 }, // 0x9x and 0xbx { unkn, unkn, 0x02, 0x41, 0x42, 0x51, unkn, 0x13 }, // 0x9x and 0xbx
@ -919,7 +921,131 @@ void supercrd_state::init_fruitstr() // TODO: check unknown opcodes
{ 0x03, 0x01, 0x52, 0x02, 0x42, 0x10, 0x52, unkn }, // 0x8x and 0xax { 0x03, 0x01, 0x52, 0x02, 0x42, 0x10, 0x52, unkn }, // 0x8x and 0xax
{ 0x01, 0x01, 0x52, 0x40, 0x11, 0x01, unkn, unkn }, // 0x9x and 0xbx { 0x01, 0x01, 0x52, 0x40, 0x11, 0x01, unkn, unkn }, // 0x9x and 0xbx
{ 0x53, 0x43, 0x13, 0x51, unkn, 0x00, 0x51, 0x12 }, // 0xcx and 0xex { 0x53, 0x43, 0x13, 0x51, unkn, 0x00, 0x51, 0x12 }, // 0xcx and 0xex
{ 0x13, 0x03, 0x10, 0x12, 0x52, 0x03, 0x51, unkn } // 0xdx and 0xfx { 0x13, 0x03, 0x10, 0x12, 0x52, 0x03, 0x51, 0x00 } // 0xdx and 0xfx
}
};
for (int j = 0; j < 0x04; j++)
{
for (int i = 0; i < 0x100; i++)
{
uint8_t const row = bitswap<3>(i, 7, 6, 4);
uint8_t const xor_v = i & 0x07;
if ((i & 0x28) == 0)
LOGUNKOPCODES("table: %01x encop: %02x; decop: %02x\n", j, i, i ^ xor_table[j][row][xor_v]);
}
}
std::copy(&xor_table[0][0][0], &xor_table[0][0][0] + 0x04 * 0x08 * 0x08, &m_decode_table[0][0][0]);
}
void supercrd_state::init_gampo() // TODO: check unknown opcodes
{
uint8_t unkn = 0x00;
uint8_t xor_table[0x04][0x08][0x08] =
{
{
{ 0x51, 0x12, 0x51, 0x02, 0x02, 0x13, unkn, 0x43 }, // 0x0x and 0x2x
{ 0x43, 0x12, 0x53, 0x43, 0x53, 0x00, unkn, 0x51 }, // 0x1x and 0x3x
{ 0x51, 0x01, 0x52, 0x43, 0x43, 0x00, 0x42, 0x12 }, // 0x4x and 0x6x
{ 0x42, 0x53, 0x10, 0x01, 0x00, 0x03, 0x01, 0x52 }, // 0x5x and 0x7x
{ 0x42, 0x00, 0x50, unkn, 0x13, unkn, 0x01, 0x41 }, // 0x8x and 0xax
{ 0x50, 0x00, 0x51, 0x01, 0x12, unkn, unkn, 0x42 }, // 0x9x and 0xbx // TODO: 0x90 to be checked
{ 0x50, 0x41, 0x13, unkn, unkn, 0x00, unkn, 0x52 }, // 0xcx and 0xex
{ 0x11, 0x42, 0x01, unkn, unkn, 0x41, unkn, 0x01 } // 0xdx and 0xfx
},
{
{ 0x10, 0x51, 0x50, 0x02, 0x11, 0x02, 0x41, 0x01 }, // 0x0x and 0x2x
{ unkn, 0x13, 0x51, 0x01, 0x43, 0x02, 0x02, 0x42 }, // 0x1x and 0x3x // TODO: 0x1a to be checked
{ 0x02, 0x41, 0x11, 0x02, 0x40, 0x00, 0x12, 0x51 }, // 0x4x and 0x6x
{ 0x53, 0x40, 0x41, 0x02, 0x02, 0x13, 0x12, 0x52 }, // 0x5x and 0x7x
{ 0x12, 0x12, 0x40, 0x50, 0x53, 0x12, 0x40, 0x51 }, // 0x8x and 0xax // TODO: 0x84 to be checked
{ unkn, 0x01, unkn, 0x02, 0x01, unkn, unkn, 0x10 }, // 0x9x and 0xbx
{ unkn, 0x02, 0x02, 0x02, 0x42, 0x00, 0x50, 0x03 }, // 0xcx and 0xex
{ 0x01, 0x03, 0x53, unkn, 0x00, unkn, unkn, 0x02 } // 0xdx and 0xfx
},
{
{ 0x52, 0x02, 0x00, 0x13, 0x43, 0x01, 0x03, unkn }, // 0x0x and 0x2x
{ 0x02, 0x00, 0x12, 0x51, 0x01, 0x40, 0x42, 0x03 }, // 0x1x and 0x3x
{ 0x13, 0x10, 0x43, 0x13, 0x43, 0x00, 0x00, 0x41 }, // 0x4x and 0x6x // TODO: 0x48 to be checked
{ 0x03, unkn, 0x41, 0x13, 0x02, 0x43, 0x01, unkn }, // 0x5x and 0x7x
{ 0x52, 0x50, unkn, 0x41, unkn, unkn, 0x02, 0x52 }, // 0x8x and 0xax
{ 0x00, 0x00, unkn, unkn, 0x01, unkn, 0x01, 0x10 }, // 0x9x and 0xbx
{ 0x41, 0x12, unkn, 0x50, 0x10, 0x00, unkn, 0x53 }, // 0xcx and 0xex
{ 0x10, 0x10, 0x40, 0x10, 0x12, unkn, 0x50, 0x01 } // 0xdx and 0xfx
},
{
{ 0x02, 0x43, 0x52, 0x51, 0x42, 0x41, 0x50, 0x13 }, // 0x0x and 0x2x
{ 0x43, 0x11, 0x00, 0x03, 0x10, 0x10, 0x43, 0x40 }, // 0x1x and 0x3x
{ 0x51, 0x42, 0x13, 0x42, 0x43, 0x00, 0x51, 0x13 }, // 0x4x and 0x6x
{ 0x13, 0x11, 0x41, 0x12, 0x41, 0x53, 0x11, 0x41 }, // 0x5x and 0x7x
{ unkn, 0x42, 0x51, 0x43, 0x03, 0x03, 0x51, 0x43 }, // 0x8x and 0xax
{ 0x52, 0x02, unkn, 0x03, 0x11, 0x03, unkn, 0x00 }, // 0x9x and 0xbx // TODO: check 2257 for 0xb3
{ 0x41, 0x43, 0x10, 0x02, 0x51, 0x00, 0x13, 0x13 }, // 0xcx and 0xex
{ 0x00, 0x52, 0x03, 0x42, 0x02, 0x13, 0x52, unkn } // 0xdx and 0xfx
}
};
for (int j = 0; j < 0x04; j++)
{
for (int i = 0; i < 0x100; i++)
{
uint8_t const row = bitswap<3>(i, 7, 6, 4);
uint8_t const xor_v = i & 0x07;
if ((i & 0x28) == 0)
LOGUNKOPCODES("table: %01x encop: %02x; decop: %02x\n", j, i, i ^ xor_table[j][row][xor_v]);
}
}
std::copy(&xor_table[0][0][0], &xor_table[0][0][0] + 0x04 * 0x08 * 0x08, &m_decode_table[0][0][0]);
}
void supercrd_state::init_supst() // TODO: check unknown opcodes
{
uint8_t unkn = 0x00;
uint8_t xor_table[0x04][0x08][0x08] =
{
{
{ 0x50, 0x12, 0x02, 0x11, 0x40, 0x11, 0x50, 0x52 }, // 0x0x and 0x2x
{ unkn, 0x01, 0x43, 0x12, 0x01, 0x10, 0x41, 0x13 }, // 0x1x and 0x3x
{ 0x51, 0x12, 0x03, 0x40, 0x02, 0x00, 0x01, 0x51 }, // 0x4x and 0x6x
{ 0x12, 0x03, 0x12, 0x51, 0x00, 0x52, 0x50, 0x40 }, // 0x5x and 0x7x
{ 0x12, 0x53, 0x41, 0x02, unkn, unkn, 0x00, 0x41 }, // 0x8x and 0xax
{ 0x51, unkn, 0x03, 0x40, 0x42, unkn, 0x01, 0x03 }, // 0x9x and 0xbx
{ 0x00, 0x10, 0x52, 0x01, unkn, 0x00, 0x41, 0x12 }, // 0xcx and 0xex
{ 0x50, 0x52, 0x41, unkn, 0x41, unkn, 0x40, 0x53 } // 0xdx and 0xfx
},
{
{ 0x52, 0x12, 0x43, 0x00, 0x01, 0x50, 0x11, 0x40 }, // 0x0x and 0x2x
{ 0x52, 0x52, 0x00, unkn, 0x12, 0x01, 0x00, 0x10 }, // 0x1x and 0x3x
{ 0x41, 0x12, 0x12, 0x41, 0x00, 0x00, 0x12, 0x52 }, // 0x4x and 0x6x
{ 0x01, 0x51, 0x42, 0x42, 0x02, 0x51, 0x01, 0x11 }, // 0x5x and 0x7x
{ 0x53, 0x03, 0x10, unkn, 0x51, 0x43, unkn, unkn }, // 0x8x and 0xax
{ 0x10, 0x53, 0x03, 0x10, 0x42, 0x01, 0x42, 0x11 }, // 0x9x and 0xbx
{ 0x50, 0x52, 0x43, 0x03, 0x43, 0x00, 0x51, 0x52 }, // 0xcx and 0xex
{ 0x01, 0x12, 0x00, 0x12, 0x10, unkn, 0x40, 0x53 } // 0xdx and 0xfx
},
{
{ 0x50, 0x12, 0x53, 0x03, 0x02, 0x02, 0x50, 0x40 }, // 0x0x and 0x2x
{ 0x11, 0x51, 0x00, 0x03, 0x11, 0x40, 0x12, 0x40 }, // 0x1x and 0x3x
{ unkn, 0x42, 0x01, 0x01, 0x10, 0x00, 0x52, 0x03 }, // 0x4x and 0x6x
{ 0x52, 0x03, 0x43, 0x00, 0x42, 0x40, unkn, 0x11 }, // 0x5x and 0x7x
{ unkn, 0x01, 0x53, 0x41, 0x13, 0x02, 0x40, 0x11 }, // 0x8x and 0xax
{ 0x02, 0x02, 0x40, unkn, 0x50, 0x43, 0x13, 0x40 }, // 0x9x and 0xbx
{ 0x41, 0x51, 0x02, 0x00, 0x11, 0x00, 0x12, 0x43 }, // 0xcx and 0xex
{ 0x11, 0x02, 0x11, 0x42, 0x40, 0x40, 0x50, unkn } // 0xdx and 0xfx
},
{
{ 0x50, 0x11, 0x01, 0x02, 0x42, 0x41, 0x51, 0x11 }, // 0x0x and 0x2x
{ 0x53, 0x02, 0x43, 0x11, 0x53, 0x12, 0x03, 0x11 }, // 0x1x and 0x3x
{ 0x13, 0x41, 0x03, 0x03, 0x41, 0x00, 0x52, 0x50 }, // 0x4x and 0x6x
{ 0x41, 0x13, 0x00, 0x41, 0x00, 0x51, 0x03, 0x01 }, // 0x5x and 0x7x
{ 0x13, 0x43, 0x03, 0x50, 0x52, unkn, 0x51, unkn }, // 0x8x and 0xax
{ 0x12, 0x43, 0x02, 0x53, 0x11, unkn, 0x50, 0x02 }, // 0x9x and 0xbx
{ 0x01, 0x42, 0x12, 0x51, 0x50, 0x00, unkn, 0x12 }, // 0xcx and 0xex
{ 0x41, 0x00, 0x52, 0x10, 0x52, 0x42, 0x51, 0x03 } // 0xdx and 0xfx
} }
}; };
@ -944,8 +1070,8 @@ void supercrd_state::init_fruitstr() // TODO: check unknown opcodes
GAME( 1992, supercrd, 0, supercrd, supercrd, supercrd_state, init_supercrd, ROT0, "Fun World", "Super Card (encrypted)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING ) GAME( 1992, supercrd, 0, supercrd, supercrd, supercrd_state, init_supercrd, ROT0, "Fun World", "Super Card (encrypted)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING )
GAME( 1992, fruitstr, 0, supercrd, supercrd, supercrd_state, init_fruitstr, ROT0, "Fun World", "Fruit Star (encrypted)", MACHINE_NOT_WORKING ) GAME( 1992, fruitstr, 0, supercrd, supercrd, supercrd_state, init_fruitstr, ROT0, "Fun World", "Fruit Star (encrypted)", MACHINE_NOT_WORKING )
GAME( 1992, fruitstra, 0, supercrd, supercrd, supercrd_state, init_fruitstr, ROT0, "Fun World", "Fruit Star (v810, encrypted)", MACHINE_NOT_WORKING ) GAME( 1992, fruitstra, 0, supercrd, supercrd, supercrd_state, init_fruitstr, ROT0, "Fun World", "Fruit Star (v810, encrypted)", MACHINE_NOT_WORKING )
GAME( 1990, gampo816, 0, supercrd, supercrd, supercrd_state, empty_init, ROT0, "Fun World", "Gamble Poker (v816, encrypted)", MACHINE_NOT_WORKING ) GAME( 1990, gampo816, 0, supercrd, supercrd, supercrd_state, init_gampo, ROT0, "Fun World", "Gamble Poker (v816, encrypted)", MACHINE_NOT_WORKING )
GAME( 1990, gampo812, 0, supercrd, supercrd, supercrd_state, empty_init, ROT0, "Fun World", "Gamble Poker (v812, encrypted)", MACHINE_NOT_WORKING ) GAME( 1990, gampo812, 0, supercrd, supercrd, supercrd_state, init_gampo, ROT0, "Fun World", "Gamble Poker (v812, encrypted)", MACHINE_NOT_WORKING )
GAME( 1994, supst839, 0, supercrd, supercrd, supercrd_state, empty_init, ROT90, "Fun World", "Super Stars (v839, encrypted)", MACHINE_NOT_WORKING ) GAME( 1994, supst839, 0, supercrd, supercrd, supercrd_state, init_supst, ROT90, "Fun World", "Super Stars (v839, encrypted)", MACHINE_NOT_WORKING )
GAME( 1990, supst834, 0, supercrd, supercrd, supercrd_state, empty_init, ROT90, "Fun World", "Super Stars (v834, encrypted)", MACHINE_NOT_WORKING ) GAME( 1990, supst834, 0, supercrd, supercrd, supercrd_state, init_supst, ROT90, "Fun World", "Super Stars (v834, encrypted)", MACHINE_NOT_WORKING )
GAME( 1989, redline, 0, supercrd, supercrd, supercrd_state, empty_init, ROT90, "Fun World", "Red Line (v808, encrypted)", MACHINE_NOT_WORKING ) GAME( 1989, redline, 0, supercrd, supercrd, supercrd_state, empty_init, ROT90, "Fun World", "Red Line (v808, encrypted)", MACHINE_NOT_WORKING )

View File

@ -28665,7 +28665,7 @@ chmpnum // 1999, unknown
chmpnuma // 1999, unknown chmpnuma // 1999, unknown
chsuper2 // 1999, unknown chsuper2 // 1999, unknown
chsuper3 // 1999, unknown chsuper3 // 1999, unknown
losttrea // 1999, unknown losttrea // 2001, unknown
@source:misc/cleartone.cpp @source:misc/cleartone.cpp
bnstlkr // bnstlkr //

View File

@ -13,6 +13,7 @@ HD63B03XP CPU
NEC D7759C ADPCM speech synthesizer NEC D7759C ADPCM speech synthesizer
Maybe just the sound PCB for something else? Maybe just the sound PCB for something else?
Listening to the UPD samples it seems to be for some kind of vending machine?
*/ */
#include "emu.h" #include "emu.h"