Author Topic: Axe Tutorial: Interrupts  (Read 5418 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Axe Tutorial: Interrupts
« on: May 19, 2011, 02:05:00 pm »
If used correctly and without abuse, interrupts can play an important part in an Axe program.  So I wrote this tutorial.  Enjoy!

Typo: On page 4, you divide T by 118, but it's to get the number of seconds you survived.  It is NOT to get the number of times each second the routine ran.
« Last Edit: May 19, 2011, 03:09:24 pm by Hot_Dog »

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #1 on: May 19, 2011, 02:50:16 pm »
I especially like the table at the end.

A question for you: are any issues raised if you stick a Dispgraph inside an interrupt?
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #2 on: May 19, 2011, 02:58:07 pm »
Hmmm, I did forget to mention that very big interrupt routines (such as those with Dispgraph) can be problems, so a huge routine should start with FnOff and end with FnOn.

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Axe Tutorial: Interrupts
« Reply #3 on: May 19, 2011, 03:09:52 pm »
The DispGraph commands themselves shouldn't cause problems with interrupts, though.
I use DispGraphrr all the time in interrupts and I never have an issue with it.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #4 on: May 19, 2011, 05:24:52 pm »
Hmmm, I did forget to mention that very big interrupt routines (such as those with Dispgraph) can be problems, so a huge routine should start with FnOff and end with FnOn.

Axe automatically adds this for you.  When you're in an interrupt routine, the interrupts are turned off until it returns to the rest of the main program.  All DispGraph commands are interrupt safe I believe.
« Last Edit: May 19, 2011, 05:25:49 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #5 on: May 19, 2011, 08:30:32 pm »
Couple-o-questions:
1. Can you use getkey in an interrupt now? (por el boton de las maestras)
2. Why the carp (yes the fish) is the 84+ always slower?? :'(
« Last Edit: May 19, 2011, 08:31:22 pm by Broseph Radson »

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #6 on: May 28, 2012, 06:58:14 am »
What would happen if I would use interrupts for Pause(5000) ?
Will it really pause, will it be an error, or what will happen?
I think it will begin with the next Pause(5000) even before the last pause is over. But how will it react on that?
(can't try it out now - my TI makes some problems again...)
*insert supercool signature*

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Tutorial: Interrupts
« Reply #7 on: May 29, 2012, 10:00:26 am »
@p2, according to Quigibo interrupts are turned off while the interrupt routine is running. So it'll run the Pause 5000 fully, return to the regular program, and the next time an interrupt fires it will Pause 5000 again