mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
bugfix/improvement
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@290 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
3ec29f016c
commit
1f4e9f147f
5 changed files with 60 additions and 15 deletions
17
Pico/Cart.c
17
Pico/Cart.c
|
@ -331,16 +331,21 @@ int PicoUnloadCart(unsigned char* romdata)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int name_cmp(const char *name)
|
static int rom_strcmp(int rom_offset, const char *s1)
|
||||||
{
|
{
|
||||||
int i, len = strlen(name);
|
int i, len = strlen(s1);
|
||||||
const char *name_rom = (const char *)Pico.rom+0x150;
|
const char *s_rom = (const char *)Pico.rom + rom_offset;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
if (name[i] != name_rom[i^1])
|
if (s1[i] != s_rom[i^1])
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int name_cmp(const char *name)
|
||||||
|
{
|
||||||
|
return rom_strcmp(0x150, name);
|
||||||
|
}
|
||||||
|
|
||||||
/* various cart-specific things, which can't be handled by generic code */
|
/* various cart-specific things, which can't be handled by generic code */
|
||||||
void PicoCartDetect(void)
|
void PicoCartDetect(void)
|
||||||
{
|
{
|
||||||
|
@ -441,5 +446,9 @@ void PicoCartDetect(void)
|
||||||
if (name_cmp("DINO DINI'S SOCCER") == 0 ||
|
if (name_cmp("DINO DINI'S SOCCER") == 0 ||
|
||||||
name_cmp("MICRO MACHINES II") == 0)
|
name_cmp("MICRO MACHINES II") == 0)
|
||||||
memset(SRam.data, 0xff, sram_size);
|
memset(SRam.data, 0xff, sram_size);
|
||||||
|
|
||||||
|
// Unusual region 'code'
|
||||||
|
if (rom_strcmp(0x1f0, "EUROPE") == 0)
|
||||||
|
*(int *) (Pico.rom+0x1f0) = 0x20204520;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -523,11 +523,22 @@ static void find_combos(void)
|
||||||
combo_keys = combo_acts = 0;
|
combo_keys = combo_acts = 0;
|
||||||
for (act = 0; act < 32; act++)
|
for (act = 0; act < 32; act++)
|
||||||
{
|
{
|
||||||
int keyc = 0;
|
int keyc = 0, keyc2 = 0;
|
||||||
if (act == 16 || act == 17) continue; // player2 flag
|
if (act == 16 || act == 17) continue; // player2 flag
|
||||||
for (u = 0; u < 32; u++)
|
if (act > 17)
|
||||||
{
|
{
|
||||||
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
for (u = 0; u < 32; u++)
|
||||||
|
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 0 && // pl. 1
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc++;
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 1 && // pl. 2
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc2++;
|
||||||
|
if (keyc2 > keyc) keyc = keyc2;
|
||||||
}
|
}
|
||||||
if (keyc > 1)
|
if (keyc > 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,11 +104,22 @@ static void find_combos(void)
|
||||||
combo_keys = combo_acts = 0;
|
combo_keys = combo_acts = 0;
|
||||||
for (act = 0; act < 32; act++)
|
for (act = 0; act < 32; act++)
|
||||||
{
|
{
|
||||||
int keyc = 0;
|
int keyc = 0, keyc2 = 0;
|
||||||
if (act == 16 || act == 17) continue; // player2 flag
|
if (act == 16 || act == 17) continue; // player2 flag
|
||||||
for (u = 0; u < 32; u++)
|
if (act > 17)
|
||||||
{
|
{
|
||||||
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
for (u = 0; u < 32; u++)
|
||||||
|
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 0 && // pl. 1
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc++;
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 1 && // pl. 2
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc2++;
|
||||||
|
if (keyc2 > keyc) keyc = keyc2;
|
||||||
}
|
}
|
||||||
if (keyc > 1)
|
if (keyc > 1)
|
||||||
{
|
{
|
||||||
|
@ -122,6 +133,7 @@ static void find_combos(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("combo keys/acts: %08x %08x\n", combo_keys, combo_acts);
|
// printf("combo keys/acts: %08x %08x\n", combo_keys, combo_acts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -794,11 +794,22 @@ static void find_combos(void)
|
||||||
combo_keys = combo_acts = 0;
|
combo_keys = combo_acts = 0;
|
||||||
for (act = 0; act < 32; act++)
|
for (act = 0; act < 32; act++)
|
||||||
{
|
{
|
||||||
int keyc = 0;
|
int keyc = 0, keyc2 = 0;
|
||||||
if (act == 16 || act == 17) continue; // player2 flag
|
if (act == 16 || act == 17) continue; // player2 flag
|
||||||
for (u = 0; u < 32; u++)
|
if (act > 17)
|
||||||
{
|
{
|
||||||
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
for (u = 0; u < 32; u++)
|
||||||
|
if (currentConfig.KeyBinds[u] & (1 << act)) keyc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 0 && // pl. 1
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc++;
|
||||||
|
for (u = 0; u < 32; u++)
|
||||||
|
if ((currentConfig.KeyBinds[u] & 0x30000) == 1 && // pl. 2
|
||||||
|
(currentConfig.KeyBinds[u] & (1 << act))) keyc2++;
|
||||||
|
if (keyc2 > keyc) keyc = keyc2;
|
||||||
}
|
}
|
||||||
if (keyc > 1)
|
if (keyc > 1)
|
||||||
{
|
{
|
||||||
|
@ -867,6 +878,8 @@ void emu_Loop(void)
|
||||||
sound_prepare();
|
sound_prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sceDisplayWaitVblankStart();
|
||||||
|
|
||||||
// loop?
|
// loop?
|
||||||
while (engineState == PGS_Running)
|
while (engineState == PGS_Running)
|
||||||
{
|
{
|
||||||
|
|
|
@ -991,7 +991,7 @@ static void menu_opt3_cust_draw(const menu_entry *entry, int x, int y, void *par
|
||||||
char *val = " never";
|
char *val = " never";
|
||||||
if (currentConfig.EmuOpt & 0x2000)
|
if (currentConfig.EmuOpt & 0x2000)
|
||||||
val = (currentConfig.EmuOpt & 0x10000) ? "sometimes" : " always";
|
val = (currentConfig.EmuOpt & 0x10000) ? "sometimes" : " always";
|
||||||
text_out16(x, y, "Wait for vsync %s", val);
|
text_out16(x, y, "Wait for vsync (slow) %s", val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -1045,7 +1045,7 @@ static void draw_dispmenu_options(int menu_sel)
|
||||||
static void dispmenu_loop_options(void)
|
static void dispmenu_loop_options(void)
|
||||||
{
|
{
|
||||||
static int menu_sel = 0;
|
static int menu_sel = 0;
|
||||||
int menu_sel_max, is_32col = 0;
|
int menu_sel_max, is_32col = (Pico.video.reg[12]&1)^1;
|
||||||
unsigned long inp = 0;
|
unsigned long inp = 0;
|
||||||
menu_id selected_id;
|
menu_id selected_id;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue