07-19-2016, 12:06 PM
couldn't sleep last night, gave-up at five AM, then coded this, after learning the annoying-ass way by which to even do it:
http://crystalien-redux.com/unrelated/ET...yData.html
it is SO tempting to use the 'forbidden black magic' method...
there'd only be one intermediate format, and it's insanely easy to work with.
opening a file then reading its contents as a binary data stream should NOT take several functions unless one is using a lower level language or something. Add to list of reasons JS is not only annoying to work with, but unnecessarily so.
Anyways, this randomly loads one of two binary files, randomly, checks their headers for the 'valid' one, confirms to the user whether a valid file has been loaded, then dumps the contents as ascii and hex.
It's not done. Even though this is just a test, I want to actually use the data i encoded. Should be easy, but I'm strapped for time atm. Whether or not I'll fix a fatal flaw in the format, IDK... as it stands, the trailing meta-data actually will be parsed as part of the palette data the files contain, because i forgot to include a byte or block to define the length of the data. OOPS. I'm likely just gonna make the parser have a hard-coded limit, this is only a test, after all. This would be why I refrain from coding at odd hours.
Anyways, thoughts?
http://crystalien-redux.com/unrelated/ET...yData.html
it is SO tempting to use the 'forbidden black magic' method...
there'd only be one intermediate format, and it's insanely easy to work with.
opening a file then reading its contents as a binary data stream should NOT take several functions unless one is using a lower level language or something. Add to list of reasons JS is not only annoying to work with, but unnecessarily so.
Anyways, this randomly loads one of two binary files, randomly, checks their headers for the 'valid' one, confirms to the user whether a valid file has been loaded, then dumps the contents as ascii and hex.
It's not done. Even though this is just a test, I want to actually use the data i encoded. Should be easy, but I'm strapped for time atm. Whether or not I'll fix a fatal flaw in the format, IDK... as it stands, the trailing meta-data actually will be parsed as part of the palette data the files contain, because i forgot to include a byte or block to define the length of the data. OOPS. I'm likely just gonna make the parser have a hard-coded limit, this is only a test, after all. This would be why I refrain from coding at odd hours.
Anyways, thoughts?