stimmer / DueVGA

Arduino Due VGA library
92 stars 30 forks source link

Scrolling #2

Closed JerryI closed 1 year ago

JerryI commented 11 years ago

Hello I have a question. I saw function "VGA.Scroll" Can I use this for scroll left/right/up/down a large picture or other large objects which are larger than the screen?

(sorry for my english :) )

stimmer commented 11 years ago

The scroll function takes a rectangular area of the screen at (x,y) size (w,h) and shifts it by (dx,dy) pixels. The area at the exposed edges gets filled with colour col.

It does not work like scrolling in a windowing system, where you have an off-screen bitmap. The Due does not have enough memory for this. It is more similar to software scrolling in VGA mode 13h from the old days of DOS.

JerryI commented 11 years ago

My last question... How can I get direct access to Video Ram? ( For example: VRAM[240][320] = 0xE3; )

stimmer commented 11 years ago

For colour modes there is char * Vga::cb which is the pointer to the top left pixel. Use it like this: VGA.cb[y*VGA.cw+x]=c; There is an inline method VGA.putCPixelFast(int x, int y, uint8_t c) which does exactly that.

JerryI commented 11 years ago

Thanks :)