Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic error in begin(uint8_t mode, uint8_t x, uint8_t y) #77

Open
GoogleCodeExporter opened this issue Jun 21, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

I may misunderstand your intention, or you use some trick i don't see, but i 
believe you have an in line 77 of TVout.cpp, where you check if size of the 
horizontal resolution is divisible by 8.
In the current code, this logic expression should evaluate to true if the x is 
not divisible by 8:

!(x & 0xF8)

However, as far as i can see this only evaluates to true if x has a value in 
the range of 0-7, or some ranges above 255 (fx. 256 is divisible by 8, but this 
resolution may be outside the capabilities of the library?).
I believe the desired effect will be achieved with:

(i & ~0xF8)

This evaluates to true for all values not divisible by 8 in the range of 0-255.

Hope this helps.
If I have misunderstood the logic or your intentions, i'm sorry for wasting 
your time.

Original issue reported on code.google.com by [email protected] on 29 Nov 2013 at 11:10

@GoogleCodeExporter
Copy link
Author

Doh. I of course mean:
(x & ~0xF8)

Copy-pasted from the program I used to test the theory.

Original comment by [email protected] on 29 Nov 2013 at 11:11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant