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

move over draw_buffer in relation to LineBuffers #80

Open
lowagner opened this issue Dec 7, 2016 · 4 comments
Open

move over draw_buffer in relation to LineBuffers #80

lowagner opened this issue Dec 7, 2016 · 4 comments

Comments

@lowagner
Copy link
Contributor

lowagner commented Dec 7, 2016

in vga_bitbox.c, didn't we think to do something like this?

uint16_t *display_buffer = LineBuffer1 + 112; // will be sent to display
uint16_t *draw_buffer = LineBuffer2 + 112; // will be drawn (bg already drawn)

(112 = (1024 - 800)/2, with 800 being max horizontal resolution, so we get a big chunk on the left (112 pixels) and right (112 as well) that we can draw to without segfaults.)

not sure how to do this for the micro, or if that messes things up.

@makapuf
Copy link
Owner

makapuf commented Dec 7, 2016

it's not that simple in fact, you need the DMA to start at a 4kB boundary in certain circumstances, so LineBuffer1+112 must be aligned at a 4kB boundary

@lowagner
Copy link
Contributor Author

lowagner commented Dec 7, 2016

ok, glad i didn't try to submit a PR with that then :). not sure how it all works down on the lowest level, but will it be possible to do something like this? i'd be happy with even 16 pixels on either side, 32 should be definitely enough -- i don't know if that helps to keep it simple. 112 doesn't have to be a thing...

@makapuf
Copy link
Owner

makapuf commented Dec 13, 2016

See current investigations on how to do it - definitely not simple.
http://stackoverflow.com/questions/41122880/align-a-variable-in-memory-with-offset-from-power-of-two-in-memory

@lowagner
Copy link
Contributor Author

definitely looks tricky! though i'd like 32 bytes (= 16 bitbox pixels) if possible... sorry to be picky...

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

No branches or pull requests

2 participants