Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

machines promoted to working (Crazy Bugs Japan ver) #12847

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mame/igs/igs_m027xa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ ROM_END
ROM_START( crzybugsj ) // IGS PCB-0575-04-HU - Has IGS027A, MX10EXAQC, IGS031, Oki M6295, 2x 8-dip banks
ROM_REGION( 0x04000, "maincpu", 0 )
// Internal ROM of IGS027A ARM based MCU
ROM_LOAD( "m6.u42", 0x00000, 0x4000, NO_DUMP ) // sticker marked 'M6'
ROM_LOAD( "m6.u42", 0x00000, 0x4000, CRC(ae3a0b2a) SHA1(60265c98278625791cdf6af6b242888e45b6b3bb) ) // sticker marked 'M6'

ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg
ROM_LOAD( "crazy_bugs_v-103jp.u34", 0x000000, 0x200000, CRC(1e35ed79) SHA1(0e4f8b706cdfcaf2aacdc40eec422df9d865b311) )
Expand Down Expand Up @@ -766,8 +766,8 @@ void igs_m027xa_state::init_crzybugs()
void igs_m027xa_state::init_crzybugsj()
{
crzybugsj_decrypt(machine());
//qlgs_gfx_decrypt(machine());
pgm_create_dummy_internal_arm_region();
m_igs017_igs031->sdwx_gfx_decrypt();
m_igs017_igs031->tarzan_decrypt_sprites(0, 0);
}

void igs_m027xa_state::init_tripfev()
Expand Down Expand Up @@ -795,7 +795,7 @@ GAMEL( 2009, crzybugs, 0, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state
GAMEL( 2006, crzybugsa, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", 0, layout_crzybugs ) // IGS FOR V100US 2006 3 29 but also V202US string
GAMEL( 2005, crzybugsb, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", 0, layout_crzybugs ) // FOR V100US 2005 7 20 but also V200US string

GAME( 2007, crzybugsj, crzybugs, igs_mahjong_xa, crzybugs, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", MACHINE_NOT_WORKING ) // IGS FOR V101JP 2007 06 08
GAMEL( 2007, crzybugsj, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", 0, layout_crzybugs ) // IGS FOR V101JP 2007 06 08 (test mode calls this V102JP, ROM label was V103JP)

GAMEL( 2006, tripfev, 0, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V108US)", 0, layout_tripfev )
GAMEL( 2006, tripfeva, tripfev, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", 0, layout_tripfev ) // IGS FOR V107US 2006 09 07
Expand Down
41 changes: 9 additions & 32 deletions src/mame/igs/pgmcrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,49 +1476,26 @@ void mgzz_decrypt(running_machine &machine)
}

// IGS FOR V101JP 2007 06 08

static const uint8_t crzybugsj_tab[0x100] = {
0x67, 0x9b, 0x05, 0x4a, 0x32, 0xcf, 0x41, 0xf8, 0xf8, 0xd5, 0xac, 0x5e, 0xd2, 0x6d, 0xbc, 0xd9,
0x3a, 0x15, 0x63, 0x71, 0xd6, 0x65, 0x5f, 0xce, 0xba, 0x9d, 0x1c, 0x75, 0x75, 0x25, 0x3c, 0x64,
0xd6, 0x83, 0xc6, 0x7c, 0x7a, 0xe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x76, 0x6b, 0x9f, 0x16, 0xf7,
0x39, 0xb0, 0x65, 0xb6, 0xe7, 0xe5, 0xdb, 0xbf, 0xd7, 0x95, 0xbd, 0x3b, 0x36, 0x71, 0xfe, 0x8f,
0x15, 0x10, 0xe5, 0x63, 0x12, 0xa5, 0x1a, 0xee, 0x77, 0x49, 0x2e, 0xb4, 0x25, 0xd4, 0x83, 0x2d
};

void crzybugsj_decrypt(running_machine &machine)
{
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());

int const rom_size = 0x80000;
memory_region *const region = machine.root_device().memregion("user1");
auto const src = util::little_endian_cast<u16>(reinterpret_cast<u32 *>(region->base()));
auto const rom_size = region->bytes();

for (int i = 0; i < rom_size / 2; i++)
{
int x = src[i];
uint16_t x = 0;

// may need corrected
IGS27_CRYPT1
IGS27_CRYPT2_ALT // correct
IGS27_CRYPT3_ALT // correct
IGS27_CRYPT4 // correct
IGS27_CRYPT5 // correct
IGS27_CRYPT2_ALT
IGS27_CRYPT3_ALT
IGS27_CRYPT4
IGS27_CRYPT5
IGS27_CRYPT6
IGS27_CRYPT7
IGS27_CRYPT8

x ^= crzybugsj_tab[(i >> 1) & 0xff] << 8;

src[i] = x;
src[i] ^= x;
}
}

Expand Down
Loading