Board index » delphi » Scroll in text-mode
eye-q
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
eye-q
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Scroll in text-modeHi I want source for scrolling a text file in text-mode (Scroll up and down Thanks /Marcus Malmgren |
Myles F
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuoteeye-q wrote in message <01bd2f2e$faa59a80$d89064c3@eye-q>... Myles Fisher - STILL frustrated with my own scrolling in text mode... |
Scott Earnes
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuoteMyles F. wrote: read file into memory There are some other minor details to this, but that essentially covers the For sake of speed and typing, I just used strict indenting to indicate block -- |
Phil Brutsch
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuoteMyles F. wrote: Quote
lets you directly access the video buffer. It's not very fast (goes plenty fast on my Pentium desktop!) but it gets the job done. I can send it to you if you want it. BTW - I have a scrolling program that does what you're trying to do -- "Be of stout heart, Number One. We've handled the Borg. We can ---------------------------------------------------------------------- |
Emil Mikuli
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-mode
> eye-q wrote in message <01bd2f2e$faa59a80$d89064c3@eye-q>... > >I want source for scrolling a text file in text-mode (Scroll up and down > >Thanks > >/Marcus Malmgren > Can I have one too? Anyway, if you're actually after "pixel-by-pixel" scrolling. Emil.
[
Scroll.pas 1K ] { please give credit where it's due } uses crt; type line=array[1..80] of char; if you need more than this, you'll need multiple segments var buffer:^scrolldata; begin assign(f,'text.txt'); i:=0; { crop line if longer than 80. extend with spaces if shorter } { and put it in the buffer } close(f); { here starts the scrolly } { key mapping: ESC to stop, UP and DOWN on the arrow keys to move } c:=readkey; { crop yofs } dispose(buffer); { that's about it, it doesn't do colors and it's a bit slow but it's |
Myles F
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-mode[dammit! my {*word*76}y server wouldn't let me post until most of your message Quote>-- My prog can take any commands ('cept the wrong ones, of course!), but the real problem lies in the implementation of those commands - ie, the 'redraw' section of your program above. I've not yet learnt just how to write directly to screen memory, so the result is that going up a line or using page-down or page-up results in a very visible 'all the lines on the screen being redrawn' effect. So, just what is exactly the code to write to screen memory - and please, if there's a way to do it without assembler, I'm all ears! Myles Fisher |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeIn article <6b3lvm$ri...@perki.connect.com.au>, QuoteMyles F. <fis...@smart.net.au> wrote: is on the top line) Osmo |
Peter Moraliysk
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuoteMyles F. wrote: offset is within 0..80*25 depending on the coordinates. Moraliyski |
Myles F
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuote
stuff but it is too slow. However, thanks must go to Emil Mikulic who provided a simple example of how to accomplish what I want in Pascal. Get his sample program, and you'll see what I'm talking about - eg: direct writes to video memory... Thanks, anyway. |
Myles F
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuote>Here's how I'd do it (attached). we're probably all seeking. Emil Mikulic's program shows exactly how to achieve a scroll-in-text-mode effect which is perfectly suitable for README type files, and for my purposes. This is the kind of stuff which should be demonstrated more often in giving answers in this newsgroup. And I'm not talking about freely giving away code with abandon, ok? Myles Fisher |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeIn article <6b8thb$du...@perki.connect.com.au>, QuoteMyles F. <fis...@smart.net.au> wrote: and delline for 8MHz 8088 and they were fast enough. On my 386DX-40 Delline takes under 4 ms. Remember that the fastest key repeat is 30 Hz or at 33ms interval. Try this: uses crt; begin Osmo |
Emil Mikuli
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Scroll in text-modeQuote> No, no, no! Did you read my other message in another branch? I've tried that instead of 2000 and pad it with color values (7 if unsure) then you can speed it up tons. Anyone wnat me to try this and post another example? At the moment there's a stupid bit of code for the direct video write Emil. |