all repos — mgba @ 99769695d7c897c8678d4fb40ffebb17cbd4875d

mGBA Game Boy Advance Emulator

Fix ADCS C bit
Jeffrey Pfau jeffrey@endrift.com
Thu, 26 Sep 2013 00:25:48 -0700
commit

99769695d7c897c8678d4fb40ffebb17cbd4875d

parent

662feed39045ff0b43d28e97e4c80243a2951518

2 files changed, 4 insertions(+), 5 deletions(-)

jump to
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -569,10 +569,9 @@ DEFINE_ALU_INSTRUCTION_ARM(ADD, ARM_ADDITION_S(n, cpu->shifterOperand, cpu->gprs[rd]),

int32_t n = cpu->gprs[rn]; cpu->gprs[rd] = n + cpu->shifterOperand;) -DEFINE_ALU_INSTRUCTION_ARM(ADC, ARM_ADDITION_S(n, shifterOperand, cpu->gprs[rd]), +DEFINE_ALU_INSTRUCTION_ARM(ADC, ARM_ADDITION_S(n, cpu->shifterOperand, cpu->gprs[rd]), int32_t n = cpu->gprs[rn]; - int32_t shifterOperand = cpu->shifterOperand + cpu->cpsr.c; - cpu->gprs[rd] = n + shifterOperand;) + cpu->gprs[rd] = n + cpu->shifterOperand + cpu->cpsr.c;) DEFINE_ALU_INSTRUCTION_ARM(AND, ARM_NEUTRAL_S(cpu->gprs[rn], cpu->shifterOperand, cpu->gprs[rd]), cpu->gprs[rd] = cpu->gprs[rn] & cpu->shifterOperand;)
M src/arm/isa-thumb.csrc/arm/isa-thumb.c

@@ -255,9 +255,9 @@ }

THUMB_NEUTRAL_S( , , cpu->gprs[rd])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ADC, - int n = cpu->gprs[rn] + cpu->cpsr.c; + int n = cpu->gprs[rn]; int d = cpu->gprs[rd]; - cpu->gprs[rd] = d + n; + cpu->gprs[rd] = d + n + cpu->cpsr.c; THUMB_ADDITION_S(d, n, cpu->gprs[rd]);) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(SBC,