From 837f7990587fa2f9982946b42c208b2bbc6d53c7 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Thu, 30 Jul 2015 18:35:33 -0400 Subject: [PATCH 1/2] #549 fixed incorrect case conversion math, simplified a couple of expressions --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 6e2892bf4..c4ee5a4f6 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -23,15 +23,15 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) for (Count = 0; Count < Finish; Count++) { Value = (Value << 4); - Current = HexValue[Count]; + Current = HexValue[Count] - '0'; if(Current >= '0' && Current <= '9') { Value += Current - '0'; } else { - if(Current < 'A') - Current += 'A' - 'a'; + if(Current > 'F') + Current -= 32; //32 is the distance between A and a if (Current >= 'A' && Current <= 'F') { From d57d951d3925889717d79b2a723a20e91cc5c895 Mon Sep 17 00:00:00 2001 From: jmarlin Date: Thu, 30 Jul 2015 18:37:15 -0400 Subject: [PATCH 2/2] #549 removed a vestigial bit of expression from a direction I ended up not going in --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index c4ee5a4f6..1047a7c67 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -23,7 +23,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) for (Count = 0; Count < Finish; Count++) { Value = (Value << 4); - Current = HexValue[Count] - '0'; + Current = HexValue[Count]; if(Current >= '0' && Current <= '9') { Value += Current - '0'; @@ -35,7 +35,7 @@ DWORD CMemoryLabel::AsciiToHex (char * HexValue) if (Current >= 'A' && Current <= 'F') { - Value += Current + 10 - 'A'; + Value += Current - 55; //55 is the code for 'A' less 10 } else {