(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-23-24 09:43 AM
Acmlm's Board - I3 Archive - - Posts by Stifu
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
User Post
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-28-07 08:39 PM, in RLE compression for SMK Link
Alright, thanks...

By the way, about tracks... I supposed all decompressed tracks should have the same size (for having the exact same amount of tiles), but that's not the case... Weird stuff. Maybe they just end some tracks sooner when all the last tiles are 00 ones...
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-28-07 08:47 PM, in RLE compression for SMK Link
All I did was butcher each music to confirm their location in the ROM.
But I don't know shit about music anyway... I guess we gotta wait for Solar Soundtrack, provided we don't die before it's out.

Oh and about tracks, I thought of something else... Maybe they're in RLE format after having decompressed them the usual way ?


(edited by Stifu on 01-28-07 02:48 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-28-07 11:39 PM, in RLE compression for SMK Link
Yep, that's actually thanks to it that I know tracks are in RLE format...

By the way, I'm working on it with a pal, and we're doing some progress... We have to figure out all those "Not tested" things though. That's the thing about mKedit, it compresses thing into the ROM, but can't decompress anything...
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-30-07 09:08 PM, in RLE compression for SMK Link
Thanks, GC.
We already figured those out, but that's cool...

And unless I'm mistaken, E40A16 would lay down 11 "16", not 10, as the "00" counts... Therefore you have to add "+1" each time.

I'll spend more time on all that later, but we made a fair load of progress already, which is quite cool. We managed to generate track files that are very close to the TrackDes mkt files, so we are almost there...


(edited by Stifu on 01-30-07 03:12 PM)
(edited by Stifu on 01-30-07 06:14 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-31-07 12:49 AM, in How well would this fit in SMW? Link
3-up moons also come back, heh ?
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-31-07 05:20 PM, in RLE compression for SMK Link
I can't look at it right now, but that's cool, GC... Nice to see someone else is working on that. I'm also planning to make a complete track editor, and I'll share my RLE notes with you once I've managed to fully decompress tracks properly...

I'm hoping my C++ teacher will accept my upcoming track editor as the big university project he wants us to make... That way I'd kill 2 birds with 1 stone, and progress would be fast... I'm waiting for his answer.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 01-31-07 09:55 PM, in RLE compression for SMK Link
First things first, let's wait for my track editor to work and to be pretty much complete before thinking of expanding it to other things... but your help will be welcome.

Our decompressor now works perfectly apart from one little bug when the RLE track has "00 0A" in it... Weirdly, our decompressor generates "0D 0A" rather than just "0A"...
Anyway, here are our current raw notes for GC:


0x0n : the next n data stored are not compressed.
02 F0 F4 63 produce F0 F4 63

0x1n : ???????????

0x2n : repeats n data.
22 F0 produce F0 F0 F0

0x3n : repeats 16+n data
32 F0 produce ????????

0x4n : ???????????
0x5n : ???????????

0x6n : 2 bytes, 0x6n data. Data is incremented each time
62 03 produce 03 04 05

0x7n : ???????????

0x8n : 3 bytes 0x8n XX YY => "Block copy" : copy n byte(s) from YYXX location of decompressed track

0x9n : ???????????
0xAn : ???????????
0xBn : ???????????

0xCn : 2 bytes 0xCn XX => "Block copy" : copy n byte(s) from (currentLocation-XX) of decompressed track

0xDn : ???????????

0xE4 : 3 bytes, 0xE4 large repeats data.
E4 02 88 produce 88 88 88

0xFn : ???????????
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-01-07 09:50 AM, in RLE compression for SMK Link
Originally posted by Alice
So in other words:
3n: Lay down 17+n tiles of the next texture value.

Personally, I'd say 16+(n+1), but that's just me.

Originally posted by Alice
Check you've opened the file in binary mode (fopen(blah, "rb")).

It works, awesome ! Thanks.


(edited by Stifu on 02-01-07 03:56 AM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-02-07 10:06 PM, in General Project Screenshot Thread Link
If you keep the first one, I think you should change the white part with another color... That looks wrong.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-02-07 11:06 PM, in General Project Screenshot Thread Link
I meant the latter...
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-03-07 09:11 PM, in RLE compression for SMK Link
I found out TrackDes does things the way I thought: in a quite dirty way.

First, when you modify a track, it actually leaves the original track data as is, and copies your new track at the bottom of the ROM (once expanded), and changes the concerned track pointer accordingly. Bouche made it this way to avoid compressed size problems...
The thing is, if you open a track and save it 10 times, it'll make 10 copies of it at the bottom of the ROM. It doesn't overwrite anything, but keeps adding things over and over again, until it reaches the ROM size limit. Some people reported that at some point, they couldn't change tracks anymore, TrackDes telling them their ROM is readonly or something... I'm pretty sure they quite simply reached the ROM size limit.

I'll try to do things in a much cleaner way, I have a few ideas...
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-04-07 12:05 AM, in RLE compression for SMK Link
Yeah, I thought about making sure the newly compressed tracks fit right into the ROM, by messing with pointers, moving big tracks where there is a lot of space, and small ones in small spaces... You get the idea. Or even redefining the space attributed to each track, when possible (basically, when tracks are packed together), changing pointers accordingly... That'd probably be the cleanest way, although the most bothersome one. And I think it'd be difficult to implement in an automated editor, too...

My other idea was to expand the ROM like Bouche did (not to 2 MB though, 1 MB is enough), copying the new track data at the bottom of the ROM, but defining clear areas for each of the 24 tracks... so that each track has its own space, so no garbage would add up each time you edit one, unlike in TrackDes.

And yeah, we figured out the 8n compression fully. The 2 parameters following the 8n command actually form an absolute hex address. Example: 80 50 01 means "copy 81 bytes starting from location 0150 of the decompressed track".

We're almost finished figuring out all the compression commands, I'll post our updated notes (reformulated and clearer) once we're done... Command 0xAn is basically the last command giving us problems... It's another block copy command, but it's quite weird (and rarely used)...


(edited by Stifu on 02-03-07 06:19 PM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-04-07 09:33 PM, in RLE compression for SMK Link
Originally posted by Dirtbag
Welcome Midwife! Looks like the SMK scene is starting to pick up

Yeah, huge thanks to Midwife who helped me getting started with track decompression and all... He's a much better coder than me, too.
I've known him for years now, and he always makes the music for all of my game projects... Hopefully Epic Racers will be no exception.

Originally posted by Dirtbag
Stifu: Well done on finding the offsets for the demo macros. When I get some spare time I'm going to relase an update to my Mushroom Cup demo of Super Baldy Kart with the demo edited.

There's something I haven't figured out yet... See, replacing all the demo data with "00" of the first demo out of four (the Mario and Yoshi one) will leave drivers completely still, as you would expect... However, it's not the case of the other three demos. In the other demos, if you remove the data, drivers don't go forward anymore, but they still hop and turn their head from time to time, so there must be some data I haven't found yet...
Let me know what you manage to do. This shouldn't require pure hex hacking, it should be possible to copy data from a ZMV file, but I don't know the details...
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-05-07 05:31 PM, in Super Mario Kart Music File Format Link
Nah, I've already talked with Midwife about all of this and sent him the Epic Racers notes, so he knows where the musics and samples are located... but that's it. I don't know any more than that.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-06-07 08:37 AM, in RLE compression for SMK Link
Originally posted by HyperHacker
Bouche once mentioned the idea of figuring out the maximum possible size a compressed map could be

That's what I thought of, basically... Except in the way I formulated the idea above, I thought I could allow more space than ever needed if I expand the ROM to 1 MB, so I wouldn't have to bother figuring out exactly what's the possible max size.
However, I may want to put other data at the bottom of each track, like their graphics... And maybe object and AI data, if it's also compressed.

I had another idea: somehow managing to pack all the track data together in the ROM, moving stuff around... All tracks being part of the same big pack would make space management easier... The difficulty to do this for me would be to change all the concerned pointers... Also, it may be confusing to users, as some things wouldn't be at the same place anymore (although I could explain what has been moved in a txt file)...

Thanks for having answered my PM, by the way... Command 5 (0xAn) is definitely a "copy command" though, so it's not what you suggested it might be... I'll spend more time on all that later.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-06-07 08:40 AM, in Super Mario Kart Music File Format Link
Thanks for the help, blackhole (nice screen too)... Hopefully midwife manages to do something with that, or we could just wait for your editor... as we have plenty of other things to do before Epic Racers is ready, anyway.
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-06-07 08:57 AM, in RLE compression for SMK Link
Originally posted by HyperHacker
Are you finding this by tracing the code?

Nah, I don't know anything about that... I simply check how TrackDes behaves.

What we use to figure out stuff:

-The track decompressed with Lunar Compress, but still RLE (and stuff) compressed.
or the track recompressed with TrackDes (reinserting it into the ROM and decompressing it with Lunar Compress)
-The track totally decompressed (.mkt files generated by TrackDes)
-The track decompressed with our own decompressor, to compare...

The only case where I've found the 0xAn command so far was when I recompressed the Mario Circuit 1 track with TrackDes (which is AE 80 around the bottom of the track, IIRC) [Edit: wrong, that wasn't a 0xAn command...], but there's also the option of modifying the RLE compressed track manually, adding a certain command somewhere to check what's its behavior.


(edited by Stifu on 02-10-07 04:49 AM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-06-07 03:25 PM, in RLE compression for SMK Link
Nope, no exception for Ghost Valley, or any other track...
In case that helps, here's our C code for 8n, I added a few quick comments to make it clearer...

    unsigned int i = 0, j = 0, count, command; // "count" = "n" in our notes

unsigned int lPosition = 0; // that's the position in the decompressed track
int srcPosition; // that's for block copies

while (lPosition<(16384)) {
value = buffer[i++];
// (...)
command = value & 0xF0;
command = command >> 4;
count = value & 0x0F;

switch (command) {
// (...)
case 0x08 :
srcPosition = buffer[i]+buffer[i+1]*256;
i += 2;
for (j=0;j<=count;j++) {
track[lPosition+j] = track[srcPosition+j];
}
lPosition += j;
break;
// (...)
} // switch end
// (...)
} // while end


Let me know if that helps...


(edited by Stifu on 02-06-07 09:27 AM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-06-07 07:02 PM, in RLE compression for SMK Link
Originally posted by GlitchCog
I guess E5 is just an additional 256 blocks. That's what I've got it set up to do for now, anyhow.

Exactly. I'll just post our updated notes although they aren't complete yet...


Super Mario Kart - Track RLE format:

Px = Parameter x

Commands:

0x0n: X bytes, 0x0n etc. The next n(+1) bytes are not compressed. 02 F0 F4 63 produce F0 F4 63
0x1n: X bytes, same as 0x0n, but with n+16
0x2n: 2 bytes, 0x2n P1. Repeats P1 n(+1) times. 22 F0 produce F0 F0 F0
0x3n: 2 bytes, same as 0x2n, but with n+16
0x4n: 3 bytes, 0x4n P1 P2. Repeats P1 and P2 alternately until n(+1) bytes are laid. 43 22 23 produce 22 23 22 23
0x5n: 3 bytes, same as 0x4n, but with n+16
0x6n: 2 bytes, 0x6n P1. Lays n(+1) bytes, starting from P1 and incrementing it by 1 each time. 62 03 produce 03 04 05
0x7n: 2 bytes, same as 0x6n, but with n+16
0x8n: 3 bytes, 0x8n P1 P2. "Block copy": copies n(+1) bytes from P2P1 location of decompressed track. 80 50 01 means "copy 81 bytes starting from location 0150 of the decompressed track"
0x9n: 3 bytes, same as 0x8n, but with n+16
???0xAn: 2 bytes, 0xAn P1. "Block copy": repeats previous(?) data ranges until n(+1)+?? (?? = multiple de 16?) bytes are laid
0xBn: 2 bytes, same as 0xAn, but with n+16
0xCn: 2 bytes, 0xCn P1. "Block copy": copies n(+1) bytes from (currentLocation - P1) of decompressed track
0xDn: 2 bytes, same as 0xCn, but with n+16


"Super" versions of the commands from 0x0n to 0x7n:
===================================================
0xE0: X bytes, 0xE0 P1 etc. The following P1(+1) bytes are not compressed. E0 01 44 07 produce 44 07
0xE1: X bytes, same as 0xE0, but with P1+256
0xE2: X bytes, same as 0xE0, but with P1+512
0xE3: X bytes, same as 0xE0, but with P1+768
0xE4: 3 bytes, 0xE4 P1 P2. P2 is repeated P1(+1) times. E4 03 88 produce 88 88 88 88
0xE5: 3 bytes, same as 0xE4, but with P1+256
0xE6: 3 bytes, same as 0xE4, but with P1+512
0xE7: 3 bytes, same as 0xE4, but with P1+768
0xE8: 4 bytes, 0xE8 P1 P2 P3. Repeats P2 and P3 alternately until P1(+1) bytes are laid. E8 04 00 01 produce 00 01 00 01 00
0xE9: 4 bytes, same as 0xE8, but with P1+256
0xEA: 4 bytes, same as 0xE8, but with P1+512
0xEB: 4 bytes, same as 0xE8, but with P1+768
0XEC: 3 bytes, 0xEC P1 P2. Lays P1(+1) bytes, starting from P2 and incrementing it by 1 each time. EC 02 49 produce 49 4A 4B
0xED: 3 bytes, same as 0xEC, but with P1+256
0xEE: 3 bytes, same as 0xEC, but with P1+512
0xEF: 3 bytes, same as 0xEC, but with P1+768


"Super" versions of the commands from 0x8n to 0xDn:
===================================================
0xF0: 4 bytes, 0xF0 P1 P2 P3. "Block copy": copies P1(+1) bytes from P3P2 location of decompressed track
0xF1: 4 bytes, same as 0xF0, but with P1+256
0xF2: 4 bytes, same as 0xF0, but with P1+512
0xF3: 4 bytes, same as 0xF0, but with P1+768
0xF4: without any doubt the "Super" version of 0xAn, with P1 replacing n
0xF5: ??? (same as 0xF4, but with P1+256?)
0xF6: ??? (same as 0xF4, but with P1+512?)
0xF7: ??? (same as 0xF4, but with P1+768?)
0xF8: 3 bytes, 0xF8 P1 P2. "Block copy": copies P1(+1) bytes from (currentLocation - P2) of decompressed track
0xF9: 3 bytes, same as 0xF8, but with P1+256
0xFA: 3 bytes, same as 0xF8, but with P1+512
0xFB: 3 bytes, same as 0xF8, but with P1+768
0xFC: ???
0xFD: ???
0xFE: ???
0xFF: 1 byte, end of track



(edited by Stifu on 02-10-07 04:48 AM)
Stifu









Since: 11-18-05
From: Your mom's bed

Last post: 6305 days
Last view: 6303 days
Posted on 02-07-07 10:21 PM, in Lunar Compress issues Link
I didn't spend much time on it, but if I remember right, it's just that the program isn't complete. It doesn't have a "main"...
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
Acmlm's Board - I3 Archive - - Posts by Stifu


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.051 seconds; used 450.66 kB (max 583.35 kB)