ndless-nspire / Luna

Create TNS files from Lua and XML
Other
57 stars 13 forks source link

Set apiLevel correctly in file headers. #11

Closed a-a closed 1 year ago

a-a commented 5 years ago

Scans input files for platform.apiLevel and if major is defined as 2 ("2.0", '2.0', "2.3" etc) sets appropriate LOCALHEADERMAGIC2 within minizip. If apiLevel isn't defined or something else/unsupported, it defaults to 1 for compatibility with older calcs. Parameters are now passed into minizip to help support adding later major API versions as/when they become a thing. For input on stdin, the original default/behavior of using apiLevel 2 is retained (needs a separate re-write of various parts of luna to deal with this nicely).

Vogtinator commented 5 years ago

I just had a look at OS code to see what the difference between the magic values is. The format is:

This is probably due to the changes in Document.xml for BMP file support.

Can you make that more obvious in the minizip changes? So instead of the api version, it should use the document version directly in the magic.

Then it's also possible to improve the luna.c changes: Use 0x700 if there are BMP files inside and 0x500 otherwise. The "platform.apilevel" parsing can be removed.

a-a commented 5 years ago

apilevel parsing removed, minizip now directly takes major and minor versions as passed by luna and formulates a magic number for the headers appropriately.

adriweb commented 5 years ago

Could someone with enough motivation finish the work started here? :P

adriweb commented 3 years ago

bumpity bump

adriweb commented 2 years ago

If this could be finished in order to solve https://tiplanet.org/forum/viewtopic.php?f=15&t=25749 ... :)

adriweb commented 1 year ago

Follow-up available in https://github.com/ndless-nspire/Luna/pull/13