ROM Hack Extracting Textures from an NSBMD file

cain05

Member
OP
Newcomer
Joined
Feb 15, 2011
Messages
17
Trophies
0
Website
cainsdomain.com
XP
127
Country
Canada
So I finally found the file that contains the title screen used in the title loop for SaGa 3. I was able to successfully export and decompress the file but I can't seem to extract the textures from it. I tried using numerous programs but the only one that comes close is NSBMD Tool, but it still fails. If anyone can help me with this problem it would be much appreciated. Here's a link to a zip file that contains the nsbmd file in question. It has both the compressed (LZ77) and decompressed versions. Below in the spoiler tag is the error I get when I try to extract the textures using NSBMD Tool. Console Tool can display all the textures in the file (which is why I was able to find it) but it can't extract individual textures.

http://cainsdomain.c.../0623.nsbmd.zip

Code:
DEBUG: file size = 00029184 (168324)
=================================
reading 'MDL0'...
No. of Model = 01
reading model 0...
DEBUG: texnum = 6
tex (matid=6): 'ttl_01'
tex (matid=1): 'ttl_03'
tex (matid=2): 'ttl_04'
tex (matid=0): 'ttl_05'
tex (matid=5): 'ttl_06'
tex (matid=7): 'ttl_07'
DEBUG: palnum = 6
pal (matid=6): 'p1'
pal (matid=1): 'p3'
pal (matid=2): 'p4'
pal (matid=0): 'p5'
pal (matid=5): 'p6'
pal (matid=7): 'z'
DEBUG: matid = 0, texname: ttl_05, palname: p5
DEBUG: matid = 1, texname: ttl_03, palname: p3
DEBUG: matid = 2, texname: ttl_04, palname: p4
DEBUG: matid = 3, texname: , palname:
DEBUG: matid = 4, texname: , palname:
DEBUG: matid = 5, texname: ttl_06, palname: p6
DEBUG: polynum = 8
DEBUG: codeoffset = 0000028c
=================================
reading 'TEX0'...
DEBUG: blockoffset = 000040c8, blocksize = 00024dd4
texnum = 6, palnum = 6
tex  0 'ttl_01		  ': offset = 0000425c size = 00010000 [W,H] = [256,256]
tex  1 'ttl_03		  ': offset = 0001425c size = 00002000 [W,H] = [32,256]
tex  2 'ttl_04		  ': offset = 0001625c size = 00000800 [W,H] = [16,128]
tex  3 'ttl_05		  ': offset = 00016a5c size = 00002000 [W,H] = [128,128]
tex  4 'ttl_06		  ': offset = 00018a5c size = 00010000 [W,H] = [256,256]
tex  5 'ttl_07		  ': offset = 00028a5c size = 00000200 [W,H] = [16,64]
pal 'p1' size = 512
pal 'p3' size = 16
pal 'p4' size = 16
pal 'p5' size = -16
pal 'p6' size = 48
DEBUG: converting pal 'p1', palentry = 256
DEBUG: converting pal 'p3', palentry = 8
DEBUG: converting pal 'p4', palentry = 8
ERROR readtex0
Unknown ID VCL0 is not supported
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
I posted in a similar thread a while back http://gbatemp.net/topic/305405-texture-and-model-data-hacking/ but I felt like doing something so a little program I like to have around for this ( http://www.propl.nl/random/NSBTXExtractor.zip ).
Some direct output from the program.
gallery_32303_143_18158.png


Frankly though I am not sure what you want to do- nsbmd tool spat out numbers and such that will point crystaltile2 exactly at what you need and get it viewable. Palettes are nominally harder as it does not tell you exactly where to look but such things are easy enough to calculate between http://llref.emutalk.net/docs/?file=xml/bmd0.xml#xml-doc and http://llref.emutalk.net/docs/?file=xml/btx0.xml#xml-doc
Back on topic in this case 0000425c houses ttl_01 which appeared to be the good stuff.
Scanning back up from that to the TEX0 stamp brings us to the file start. Palette Data Offset is at 0x0038 for 4 bytes (NSBMDtool already told us what goes here texture to palette wise but the logic is not that different if it differed) which when fiddled gives 00024B94 which is an offset within the tex0 file rather that from the whole nsbmd start but a good hex editor should not be troubled by that (if not 40c8 plus 00024B94 is not a hard sum) leading us to 028c5c
This brings
gallery_32303_143_51609.png


I then got bored and edited it giving
gallery_32303_143_450.png


However when I tried injecting it back into the rom (after recompressing and padding the file) it kept displaying the original screen. Not sure why this is but I have seen phantom files (files that appear to be what you want but really are just there for the sake of being there) and when dealing with 3d there can be other files in the mix (I only replaced "data\field\mdl\0623.nsbmd").
Edit- see two posts below- the game has 3d for animation and then jumps to conventional 2d apparently.
 

cain05

Member
OP
Newcomer
Joined
Feb 15, 2011
Messages
17
Trophies
0
Website
cainsdomain.com
XP
127
Country
Canada
I guess I wasn't doing something right in crystal tile then. I'll have another look at it, thanks for the info. As for why it doesn't display in game, there's actually two images. One is an NCGR used on the title screen while the NSBMD is used during an animation at the end of the title loop. Once again thanks for the help.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Ah yes I watched the whole intro and my edit appeared for a second or so- one video (apologies for the awful quality- I hosed up the encoding side of my computer and a quick and dirty grab to less than lossless motion JPEG followed by an even quicker and dirtier conversion to h264 is not conducive to such things)

http://www.4shared.com/video/BWsIw0B1/saga3titlescreendemo.html

 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: Or Genesis.