sh2 drc: bugfix in block management

This commit is contained in:
kub 2019-10-12 11:10:28 +02:00
parent a6c0ab7d99
commit 6b9ded20a0
2 changed files with 3 additions and 5 deletions

View file

@ -769,8 +769,7 @@ static void rm_block_list(struct block_list **blist)
struct block_list *next, *current = *blist; struct block_list *next, *current = *blist;
while (current != NULL) { while (current != NULL) {
next = current->next; next = current->next;
current->next = blist_free; rm_from_block_lists(current->block);
blist_free = current;
current = next; current = next;
} }
*blist = NULL; *blist = NULL;
@ -5441,7 +5440,6 @@ int sh2_drc_init(SH2 *sh2)
block_tables[i] = calloc(BLOCK_MAX_COUNT(i), sizeof(*block_tables[0])); block_tables[i] = calloc(BLOCK_MAX_COUNT(i), sizeof(*block_tables[0]));
if (block_tables[i] == NULL) if (block_tables[i] == NULL)
goto fail; goto fail;
// max 2 block links (exits) per block
block_link_pool[i] = calloc(BLOCK_LINK_MAX_COUNT(i), block_link_pool[i] = calloc(BLOCK_LINK_MAX_COUNT(i),
sizeof(*block_link_pool[0])); sizeof(*block_link_pool[0]));
if (block_link_pool[i] == NULL) if (block_link_pool[i] == NULL)

View file

@ -513,9 +513,9 @@ static void p32x_reg_write8(u32 a, u32 d)
case 0x2e: case 0x2e:
case 0x2f: case 0x2f:
if (REG8IN16(r, a) != d) { if (REG8IN16(r, a) != d) {
int cycles = SekCyclesDone(); unsigned int cycles = SekCyclesDone();
if (cycles - (int)msh2.m68krcycles_done > 30) if (CYCLES_GT(cycles - msh2.m68krcycles_done, 64))
p32x_sync_sh2s(cycles); p32x_sync_sh2s(cycles);
REG8IN16(r, a) = d; REG8IN16(r, a) = d;