Gary Vine and I started to convert the assembly language by hand, and it took around 1 day to convert 1 source file (there were around 40 files if I remember correctly), but the game was still in development so each time a file was changed we had to check it and see what was different and then redo that section. So it would take another hour or two each time a file was changed. So I wrote the 68K2C program, with the idea it would do most of the tedious part of the conversion and then we would hand code the sections it couldn't handle. Whilst I was doing that, Gary was working on the PC version (Direct X version 1 I think), it was designed to be able to run on a Pentium at 90 Mzh. The 68K2C program would keep track of instructions that modified the condition code flag, but it would care if there was a branch afterwards. I included the assembly language as comments in the C code, so we could check if there was a problem. I used a union so that I could refer to .b = (byte), .w = (word 16 bits), and .l = (long 32 bits).
D0.W = 10; //move.w #10,D0
D1.W += D0.W; //add.w d1,d0
moveSprite(); //jsr moveSprite()
D1.W += D0.W; //add.w d1,d0
if (D1.W > 0) goto finish; //bge finish
The 68000 source code was optimized so it would do stuff like addq #4,A7 which skips the top value from the stack (that means don't return to where you came from, but go back to where that was called). So I built a list of routines where that could happen when it was converting the program, so that it could treat those as a special case. I made those routines return a bool value (true or false), and the code became
if (moveSonic()) return; //jsr moveSonic
There were a few instructions that were converted into macros because there is no C equivalent, such as rotate. Neil Harding