all repos — mgba @ dab27463a979056fb017b4e2271a7a24c7455e0b

mGBA Game Boy Advance Emulator

Implement DivArm
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 19:58:21 -0700
commit

dab27463a979056fb017b4e2271a7a24c7455e0b

parent

fd5661e941549e5cf22b93f071c2609203ffabfc

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M src/gba/gba-bios.csrc/gba/gba-bios.c

@@ -105,6 +105,14 @@ gba->cpu.gprs[1] = result.rem;

gba->cpu.gprs[2] = abs(result.quot); } break; + case 0x7: + { + div_t result = div(gba->cpu.gprs[1], gba->cpu.gprs[0]); + gba->cpu.gprs[0] = result.quot; + gba->cpu.gprs[1] = result.rem; + gba->cpu.gprs[2] = abs(result.quot); + } + break; case 0xB: _CpuSet(gba); break;