Helo guys,
I want to have soft scroll in my os. I think i know how to do it, but i want somewhere i can get some code that shows me the way to implement it.
any one can heko me please??
scroll screen
Re:scroll screen
If you're doing it in software then quite simply this isn't rocket science or anything.
All scrolling actually involves is copying the entire page into video memory only shifted up one row (Or as many as are requested). The principle is exactly the same whether you are scrolling in text mode or graphics mode.
The only nuances involved are whether you are maintaining a history larger than a single page, whether you want to allow scrolling of more than one line (In a graphics mode you might want to scroll by more than one pixel at a time), how many degrees of freedom you want to allow scrolling for (This is reliant on maintaining screen history of course). None of which change the principle, just implementation of it.
Basic outline of a scroll would be something like this:
Hope that helps, it's probably just confirmation of what you were already thinking.
Hardware scrolling involves changing the base address of the text page, an interesting problem, but not particularily worth the effort IMO.
All scrolling actually involves is copying the entire page into video memory only shifted up one row (Or as many as are requested). The principle is exactly the same whether you are scrolling in text mode or graphics mode.
The only nuances involved are whether you are maintaining a history larger than a single page, whether you want to allow scrolling of more than one line (In a graphics mode you might want to scroll by more than one pixel at a time), how many degrees of freedom you want to allow scrolling for (This is reliant on maintaining screen history of course). None of which change the principle, just implementation of it.
Basic outline of a scroll would be something like this:
- Find out where the new top of page starts in memory (Ie one complete line from the current top).
- Copy everything from that point to the bottom of the page into screen memory (Or a buffer if you're not writing directly to screen).
- Add a blank line at the bottom and start any further output at the start of it.
Hope that helps, it's probably just confirmation of what you were already thinking.
Hardware scrolling involves changing the base address of the text page, an interesting problem, but not particularily worth the effort IMO.
Re:scroll screen
(sorry) Reading this, I think I'll post my question.
I would like to save several screen-fulls of text and be able to recall them at will, sort of like a text buffer. I am thinking of using two dimentional arrays for the characters and the attributes. However, is the max number of elements 999? If so, how can I store 80x25 chars in a var (not a file)?
I would like to save several screen-fulls of text and be able to recall them at will, sort of like a text buffer. I am thinking of using two dimentional arrays for the characters and the attributes. However, is the max number of elements 999? If so, how can I store 80x25 chars in a var (not a file)?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:scroll screen
What would it be so ?Mastermind wrote: (sorry) Reading this, I think I'll post my question.
However, is the max number of elements 999?
What kind of magic do you see in 999 ? (except it's 666 if you look it upside-down ?)
char screen[80][25] should do it.If so, how can I store 80x25 chars in a var (not a file)?
However, on a screen, you have 80x25x2 = 4000 characters, not 80x25 ...
so you're likely to prefer
Code: Select all
short screen[80][25]