I don't know if I would call this "proper", but in terms of simple pragmatic tools that work, I tried translating essen's fpb C program to nodejs, and I was able to unpack the nmll archive with his nbl tool. So i think the output should be the same.
Code:
/*
* @author - Benjamin Collins - [email protected]
* Adapted from : https://github.com/essen/gasetools
* License : GPL 3.0
*/
"use strict";
const fs = require('fs');
console.log(process.argv);
if(process.argv.length !== 3) {
console.error("Usage: node %s file.fpb", process.argv[1]);
process.exit();
}
https://github.com/essen/gasetools
let ext = process.argv[2].split(".").pop();
if(ext !== "fpb") {
console.error("Usage: node %s file.fpb", process.argv[1]);
process.exit();
}
try {
var src = fs.readFileSync(process.argv[2]);
} catch(err) {
console.error("Error: could not open %s for reading", process.argv[2]);
console.log(err);
process.exit();
}
const NBL_ID_NMLL = 0x4C4C4D4E;
const NBL_ID_NMLB = 0x424C4D4E;
const NBL_ID_TMLL = 0x4C4C4D54;
const nbl = [];
for(let i = 0; i < src.length - 4; i+= 0x10) {
let dword = src.readUInt32LE(i);
if(dword !== NBL_ID_NMLL && dword !== NBL_ID_NMLB) {
continue;
}
nbl.push(i);
}
nbl.push(src.length);
for(let i = 0; i < nbl.length - 1; i++) {
let dst = src.subarray(nbl[i], nbl[i + 1]);
let num = i.toString();
while(num.length < 5) {
num = "0" + num;
}
let name;
if(dst[5]) {
name = "nmll-"+num+"-new-format.nbl";
} else {
name = "nmll-"+num+".nbl";
}
fs.writeFileSync(name, dst);
}
You can save the code as "fpb.js". Install nodejs, on windows there should be an "add to path" option in the install which allows you to run node from the normal cmd console. Put fpb.js and the psp2i file.fpb into the same folder and run:
And after a few seconds you should have about ten thousand .nbl files populating the directory. You can run
If you want to clean up the files and put the output in it's own out folder. As for the output there should be two kind of nbl files. the normal nmll-08894.nbl and then the "new" nmll-11408-new-format.nbl. I don't know what the difference between the new and normal files is, but I think essen's nbl tool only works on the normal files, and not the new ones. Either way you can test with nmll-08894.nbl which should contain the drop models like ob_xxx_drop_meseta.unj.