Пример #1
0
//Emulates an ANSI compatible display subsystem
void Dex32PutC(DEX32_DDL_INFO *dev, char c){
    if(c == '\t') {
        int i;
        for(i = 0; i < 3; i++)
            Dex32PutC(dev, ' ');
        return;
    }
    else if(c == '\b') {
        if(dev->curx > 0)
            dev->curx--;
        Dex32UpdateCursor(dev, dev->cury, dev->curx);
    }
    else if(c == '\r') {
        dev->curx = 0;
        Dex32UpdateCursor(dev, dev->cury, dev->curx);
    }
    else if(c == '\n') {
        dev->curx = 0;
        Dex32NextLn(dev);
    }
    else {
        Dex32PutChar(dev, dev->curx, dev->cury, c, dev->attb);
        dev->curx++;
        Dex32PutChar(dev, dev->curx, dev->cury, ' ', dev->attb);

        if(dev->active)
            Dex32UpdateCursor(dev, dev->cury, dev->curx);
    }

    if(dev->curx > 79) {
        dev->curx = 0;
        Dex32NextLn(dev);
    }
}
Пример #2
0
void putc(char x)
 {
 #ifdef USE_CONSOLEDDL
  DEX32_DDL_INFO *d = Dex32GetProcessDevice();
  int cx = d->curx ,cy=d->cury;
  char attb = d->attb;
  Dex32PutChar(d,cx,cy,x,attb);
 #else 
  putchar(CsrX,CsrY,x,attb);
 #endif  
 };
Пример #3
0
//the lowest level video memory oepration available aside from
//update_cursor, puthcar places a character with specified attribute or color
//into an X,Y location (supports only textmode color displays as of the
//moment
//-4-9-2003: Added functions for working with virtual consoles
unsigned int putchar(char x,char y,char c,char color)
  {
   #ifdef USE_CONSOLEDDL
   Dex32PutChar(Dex32GetProcessDevice(),x,y,c,color);
   #else
   char *cptr;
   DWORD vidmemloc=0xb8000;
   cptr=(char*)(vidmemloc+ (y * 80 + x) * 2);
   *cptr=c;
   *(cptr+1)=color;
   #endif
  };
Пример #4
0
void Dex32NextLn(DEX32_DDL_INFO *dev){
    DWORD vidmemloc = dev->buf_ptr;
    dev->cury++;
    dev->lines++;
    if(dev->cury >= 25) {
        dev->cury = 24;
        if(dev->scroll) {
            Dex32ScrollUp(dev);
            memset(vidmemloc+0x00F00, 0, 80*2);
        }
    }

    Dex32PutChar(dev, dev->curx, dev->cury, ' ', dev->attb);
    if(dev->active && !dev->bufmode) move_cursor(dev->cury, dev->curx);

}