feat: #2 보수 연산을 적용한 Dualsonic 시리얼 파싱 로직 구현 #6
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/serial-complement-parser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
듀얼소닉 카트리지 펌웨어는 시리얼 넘버를 다음 형식으로 입력받아 4바이트(32비트) 저장소에 저장하고 처리함
시리얼 넘버 전체는 10자리 숫자
펌웨어는 10자리 시리얼 넘버를 16진수 방식으로 저장하고, 32비트 signed int로 출력하기 때문에
→ 22년도 시리얼인 2200000000 부터 상위 비트가 1로 해석되어 음수 처리가 발생 (21년도까지 괜찮음)
따라서 100000000 에 해당하는 숫자 2^32 = 4294967296을 더해 관련 보수 처리를 하여 정상적인 값 복원 가능하게 해결함
@ -19,3 +19,1 @@
Private Const PROSerialParsing As ULong = 111669149696
Private Const LUXSerialParsing As ULong = 0
Private Const ALPHASerialParsing As ULong = 412316860416
Private Const TwosComplement32Mask As Long = 4294967296
2^32 보수 처리를 위한 const 변수
@ -1054,1 +1052,3 @@
DataResult = SerialParsingFunc(ModelCode, DataResult)
If serial < 0 Then
serial += TwosComplement32Mask
End If
22년도 시리얼 부터 음수 처리가 되어
음수가 들어올 시 보수 처리