I'm currently trying to make a flash library for the TI-84+ CE using the app.inc from Cesium. I've managed to get it to do OpenLib( by passing 3 as the "splash" parameter of the start_app() macro, but I can't figure out how the indexing of the ExecLib command works or how to register my function. As for the indexing, I figured out that the maximum index is 9999, because any number above that gives a "List index out of range" error, while any number (that I've tried) below it gives "Domain". Does anyone know how to register the functions correctly and call them using ExecLib?
I haven't actually finished writing that part of the code for app.inc, but if you look at the documentation page for applications you will see that they have this particular offset in the header:

021h = Offset used for ExecLib

Which corresponds to the second 0 on this line in app.inc; which you replace with the offset to the library function code; which would be something like 'MyLibrary-__ahs'.

From there you can just write up what should happen when ExecLib is encountered. Here's some sample code to get you started:


Code:

MyLibrary:
   add   a,e      ; I can never remember if this is needed or not. Try removing it to see what happens.
   call   _RclAns
   ld   a,(hl)
   cp   a,ListObj
   jp   nz,_ErrDataType
   ...         ; Parse the list here or do something else. You don't *have* to pass it as a list, it could just be a number or a string.
   ret


Anyway, feel free to ask any questions you may have Smile
I just tried that, but I still have the same problem with "Error: Domain" when calling ExecLib from my BASIC application. The catalog help says that ExecLib takes a numeric input as the "Number of a routine in a library app", but I don't know what that number would be. Do you know how to find that number? Or should I poke around in the ROM code with CEmu for an answer?
The catalog is incorrect. It does not take input as a number; it just jumps to the handling code when ExecLib is run.
Oh. That's weird, because even when I do it without any argument, it gives a domain error
What type of library is this?? I'm interested...
Currently, it's just a simple test library, so basically "Hello, world". I might make a graphics library later, though, if I can figure out how to implement Bresenham's algorithms in Assembly
Neat!, ICE and TEXTLIB are things you might want to look at (84pce/asm/<something>, ICE has it's own graphics things...)

EDIT, PT_ just said that ICE uses the GRAPHX lib, sorry for the confusion
SM84CE wrote:
Neat!, ICE and TEXTLIB are things you might want to look at (84pce/asm/<something>, ICE has it's own graphics things...)

EDIT, PT_ just said that ICE uses the GRAPHX lib, sorry for the confusion


Thanks, I'll look at those if I get stuck implementing something
No problem!, Both are in 84pce/asm/programs, just checked.
goose121 wrote:
Oh. That's weird, because even when I do it without any argument, it gives a domain error

I stand corrected; I should have written better documentation. You are indeed correct. Anywho; it looks like supporting this is going to require a lot more work than I anticipated, so I will hopefully update app.inc and the wiki as soon as possible to give you more valid information Smile
MateoConLechuga wrote:
goose121 wrote:
Oh. That's weird, because even when I do it without any argument, it gives a domain error

I stand corrected; I should have written better documentation. You are indeed correct. Anywho; it looks like supporting this is going to require a lot more work than I anticipated, so I will hopefully update app.inc and the wiki as soon as possible to give you more valid information Smile


Thank you so much! It's nice that we won't have to do the usb8x hack of passing in a list if we want multiple functions in our library
I have written an example application using ExecLib which you can build for yourself and run here:

https://github.com/mateoconlechuga/app-inc

Be sure to read the readme and the comments with the example application. Enjoy; let me know if you need any more help Smile
MateoConLechuga wrote:
I have written an example application using ExecLib which you can build for yourself and run here:

https://github.com/mateoconlechuga/app-inc

Be sure to read the readme and the comments with the example application. Enjoy; let me know if you need any more help Smile


Thanks! This is going to be really cool! I'm also really happy that they fixed the infamous 8-character app name bug (only after years and when their docs say that the function is "Not available" Razz)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement