Re: Redirection and Screen I/O
- Posted by mike burrell <mikpos at GAIANET.NET> Jan 23, 1997
- 1134 views
> I noticed that the ed.ex program just uses standard out for all of > it's screen writes, so I thought I would modify it a little, and > instead of setting SCREEN = 1, I would set SCREEN = open("CON","w") > but if I do this, the screen is definitely messed up. > > So what is the problem ? Is there a way to do text-based screen I/O > without assuming that stdout is pointing there ? > > (I have been trying to modify a Turbo-Pascal program I wrote a while > back that had to deal with the same issue -- not using stdout for > screen writes. In TP, though, opening the console worked correctly ) > > Any ideas ? Or is this possible a bug/feature of the interpreter > itself ? well i'm not exactly sure what you're trying to do... why don't you want to use just normal output??? i do have ONE alternative, however... you can write text directly to video memory using poke... video memory is linear, meaning that the character one the right of another will follow it immediately in memory... the address are: mono output: #B0000 colour output: #B8000 when you poke into memory, you should actually poke two bytes... the first byte is the character itself and the second byte is the colour.. now to figure out the ACTUAL value poked into memory for colour, you can use an equation like this: x = (128 * is_blinking) + (16 * background_colours) + (foreground_colour) well once again i'm not very clear on what you were trying to do... but at least everyone knows how to poke text directly into video memory now :> anyway... ttyl ...oooO MikPos of MARTYR Oooo... ..ooO http://www.geocities.com/SoHo/9036 Ooo.. ....oooO mike burrell OOooo....