mirror of https://github.com/mgba-emu/mgba.git
Implement Div
This commit is contained in:
parent
d2e84f0a30
commit
3cd5e8d093
|
@ -96,6 +96,14 @@ void GBASwi16(struct ARMBoard* board, int immediate) {
|
||||||
gba->memory.io[REG_IF >> 1] = 0;
|
gba->memory.io[REG_IF >> 1] = 0;
|
||||||
ARMRaiseSWI(&gba->cpu);
|
ARMRaiseSWI(&gba->cpu);
|
||||||
break;
|
break;
|
||||||
|
case 0x6:
|
||||||
|
{
|
||||||
|
div_t result = div(gba->cpu.gprs[0], gba->cpu.gprs[1]);
|
||||||
|
gba->cpu.gprs[0] = result.quot;
|
||||||
|
gba->cpu.gprs[1] = result.rem;
|
||||||
|
gba->cpu.gprs[2] = abs(result.quot);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 0xB:
|
case 0xB:
|
||||||
_CpuSet(gba);
|
_CpuSet(gba);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue