Given x-coord, y-coord, and display buffer location, need to calculate where in the display buffer the pixel needs to be set, using these three steps:
- set the 5th-15th bits of x-coord all equal to 0 (so we get a value 0-15 instead of 0-31)
- perform exponentiation: x -> 2^x
this will set, if value is 0, value will be 0....01, if value is 1 will be 0...10,
if value is 2 will be 0...0100, and so on. setting xth bit equal to 1
- flip the bit orientation. because if x = 0 we need it to be 10...0, not 0...01
Given x-coord, y-coord, and display buffer location, need to calculate where in the display buffer the pixel needs to be set, using these three steps:
this will set, if value is 0, value will be 0....01, if value is 1 will be 0...10,
if value is 2 will be 0...0100, and so on. setting xth bit equal to 1