mirror of https://github.com/mgba-emu/mgba.git
GBA DMA: Minor branch optimization
This commit is contained in:
parent
4a5a25e90c
commit
1c739e39e7
|
@ -319,9 +319,11 @@ void GBADMAService(struct GBA* gba, int number, struct GBADMA* info) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 4; ++i) {
|
for (i = 0; i < 4; ++i) {
|
||||||
struct GBADMA* dma = &memory->dma[i];
|
struct GBADMA* dma = &memory->dma[i];
|
||||||
int32_t time = dma->when - info->when;
|
if (GBADMARegisterIsEnable(dma->reg) && dma->nextCount) {
|
||||||
if (time < 0 && GBADMARegisterIsEnable(dma->reg) && dma->nextCount) {
|
int32_t time = dma->when - info->when;
|
||||||
dma->when = info->when;
|
if (time < 0) {
|
||||||
|
dma->when = info->when;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue