Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in ROM Hacking. |
Acmlm's Board - I3 Archive - ROM Hacking - SMW Compression? | New poll | | |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
User | Post | ||
Smallhacker Super Koopa I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER |
| ||
I've tried to find it myself, but failed.
Does anyone have a description of how SMW's compression format works? According to Lunar Compress, it uses LC_LZ1 (SMWj) and LC_LZ2 (SMW). (What's that "j" anyway? Japanese version? If so, I only need LC_LZ2.) Please don't say "Just use the Lunar Compress DLL". |
|||
spel werdz rite Since: 11-19-05 Last post: 6431 days Last view: 6430 days |
| ||
I'm not sure myself, but to try and get a better understanding, I opened up the hex addresses that Lunar Magic tells you where the graphics are.
I sometimes make small or simple GFX files, let LM copress them, and change some bytes to see what happens. You can try this, and you may or may not start to figure out how it works. This is just a suggestion I have. Do Yoshi's Island and Zelda3 have the same GFX compression? |
|||
Stifu Since: 11-18-05 From: Your mom's bed Last post: 6432 days Last view: 6430 days |
| ||
Originally posted by spel werdz rite SMK does, at least. |
|||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6431 days Last view: 6431 days |
| ||
Just curious, why isn't using Lunar Compress an option? | |||
spel werdz rite Since: 11-19-05 Last post: 6431 days Last view: 6430 days |
| ||
Maybe he's just trying to learn for general knowledge.
I myself do it a lot (perhaps too much). |
|||
Smallhacker Super Koopa I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER |
| ||
The programming language I'm using doesn't support DLLs. (Well... It does, but not the version I'm using.) Also, I haven't got enough experience with C++ to be able to do what I want to do. | |||
BMF54123 Since: 11-18-05 From: MOOGLES Last post: 6431 days Last view: 6430 days |
| ||
So...the Japanese and American versions actually use different compression formats? That's bizarre... | |||
Stifu Since: 11-18-05 From: Your mom's bed Last post: 6432 days Last view: 6430 days |
| ||
Originally posted by BMF54123 SMW is Nintendo's first SNES game or something, right ? I recall reading they used some kind of beta or early version of their music engine too... So after they released the Japanese version and that the game was still getting translated and stuff for the US release, they had probably improved their compression format by then, as their SNES formats / engines / whatever were still young at the time... |
|||
Smallhacker Super Koopa I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER |
| ||
Okay. I figured out most myself and this helped me with the rest.
The program I made can export GFX32 and GFX33 from a ROM perfectly. Probably the other files as well, but I haven't tested those yet. |
|||
BMF54123 Since: 11-18-05 From: MOOGLES Last post: 6431 days Last view: 6430 days |
| ||
Keep in mind all graphics in SMW are 3bpp, except for Mario and a couple other things (like berries), so they'll probably appear scrambled even with proper decompression. | |||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6431 days Last view: 6431 days |
| ||
Unless of course you've converted them to 4BPP in LM. | |||
MathOnNapkins 1100 In SPC700 HELL Since: 11-18-05 Last post: 6431 days Last view: 6430 days |
| ||
Originally posted by BMF54123 3bpp is not a format, it's another type of compression. So if you have decompressed something and the product is 3bpp, it is still compressed. |
|||
BMF54123 Since: 11-18-05 From: MOOGLES Last post: 6431 days Last view: 6430 days |
| ||
Er, yeah, I knew that.
So, technically, SMW uses "layered" compression... (edited by BMF54123 on 04-15-06 04:54 AM) |
|||
Guy Perfect Since: 11-18-05 Last post: 6432 days Last view: 6431 days |
| ||
1) Lunar Compress is a Windows-only app, isn't it? That won't help people developing for the DS. (-:
2) There's a difference between compression and encoding. 3bpp is the encoding. LZ2 is the compression. One of them exp |
|||
Unicorn_Poop Micro-Goomba Since: 12-21-05 From: Knox-Vegas Last post: 6605 days Last view: 6605 days |
| ||
I'm decoding all of Super Metroid right now, and I decoded the compression routine long ago. I'm almost positive that most Nintendo games use the same compression routine, so these notes should be valid for your purposes.
Copy and Paste this into Notepad with the Lucida Console font. +--------------------------------------------------------------------------------------------------------------+ |=Decompression=Routine=[$80:B0FF-$80:B270]====================================================================| +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ |=Command=Name=|=Hex=|=Binary====|=Syntax==================|=Range======|=Notes================================| +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $00 | %00000000 | | | Copies the next (# + 1) bytes from | | Direct Copy | .. | CMD..... | [%000xxxxx : xxxxx = #] | 1-32 bytes | Compressed Data (CD) to RAM. | | | $1F | %00011111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $20 | %00100000 | | | Writes the next byte (# + 1) bytes | | Byte Fill | .. | CMD..... | [%001xxxxx : xxxxx = #] | 1-32 bytes | deep to RAM. | | | $3F | %00111111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $40 | %01000000 | | | Writes the next word (# + 1) bytes | | Word Fill | .. | CMD..... | [%010xxxxx : xxxxx = #] | 1-32 bytes | deep to RAM. | | | $5F | %01011111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $60 | %01100000 | | | Writes the next byte to RAM. Then | | Sigma Fill | .. | CMD..... | [%011xxxxx : xxxxx = #] | 1-32 bytes | adds 1 to that byte and writes it | | | $7F | %01100000 | | | again...etc. Writes (# + 1) times. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $80 | %10000000 | | | Copies (# + 1) bytes from the RAM | | Library Copy | .. | CMD..... | [%100xxxxx : xxxxx = #] | 1-32 bytes | address provided in the next two | | | $9F | %10011111 | | | bytes. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $A0 | %10100000 | | 1-32 bytes | Much like the Library Copy. The only | | EORed Copy | .. | CMD..... | [%101xxxxx : xxxxx = #] | $7F:0000 - | difference is that all data copied | | | $BF | %10111111 | | $7F:FFFF | is EORed with %11111111. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $C0 | %11000000 | | 1-32 bytes | Subtracts next byte from Y, the RAM | | Minus Copy | .. | CMD..... | [%110xxxxx : xxxxx = #] | 0-255 from | offset, and copies (# + 1) bytes to | | | $DF | %11011111 | | current Y | current Y. Can copy last tile. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $E0 | %111 000 00-->Bits 8 9 of X (aka #) | 1-1024 | Extends the range of previous CMDs | | | | ||| --------------------- | bytes | from 1-32, to 1-1024 bytes deep. | | | | CMD----->Command Code. Any one | | | | Extended CMD | .. | of the previous 7 CMD | $7F:0000 - | Specifically, Bits 7-5 flag the ECMD,| | | | patterns can go here. | $7F:FFFF | & Bits 4-2 are interpreted as a CMD. | | | | --------------------- | RAM | Bits 1-0 & the next byte are treated | | | $FE | %111 111 11 | | as a 10-bit value for X, aka #. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | | | | | | | Terminate SR | $FF | %11111111 | [%11111111] | ---- | Terminates Sub Routine | | | | | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ |
|||
HyperHacker Star Mario Finally being paid to code in VB! If only I still enjoyed that. <_< Wii #7182 6487 4198 1828 Since: 11-18-05 From: Canada, w00t! My computer's specs, if anyone gives a damn. STOP TRUNCATING THIS >8^( Last post: 6431 days Last view: 6431 days |
| ||
Originally posted by BGNG An SMW editor for the DS? ...Hey, that's not a half bad idea. (edited by HyperMackerel on 04-16-06 04:08 AM) |
|||
Guy Perfect Since: 11-18-05 Last post: 6432 days Last view: 6431 days |
| ||
Originally posted by HyperMackerel Well there you have it, then. A reason. (-: |
|||
Unicorn_Poop Micro-Goomba Since: 12-21-05 From: Knox-Vegas Last post: 6605 days Last view: 6605 days |
| ||
Wow, I didn't relize it, but the forum butchered my notes. In Notepad, just line up the verticle bars ( | ) with the pluses and you should have a nice table.
Of note, the address in the table's title is the Decompression Routine's ROM address in Super Metroid only. Also, I forgot to mention the data used to control the Decompression Routine's Input and Output is located directly after the JSLs that lead to the execution of the routine. So, if you don't know where to locate this data, just look for JSLs to SMW's Decompression Routine. You can find the routine's address if you watch where in the program the game writes new level data to RAM. |
|||
FreeDOS + Giant Red Koopa Legion: freedos = fritos Since: 11-17-05 From: Seattle Last post: 6430 days Last view: 6430 days |
| ||
Originally posted by Unicorn_Poop Or the better option and use <tt> plus (the board doesn't like <pre>, so go into a text editor and replace ' ' with ' '): +--------------------------------------------------------------------------------------------------------------+ |=Decompression=Routine=[$80:B0FF-$80:B270]====================================================================| +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ |=Command=Name=|=Hex=|=Binary====|=Syntax==================|=Range======|=Notes================================| +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $00 | %00000000 | | | Copies the next (# + 1) bytes from | | Direct Copy | .. | CMD..... | [%000xxxxx : xxxxx = #] | 1-32 bytes | Compressed Data (CD) to RAM. | | | $1F | %00011111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $20 | %00100000 | | | Writes the next byte (# + 1) bytes | | Byte Fill | .. | CMD..... | [%001xxxxx : xxxxx = #] | 1-32 bytes | deep to RAM. | | | $3F | %00111111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $40 | %01000000 | | | Writes the next word (# + 1) bytes | | Word Fill | .. | CMD..... | [%010xxxxx : xxxxx = #] | 1-32 bytes | deep to RAM. | | | $5F | %01011111 | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $60 | %01100000 | | | Writes the next byte to RAM. Then | | Sigma Fill | .. | CMD..... | [%011xxxxx : xxxxx = #] | 1-32 bytes | adds 1 to that byte and writes it | | | $7F | %01100000 | | | again...etc. Writes (# + 1) times. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $80 | %10000000 | | | Copies (# + 1) bytes from the RAM | | Library Copy | .. | CMD..... | [%100xxxxx : xxxxx = #] | 1-32 bytes | address provided in the next two | | | $9F | %10011111 | | | bytes. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $A0 | %10100000 | | 1-32 bytes | Much like the Library Copy. The only | | EORed Copy | .. | CMD..... | [%101xxxxx : xxxxx = #] | $7F:0000 - | difference is that all data copied | | | $BF | %10111111 | | $7F:FFFF | is EORed with %11111111. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $C0 | %11000000 | | 1-32 bytes | Subtracts next byte from Y, the RAM | | Minus Copy | .. | CMD..... | [%110xxxxx : xxxxx = #] | 0-255 from | offset, and copies (# + 1) bytes to | | | $DF | %11011111 | | current Y | current Y. Can copy last tile. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | $E0 | %111 000 00-->Bits 8 9 of X (aka #) | 1-1024 | Extends the range of previous CMDs | | | | ||| --------------------- | bytes | from 1-32, to 1-1024 bytes deep. | | | | CMD----->Command Code. Any one | | | | Extended CMD | .. | of the previous 7 CMD | $7F:0000 - | Specifically, Bits 7-5 flag the ECMD,| | | | patterns can go here. | $7F:FFFF | & Bits 4-2 are interpreted as a CMD. | | | | --------------------- | RAM | Bits 1-0 & the next byte are treated | | | $FE | %111 111 11 | | as a 10-bit value for X, aka #. | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ | | | | | | | | Terminate SR | $FF | %11111111 | [%11111111] | ---- | Terminates Sub Routine | | | | | | | | +--------------+-----+-----------+-------------------------+------------+--------------------------------------+ |
|||
Raccoon Sam Boomerang Brother Custom Title Since: 11-20-05 From: Correct Last post: 6431 days Last view: 6430 days |
| ||
So uh.. Is there a way to make a ROM decompressor so we Mac user could edit the Gfx too..? |
Pages: 1 2 | Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - ROM Hacking - SMW Compression? | | |