Thread: OBDuino Mega
View Single Post
Old 09-26-2009, 08:34 PM   #14 (permalink)
nickdigger
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
here you go:

//byte row_offsets is unused
byte dr = 0x80 + x + (y&1 ? 0x40 : 0) + (y&2 ? 0x14 : 0);
//32 bytes saved (burp)


edit: this one appears to save 18 more:

byte dr = 0x80 + x;
if (y&1) dr+= 0x40;
if (y&2) dr+= 0x14;

Last edited by nickdigger; 09-26-2009 at 08:40 PM..
  Reply With Quote
The Following User Says Thank You to nickdigger For This Useful Post:
Froggy (09-27-2009)