diff options
author | Lioncash <mathew1800@gmail.com> | 2015-07-28 05:45:24 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2015-07-28 08:27:57 +0200 |
commit | 89540ea7618fbaca1c9cd332b24aff7f2865d324 (patch) | |
tree | d5e25da76e20be36e3016beb363b2c25071d9c36 /src/core/arm/dyncom/arm_dyncom_dec.cpp | |
parent | dyncom: Remove code duplication regarding thumb instructions (diff) | |
download | yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar.gz yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar.bz2 yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar.lz yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar.xz yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.tar.zst yuzu-89540ea7618fbaca1c9cd332b24aff7f2865d324.zip |
Diffstat (limited to 'src/core/arm/dyncom/arm_dyncom_dec.cpp')
-rw-r--r-- | src/core/arm/dyncom/arm_dyncom_dec.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/arm/dyncom/arm_dyncom_dec.cpp b/src/core/arm/dyncom/arm_dyncom_dec.cpp index 3ab9f2c17..48fc1c683 100644 --- a/src/core/arm/dyncom/arm_dyncom_dec.cpp +++ b/src/core/arm/dyncom/arm_dyncom_dec.cpp @@ -414,14 +414,13 @@ const ISEITEM arm_exclusion_code[] = { { "invalid", 0, INVALID, { 0 }} }; -int decode_arm_instr(u32 instr, s32* idx) { +ARMDecodeStatus DecodeARMInstruction(u32 instr, s32* idx) { int n = 0; int base = 0; - int ret = DECODE_FAILURE; - int i = 0; int instr_slots = sizeof(arm_instruction) / sizeof(ISEITEM); + ARMDecodeStatus ret = ARMDecodeStatus::FAILURE; - for (i = 0; i < instr_slots; i++) { + for (int i = 0; i < instr_slots; i++) { n = arm_instruction[i].attribute_value; base = 0; @@ -438,11 +437,11 @@ int decode_arm_instr(u32 instr, s32* idx) { n--; } - // All conditions is satisfied. + // All conditions are satisfied. if (n == 0) - ret = DECODE_SUCCESS; + ret = ARMDecodeStatus::SUCCESS; - if (ret == DECODE_SUCCESS) { + if (ret == ARMDecodeStatus::SUCCESS) { n = arm_exclusion_code[i].attribute_value; if (n != 0) { base = 0; @@ -454,13 +453,13 @@ int decode_arm_instr(u32 instr, s32* idx) { n--; } - // All conditions is satisfied. + // All conditions are satisfied. if (n == 0) - ret = DECODE_FAILURE; + ret = ARMDecodeStatus::FAILURE; } } - if (ret == DECODE_SUCCESS) { + if (ret == ARMDecodeStatus::SUCCESS) { *idx = i; return ret; } |