Skip to content

Commit

Permalink
- Fix random missed interrupt.
Browse files Browse the repository at this point in the history
- Fix Game Boy Player Start-up Disc soft reset.
  • Loading branch information
Extrems committed Oct 24, 2019
1 parent 6e0e316 commit d594b6b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cube/patches/alt/emulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ void di_update_interrupts(void)
*(OSInterruptMask *)OSCachedToMirrored(VAR_FAKE_IRQ_SET) |= OS_INTERRUPTMASK_EMU_DI;
else
*(OSInterruptMask *)OSCachedToUncached(VAR_FAKE_IRQ_SET) &= ~OS_INTERRUPTMASK_EMU_DI;

asm volatile("sc" ::: "r9", "r10");
}

void di_complete_transfer(void)
Expand Down Expand Up @@ -65,9 +67,12 @@ static void di_execute_command(void)
}
case 0xE3:
{
(*DI_EMU)[1] |= 0b001;
mftb((tb_t *)VAR_TIMER_START);
*(uint32_t *)VAR_DISC_CHANGING = 1;
if (*(uint32_t *)VAR_DISC_1_LBA != *(uint32_t *)VAR_DISC_2_LBA) {
(*DI_EMU)[1] |= 0b001;
mftb((tb_t *)VAR_TIMER_START);
*(uint32_t *)VAR_DISC_CHANGING = 1;
}
break;
}
}

Expand Down

0 comments on commit d594b6b

Please sign in to comment.