Users browsing this thread: 1 Guest(s)
"bstga" texture files? [solved]
#1
️️ ️️️ ️
Reply
Thanked by:
#2
Looked into it, I can make a GFXtract script for it but the colours look a bit off:

[Image: C4yASJT.png]

The format is quite obvious though and I'm sure that I'm doing it almost correctly, the only thing I can think of that might be wrong is the colour order. Would you be able to tell me what you expect the background colour to be here? Also knowing the game would be nice.
[img=0x180]http://phazepages.net/code/dilbert/dilbert.gif[/img]
Sprites ~ Sounds
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: Centrixe
#3
The game is MySims for the DS.
[Image: blUDdLp.png]
This is what it should look like (all thanks to the manual Tinke caveman method). Hilariously enough, I was actually working on a GFXtract script earlier today for this, which was my first time trying it out. Never got around to finishing it though. I'm eager to see the script you made.
[Image: 582217063e.png][Image: RWDCRik.png]


Reply
Thanked by: Pingu!, Centrixe, puggsoy
#4
Nice Smile Unfortunately the colours are strange and I don't think GFXtract support whatever weird method this file uses. Even so, I'll give you the script, this works perfectly except of course in terms of colour reading (you can hit me up on Skype to talk about exactly how it works if you want):

Code:
goto 0x10
get WIDTH short
get HEIGHT short
get OFFSET long
get LENGTH long
goto 8 cur
get PALOFF long
get PALLEN long

setformat 4 BGR 1 16 PALOFF
read IMG WIDTH HEIGHT
savepng IMG

And yes I am still going to make a tutorial don't worry Wink

Anyway I'm gonna see if I can figure out how the hell to read the palette and probably just make a custom program for this. Can you describe the method you used? Eventually GFXtract should support it but there are other features that I think are higher priority.
[img=0x180]http://phazepages.net/code/dilbert/dilbert.gif[/img]
Sprites ~ Sounds
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: Centrixe, Shade
#5
(02-21-2016, 10:18 PM)puggsoy Wrote: Anyway I'm gonna see if I can figure out how the hell to read the palette and probably just make a custom program for this. Can you describe the method you used? Eventually GFXtract should support it but there are other features that I think are higher priority.

The DS uses the same 16 bit colour order for basically every game.

Little Endian short
ABGR1555

So something along these lines.

Code:
a = ((by & 0b1000000000000000) >> 15) * 255;
b =  (by & 0b0111110000000000) >> 7;
g =  (by & 0b0000001111100000) >> 2;
r =  (by & 0b0000000000011111) << 3;

I actually don't remember if the DS uses the repeat last 3 bits extension thing.
Like if blue is 0b11100, the extended would be 0b11100111 instead of 0b11100000.
It mean, the difference probably isn't noticeable anyway.
Reply
Thanked by: puggsoy, Shade
#6
Ooooh wow OK I didn't know that. That's pretty simple. Also for some reason I never processed that even though little-endian ARGB = big-endian BGRA for 32-bit colours, that doesn't hold for other bit-depths and I should actually check both endians in TiledGGD Tongue

Still, GFXtract doesn't support that quite yet so I made bstga2png. Simple usage:

Code:
Usage: bstga2png inFile outDir
   inFile: The .bstga file to convert. Can alternatively be a folder containing the files to convert
   outDir: The folder to save the converted files to

Once I've improved GFXtract I'll probably complete the script for it too.
[img=0x180]http://phazepages.net/code/dilbert/dilbert.gif[/img]
Sprites ~ Sounds
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Reply
Thanked by: Shade


Forum Jump: