The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: Nipedley on July 04, 2009, 07:32:01 am

Title: Help with byte swapping?
Post by: Nipedley on July 04, 2009, 07:32:01 am
Hey guys, not 100% if this is the right forum but I couldn't think where else it would be appropriate!

I noticed someone post about a mega-tech and the possibility of using old MD games on them, it was an old project of mine to build a dev cart but I could never figure out how the roms were byte swapped. I decided to have another bash at it today, since I now owned a sonic the hedgehog 2 cart for my mega-tech I decided to see what the differences were between the original and the arcade..

Here is a portion of the original;
SEGA GENESIS    (C)SEGA 1992.SEPSONIC THE             HEDGEHOG 2

and here is the same portion of the mega-tech cart;
ESAGG NESESI    C(S)GE A9129S.PEOSIN CHT E            EHGDHEGO2

I managed to determine the difference, each individual byte needs to flip with its neighbour.

Example; flipping each letter with its neighbour
ESAGG NESESI
SEGA GENESIS

The problem is I don't know how to effect that change on a whole rom dump rather than doing every byte by hand which is obviously impractical!!

Any help or if you could point me in the right direction would be magic. I know a few other people who were also wondering about this so you'd be helping them in effect too :)
Title: Re: Help with byte swapping?
Post by: headkaze on July 04, 2009, 07:56:52 am
Just knocked up this little app for you.

USAGE: SwapEndian <file>
Title: Re: Help with byte swapping?
Post by: Nipedley on July 04, 2009, 08:27:29 am
Thanks :D For some reason it won't let me download your program but looking into what you mentioned about endians I managed to find a hex editor 'Reverse engineering', I tried out all the byte swap and flips it could perform and found out I needed a 16 bit byte swap. It was only a trial and wouldn't let me save hence, straight into hex workshop and out comes a working rom! Tested the megatech rom swapped and it worked great as a megadrive game, and the megadrive rom swapped works as a megatech game!

Now I just need to find my old plans for the dev cart and this project can get started! ;D
Title: Re: Help with byte swapping?
Post by: Robbbert on July 06, 2009, 04:32:55 am
I agree - that attachment cannot be saved.

If any admins wander by, maybe you can fix it? Clicking on it gives the "server not found or DNS error" message.