#19701 - slboytoy - Fri Apr 23, 2004 6:15 pm
hi all. i'm working on a logc analyzer display function which checks the bits withen a pair of integers which are stored in a structure (channels.hi and channels.lo). there seems to be a problem when we're trying to switch from 1 int to the other. this results in an output which seems to be missing one bit of data. instead, a blank space is drawn instead of an actual piece of data.
anybody see what we are missing in this chunk of code?
anybody see what we are missing in this chunk of code?
Code: |
do { //Drawing the horizontal line if(count > 31) { if(channels.hi & (1 << count - 31)) { y = yHigh; } else { y = yLow; } x = HorizontalLines(x, y, X_Length); //Returns new value of 'x' cordinites } else { if(channels.lo & (1 << count)) { y = yHigh; } else { y = yLow; } x = HorizontalLines(x, y, X_Length); //Returns new value of 'x' cordinites } //Checks when to put a vertical line if (count !=0) { if(count == 31) { if (channels.hi & (1 << count -1) && (y == yLow)) //Low to High { VerticalLines(x, yLow, yHigh); } else if (channels.hi & (1 << count -1) && (y == yHigh)) //Still High {} else if (y == yHigh ) //High to Low { VerticalLines(x, yLow, yHigh); } } if(count > 31) { if (channels.hi & (1 << count -32) && (y == yLow)) //Low to High { VerticalLines(x, yLow, yHigh); } else if (channels.hi & (1 << count -32) && (y == yHigh)) //Still High {} else if (y == yHigh ) //High to Low { VerticalLines(x, yLow, yHigh); } } else { if (channels.lo & (1 << count -1) && (y == yLow)) //Low to High { VerticalLines(x, yLow, yHigh); } else if (channels.lo & (1 << count -1) && (y == yHigh)) //Still High {} else if (y == yHigh ) //High to Low { VerticalLines(x, yLow, yHigh); } } } count--; }while(count > 0); |