User Tools

Site Tools


base:frame_skipping

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
base:frame_skipping [2014-11-11 12:50]
mace created
base:frame_skipping [2015-04-17 04:32] (current)
Line 1: Line 1:
 +====== Frame skipping ======
  
 +Once in a while you created some effect that just goes too quick when you update it every frame.
 +The option is to have a check in order to skip your routine every other frame.
 +Put this inside your IRQ.
 +
 +<​code>​
 +start:
 +   inc skipper+1 ​     // increase the check byte
 +   
 +skipper:
 +   lda #$00           // check byte
 +   and #$01           // check first bit (even or odd number?)
 +   beq passroutine ​   // skip routine on even numbers
 +   
 +routine:
 +   // routine that will be executed every other frame
 +   
 +passroutine:​
 +   // the rest, executed every frame</​code>​
base/frame_skipping.txt ยท Last modified: 2015-04-17 04:32 (external edit)