GBA DMA: Minor branch optimization

This commit is contained in:
Vicki Pfau 2024-10-18 05:08:14 -07:00
parent 4a5a25e90c
commit 1c739e39e7
1 changed files with 5 additions and 3 deletions

View File

@ -319,11 +319,13 @@ void GBADMAService(struct GBA* gba, int number, struct GBADMA* info) {
int i;
for (i = 0; i < 4; ++i) {
struct GBADMA* dma = &memory->dma[i];
if (GBADMARegisterIsEnable(dma->reg) && dma->nextCount) {
int32_t time = dma->when - info->when;
if (time < 0 && GBADMARegisterIsEnable(dma->reg) && dma->nextCount) {
if (time < 0) {
dma->when = info->when;
}
}
}
if (!info->nextCount) {
info->nextCount |= 0x80000000;