Endian-ness of 16bit SNES ROMs

Discussion in 'Modding and Hacking - Consoles and Electronics' started by jaskamakkara, Feb 12, 2018.

  1. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    Hi guys,

    I am trying to make some SA-1 and SDD-1 repros using M27c322 EPROMs with the adapters from @TheRealPhoenix found in this thread. I am burning the EPROMs using an adapter for my TL866 that I built using the schematic from this thread.

    The only question I have is, what is the endianness that the SNES uses for these 16bit cartridges? Can I simply burn my Super Mario RPG (for example) ROM onto my M27c322 with my TL866 without any byte-swapping?

    I'm really struggling to find a definitive answer in an existing thread on this one, so any help from someone who has done this before would be appreciated. The TL866 software seems to show the ROM data byte-swapped in it's window, which is also a little confusing...
     
  2. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,613
    Likes Received:
    1,383
    There's no byte swapping required
     
  3. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    OK thanks :)

    Am I right in saying, though, that you do need to byte-swap for Mega Drive games? (I read this somewhere on a forum)
     
  4. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,613
    Likes Received:
    1,383
    Yes, assuming it's not already swapped.

    If your software shows the buffer in 8 bit and 16 bit and the 16 bit looks swapped compared to 8 (this is how my programmer works).

    You should be able to load a rom and be able to read the text in 16 bit mode but not 8.
     
    jaskamakkara likes this.
  5. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    Yes that's how my programmer (TL866) works, too. Can Mega Drive ROMs come in both swapped or non-swapped states? I guess it's wise then to always check the ROM in a hex editor before doing anything.
     
  6. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,613
    Likes Received:
    1,383
    Just open in your programmer software, switch to 16 bit mode. See if you can read the text or not.
     
  7. TheRealPhoenix

    TheRealPhoenix Spoken Language: French & English

    Joined:
    Apr 24, 2014
    Messages:
    298
    Likes Received:
    81
    No need to byte-swapp with my SA-1/SDD1 adpaters: they are straight-forward as possible.
     
    jaskamakkara likes this.
  8. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,613
    Likes Received:
    1,383
    It's not specific to your adapter. There's no byte swapping of snes roms.
     
  9. TheRealPhoenix

    TheRealPhoenix Spoken Language: French & English

    Joined:
    Apr 24, 2014
    Messages:
    298
    Likes Received:
    81
    If you're using a 27C801 to directly replace a maskrom, you can use SNES ROM UTILITY and byteswap the file before burning it: this will make the output closer to the orginal pinout of an actual Maskrom, minus the A16 and /OE to manualy wire. This is to avoid a spaghetti mode.

    But if you're using 29F016/29F032 on a TSOP/DIP adpater yes, no byteswap.
     
  10. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,613
    Likes Received:
    1,383
    Thats not byte swapping for endianness (reversing the order the 2 bytes), thats selectively pin swapping to make the rom pinout better, as you said.

    This is byte swapping:

    [​IMG]

    To byte swap with wiring - you would need to wire D0-7 to D8-15 and D8-15 to D0-7.

    You are confusing 2 things.
     
    Last edited: Feb 22, 2018

Share This Page