Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Interrupt Timer

Author
Message
Code Maker
8
Years of Service
User Offline
Joined: 4th Dec 2015
Location:
Posted: 21st Jul 2017 15:06 Edited at: 22nd Jul 2017 14:04
Interrupt Timer - by Code Maker 2017

This program can periodic execute code without any calls from the
main loop

I am sure there is many applications opportunities for an interrupt
timer like this.


Notes.

1.
You sould try to keep the timer delay above 10 milliseconds or
else it will overload your system, to quote MS API SDK help files
"Periodic timer events with an event delay of 10 milliseconds or less
consume a significant portion of CPU resources."

2.
The interrupt timer will bee killed if the window to which it has been
associated is closed.


Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Jul 2017 07:33
Looks cool

What's that get ptr to function,



I didn't know that DBP had such a command.
Code Maker
8
Years of Service
User Offline
Joined: 4th Dec 2015
Location:
Posted: 28th Jul 2017 16:46
That command is part off the Matrix1 plugin, you will need it to run the program
wath it basically dose is to get the memory address of the InterruptTimer
function in the program, also known in programming terms as a pointer,
so it can execute the function by calling that address periodically
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 13th Sep 2017 14:16
That is pretty cool. It has been a long time since I have used an interrupt routine. Back in the day I used to program my AtariST in Assembly language and I used to play around with interrupt routines. Nice job.



So many games to code.....so little time.

Login to post a reply

Server time is: 2024-11-21 11:43:01
Your offset time is: 2024-11-21 11:43:01