示例#1
0
void XmlTextWriter::WriteStartElement(RCString name) {
	CloseElement();
	if (!m_bEoled)
		Eol();
	Indent();
	m_os << '<' << name;
	m_elements.push(name.c_str()); //!!!
	m_bOpenedElement = true;
	m_bEoled = false;
}
示例#2
0
void XmlTextWriter::WriteEndElement() {
	if (m_bOpenedElement) {
		m_os << "/";
		CloseElement();
		m_elements.pop();
	} else {
		if (m_elements.empty())
			throw logic_error(string(__FUNCTION__)+ string(" at root element"));
		string tag = m_elements.top();
		m_elements.pop();
		if (m_bEoled)
			Indent();
		m_os << "</" << tag << ">";
	}
	Eol();
}
示例#3
0
void XmlTextWriter::WriteProcessingInstruction(RCString name, RCString text) {
	m_os << "<?" << name << " " << text << "?>";
	Eol();
}
示例#4
0
UINT32 main(UINT32 argc, UINT8 **argv) {

  UINT32 qqa32;
  UINT16 qqb16;
  UINT8  qqc8,qqd8;
   
  VBFAIL=0 ; VBPREF32=0 ; VBPREFHI=0 ;
 
  Eol();
  printf ("Hello DOSSER dude !!!");
  Eol();

  /* COLOR transation buffer */
  qqa32=0 ; qqc8=255 ; qqd8=255 ;
  while (1) {
    COLORBUF[qqa32]=qqc8;
    qqa32=qqa32+1;
    if (qqa32==1024) /* then */ break;
    qqc8=qqc8+qqd8;                      /* 255 to 55  step -1 | 200 */
    if (qqa32==200) /* then */ qqd8=2;   /* 55  to 255 step  2 | 100 */
    if (qqa32==300) /* then */ qqd8=253; /* 255 to 6   step -3 | 83  */
    if (qqa32==383) /* then */ qqd8=1;   /* 6   to 255 step  1 | 249 */
    if (qqa32==632) /* then */ qqd8=255; /* 255 to 59  step -1 | 196 */
    if (qqa32==828) /* then */ qqd8=1;   /* 59  to 254 step  1 | 195 */
  } /* endwhile | loop */

  if (argc>=2) /* then */ {
    qqc8=strcmp(argv[1],"PREF32");
    if (qqc8==0) /* then */ VBPREF32=1;
    qqc8=strcmp(argv[1],"PREFHI");
    if (qqc8==0) /* then */ VBPREFHI=1;
  } /* endif */
  if (argc>=3) /* then */ {
    qqc8=strcmp(argv[2],"PREF32");
    if (qqc8==0) /* then */ VBPREF32=1;
    qqc8=strcmp(argv[2],"PREFHI");
    if (qqc8==0) /* then */ VBPREFHI=1;
  } /* endif */

  printf ("DOS Alloc : ");
  regs.h.ax = 0x4800 ; /* Alloc */
  regs.h.bx = 0x0040 ; /* 1 KiB */
  regs.h.flags = 0x72 ;
  regs.h.ss = 0 ;
  regs.h.sp = 0 ;
  dpmi_simulate_real_interrupt(0x21,&regs);
  qqb16  =  regs.h.flags ;
  DosMem =  regs.h.ax ;
  if ((qqb16&1)==1) /* then */ {
    VBFAIL=1;
    printf ("failed ");
    SmiEvil() ;
  } else {
    printf ("OK: %d",DosMem);
  };
  Eol();

  if (VBFAIL==0) /* then */ {
   
    Empty();
    dosmirbuf[0]=86;
    dosmirbuf[1]=66;
    dosmirbuf[2]=69;
    dosmirbuf[3]=50;
    memcpy((void *)(DosMem*16),dosmirbuf,1024);

    regs.h.ax    = 0x4F00; /* VESA : Capturing info block */
    regs.h.flags = 0x72;
    regs.h.ss = 0;
    regs.h.sp = 0;
    regs.h.es = DosMem;
    regs.h.di = 0;
    dpmi_simulate_real_interrupt(0x10,&regs);
    qqb16 =  regs.h.ax ;
    if (qqb16!=0x004F) /* then */ {
      VBFAIL=1;
      printf ("VBE2 failure ");
      SmiEvil() ; Eol() ;
    };

  } /* endif */

  if (VBFAIL==0) /* then */ {
   
    memcpy(dosmirbuf,(void *)(DosMem*16),512);
    VESAVER=dosmirbuf[5];
    qqa32=0;
    while (1) {
      qqc8=dosmirbuf[qqa32];
      if ((qqc8<32) || (qqc8>125)) /* then */ qqc8=46;
      printf ("%c",qqc8);
      qqa32=qqa32+1;
      if (qqa32==512) /* then */ break;
    }; /* endwhile | loop */
    Eol();
   
    qqc8=4; /* Silly "pointers" */
    while (1) {
      qqb16=dosmirbuf[qqc8]+256*dosmirbuf[qqc8+1];
      printf (">%X-%X<",qqc8,qqb16);
      qqc8=qqc8+2;
      if (qqc8==34) /* then */ break;
    }; /* endwhile | loop */
    Eol();

    PL1  =dosmirbuf[14]+dosmirbuf[15]*256;
    PL2  =dosmirbuf[16]+dosmirbuf[17]*256;
    VRAM =dosmirbuf[18]+dosmirbuf[19]*256; /* 64 KiB units */
    PLLIN=(UINT32)PL1+PL2*16;

    printf ("Buffer: %d -> ",DosMem*16);
    printf ("List  : %d",PLLIN);
    Eol();
    printf ("VESA Version: %d | VRAM : %d MiB",VESAVER,VRAM/16);
    Eol();
    if (VESAVER<2) /* then */ {
      VBFAIL=1;
      printf ("At least VESA 2.0 required ");
      SmiEvil() ; Eol() ;
    };

  } /* endif */

  if (VBFAIL==0) /* then */ {

    MODES1=0;MODES2=0;
    while (1) {
      memcpy(&qqb16,(void *)(PLLIN+MODES1*2),2); /* PEEK */
      if ((MODES1==100) || (qqb16==65535)) /* then */ break;
      printf (">%d<",qqb16);
      MODES1=MODES1+1;
      if ((qqb16>255) && (qqb16<511)) /* then */ {
        mlbuf[MODES2]=qqb16 & 255;
        MODES2=MODES2+1;
      } /* endif */
    }; /* endwhile | loop */
    mlbuf[MODES2]=255; /* Terminate list */
    Eol();
   
    printf ("Modes : %d -> %d",MODES1,MODES2);
    if (MODES2==0) /* then */ {
      VBFAIL=1;
      printf (" - no usable mode candidates ");
      SmiEvil() ;
    } /* endif */
    Eol() ;
  } /* endif */

  if (VBFAIL==0) /* then */ {

    BRUTEFORCE=0 ; BFSUCC=0;
    qqc8=0;
    while (1) {
      WINNERBUF[qqc8]=0;
      qqc8=qqc8+1;
      if (qqc8==48) /* then */ break;
    } /* endwhile | loop */
    printf ("mode xx yy bpp bpsl $physlfb");
    Eol();
 
    while (1) {
      BFMODE=mlbuf[BRUTEFORCE];
      if (BFMODE==255) /* then */ break; /* The end */   
      Empty();
      memcpy((void *)(DosMem*16),dosmirbuf,1024);
      regs.h.ax = 0x4F01 ;     /* VESA */
      regs.h.cx = 256+BFMODE;  /* Mode */ 
      regs.h.flags = 0x72;
      regs.h.ss = 0;
      regs.h.sp = 0;
      regs.h.es = DosMem; /* ES:DI */
      regs.h.di = 0;
      dpmi_simulate_real_interrupt(0x10,&regs);
      qqb16 =  regs.h.ax ;
      if (qqb16!=0x004F) /* then */ {
        VBFAIL=1;
        printf ("Mode info call failed ");
        SmiEvil() ; Eol() ;
        break;
      } else {
        memcpy(dosmirbuf,(void *)(DosMem*16),256); /* $10,$12/13,$14/15,$19,$28 */
        BFBPSL = dosmirbuf[16]+dosmirbuf[17]*256;
        BFXX   = dosmirbuf[18]+dosmirbuf[19]*256;
        BFYY   = dosmirbuf[20]+dosmirbuf[21]*256;
        BFBPP  = dosmirbuf[25];
        memcpy(&BFPHYSLFB,&dosmirbuf[40],4);
        printf ("%d %d %d %d %d $%X ",BFMODE,BFXX,BFYY,BFBPP,BFBPSL,BFPHYSLFB);
        if ((BFXX==800) && (BFYY==600) && (BFBPP==24)) /* then */ {
          SmiGood();
          WINNERBUF[0] = BFBPP;
          WINNERBUF[1] = BFMODE;
          memcpy(&WINNERBUF[2] ,&BFBPSL,   2); 
          memcpy(&WINNERBUF[4] ,&BFPHYSLFB,4); 
          memcpy(&WINNERBUF[8] ,&BFXX,     2); 
          memcpy(&WINNERBUF[10],&BFYY,     2); 
          BFSUCC=BFSUCC+1;
        }; /* endif */
        if ((BFXX==800) && (BFYY==600) && (BFBPP==32)) /* then */ {
          SmiGood();
          WINNERBUF[12] = BFBPP;
          WINNERBUF[13] = BFMODE;
          memcpy(&WINNERBUF[14] ,&BFBPSL,   2); 
          memcpy(&WINNERBUF[16] ,&BFPHYSLFB,4); 
          memcpy(&WINNERBUF[20] ,&BFXX,     2); 
          memcpy(&WINNERBUF[22] ,&BFYY,     2); 
          BFSUCC=BFSUCC+1;
        }; /* endif */
        if ((BFXX==1024) && (BFYY==768) && (BFBPP==24)) /* then */ {
          SmiGood();
          WINNERBUF[24] = BFBPP;
          WINNERBUF[25] = BFMODE;
          memcpy(&WINNERBUF[26] ,&BFBPSL,   2); 
          memcpy(&WINNERBUF[28] ,&BFPHYSLFB,4); 
          memcpy(&WINNERBUF[32] ,&BFXX,     2); 
          memcpy(&WINNERBUF[34] ,&BFYY,     2); 
          BFSUCC=BFSUCC+1;
        }; /* endif */
        if ((BFXX==1024) && (BFYY==768) && (BFBPP==32)) /* then */ {
          SmiGood();
          WINNERBUF[36] = BFBPP;
          WINNERBUF[37] = BFMODE;
          memcpy(&WINNERBUF[38] ,&BFBPSL,   2); 
          memcpy(&WINNERBUF[40] ,&BFPHYSLFB,4); 
          memcpy(&WINNERBUF[44] ,&BFXX,     2); 
          memcpy(&WINNERBUF[46] ,&BFYY,     2); 
          BFSUCC=BFSUCC+1;
        }; /* endif */
        Eol();
      }; /* endif */
      BRUTEFORCE=BRUTEFORCE+1;
    } /* endwhile | loop */

    if (BFSUCC==0) /* then */ {
      printf ("No usable modes found ");
      SmiEvil();Eol();
      VBFAIL=1;
    }; /* endif */

  }; /* endif */

  if (VBFAIL==0) /* then */ {
   
    printf ("We have %d modes ",BFSUCC);
    SmiGood() ; Eol() ;
    MMODE0123=0 ;
    if                    (WINNERBUF[0] ==0)  /* then */ MMODE0123=1;
    if ((MMODE0123==1) && (WINNERBUF[12]==0)) /* then */ MMODE0123=2;
    if ((MMODE0123==2) && (WINNERBUF[24]==0)) /* then */ MMODE0123=3;
    if ((VBPREF32==1) && (MMODE0123==0) && (WINNERBUF[12]!=0)) /* then */ MMODE0123=1;
    if ((VBPREF32==1) && (MMODE0123==2) && (WINNERBUF[36]!=0)) /* then */ MMODE0123=3;
    if ((VBPREFHI==1) && (MMODE0123==0) && (WINNERBUF[24]!=0)) /* then */ MMODE0123=2;
    if ((VBPREFHI==1) && (MMODE0123==1) && (WINNERBUF[36]!=0)) /* then */ MMODE0123=3;
    MMODEV =           WINNERBUF[MMODE0123*12+1];
    MMBPP  =           WINNERBUF[MMODE0123*12];
    memcpy(&MMBPSL,   &WINNERBUF[MMODE0123*12+2] ,2); 
    memcpy(&MMPHYSLFB,&WINNERBUF[MMODE0123*12+4] ,4); 
    memcpy(&MMXX,     &WINNERBUF[MMODE0123*12+8] ,2); 
    memcpy(&MMYY,     &WINNERBUF[MMODE0123*12+10],2); 
    MMSIZE=MMBPSL*MMYY;
    printf ("Selected mode ");
    printf ("%d %d %d %d %d %d %d $%X",MMODE0123,MMODEV,MMXX,MMYY,MMBPP,MMBPSL,MMSIZE,MMPHYSLFB);
    Eol();
    printf ("Map now ... ");
    asm {
      push esi
      push edi
      push ebx
      mov  ax,0x0800
      mov  ebx,[MMPHYSLFB] /* BX:CX physical address of memory, BX is high */
      mov  ecx,ebx
      shr  ebx,16
      mov  esi,[MMSIZE] /* SI:DI size of region to map (bytes), SI is high */
      mov  edi,esi
      shr  esi,16
      int  0x31
      jnc  blah    /* OK */
      xor  ebx,ebx /* return 0 */
      xor  ecx,ecx
blah: shl  ebx,16
      mov  bx,cx   /* Now we have 32 bits in EBX */
      mov  [MMLIN],ebx
      pop  ebx
      pop  edi
      pop  esi
    } 
    if (MMLIN>1048576) /* then */ {
      printf ("Done: $%X -> $%X ... p.a.k. (ESC to abort) ",MMPHYSLFB,MMLIN); 
      SmiGood();
      Eol();
      while (!kbhit());
      qqc8=getch();
      Eol();
      if (qqc8==27) /* then */ VBFAIL=1;
    } else {
      printf ("Mapping failed - Vi$ta/XP NTVDM crap rulez ");
      SmiEvil() ; Eol() ;
      VBFAIL=1 ;
    } /* endif */
  }; /* endif */