Uploaded June 2022 | Updated November 2026, 1 day ago
When translating Motorola 68000 assembly to C#, I often change the order of the conditional instructions, to make it simpler and clearer in C#. Though, between so many little details it is not unusual to misinterpret a conditional operand. Specially when you find a variety of them as follows:
CMP A,B signed unsigned
---------------------------------------------------------
B « A BLT BLO or BCS
B «= A BLE BLS
B == A BEQ BEQ
B != A BNE BNE
B » A BGT BHI
B »= A BGE BHS or BCC
There's also BPL for A »= 0 and BMI for A « 0
More on the Motorola 68K comparison operations:
68k.hax.com/CMP
Now, the real challenge is to find the bugs in the first place. First they have to be noticed. Often this errors result in single pixel or single frame differences from the original and are hardly noticeable, if at all. Then once identified, I have to go through the code that is playing part of the circumstance, checking every condition and operation against the M68K disassembly. Also helps knowing the code and having a gut feeling of where to look. But finding the source of a bug like this can take hours. Debugging comes to aid as well. Often only on the C# side, but not rarely it is necessary to debug the original game as well, with an emulator with disassembly and debugging capabilities. Debugging the original game and the C# port side by side, in the same circumstances, proves effective.
All in all, all tools come in hand to find find a needle in a haystack.
Check out Streets of Rage 2 New Era at:
sor2newera.com
When translating Motorola 68000 assembly to C#, I often change the order of the conditional instructions, to make it simpler and clearer in C#. Though, between so many little details it is not unusual to misinterpret a conditional operand. Specially when you find a variety of them as follows:
CMP A,B signed unsigned
---------------------------------------------------------
B « A BLT BLO or BCS
B «= A BLE BLS
B == A BEQ BEQ
B != A BNE BNE
B » A BGT BHI
B »= A BGE BHS or BCC
There's also BPL for A »= 0 and BMI for A « 0
More on the Motorola 68K comparison operations:
68k.hax.com/CMP
Now, the real challenge is to find the bugs in the first place. First they have to be noticed. Often this errors result in single pixel or single frame differences from the original and are hardly noticeable, if at all. Then once identified, I have to go through the code that is playing part of the circumstance, checking every condition and operation against the M68K disassembly. Also helps knowing the code and having a gut feeling of where to look. But finding the source of a bug like this can take hours. Debugging comes to aid as well. Often only on the C# side, but not rarely it is necessary to debug the original game as well, with an emulator with disassembly and debugging capabilities. Debugging the original game and the C# port side by side, in the same circumstances, proves effective.
All in all, all tools come in hand to find find a needle in a haystack.
Check out Streets of Rage 2 New Era at:
sor2newera.com










