Re: Scrolltext
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Jan 20, 1999
- 478 views
Tor Bernhard Gausen writes: > The depressing problem is that my routine is incredibly slow. > I'm clearly doing something REALLY wrong, but what? If you don't need smooth scrolling, you can use Euphoria's scroll() library routine in any graphics or text mode. It's reasonably fast. Here's a mode 18 example. include graphics.e if graphics_mode(18) then end if for i = 1 to 30 do printf(1, "%d:%s\n", {i, 'A' + rand(repeat(20, 60))}) end for for i = 1 to 100 do scroll(1,1,30) -- scroll lines 1..30 up one line position(30,1) printf(1, "%d:%s", {i, 'A' + rand(repeat(20, 60))}) end for if graphics_mode(-1) then end if As for your smooth scrolling program, it spends over 95% of it's time doing mem_copy() of 64000 bytes. Euphoria's mem_copy() calls C's memcpy(). I don't think you could run your program more than about 1% faster in C. I believe that writes to screen memory are much slower than writes to general DRAM addresses, because of the lack of caching. Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/