Advertisement
Guest User

Untitled

a guest
Jul 20th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. inplast_tmp = inpwork_last
  2. inpcur_tmp = inpwork
  3.  
  4. inpwork_last = inpcur_tmp
  5. inpwork_down = inpcur_tmp & ~inplast_tmp
  6. inpwork_no_rept_up = (~inpcur_tmp & inplast_tmp) & inpwork_repeat
  7.  
  8. for i in 0...30-1
  9. inpwork_history[i] = inpwork_history[i+1] # Move the history along
  10.  
  11. inpwork_history_inv[29] = inpwork_last # Put current input at end of the history
  12. historical_held = $FFFF
  13. for i in 0...30
  14. historical_held &= inpwork_history[i]
  15.  
  16. # historical_held now has bits for all keys held 30 frames or longer
  17.  
  18. # inpwork_repeat has all keys held 30 frames or longer IN ADDITION TO all buttons just pressed
  19. inpwork_repeat = historical_held | inpwork_down
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement