Talk:BREFF and BREFT (File Format)

From Custom Mario Kart
Jump to navigation Jump to search

Compare the subfiles of the BREFT with a tex0 texture (all formats). Maybe you can find some textures as subfiles.

Vulcanus2 22:31, 5 June 2011 (CEST)

Any comment on this @Wiimm

Vulcanus2 20:39, 16 June 2011 (CEST)

The header is different and I have not analyzed data area (only overwritten with patterns to find colors)
That's all I know. And for Tock I'm trying to replace several values that looks like "red" into "green" or "blue" -- failed until now.
Wiimm 21:22, 16 June 2011 (CEST)
The header is fairly simple, I don't have time to implement it in CTools right now, but the width is a u16 at 0x4, the height is at 0x6 and the format is at 0xc. Other than that it's a standard image starting at 0x20.
Chadderz 12:33, 17 June 2011 (CEST)
Yes, I know. But where is the color info? In the moment I'm Tocks slave and locking for color info in the steam object of toads factory. It red, but tock needs white steam for his sherbet land. Any hints? (maybe it's in staticr.rel because I have found the path+name)
Wiimm 15:32, 17 June 2011 (CEST)

This is how animated textures work?

HelloImYourMind 03:18, 18 June 2011 (CEST)

Nope STR0 are the files that create animations.
Tock 03:29, 18 June 2011 (CEST)
Please could you explain me how to animate them (my skype is helloimyourmind13, if you can).
HelloImYourMind 03:47, 18 June 2011 (CEST)

Reading from not aligned addresses

It is important to read and write byte by byte, because some CPUs do not support accessing u16/u32 values on not aligned addresses.
What will happen if you read a u32 on a not aligned adress with a CPU that doesn't support reading u32s on not aligned addresses?
Wexos (talk) 18:33, 27 May 2016 (UTC)

A hardware interrupt, e.g. "Address Violation". As solution I have written my own endian functions. -- Wiimm (talk) 18:59, 27 May 2016 (UTC)
Okey. I think I will create a method that reads a byte array and then use:
return Convert.ToUInt32(byte[0] | (byte[1] << 8) | (byte[2] << 16) | (byte[3] << 24));
Wexos (talk) 08:24, 28 May 2016 (UTC)
This is a little endian solution (and you don't need parenthesis here, because << has priority over | ) -- Wiimm (talk) 08:58, 28 May 2016 (UTC)
Actually, I don't need to do that because it only exist a little endian reader in C#, so I have created methods to reverse the values that I read (so it's like a big endian reader), so I can read all those values as they are because I only read bytes and then I convert them to the format that I want.
Wexos (talk) 11:06, 28 May 2016 (UTC)

BREFF and BREFT

I think we should create separate pages for BREFF and BREFT. There is just too much information on this page now.
Wexos (talk) 18:55, 3 July 2016 (UTC)

Good idea. And the old article can be a summary pair and common design.
-- Wiimm (talk) 21:31, 4 July 2016 (UTC)