I'd like to add a scroll bar to scroll up and down through output, sort of like EDIT.COM. Assume no access to system calls, interrupts or otherwise, forget ncurses, and assume direct access to keyboard I/O ports and video memory.
I'd like to add a scroll bar to scroll up and down through output, sort of like EDIT.COM. Assume no access to system calls, interrupts or otherwise, forget ncurses, and assume direct access to keyboard I/O ports and video memory.
Let's assume none. I have basically most of the stdlib, and direct access to everything.
Listen, I have direct access, because I wrote the kernel. This is my point.
So what exactly are you having problems with? Write a ^ on the top right corner. Write a v on the bottom right corner. Write a | everywhere else along the right wall, with a # or something showing how far down the page you are.
Quzah.
Hope is the first step on the road to disappointment.
How can I scroll up and down with the arrow keys is my point, like EDIT.COM?
You wrote a kernel, but you can't figure out how to read keys? Grab the keystroke from the arrow keys, and repaint the visible portion of the screen.
Quzah.
Hope is the first step on the road to disappointment.
I can grab the keystroke, my point is how to repaint the screen? How do I store what was previous, etc.
you wrote a kernel? woah...
You buffer everything you expect to be on the screen, decide how much of it is shown at once, and output whatever is shown. When you ^ or v you simply adjust your frame of reference and output that. Look:
abc
def
ghi
jkl
The screen is two lines. Paint ABC DEF. I hit down. Paint DEF GHI. I hit down. Paint GHI JKL. I hit down. Nothing changes. I hit up. Paint DEF GHI.
Quzah.
Hope is the first step on the road to disappointment.
Yeah, it's a small one, but anyway, I wanted to create a scrolling type ability for the command line. MS should open source edit.com by now.
No one can help you then. If you're not clever enough to output to something other than the screen first, then no one can help you. Oh, and no one will actually believe you wrote the kernel either, if the concept of a buffer makes your head explode.
Quzah.
Hope is the first step on the road to disappointment.
I understand the concept of a buffer, thank you. Never mind, I'll go elsewhere.