Simion32 wrote:LokiNova wrote:I'm going to do a level editor like Lunar Magic, simple interface with drag-drop of elements
The decompression lib is going to decompress resources to show terrain and sprites on the screen, without saving file, all the work done in memory
Hmm... do note that you'll probably have to be able to expand the entire ROM to do that (unless you manage to make a re-compressor and like being restrained by the original data size). You'd likely run out of room, unless the ROM is made bigger and its data rearranged.
Yeah thats a problem that I will have to deal with... as for now, I have to render the complete level with background and tile
Simion32 wrote:What does your decompressor code use to store the data? I've coded mine so far with a vector<char> to store extracted data in. I have about 20 functions done so far..
It use an array of unsigned char, declared like that :
- Code: Select all
unsigned char dataOut[2000];
Or it can be allocated into the heap with the Windows API if you dont want to overflow the stack :
- Code: Select all
unsigned char *dataOut = (unsigned char*) HeapAlloc(GetProcessHeap(), NULL, 2000);
I just did a function that take as parameter,
unsigned decompress(unsigned char *dataOut, unsigned dataOutSize, const unsigned char *dataIn, unsigned dataInSize);
For each subroutine to parse, it is enclosed in a switch/case statement,
- Code: Select all
switch (t)
{
case 0x08:
{
unsigned char byte = dataIn[indexIn++];
dataOut[indexOut++] = (byte / 0x10) | ((d % 0x10) << 4);
d = dataIn[indexIn++];
dataOut[indexOut++] = byte % 0x10 | (d / 0x10);
t = ((d & 0x0F) << 2) + 0x3F;
break ;
}
...
}
Simion32 wrote:Do you know if the tile data for DKC2 in tall levels (like brambles) are any different than DKC's? I assume there has to be some level dimensions because the levels in DKC2 are not always "16 x Length" or "Height x 64" in tile area.
I haven't got into that currently, but it should be similar to Super Mario World, there may be some data to define the dimensions of the level, the music, etc. this need to be more investigate

As for now, I'm trying to understand how all it is stored into the memory... I've got the bitplane and I just verify if my knowledge is right with some sample data...