Hacking Compressed ROMs

D-Trogh

Well-Known Member
Member
Joined
Aug 18, 2006
Messages
167
Trophies
0
Location
Belgium
Website
promh.freehostia.com
XP
291
Country
Belgium
With VisualBoyAdvance I think you CAN run ROMs out of a .ZIP archive..
Correct me when I'm wrong.. but I think you can..

But er.. talking about ROMs is not allowed.. right ?
Meh.. maybe you can talk about them, as it's more about an emulator here..
As long as you don't ask for them
wink.gif
 

Retal

Well-Known Member
OP
Member
Joined
May 20, 2007
Messages
933
Trophies
0
Location
England              Sex: Daily
XP
156
Country
Can you quit posting utter bullshit please. The only person who made a sensible reply was maikelsteneker. This has NOTHING to do with emulators. In case you hadn't have already noticed, this is the R4 and flashcart forum and nowhere in my post did I mention emulators.

It is technically possible. The flashcard would have to unpack the rom onthefly. This would probably require memory in the flashcard though.
If flashcarts don't have enough or any memory then it is not technically possible. Do flashcarts have enough memory to run carts in this way or not?
 

arctic_flame

GBAtemp ATMEGA8 Fan
Member
Joined
Nov 4, 2006
Messages
2,835
Trophies
0
Age
32
Location
England land
XP
168
Country
It is technically possible. It would just take ages to load.

Steps:

1. Have enough free space on your card for the unzipped rom
2. Write an unzip program for your DS
3. Curse and swear at how slowly the unzip prgram runs.
4. Wait a bit more
5. Run the uncompressed rom.
6. Have fun playing
7. Delete Uncompressed rom whenever you want to play a different game.
8. Repeat steps 3-8.

EDIT: It would be impossible to run a compressed rom without uncompressing. DS cards require a fast-ish response time. So basically every game might load, but would freeze instantly.
 

D-Trogh

Well-Known Member
Member
Joined
Aug 18, 2006
Messages
167
Trophies
0
Location
Belgium
Website
promh.freehostia.com
XP
291
Country
Belgium
Can you quit posting utter bullshit please. The only person who made a sensible reply was maikelsteneker. This has NOTHING to do with emulators. In case you hadn't have already noticed, this is the R4 and flashcart forum and nowhere in my post did I mention emulators.
Can't you be a lil' more polite please - -' !!
I noticed we were in the R4-board when I was posting, so I couldn't change it anymore..
Ow, the edit button.. yeah.. I clicked it, but the page doesn't wanted to load.. so I went to another site..

But.. If you want an asnwer for the R4 - -'
The R4-team just need to write a compressor themselves and update the firmware version.
The compressor uses an own format (or a known one like .zip, .rar, ..) and the R4 just reads the compressed files.

Edit (whooh, it loaded!):
This will be quicker than an uncompressor on the R4
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
Various carts (the RAM based ones) use simple compression like LZ/huffman/RLE (which the GBA/DS can decode with BIOS functions) for GBA but seen as DS roms currently are up at 128 megs and do not often require a fast bit of memory then no. You could decompress to empty space on the NAND/?SD but time taken would be horrendous .

Not to mention about 60% of roms these days already have their internal code and/or pictures/sound.... compressed: compression on top of compression does not give great results: pull apart a DS rom and see how many files have LZ in their name or start of the file.

I dare say as most people maintain a clean set of roms the majority of compression seen is normally the junk bytes at the end of the rom (in various cases they can be almost half the rom: snowboard kids USA is 34 megs after trimming if memory serves).
 

Retal

Well-Known Member
OP
Member
Joined
May 20, 2007
Messages
933
Trophies
0
Location
England              Sex: Daily
XP
156
Country
Not to mention about 60% of roms these days already have their internal code and/or pictures/sound.... compressed: compression on top of compression does not give great results: pull apart a DS rom and see how many files have LZ in their name or start of the file.
I can positively assert that "additional" compression would not be a waste of time. I can typically reduce ROM sizes by well over 50% using various algorithms.
 

rest0re

Well-Known Member
Member
Joined
Dec 23, 2006
Messages
755
Trophies
0
Location
WINLAND
XP
224
Country
Finland
Various carts (the RAM based ones) use simple compression like LZ/huffman/RLE (which the GBA/DS can decode with BIOS functions) for GBA but seen as DS roms currently are up at 128 megs and do not often require a fast bit of memory then no. You could decompress to empty space on the NAND/?SD but time taken would be horrendous .

Not to mention about 60% of roms these days already have their internal code and/or pictures/sound.... compressed: compression on top of compression does not give great results: pull apart a DS rom and see how many files have LZ in their name or start of the file.

I dare say as most people maintain a clean set of roms the majority of compression seen is normally the junk bytes at the end of the rom (in various cases they can be almost half the rom: snowboard kids USA is 34 megs after trimming if memory serves).
as far as i know trimming doesnt have anything to do with compression. its just simply removing "empty" junk data...
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
@Retal I agree LZ, RLE and huffman are not great space saving wise (they are fast though) and additional compression can have positive effects, it is just a bit less. I also contend that space saving does mainly come from the junk data being compressed (see below).

@rest0re trimming has nothing to do with compression I agree, when however the last 14 megabytes are all 0000 0000 0000...... which can be summed up in a few bytes you see a massive gain in compression for your 7z/zip/rar/whatever file.
 

Retal

Well-Known Member
OP
Member
Joined
May 20, 2007
Messages
933
Trophies
0
Location
England              Sex: Daily
XP
156
Country
Just to cite a few examples of trimmed roms that I have then compressed with RAR compression:

Castlevania - Portrait of Ruin (E) 50MB -> 25MB
Digimon World (U) 57MB -> 18MB
Phoenix Wright - Justice For All (E) 32MB -> 13MB
Picross (E) 33MB -> 4MB
Pokémon Diamond (U) 61MB -> 18MB
Sim City (E) 56MB -> 7MB

I think there's no more need to question whether compression would be a valuable space saving endeavour.

So back to the topic question, would it be feasible to support compression on flashcarts. As arctic_flame mentioned, one method is to decompress before execution which would take time. Alternatively, as maikelsteneker mentioned, it may be possible to decompress on-the-fly but would require memory on the flashcart.
 

OSW

Wii King
Former Staff
Joined
Oct 30, 2006
Messages
4,787
Trophies
0
XP
482
Country
well storage is always getting cheaper, most people these days wouldn't care much for compression features on a DS cart.

Basically summarising what other people have said, the space saving benefit does not outweigh the time disadvantage.
 

rest0re

Well-Known Member
Member
Joined
Dec 23, 2006
Messages
755
Trophies
0
Location
WINLAND
XP
224
Country
Finland
Just to cite a few examples of trimmed roms that I have then compressed with RAR compression:

Castlevania - Portrait of Ruin (E) 50MB -> 25MB
Digimon World (U) 57MB -> 18MB
Phoenix Wright - Justice For All (E) 32MB -> 13MB
Picross (E) 33MB -> 4MB
Pokémon Diamond (U) 61MB -> 18MB
Sim City (E) 56MB -> 7MB

I think there's no more need to question whether compression would be a valuable space saving endeavour.

So back to the topic question, would it be feasible to support compression on flashcarts. As arctic_flame mentioned, one method is to decompress before execution which would take time. Alternatively, as maikelsteneker mentioned, it may be possible to decompress on-the-fly but would require memory on the flashcart.
Dear sir, you are an idiot!
Seriously. You must understand what RAR does. It compress file with powerful algorhytm which replaces repeating sequences in with simpler algorhytm to describe them. Doing this "realtime" required much more power than DS has. See for example game needs to find information end of file or middle. It must compress file and it causes swapping at media. So it would not be A) Useful B) Requires more power than DS can handle. DS is now barely handling streaming games from your R4DS so imagine DS working streaming some hardcoded RAR package. Ask any #DSDEV channel coders and they laugh at your face. So... get real or live in fantasy world.
 

pduin

Active Member
Newcomer
Joined
Mar 1, 2006
Messages
30
Trophies
0
XP
116
Country
Netherlands
besides additional memory uncompressing needs a lot of computing power. you will have to put memory and a dedicated decompression chip on the cart to be able to run compressed roms. it is certainly possible but it will cost too much and take too much space on a cart.
 

Glacius0

Well-Known Member
Member
Joined
Nov 27, 2005
Messages
604
Trophies
0
Age
38
Location
The Netherlands
Website
Visit site
XP
205
Country
Netherlands
This conversation is so pointless. But hey, I have nothing better to do, so:

A flash cart with GBA support may be able to run compressed roms as long as they're under 32mb (meaning they fit in the cart it's RAM). And even then, as mentioned before, you do indeed still need to use a simpler compression method than RAR. Let's say this saves you maybe optimistically 10 mb per 32 mb rom. Guessing from the loading of GBA roms, load times would be around a minute. Would anyone care for this?
 

rest0re

Well-Known Member
Member
Joined
Dec 23, 2006
Messages
755
Trophies
0
Location
WINLAND
XP
224
Country
Finland
People whine and bitch and require all kind of things for flashcarts? What next, should flashcart take out your dog, make you coffee, fuck your girlfriend while you play Mario Kart? SNES backup times you could fit one game into backup device and you had to use disks to load it
wink.gif
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    The Real Jdbye @ The Real Jdbye: @BigOnYa series S is the way to go, its a bargain for a capable system