<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Using timers</title>
		<link>http://www.allegro.cc/forums/view/591494</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 22 May 2007 08:16:05 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello! </p><p>Is there any comprehensive tutorial on how to use timers? Im making a space-invaders style game and I need to know how to use them... But the current tutorials arent helping. Should I post the code?</p><p>Thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 14:16:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Almost all you need to know:
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">int</span> timer<span class="k2">;</span></td></tr><tr><td class="number">2</td><td><span class="k1">void</span> timer_f<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">3</td><td>   <span class="k3">+</span><span class="k3">+</span>timer<span class="k2">;</span></td></tr><tr><td class="number">4</td><td><span class="k2">}</span></td></tr><tr><td class="number">5</td><td>&#160;</td></tr><tr><td class="number">6</td><td><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">7</td><td>   ...</td></tr><tr><td class="number">8</td><td>   <a href="http://www.allegro.cc/manual/install_timer" target="_blank"><span class="a">install_timer</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>   <a href="http://www.allegro.cc/manual/install_int_ex" target="_blank"><span class="a">install_int_ex</span></a><span class="k2">(</span>timer_f, BPS_TO_TIMER<span class="k2">(</span><span class="n">100</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">10</td><td>   timer <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td>   <span class="k1">while</span> <span class="k2">(</span><span class="k3">!</span>done<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">13</td><td>      <span class="c">// this will happen 100 times per second</span></td></tr><tr><td class="number">14</td><td>      <span class="k1">while</span> <span class="k2">(</span>timer<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">15</td><td>         do_logic<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>         <span class="k3">-</span><span class="k3">-</span>timer<span class="k2">;</span></td></tr><tr><td class="number">17</td><td>      <span class="k2">}</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>      draw_stuff<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>   <span class="k2">}</span></td></tr><tr><td class="number">21</td><td>   ...</td></tr><tr><td class="number">22</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>
EDIT: Made sure timer is 0 before entering the main loop.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 21 May 2007 14:58:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just make sure to set &quot;timer&quot; to 0 before entering the loop shown above.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Mon, 21 May 2007 15:20:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you manage how many times a second should the loop go?</p><p>EDIT: Yeah im stupid. Found that out! Thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 21:25:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes.<br />Try clicking the function name in the source code below:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/install_int_ex" target="_blank"><span class="a">install_int_ex</span></a><span class="k2">(</span>timer_f, BPS_TO_TIMER<span class="k2">(</span><span class="n">100</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Mon, 21 May 2007 21:28:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What if I have such code:
</p><div class="source-code snippet"><div class="inner"><pre>        <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span>
        <span class="k2">{</span>
            <span class="k1">while</span><span class="k2">(</span>timer<span class="k2">)</span>
            <span class="k2">{</span>
                <span class="c">// Print and Clear the buffer so no 'drawing' occurs</span>
                <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>,<a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span>
                <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span>

                <span class="c">// Timer...</span>
                timer--<span class="k2">;</span>
            <span class="k2">}</span>
        <span class="k2">}</span>
</pre></div></div><p>

If I press escape I cant get out. Should I do it like this:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span>timer <span class="k3">|</span><span class="k3">|</span> <span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span>
<span class="k2">{</span>
    <span class="c">/// code .......</span>
<span class="k2">}</span>
</pre></div></div><p>

Because if I press ESCAPE more times and it doesent work the program will crash.<br />Any suggestions?</p><p>P.S. My timer functions are like those above in miran&#39;s example. I set the timer to 0 before the loop. I used LOCKED_FUNCTION,LOCK_VARIABLE and END_OF_FUNCTION appropriately..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 21:36:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What you want to do is something like this:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">while</span> <span class="k2">(</span>running <span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td>   <span class="k1">if</span> <span class="k2">(</span>timer<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">4</td><td>       <span class="k1">int</span> maxSkip <span class="k3">=</span> <span class="n">4</span><span class="k2">;</span></td></tr><tr><td class="number">5</td><td>       <span class="k1">while</span><span class="k2">(</span>timer <span class="k3">&amp;</span><span class="k3">&amp;</span> maxSkip<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">6</td><td>           <span class="c">// logic</span></td></tr><tr><td class="number">7</td><td>           <span class="k3">-</span><span class="k3">-</span>timer<span class="k2">;</span></td></tr><tr><td class="number">8</td><td>           <span class="k3">-</span><span class="k3">-</span>maxSkip<span class="k2">;</span></td></tr><tr><td class="number">9</td><td>       <span class="k2">}</span></td></tr><tr><td class="number">10</td><td>   <span class="k2">}</span> <span class="k1">else</span> <span class="k2">{</span></td></tr><tr><td class="number">11</td><td>       <span class="c">// good place to return some time to the system</span></td></tr><tr><td class="number">12</td><td>       <span class="c">// not sure what's currently the best way to do it,</span></td></tr><tr><td class="number">13</td><td>       <span class="c">// so check if this is still ok:</span></td></tr><tr><td class="number">14</td><td>       <a href="http://www.allegro.cc/manual/rest" target="_blank"><span class="a">rest</span></a><span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">15</td><td>   <span class="k2">}</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td>   running <span class="k3">=</span> <span class="k3">!</span> <a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>

Normally, your code above should also work, unless your computer is very slow.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Mon, 21 May 2007 21:51:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t put drawing code in the timed section! You only need to keep the logic rate down to 100 FPS (or whatever) but draw as many times as possible (or cap to logic framerate if you want). What happens with your code is that your computer isn&#39;t fast enough to draw 100 frames per second (remember, this is fullscreen software blitting), so the timer callback does ++timer faster than you can do --timer which means you never break out of the inner while. The solution is to add a check inside the inner while to see if the value of timer is some high unexpected number and if it is, reset it to 0 and break out of the while (effectively dropping frames). But unless you do some heavy processing in the timed section, this should never happen (except in situations you can&#39;t control, like some other program stealing the CPU or something).</p><p>In code this would look like this:</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="k1">while</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/key" target="_blank"><span class="a">key</span></a><span class="k2">[</span>KEY_ESC<span class="k2">]</span><span class="k2">)</span></td></tr><tr><td class="number">2</td><td><span class="k2">{</span></td></tr><tr><td class="number">3</td><td>    <span class="k1">while</span><span class="k2">(</span>timer<span class="k2">)</span></td></tr><tr><td class="number">4</td><td>    <span class="k2">{</span></td></tr><tr><td class="number">5</td><td>        get_player_input<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">6</td><td>        run_physics_engine<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">7</td><td>        do_ai_processing<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">8</td><td>        etc<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td>        <span class="c">// Timer...</span></td></tr><tr><td class="number">11</td><td>        timer--<span class="k2">;</span></td></tr><tr><td class="number">12</td><td>&#160;</td></tr><tr><td class="number">13</td><td>        scene_needs_to_be_redrawn <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span></td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td>        <span class="k1">if</span> <span class="k2">(</span>timer <span class="k3">&gt;</span> frame_drop_threshold<span class="k2">)</span> <span class="c">// like 20 or something</span></td></tr><tr><td class="number">16</td><td>        <span class="k2">{</span></td></tr><tr><td class="number">17</td><td>            timer <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>            <span class="k1">break</span><span class="k2">;</span></td></tr><tr><td class="number">19</td><td>        <span class="k2">}</span></td></tr><tr><td class="number">20</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">21</td><td>&#160;</td></tr><tr><td class="number">22</td><td>    <span class="k1">if</span> <span class="k2">(</span>scene_needs_to_be_redrawn<span class="k2">)</span> <span class="k2">{</span></td></tr><tr><td class="number">23</td><td>        <a href="http://www.allegro.cc/manual/clear_bitmap" target="_blank"><span class="a">clear_bitmap</span></a><span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">24</td><td>        draw_scene_to<span class="k2">(</span>buffer<span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>&#160;</td></tr><tr><td class="number">26</td><td>        <span class="c">// blast the buffer onto the visible screen</span></td></tr><tr><td class="number">27</td><td>        <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>,<a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">28</td><td>&#160;</td></tr><tr><td class="number">29</td><td>        scene_needs_to_be_redrawn <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span></td></tr><tr><td class="number">30</td><td>    <span class="k2">}</span></td></tr><tr><td class="number">31</td><td><span class="k2">}</span></td></tr></tbody></table></div></div><p>
Now that&#39;s really almost all you need. All that&#39;s missing now is giving up the CPU when you can so you don&#39;t eat 100% and maybe handle the window close icon click and that&#39;s it as far as the main loop is concerned.</p><p>EDIT: Beaten by spellcaster. His code is a little better too... <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 21 May 2007 21:57:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
EDIT: Beaten by spellcaster.
</p></div></div><p>
But I forgot to mention the that he needs to separate logic and drawing. So let&#39;s call it a draw <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>EDIT:<br />Could somebody reply in the transitions thread? I need to post the examples on how to use the fade code <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Mon, 21 May 2007 22:07:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Could somebody reply in the transitions thread? I need to post the examples on how to use the fade code
</p></div></div><p>
Done. But you can click &quot;send to top&quot; if it&#39;s been more than an hour and it will go to the top anyway. I think.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 21 May 2007 22:11:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The problem was that my last post in that thread got too big. And I still wanted to post the examples. Since I can&#39;t double-post, I needed somebody to post in between <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Mon, 21 May 2007 22:14:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Now, the code works fine. But I have a problem. When I press Escape, the program exits. But then, I dont know if it exits like exits, or if it crashes. When I press ESC the program exits and then the &quot;This application has encountered ... and must close...&quot; message appears. </p><p>I have included all the source if someone can find the problem. Im still looking... </p><p>Thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 22:36:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Your program crashes, that&#39;s what getting that dialog means. No one will go through your code for you though...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 21 May 2007 22:38:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No, mogoče pa bi bil kdo dovolj nor... <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=":D" /></p><p>Anyways im gonna keep looking. Thanks for the help with the timers miran &amp; spellcaster! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 22:43:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /><img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /><img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /> Uuu, končn spet en Slowenc tuki gor! <img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /><img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /><img src="http://www.allegro.cc/forums/smileys/shocked.gif" alt=":o" /></p><p>EDIT:</p><p>Problem:
</p><div class="source-code snippet"><div class="inner"><pre>    <a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>title_image<span class="k2">)</span><span class="k2">;</span>
    <a href="http://www.allegro.cc/manual/unload_datafile" target="_blank"><span class="a">unload_datafile</span></a><span class="k2">(</span>data<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
Ne smeš uničit podatkov iz datafilea, ker unload_datafile() to naredi avtomatsko in potem sproščaš en in isti pointer dvakrat in potem se program sesuje.</p><p>English: You mustn&#39;t destroy data that was loaded from a datafile because unload_datafle() does that automatically. If you do that, you destroy the same pointer twice which crashes your program.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 21 May 2007 22:50:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ni kaj, bom še kr nekaj časa tu! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /> <br />Kak me razjezijo take napake!! Pa tak se skrije! Hvala ti!</p><p>Thanks for the help miran, I wouldnt spot the bug whitout you! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 23:00:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see you two have everything under control...</p><p>I think <tt>timer</tt> should be <tt>volatile int</tt>, not just <tt>int</tt>.<br />Shouldn&#39;t there be <tt>END_OF_FUNCTION()</tt> in there?<br />Also, <tt>LOCK_VARIABLE</tt> and <tt>LOCK_FUNCTION</tt>...</p><p>I don&#39;t know what the last two truly <b>do</b>, but the manual <i>says</i> to use them... That&#39;s usually a bad reason to do anything, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kibiz0r)</author>
		<pubDate>Mon, 21 May 2007 23:16:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have added END_OF_FUNCTION,LOCK_VARIABLE and LOCK_FUNCTION!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Vanneto)</author>
		<pubDate>Mon, 21 May 2007 23:17:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t know what the last two truly <b>do</b>, but the manual says to use them...
</p></div></div><p>
As far as I know, the LOCK_<i>whatever</i> calls are used because when you install the timers, you&#39;re creating a hardware interrupt.  So, at a given interval, the hardware takes over and runs whatever functions/variables used in the install.  I assume the LOCK_<i>whatever</i> calls help protect bad things from happening in this process (don&#39;t want other things fiddling with this portion of memory).  So, really, it&#39;s just good practice.  </p><p>I could be wrong though...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Onewing)</author>
		<pubDate>Tue, 22 May 2007 00:14:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>MacOS 9 and DOS are the only platforms that need the macros. The #defines are empty for all other platforms.</p><p>From allegro/platform/aldjgpp.h:
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#define END_OF_FUNCTION(x)          void x##_end(void) { }</span>
<span class="p">#define END_OF_STATIC_FUNCTION(x)   static void x##_end(void) { }</span>
<span class="p">#define LOCK_DATA(d, s)             _go32_dpmi_lock_data((void *)d, s)</span>
<span class="p">#define LOCK_CODE(c, s)             _go32_dpmi_lock_code((void *)c, s)</span>
<span class="p">#define UNLOCK_DATA(d,s)            _unlock_dpmi_data((void *)d, s)</span>
<span class="p">#define LOCK_VARIABLE(x)            LOCK_DATA((void *)&amp;x, sizeof(x))</span>
<span class="p">#define LOCK_FUNCTION(x)            LOCK_CODE((void *)x, (intptr_t)x##_end - (intptr_t)x)</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Tue, 22 May 2007 01:19:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve implemented the interupt timing system and it works to keep the logic control. However, I get those nasty looking vertical refresh lines. Shouldn&#39;t the drawing also be slowed down? If not, do I have to use vsync() <b>shudders</b>?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (aadfo824)</author>
		<pubDate>Tue, 22 May 2007 08:16:05 +0000</pubDate>
	</item>
</rss>
