#16
|
||||
|
||||
Quote:
It compresses fine, just using different tools so file sizes differ. |
#17
|
||||
|
||||
Quote:
![]() And good luck reverse engineering the header. I know there are differences between the kiosk and final version's headers. Quote:
Quote:
Last edited by runehero123; 29th July 2009 at 03:39 AM. |
#18
|
||||
|
||||
Preliminary details, will update as I continue.
Code:
DK64 Model Header: This data is for the final version, though the kiosk versions header is the same; just subtract 8 bytes from each offset. Layout is "offset (datatype) = description and details" s16 = signed 16 bit int (-32768 - 32767) u8 = unsigned 8 bit int (byte, 0-255) 0x38-0x3B (32-bit UInt) = pointer to start of master vertex lookup table (16 bytes per entry - [xxxx - s16][yyyy - s16][zzzz - s16][0000][uuuu - s16][vvvv - s16][rr - u8][gg - u8][bb - u8][aa - u8] 0x40-0x43 (32-bit UInt) = pointer to end of master vertex lookup table ((endptr-startptr) / 16) = vertex count) 0xE6-0xE7 (16-bit UInt) = number of display list commands (*8 = dlist buffer size in bytes) 0x148 (64-bit UInt per command) = start of master display list (first 8b = commandcode, next 24b = loword, next 32b = hiword) struct DK64Header { int VertStart; int VertEnd; int VertCount; int DLStart; int DLCommandCount; } struct Vertex { short x; short y; short z; short flags; short u; short v; byte r; byte g; byte b; byte a; } struct DisplayList { unsigned long Command; byte CommandCode; unsigned int loWord; unsigned int hiWord; } long[4] ShiftTable = {0xFFFFFFFF, 0xFFFF, 0xFF, 1}; // macro for appending bytes void ReadHeader(byte[] FileByteBuffer, struct DK64Header Header, bool kioskMode) { int inc = 0; // for kiosk/final compatibility if(kioskMode) {inc=8;} // could be more elegant for(int i=0;i<4;i++) { Header.VertStart += FileByteBuffer[(0x38-inc)+i] * ShiftTable[i]; Header.VertEnd += FileByteBuffer[(0x40-inc)+i] * ShiftTable[i]; } Header.VertCount = ((Header.VertEnd - Header.VertStart) / 16); Header.DLStart = 0x148-inc; //constant for(int i=0;i<2;i++) { Header.DLCommandCount += FileByteBuffer[(0xE6-inc)+i] * ShiftTable[i+3]; } } Last edited by cooliscool; 30th July 2009 at 01:35 AM. |
#19
|
||||
|
||||
I can't understand hardly any of this, but I'm eager to play the final version. I'll be keeping watch on this thread for more exciting updates.
__________________
Legalize Gay Weed |
#20
|
||||
|
||||
Those without any programming know-how and know-what would have that C code go right over their heads. Not to mention ASM.
|
#21
|
||||
|
||||
It'd really be better for me to redo compression using gzip anyways, the way it's done is rather...pardon the pun, funky.
|
#22
|
||||
|
||||
Quote:
![]() Last edited by cooliscool; 29th July 2009 at 11:14 PM. |
#23
|
||||
|
||||
Yep. I hope this thing goes well. This thread is one to watch, hence my recent activity.
|
#24
|
||||
|
||||
if this does go well (kudos to all the programmers who know what they are doing and talking about) Then we shall get the life balloon thing, as well as old sprites, original levels and challenges, so excited for the revival
![]()
__________________
Come visit my site, and let the games begin!o-O |
#25
|
||||
|
||||
Quote:
Quote:
|
#26
|
||||
|
||||
Collision is indeed a "transparent" set of triangles, but it's not set up through a display list since it'll never be seen - no use in sending it to the RDP. Normals are specified so that the equation, which essentially judges the player's distance from the triangle, doesn't need to compute much. I'm still working out exactly how it's setup as far as DK64 is concerned; and I may need some levels' setup files to make a proper determination. Do you have any you're aware of?
|
#27
|
||||
|
||||
Hmm looks like it's already there?
Do you have: (needs gzip exe) bool GECompression::CompressGZipFile(CString inputFile, CString outputFile, bool byteFlipCompressed) { CString gzipFileName = (mainFolder + "gzip.exe"); char tempFileExistName[1000]; strcpy(tempFileExistName, (mainFolder + "gzip.exe")); |
#28
|
||||
|
||||
Quote:
Quote:
Quote:
Last edited by runehero123; 31st July 2009 at 03:52 AM. |
#29
|
||||
|
||||
It's not truncated...it's compressed better. You need to redo the table of all files if DK has that (and shift contents), or where it says compressed size, or else it will possibly crash like you see.
|
#30
|
||||
|
||||
Quote:
There's a table for the decompressed size of BG data, and compressed size is calculated in the pointer table. |
![]() |
Tags |
beta, complete, dk64 |
Thread Tools | |
|
|