News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: I am looking for Sega Master System Compressors!  (Read 801 times)

ResetCartucho

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
I am looking for Sega Master System Compressors!
« on: June 27, 2019, 10:26:41 am »
 Do anyone could recommend some compressors for the SMS? Not for a game in special, I just want some compressors recommendations.
 :P

FAST6191

  • Hero Member
  • *****
  • Posts: 2623
    • View Profile
Re: I am looking for Sega Master System Compressors!
« Reply #1 on: June 27, 2019, 11:06:30 am »
Emulators and ROM management tools have supported zip (and even rar and 7zip in some cases) for years at this point so I am assuming it is not that.

This leaves you wanting something to compress parts of a ROM to fit more in a ROM hack or something to compress parts of a homebrew you are making.

As far as I am aware the SMS did not include any BIOS level decompression routines which means you are not going to get anything like we saw on the GBA and DS. Similarly I don't think Sega or any big library makers of the time made a format that got terribly widespread. SMS homebrew is pretty minimal so I doubt there are a bunch of nice libraries floating around similar to what we saw with the GBA and DS.

This means you are probably left making you own, or porting across something from the NES (the SMS and NES are similar enough in power) and then such things will probably be more like inspiration than porting. NES stuff, and most stuff I see on similarly powered systems, for decompression in real time whilst still doing something else is limited to some of the most basic forms of compression like run length encoding (RLE) and really short window LZ style compression (hard to manipulate 16 bits of data in the look ahead/read length aspect on an 8 bit machine without taking 10 times the number of instructions and time to do them all), maybe a basic lookup/substitution (full blown Huffman would be a bit strong) as well as classic pointer style compression for text that can handle it.
Compression gains will be similarly minimal as a result of how basic this stuff is and some kind of constraint upon it.

If you are good enough to hack it into a game then you are similarly good enough to not need a library, or indeed probably see the library get in your way more than it helps (even on later systems where we have assemblers capable of injecting code into random points in the ROM such that you could have a "library" it still takes a lot of fiddling for a lot of things). For homebrew as you are unlikely to be writing in C or something high level for this then same problem really. If more exotic compression could be achieved with half sensible results then that would be one thing but RLE and substitutions are nothing drastic to code.

FlashPV

  • Full Member
  • ***
  • Posts: 160
    • View Profile
    • Terminus Traductions
Re: I am looking for Sega Master System Compressors!
« Reply #2 on: July 01, 2019, 08:37:09 am »
There's a Tile editor able to decompress any data using the Phantasy Star RLE format which is used in many Master System games:
http://jmimu.free.fr/mastertileconverter/

ResetCartucho

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: I am looking for Sega Master System Compressors!
« Reply #3 on: August 31, 2019, 04:55:02 pm »
Emulators and ROM management tools have supported zip (and even rar and 7zip in some cases) for years at this point so I am assuming it is not that.

This leaves you wanting something to compress parts of a ROM to fit more in a ROM hack or something to compress parts of a homebrew you are making.

As far as I am aware the SMS did not include any BIOS level decompression routines which means you are not going to get anything like we saw on the GBA and DS. Similarly I don't think Sega or any big library makers of the time made a format that got terribly widespread. SMS homebrew is pretty minimal so I doubt there are a bunch of nice libraries floating around similar to what we saw with the GBA and DS.

This means you are probably left making you own, or porting across something from the NES (the SMS and NES are similar enough in power) and then such things will probably be more like inspiration than porting. NES stuff, and most stuff I see on similarly powered systems, for decompression in real time whilst still doing something else is limited to some of the most basic forms of compression like run length encoding (RLE) and really short window LZ style compression (hard to manipulate 16 bits of data in the look ahead/read length aspect on an 8 bit machine without taking 10 times the number of instructions and time to do them all), maybe a basic lookup/substitution (full blown Huffman would be a bit strong) as well as classic pointer style compression for text that can handle it.
Compression gains will be similarly minimal as a result of how basic this stuff is and some kind of constraint upon it.

If you are good enough to hack it into a game then you are similarly good enough to not need a library, or indeed probably see the library get in your way more than it helps (even on later systems where we have assemblers capable of injecting code into random points in the ROM such that you could have a "library" it still takes a lot of fiddling for a lot of things). For homebrew as you are unlikely to be writing in C or something high level for this then same problem really. If more exotic compression could be achieved with half sensible results then that would be one thing but RLE and substitutions are nothing drastic to code.

 Thanks for the explanation, I am studying it.

August 31, 2019, 04:56:07 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
There's a Tile editor able to decompress any data using the Phantasy Star RLE format which is used in many Master System games:
http://jmimu.free.fr/mastertileconverter/
Thanks for the suggestion, I will test it.

DougRPG

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: I am looking for Sega Master System Compressors!
« Reply #4 on: August 31, 2019, 11:04:54 pm »
You need to debug the game to understand how the compression works and create your own code to decompress the data you want.
Two games may have the same format for the compressed data, but you'll need to debug anyway to find pointer tables, change routines and/or a lot of other stuff.
So even if you have a generic compressor that could work with some games, it means nothing to you if you don't know how to debug and change the game's code.
You can find a custom tool for some specific games, but in this case someone else did the job for you (it's fine if your goal is only to translate the text).
So focus in programming/debugging if you want to work with compression.