This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Mapar007


Advanced Member


Joined: 04 Oct 2008
Posts: 365

Posted: 29 Nov 2008 12:40:09 pm    Post subject:

I'd like to create a start-up autorun program, (the Start-up app is too big to distribute in conjunction with small programs/shells), but I don't have a clue how to start it....
Back to top
darkstone knight


Advanced Member


Joined: 07 Sep 2008
Posts: 438

Posted: 29 Nov 2008 12:51:11 pm    Post subject:

run an interupt to detect startup, i think
Back to top
brandonw


Advanced Member


Joined: 12 Jan 2007
Posts: 455

Posted: 29 Nov 2008 02:26:54 pm    Post subject:

The Startup app works by the ONSCRPT and OFFSCRPT appvars. Code in those appvars is copied to 8000h and executed when the calculator is turned on and off.

ONSCRPT is intended to be used after a warm start from APD, so it's not terribly useful for your purposes. OFFSCRPT is what you want. It gets called when the calculator is turned off, so what you'd want to do is turn off the LCD and go into a low power mode, then when the user presses ON, do what you want it to do on startup.

I'm not sure where any examples would be...I recommend reading WikiTI (all you have to do is have OFFSCRPT on the calculator, UNARCHIVED, and set the appropriate hook flag to enable it being called).

There's also a bug with how the OS copies it to memory, which essentially prevents it from being larger than 255 bytes, and you have to put a dummy byte ("nop" for example) at the start of the appvar. If I remember right.

You can look for sample code somewhere on the internet, or detachedsolutions.com/forum. Hopefully that steers you in the right direction.
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 29 Nov 2008 04:16:11 pm    Post subject:

Here's an example of a program that creates and installs a custom OFFSCRPT, with comments:


Code:
.nolist
#include "ti83plus.inc"
.list

.org userMem-2
   .db t2ByteTok,tasmCmp

;First, we create an appvar called OFFSCRPT
   ld hl, AppVarName
   b_call(_Mov9ToOP1)
   b_call(_ChkFindSym)
   jr c, Create
   b_call(_DelVarArc)
Create:
   ld hl, AppVarEnd - AppVarStart + 1
   b_call(_CreateAppVar)
;Next, we copy the code into the new appvar
   inc de
   inc de
   ld hl, AppVarStart
   ld bc, AppVarEnd - AppVarStart + 1
   ldir
;Next, we tell the OS to start using OFFSCRPT
   set 1, (IY + $33)
;Installation complete!
   ret

AppVarStart:
;This is the code that was copied to the appvar.  It can do just about anything you want, including running another program
   b_call(_ClrScrnFull)
   ld hl, $0203
   ld (curRow), hl
;Note that since the code is not longer being run from $9D95 (it's being run from $8000) we have to modify our absolute references
;Relative references are fine though (like jr)
   ld hl, Text1 - AppVarStart + $8001
   b_call(_PutS)
   ld hl, $0404
   ld (curRow), hl
   ld hl, Text2 - AppVarStart + $8001
   b_call(_PutS)
   ld hl, 0
   ld (curRow), hl
   ret

Text1:
   .db "Property of", 0
Text2:
   .db "pcGuru()", 0

AppVarEnd:

AppVarName:
   .db AppVarObj, "OFFSCRPT"

.end


I hope this helped! Just ask if you need more explanations.
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 29 Nov 2008 06:39:51 pm    Post subject:

Well, it's a bit more complicated than that, unfortunately. OFFSCRPT is run when the calculator is turning off, not when it's turning on. TI's Start-Up app works by having OFFSCRPT install a hook that gets run when the calculator turns back on. (This means your program has to be an app; if not, the process will be somewhat more complicated.) The hook is what does the actual work of running a program, displaying a picture, or whatever.
Back to top
Mapar007


Advanced Member


Joined: 04 Oct 2008
Posts: 365

Posted: 30 Nov 2008 03:24:58 am    Post subject:

I'll try it out
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement