gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > mario dumped!

#34951 - darkfader - Fri Jan 28, 2005 5:27 pm

<deleted>

Last edited by darkfader on Tue Mar 01, 2005 8:37 pm; edited 2 times in total

#34952 - darkfader - Fri Jan 28, 2005 5:30 pm

<deleted>

Last edited by darkfader on Tue Mar 01, 2005 8:36 pm; edited 1 time in total

#34969 - Abscissa - Fri Jan 28, 2005 7:54 pm

Geez, that's a lot of files :)

#34971 - fagotero - Fri Jan 28, 2005 8:19 pm

Nice news! ;-)

#34972 - DiscoStew - Fri Jan 28, 2005 8:23 pm

Yeah compared to the Metroid: First Hunt, and that was just a demo.
_________________
DS - It's all about DiscoStew

#34983 - Darkain - Fri Jan 28, 2005 10:35 pm

using the nds model viewer, right now we cant view anything in this dump. why? every single file is LZ77 compressed. NOT the same as ZIP, nintendo likes doing things their own way. ;)

so, if someone could figure out their compression method, and integrate this into the model viewer, that would be sweet.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#34993 - ryuryan - Sat Jan 29, 2005 2:27 am

This is designed to decompress LZ77 pictures from pokemon games,
might work straight out or need to be slightly modified.

http://www.zophar.net/utilities/download/PokePic-win32-bin.zip
http://www.zophar.net/utilities/download/PokePic-src.zip

#34994 - MumblyJoe - Sat Jan 29, 2005 3:01 am

Totally good work man. Wanna share any details about why you couldn't do it when you did metroid and how you overcame those problems?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#35012 - SeKuM - Sat Jan 29, 2005 11:02 am

I'm amazed.

What is the size of the rom ?!

#35056 - Touchstone - Sat Jan 29, 2005 10:59 pm

Uuh, I haven't played this game yet but \data\enemy\peach\? Is this Princess Peach? I've never thought of her as an enemy before. :)
_________________
You can't beat our meat

#35063 - tepples - Sat Jan 29, 2005 11:46 pm

You've never played Smash Bros. against somebody who can beat 3 teamed level 9 CPUs with Peach.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#35073 - NMcCoy - Sun Jan 30, 2005 2:33 am

I wonder what the odds are that someone will find a way to export the models and maps to a popular first-person-shooter model format...?

#35083 - netdroid9 - Sun Jan 30, 2005 4:45 am

I suddenly want to import a whole lot of quake 3 weapons as shell models for some reason.

#35244 - CoolkcaH - Wed Feb 02, 2005 12:05 am

What's the size of the dump?

#35252 - DiscoStew - Wed Feb 02, 2005 3:35 am

Why do many people want to know the size of the dump anyways? I feel it is kinda irrelevent ATM.

If anything, I'd like to know the format and size of the raw 3D models and animation schemes, a good average poly-count on in-game models, etc, just so I would know what I can work with when the time comes when we all can do some actual DS programming.
I'm starting to get the itch of trying (once again) to learn how to use Lightwave, just so that I can get a head start.
_________________
DS - It's all about DiscoStew

#35257 - dagamer34 - Wed Feb 02, 2005 5:25 am

DiscoStew wrote:
Why do many people want to know the size of the dump anyways? I feel it is kinda irrelevent ATM.

If anything, I'd like to know the format and size of the raw 3D models and animation schemes, a good average poly-count on in-game models, etc, just so I would know what I can work with when the time comes when we all can do some actual DS programming.
I'm starting to get the itch of trying (once again) to learn how to use Lightwave, just so that I can get a head start.


Get a feel for the system in general and such. Or maybe to know what kind of game sizes we expect to be dealing with. I mean, Super mario 64 DS is just as large as the Metroid Prime demo. And it's only a demo, not the full game.

It could be a number of things though; i don't feel like thinking up more.
_________________
Little kids and Playstation 2's don't mix. :(

#35306 - CoolkcaH - Wed Feb 02, 2005 9:19 pm

Found this gba LZSS decompression program:
http://www.geocities.com/dkl_74/
but it's in ARM assembly...

#35353 - bertsnks - Thu Feb 03, 2005 3:24 pm

Code:

typedef   unsigned char         u8;
typedef   unsigned short int      u16;
typedef   unsigned int         u32;

typedef   signed char            s8;
typedef   signed short int      s16;
typedef   signed int            s32;

int main(int argc, char* argv[])
{
   printf("Nintendo LZ77 unpacker\n");
   printf("----------------------\n");

   FILE *fin, *fout;

   fin = fopen(argv[1],"rb");
   fout = fopen(argv[2],"wb");

   u8 header, b;
   u32 size=0;

   fread(&header, sizeof(u8), 1, fin);
   fread(&b, sizeof(u8), 1, fin);
   size+=b<<0;
   fread(&b, sizeof(u8), 1, fin);
   size+=b<<8;
   fread(&b, sizeof(u8), 1, fin);
   size+=b<<16;

   printf("Header: $%02x (%s)\n", header, (header&0xf0)!=0x10?"INCORRECT":"NINTENDO LZ77");
   printf("Uncompressed size: %d\n", size);

   u8 *unpacked = new u8[size];
   u8 *begin = unpacked;
   u8 *end = unpacked + size;

   u32 compsize = 0;


   while(begin < end)
   {
      u8 flag;
      fread(&flag, sizeof(u8), 1, fin);
      compsize++;

      for(int i=7;i>=0;i--)
      {
         if ( (flag & (1<<i)) == 0 )
         {
            u8 byte;
            fread(&byte, sizeof(u8), 1, fin);
            compsize++;

            *begin++ = byte;
            if (begin >= end)
               break;            
         }
         else
         {
            u16 data;
            fread(&data, sizeof(u16), 1, fin);
            compsize+=2;

            data = (data>>8) | ((data<<8)&0xff00);
            int length = 3+(data>>12);
            int offset = (data&0x0FFF);
         
            for(int j=0;j<length;j++)
            {
               if (begin-offset-1 < unpacked)
                  *begin++ = 0;
               else
                  *begin++ = *(u8*)(begin-offset-1);
               if (begin >= end)
                  break;
            }
         }
      }

   }


   fwrite(unpacked, sizeof(u8), size, fout);

   fclose(fin);
   fclose(fout);

   int align = 4 - (compsize - (compsize & ~3));

   printf("Compressed size: %d + %d (align) + %d (header) = %d\n", compsize, align, 4, compsize+4+align);

   printf("Done.\n");


   delete[] unpacked;

   return 0;
}