don't click here

Why does everything have padding?

Discussion in 'Technical Discussion' started by Hanoch, Sep 30, 2010.

  1. Hanoch

    Hanoch

    Also known as TheKnock, Birashot Member
    491
    0
    0
    Israel
    everything
    Is there a real reason why most huge ass games fill all the space with junk (a bunch of $FF bytes in a genesis ROM, for example).

    I also read somewhere here that xbox 360 and ps games are almost the same, only difference is PS games have a lot of padding for the blue ray disks (and also changing text strings to load the right buttons that vary from each console).

    Is it really necessary to fill the emptiness in the games, to match the cartridge/disk size?

    Also, why when adding new art to a sonic game, sometimes the new DAC samples I add become noisy, but after resizing the padding file, its all better?
     
  2. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,243
    974
    93
    Long-term happiness
    For ROM chips, yes, it is vital that the ROMs are padded, it's due to how the chips work. You can't have half a chip filled, something has to be there.

    In modern games, padding is almost always done to push the game data to the outside edge of a disc, to cut down loading times and saving wear on the laser motor.
     
  3. Sappharad

    Sappharad

    Oldbie
    1,415
    70
    28
    To provide some more insight on this point, it might help to explain why they're padded with 0xFF instead of 00 or random values.

    Remember that each byte is made of 8 bits which can be 0 or 1. Thus FF is 11111111. A 1 is typically represented by the presence of voltage, and 0 represents a lack thereof. I don't know the specifics for a Gen/MD cart, but for the sake of this example I assume the system applies 5V to the cart. On an empty chip, every single address has a connection to that 5V source. When they 'burn' the ROM data onto the chip, they're burning away a physical connection between the voltage source and the desired address on the chip. Without that connection, you no longer have voltage present when trying to read data for that address. In short, a blank chip starts with everything returning 1's and you burn away what you don't want to be 1 in order to write data to the chip.

    This is a very simplified example, but I think it makes sense. NOR based flashcarts work very similar to this. If you've ever used an older GBA or MD flashcart, this is why it needs to be 'erased' before you can write a new rom to it. Everything get's set to FF before the desired bits get turned back off.
     
  4. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    In case of ROMs, you got FF in unused parts because in erased state, the memory has its cells in High state (1). When being programmed the ones are programmed to zero. It does not matter if you burn the ROM/Flash/whatever partially, only erase operations degrade memory. If some software requires padding in a ROM its doing something wrong... it should either pad the file itself or not do it at all (my software only writes the data, and does no padding and I've yet to find something that's unhappy with it).
     
  5. While we're on the topic, why are next gen titles padded? :s
     
  6. nineko

    nineko

    I am the Holy Cat Tech Member
    6,310
    486
    63
    italy
     
  7. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    This is what I thought as well. Maybe the padding at the end of a rom file is specifically because of this, not because the original binary burned to the EPROM was really a 512 or 1024kb file exactly padded with 0xFF, maybe it was whatever size it needed to be and the rest ended up as 0xFF due to the burning :specialed:
     
  8. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    in case of X360 and PS3 games being so big while actual game may take much less is because the stuff on the discs is encrypted... when you dump you dump all the stuff on the disc as there's no way of knowing where the stuff is or not etc.
    At least so I understood it when a friend talked about it.
     
  9. Meat Miracle

    Meat Miracle

    Researcher
    1,664
    5
    18
    Because CSS is awesome.
     
  10. Covarr

    Covarr

    Sentient Cash Register Member
    4,233
    3
    18
    Trapped in my own thoughts.
    Two stageplays, a screenplay, and an album
    This is both the worst and best answer ever. Good job.

    What's always confused me is why so many people seem to want "clean" dumps with the padding still intact and not trimmed. I understand the desire for a dump that hasn't been tampered with in any obvious way (pirate intros, etc), but padding properly removed serves no purpose but to save space.
     
  11. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    I can think of two reasons: 1) there's nothing stopping programmers from using $FF as legitimate null data that the program has to read (this happens in Chaotix; the first few $FF bytes are actually used by the object system); 2) the padding bytes probably creates the false security of knowing it was dumped from an EEPROM dumper (padding is easy to fake too you know!).
     
  12. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    I think he meant in disc dumps (where it does indeed take up lots of useless space).
     
  13. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    5,355
    441
    63
    Lincs, UK
    TurBoa, S1RL
    Padding takes up almost no space at all when the file is compressed. I don't see how it's a problem either way.