ticalc-usb icon indicating copy to clipboard operation
ticalc-usb copied to clipboard

Application support

Open commandblockguy opened this issue 4 years ago • 2 comments

Because you need the CabriJr app to run assembly programs on the later CE OS versions, it would be nice if the library supported applications. Unfortunately, applications are a bit tricky:

  • They use a different file format from regular variables.
  • In the files for monochrome calcs, the application data is stored in a hex format. For the ez80 calcs, the data is stored in binary. The data is transmitted in binary on both.
  • The ez80 calcs expect the upper two bytes of the file type to exactly equal 0xF00F.
  • At least the ez80 calcs reject RTS packets for applications that have the VERSION attribute set.

I have some code for sending applications to the ez80 series on my fork, but I would best describe that as an incomplete hack. I'm unsure what the best way of handling applications (and potentially other types of flash files, in the future) would be, in terms of the API - right now, I'm adding a special case to the existing file parsing function, then creating a list of "fake" entries to return, but this might not be the best solution overall, especially if we want to support OSes in the future.

commandblockguy avatar Sep 17 '21 04:09 commandblockguy

@Timendus any comment?

reesericci avatar Oct 07 '21 14:10 reesericci

libtifiles has separate data structures for standard variable content, for FlashApps / OS upgrades content and for backup content; arrays of variables and TIGroups reference these structures. It's definitely possible to make a unified data structure for variable content, Flash content and backup content, and then a data structure for packs of the other content structure; however, since these three types hardly have any common attributes, for any given variable entry, most fields would be empty.

debrouxl avatar Oct 07 '21 16:10 debrouxl