Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Juju on July 02, 2011, 03:10:29 am

Title: Screensavers
Post by: Juju on July 02, 2011, 03:10:29 am
So the other day I was bored, so I made a neat screensaver in Axe, then I wondered how the program could autorun after some minutes of inactivity. You would use hooks right? So you would put the Axe program somewhere in archive, then install the hook to make the Axe program to execute when the cursor blinks or somethink, and with that you need some asm right?
Title: Re: Screensavers
Post by: aeTIos on July 02, 2011, 08:00:56 am
Maybe use the apd timer?
Title: Re: Screensavers
Post by: Juju on July 02, 2011, 09:32:48 pm
Probably. What is it?
Title: Re: Screensavers
Post by: thepenguin77 on July 05, 2011, 11:36:18 pm
Well, here's the specifics for the hook. If your going to use it, you can either assemble it yourself, or I'm going to need your program name.

Code: [Select]
cursorHook:
add a, e
ld a, (apdTimer)
cp $25 ;starts at $74, so...
ld a, b
jr z, isZero
ret nc ;have to ret NZ
isZero:
bcall(_closeEditBuf)
ld hl, programName
rst 20h
bcall(_executePrgm)
xor a
ld (menuCurrent), a
bcall(_jForceCMDNoChar)

programName:
.db protProgObj, "YOURNAME"
cursorHookEnd:
Title: Re: Screensavers
Post by: Juju on July 06, 2011, 02:40:11 am
So that's the hook installer? It makes prgmYOURNAME run each time the cursor blink? If so, I have to make the program count how much time it had been ran. Also there must be some  way to reset the counter when something has been typed?
Title: Re: Screensavers
Post by: XVicarious on July 06, 2011, 02:47:47 am
I'm pretty sure it counts how many times the cursor has blinked with inactivity. The timer resets every time a button is pressed. I'm just assuming that though.