* knightsb2: fixed priorities and highscores.

* cps1 kludges: gave reverse sprites its own bit as it's used often
This commit is contained in:
Robbbert 2022-07-28 07:59:37 +10:00
parent 1cf2d85609
commit e54ded48cb

View File

@ -501,6 +501,7 @@ The games seem to use them to mark platforms, kill zones and no-go areas.
#define HACK_B_1 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x14,{0x12,0x10,0x0e,0x0c},0x0a, {0x0e,0x0e,0x0e,0x30,0x30}
#define HACK_B_2 -1, -1, 0x0e,0x0c,0x0a,0x08, 0x06,0x04,0x02, 0x28,{0x26,0x24,0x22,0x20},0x22, {0x20,0x04,0x08,0x12,0x12}
#define HACK_B_3 0x20,0x0004, __not_applicable__, 0x30,{0x26, -1, 0x28,0x32},0x2a, {0x02,0x04,0x08,0x00,0x00} // varthb2, writes to priority mask 2 have been patched out
#define HACK_B_4 -1, -1, __not_applicable__, 0x28,{0x26,0x24,0x22,0x20},0x30, {0x40,0x10,0x02,0x00,0x00} // knightsb2
/*
CPS_B_21_DEF is CPS-B-21 at default settings (no battery)
@ -1793,11 +1794,11 @@ static const struct CPS1config cps1_config_table[]=
{"sf2ef", CPS_B_15, mapper_STF29, 0x36 },
{"sf2em", CPS_B_17, mapper_STF29, 0x36 },
{"sf2en", CPS_B_17, mapper_STF29, 0x36 }, // wrong, this set uses a custom gal, not dumped
{"sf2ebbl", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2ebbl2", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2ebbl3", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2stt", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2rk", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2ebbl", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2ebbl2", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2ebbl3", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2stt", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2rk", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2ua", CPS_B_17, mapper_STF29, 0x36 },
{"sf2ub", CPS_B_17, mapper_STF29, 0x36 },
{"sf2uc", CPS_B_12, mapper_STF29, 0x36 },
@ -1841,13 +1842,13 @@ static const struct CPS1config cps1_config_table[]=
{"captcommu", CPS_B_21_BT3, mapper_CC63B, 0x36, 0x38, 0x34 },
{"captcommj", CPS_B_21_BT3, mapper_CC63B, 0x36, 0x38, 0x34 },
{"captcommjr1", CPS_B_21_BT3, mapper_CC63B, 0x36, 0x38, 0x34 },
{"captcommb", CPS_B_21_BT3, mapper_CC63B, 0x36, 0x38, 0x34, 3 },
{"captcommb", CPS_B_21_BT3, mapper_CC63B, 0x36, 0x38, 0x34, 0x43 },
{"captcommb2", CPS_B_21_BT4, mapper_CC63B }, // junk around health bar with default cps2 mapper, uses BT4(knights) config
{"knights", CPS_B_21_BT4, mapper_KR63B, 0x36, 0, 0x34 },
{"knightsu", CPS_B_21_BT4, mapper_KR63B, 0x36, 0, 0x34 },
{"knightsj", CPS_B_21_BT4, mapper_KR63B, 0x36, 0, 0x34 },
{"knightsja", CPS_B_21_BT4, mapper_KR22B, 0x36, 0, 0x34 },
{"knightsb2", CPS_B_21_BT4, mapper_KR63B, 0x36, 0, 0x34 }, // wrong, knightsb bootleg doesn't use the KR63B PAL
{"knightsb2", HACK_B_4, mapper_KR63B, 0x36, 0, 0x34, 0x40 }, // wrong, knightsb bootleg doesn't use the KR63B PAL
//{"knightsb", CPS_B_21_BT4, mapper_KR63B, 0x36, 0, 0x34 }, // wrong, knightsb bootleg doesn't use the KR63B PAL
{"knightsb3", CPS_B_21_BT4, mapper_KR63B },
{"pokonyan", CPS_B_21_DEF, mapper_pokonyan, 0x36 }, // wrong, this set uses an unknown PAL, still not dumped
@ -1872,45 +1873,45 @@ static const struct CPS1config cps1_config_table[]=
{"sf2cebltw", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2acca", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2accp2", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2amf", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 }, // probably wrong but this set is not completely dumped anyway
{"sf2amf2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2amf3", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2amf", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 }, // probably wrong but this set is not completely dumped anyway
{"sf2amf2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2amf3", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2dkot2", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2level", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2level", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2m1", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2m2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m3", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2m4", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m5", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m6", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m7", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m8", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2m2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2m3", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2m4", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2m5", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2m6", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2m7", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2m8", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2m9", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2m10", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2m10", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2dongb", CPS_B_21_DEF, mapper_S9263B, 0x36 },
{"sf2yyc", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2koryu", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2mdt", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2mdta", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2mdtb", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceb", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceb2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceb3", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceb4", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceb5", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2b", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2b2", CPS_B_17, mapper_STF29, 0x36, 0, 0, 1 },
{"sf2ceupl", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2rules", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2ceds6", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2cems6a", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2cems6b", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2cems6c", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2re", HACK_B_1, mapper_S9263B, 0, 0, 0, 2 },
{"sf2mkot", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },
{"sf2yyc", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2koryu", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2mdt", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2mdta", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2mdtb", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceb", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceb2", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceb3", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceb4", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceb5", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2b", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2b2", CPS_B_17, mapper_STF29, 0x36, 0, 0, 0x41 },
{"sf2ceupl", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2rules", HACK_B_1, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"sf2ceds6", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2cems6a", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2cems6b", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2cems6c", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2re", HACK_B_1, mapper_S9263B, 0, 0, 0, 0x42 },
{"sf2mkot", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 0x41 },
{"varth", CPS_B_04, mapper_VA24B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
{"varthb", CPS_B_04, mapper_VA63B, 0, 0, 0, 0x0F },
{"varthb2", HACK_B_3, mapper_sfzch, 0, 0, 0, 0x80 }, // unknown gal, other varth mappers don't work (game looks for sprites in >0x8000 unmapped region)
{"varthb2", HACK_B_3, mapper_sfzch, 0, 0, 0, 0xc1 }, // unknown gal, other varth mappers don't work (game looks for sprites in >0x8000 unmapped region)
{"varthb3", CPS_B_04, mapper_VA63B, 0, 0, 0, 0x0F }, // TODO: wrong
{"varthr1", CPS_B_04, mapper_VA24B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
{"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
@ -2259,7 +2260,8 @@ void cps_state::cps1_get_video_base()
}
/* Some of the sf2 hacks use only sprite port 0x9100 and the scroll layers are offset */
if (m_game_config->bootleg_kludge == 0x01)
u8 kludge = m_game_config->bootleg_kludge & 15;
if (kludge == 0x01)
{
m_cps_a_regs[CPS1_OBJ_BASE] = 0x9100;
scroll1xoff = -0x0c;
@ -2267,21 +2269,21 @@ void cps_state::cps1_get_video_base()
scroll3xoff = -0x10;
}
else
if (m_game_config->bootleg_kludge == 0x0E)
if (kludge == 0x0E)
{
scroll1xoff = 0xffba;
scroll2xoff = 0xffc0;
scroll3xoff = 0xffba;
}
else
if (m_game_config->bootleg_kludge == 0x0F)
if (kludge == 0x0F)
{
scroll1xoff = 0xffc0;
scroll2xoff = 0xffc0;
scroll3xoff = 0xffc0;
}
else
if (m_game_config->bootleg_kludge == 2)
if (kludge == 2)
{
m_cps_a_regs[CPS1_OBJ_BASE] = 0x9100;
scroll1xoff = -0x10;
@ -2289,20 +2291,13 @@ void cps_state::cps1_get_video_base()
scroll3xoff = -0x10;
}
else
if (m_game_config->bootleg_kludge == 3)
if (kludge == 3)
{
scroll1xoff = -0x08;
scroll2xoff = -0x0b;
scroll3xoff = -0x0c;
}
else
if (m_game_config->bootleg_kludge == 0x80)
{
scroll1xoff = -0x0c;
scroll2xoff = -0x0e;
scroll3xoff = -0x10;
}
else
if (m_game_config->bootleg_kludge == 0x88) // 3wondersb
{
scroll1xoff = 0x4;
@ -2708,7 +2703,8 @@ void cps_state::find_last_sprite() /* Find the offset of last sprite */
/* Locate the end of table marker */
while (offset < m_obj_size / 2)
{
if (m_game_config->bootleg_kludge == 3) {
if (BIT(m_game_config->bootleg_kludge, 0, 4) == 3)
{
/* captcommb - same end of sprite marker as CPS-2 */
int colour = m_buffered_obj[offset + 1];
if (colour >= 0x8000)
@ -2761,7 +2757,7 @@ void cps_state::cps1_render_sprites( screen_device &screen, bitmap_ind16 &bitmap
uint16_t *base = m_buffered_obj.get();
/* some sf2 hacks draw the sprites in reverse order */
if ((m_game_config->bootleg_kludge == 1) || (m_game_config->bootleg_kludge == 2) || (m_game_config->bootleg_kludge == 3) || (m_game_config->bootleg_kludge == 0x80))
if (BIT(m_game_config->bootleg_kludge, 6))
{
base += m_last_sprite_offset;
baseadd = -4;