#include <graphics.h>\r
#include <stdio.h>\r
#include <conio.h>\r
+#include <string.h>\r
#include <stdlib.h>\r
+#include <mem.h>\r
#include <dos.h>\r
#include <bios.h>\r
\r
unsigned char ptyp;\r
long fih_offset;\r
};\r
+\r
struct FontInfoHeader\r
{\r
short num_codepages;\r
};\r
+\r
struct CodePageEntryHeader\r
{\r
short cpeh_size;\r
unsigned char reserved[6];\r
long cpih_offset;\r
};\r
+\r
struct CodePageInfoHeader\r
{\r
short version;\r
short num_fonts;\r
short size;\r
};\r
+\r
struct ScreenFontHeader\r
{\r
unsigned char height;\r
unsigned char xaspect;\r
short num_chars;\r
};\r
+\r
struct char8\r
{\r
unsigned char lin[8];\r
};\r
+\r
struct char14\r
{\r
unsigned char lin[14];\r
};\r
+\r
struct char16\r
{\r
unsigned char lin[16];\r
};\r
+\r
struct ScreenFontBitmap16\r
{\r
char16 lit[256];\r
\r
\r
int status;\r
- char nazwap[40]="Nie_wybrano_pliku";\r
- char err[40];\r
-// int kart8=CGA;\r
-// int kart14=EGA;\r
+ char nazwap[256]="Nie_wybrano_pliku";\r
+ char err[51];\r
+\r
int kart16=VGA;\r
-// int tryb8=CGAC2;\r
-// int tryb14=EGAHI;\r
+\r
int tryb16=VGAHI;\r
\r
FILE *CPI;\r
- FontFileHeader FFH;\r
- FontInfoHeader FIH;\r
- CodePageEntryHeader CPEH[6];\r
- CodePageInfoHeader CPIH[6];\r
- ScreenFontHeader SFH[6][3];\r
- ScreenFontBitmap16 SFB16[6];\r
- ScreenFontBitmap14 SFB14[6];\r
- ScreenFontBitmap8 SFB8[6];\r
-\r
- int byo8[6];\r
- int byo14[6];\r
- int byo16[6];\r
+ FontFileHeader *FFH;\r
+ FontInfoHeader *FIH;\r
+ CodePageEntryHeader *CPEH[16];\r
+ CodePageInfoHeader *CPIH[16];\r
+ ScreenFontHeader *SFH[16][3];\r
+ ScreenFontBitmap16 *SFB16[16];\r
+ ScreenFontBitmap14 *SFB14[16];\r
+ ScreenFontBitmap8 *SFB8[16];\r
+\r
+ int byo8[16];\r
+ int byo14[16];\r
+ int byo16[16];\r
int wys=8;\r
int cp=0;\r
int lit=0x42;\r
int cury=2;\r
int key;\r
int tab=0;\r
- char abc[16]="0123456789ABCDEF";\r
+ int any=0;\r
+ char abc[17]="0123456789ABCDEF";\r
+\r
+void nullpointers()\r
+{\r
+ short i,j;\r
+ CPI = NULL;\r
+ FFH = NULL;\r
+ FIH = NULL;\r
+ for(i=0;i<16;++i)\r
+ {\r
+ CPEH[i] = NULL;\r
+ CPIH[i] = NULL;\r
+ for(j=0;j<3;++j)\r
+ {\r
+ SFH[i][j] = NULL;\r
+ }\r
+ SFB8[i] = NULL;\r
+ SFB16[i] = NULL;\r
+ SFB14[i] = NULL;\r
+ byo8[i]=0;\r
+ byo14[i]=0;\r
+ byo16[i]=0;\r
+ \r
+ }\r
+}\r
+void offset()\r
+{\r
+ long off=0;\r
+ short i,j,s;\r
+ off+=sizeof(FontFileHeader);\r
+ FFH->fih_offset=off;\r
+ off+=sizeof(FontInfoHeader);\r
+ for(i=0,s=0;i<FIH->num_codepages;++i,s=0)\r
+ {\r
+ off+=sizeof(CodePageEntryHeader);\r
+ CPEH[i]->cpih_offset=off;\r
+ off+=sizeof(CodePageInfoHeader);\r
+ for(j=0;j<CPIH[i]->num_fonts;++j)\r
+ {\r
+ s+=sizeof(ScreenFontHeader);\r
+ s+=SFH[i][j]->num_chars*SFH[i][j]->height*((SFH[i][j]->width+7)/8);\r
+ }\r
+ off+=s;\r
+ CPIH[i]->size=s;\r
+ if(i==FIH->num_codepages-1)\r
+ CPEH[i]->next_cpeh_offset=0;\r
+ else\r
+ CPEH[i]->next_cpeh_offset=off;\r
+ }\r
\r
+}\r
+void deleteCPI(short st=6,short a=0,short b=0)\r
+{\r
+ short i,j;\r
+ switch(st)\r
+ {\r
+ case 6:\r
+ if(FIH==NULL)\r
+ return;\r
+ a=FIH->num_codepages-1;\r
+ b=CPIH[a]->num_fonts-1;\r
+ case 5:\r
+ switch(SFH[a][b]->height)\r
+ {\r
+ case 8:\r
+ delete SFB8[a];\r
+ SFB8[a] = NULL;\r
+ byo8[a] = 0;\r
+ break;\r
+ case 14:\r
+ delete SFB14[a];\r
+ SFB14[a] = NULL;\r
+ byo14[a] = 0;\r
+ break;\r
+ case 16:\r
+ delete SFB16[a];\r
+ SFB16[a] = NULL;\r
+ byo16[a] = 0;\r
+ break;\r
+ //default:\r
+ //totally unexpected;\r
+ }\r
+ case 4:\r
+ delete SFH[a][b];\r
+ SFH[a][b] = NULL;\r
+ for(j=0;j<b;++j)\r
+ {\r
+ switch(SFH[a][j]->height)\r
+ {\r
+ case 8:\r
+ delete SFB8[a];\r
+ SFB8[a] = NULL;\r
+ byo8[a] = 0;\r
+ break;\r
+ case 14:\r
+ delete SFB14[a];\r
+ SFB14[a] = NULL;\r
+ byo14[a] = 0;\r
+ break;\r
+ case 16:\r
+ delete SFB16[a];\r
+ SFB16[a] = NULL;\r
+ byo16[a] = 0;\r
+ break;\r
+ //default:\r
+ //totally unexpected;\r
+ }\r
+ delete SFH[a][j];\r
+ SFH[a][j] = NULL;\r
+ }\r
+ case 3:\r
+ delete CPIH[a];\r
+ CPIH[a] = NULL;\r
+ case 2:\r
+ delete CPEH[a];\r
+ CPEH[a] = NULL;\r
+ for(i=0;i<a;++i)\r
+ {\r
+ for(j=0;j<CPIH[i]->num_fonts;++j)\r
+ {\r
+ switch(SFH[i][j]->height)\r
+ {\r
+ case 8:\r
+ delete SFB8[i];\r
+ SFB8[i] = NULL;\r
+ byo8[i] = 0;\r
+ break;\r
+ case 14:\r
+ delete SFB14[i];\r
+ SFB14[i] = NULL;\r
+ byo14[i] = 0;\r
+ break;\r
+ case 16:\r
+ delete SFB16[i];\r
+ SFB16[i] = NULL;\r
+ byo16[i] = 0;\r
+ break;\r
+ //default:\r
+ //totally unexpected;\r
+ }\r
+ delete SFH[i][j];\r
+ SFH[i][j] = NULL;\r
+ }\r
+ delete CPIH[i];\r
+ delete CPEH[i];\r
+ CPIH[i] = NULL;\r
+ CPEH[i] = NULL;\r
+ }\r
+ case 1:\r
+ delete FIH;\r
+ FIH = NULL;\r
+ case 0:\r
+ delete FFH;\r
+ FFH = NULL;\r
+ }\r
+}\r
\r
-int pot(int a,int n)\r
+/*t pot(int a,int n)\r
{\r
int y=1;\r
for(int i=0;i<n;++i)\r
y*=a;\r
return y;\r
-}\r
+}*/\r
\r
void new8()\r
{\r
- system("CLS");\r
+ //system("CLS");\r
cleardevice();\r
setcolor(GREEN);\r
//outtextxy(0,0, "Edytor napis¢w±°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");\r
outtextxy(0,0, "Edytor napis¢w± ");\r
outtextxy(0,8, "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
+ outtextxy(608,16,"v1.1");\r
}\r
void menu8()\r
{\r
setcolor(GREEN);\r
+ outtextxy(609,449,",");\r
+ outtextxy(472,456,"Balthasar Szczepanski");\r
outtextxy(0,464,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
- outtextxy(0,472,"F1.pomoc°°F2.zapis°°F3.odczyt°°F4.uzycie w systemie°°F5.zmiana numeru°°F6.koniec");\r
- outtextxy(280,466,".");\r
+ if(any)\r
+ outtextxy(0,472,"1.new°°2.save°°3.load°°4.use°°5.number°°6.newF°°7.newCP°°8.delF°°9.delCP°°10.end");\r
+ else\r
+ outtextxy(0,472,"1.new°°°°°°°°°°3.load°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°10.end");\r
+ \r
+ //outtextxy(280,466,".");\r
}\r
void cpwys()\r
{\r
char cpw[90];\r
setcolor(BLACK);\r
outtextxy(0x78,0,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
- sprintf(cpw,"°cp%03d°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp].codepage,wys,nazwap);\r
+ if(any)\r
+ sprintf(cpw,"°cp%03u°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys,nazwap);\r
+ else\r
+ strcpy(cpw, "°No CPI open°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");\r
setcolor(GREEN);\r
\r
outtextxy(0x78,0,cpw);\r
\r
void ramka8()\r
{\r
+ if(!any)\r
+ return;\r
if(tab==0&&wys==8)\r
setcolor(GREEN);\r
else\r
}\r
void ramka14()\r
{\r
+ if(!any)\r
+ return;\r
if(tab==0&&wys==14)\r
setcolor(GREEN);\r
else\r
}\r
void ramka16()\r
{\r
+ if(!any)\r
+ return;\r
if(tab==0&&wys==16)\r
setcolor(GREEN);\r
else\r
}\r
void lin14()\r
{\r
+ if(!any)\r
+ return;\r
char ab[2]="X";\r
setcolor(RED);\r
outtextxy(176,215,"0123456789ABCDEF");\r
outtextxy(168,422,"E");\r
outtextxy(168,436,"F");\r
\r
+ if(byo14[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(176,223,303,446);\r
+ floodfill(180,230,RED);\r
+ line(176,223,303,446);\r
+ line(303,223,176,446);\r
+ return;\r
+ }\r
+ \r
for(int l=0;l<256;++l)\r
{\r
for(int a=0;a<14;++a)\r
ab[0]=abc[lit/16];\r
outtextxy(168,226+14*(lit/16),ab);\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB14[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB14[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,GREEN);\r
else\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
}\r
else\r
{\r
- if((SFB14[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB14[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,GREEN);\r
else\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
- }\r
+ }*/\r
+ if(SFB14[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(176+b+(l%16)*8,223+a+(l/16)*14,GREEN);\r
+ else\r
+ putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
}\r
else\r
{\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB14[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB14[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BROWN);\r
else\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
}\r
else\r
{\r
- if((SFB14[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB14[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BROWN);\r
else\r
putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
- }\r
+ }*/\r
+ if(SFB14[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BROWN);\r
+ else\r
+ putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
}\r
}\r
}\r
}\r
void lin8()\r
{\r
+ if(!any)\r
+ return;\r
char ab[2]="X";\r
setcolor(RED);\r
outtextxy(176,24,"0123456789ABCDEF");\r
outtextxy(168,136,"D");\r
outtextxy(168,144,"E");\r
outtextxy(168,152,"F");\r
+ if(byo8[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(176,32,303,159);\r
+ floodfill(180,40,RED);\r
+ line(176,32,303,159);\r
+ line(303,32,176,159);\r
+ return;\r
+ }\r
\r
for(int l=0;l<256;++l)\r
{\r
ab[0]=abc[lit/16];\r
outtextxy(168,32+8*(lit/16),ab);\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB8[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB8[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,GREEN);\r
else\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
}\r
else\r
{\r
- if((SFB8[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB8[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,GREEN);\r
else\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
- }\r
+ }*/\r
+ if(SFB8[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(176+b+(l%16)*8,32+a+(l/16)*8,GREEN);\r
+ else\r
+ putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
}\r
else\r
{\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB8[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB8[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BROWN);\r
else\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
}\r
else\r
{\r
- if((SFB8[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB8[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BROWN);\r
else\r
putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
- }\r
+ }*/\r
+ if(SFB8[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BROWN);\r
+ else\r
+ putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
}\r
}\r
}\r
}\r
void lin16()\r
{\r
+ if(!any)\r
+ return;\r
char ab[2]="X";\r
setcolor(RED);\r
outtextxy(496,103,"0123456789ABCDEF");\r
outtextxy(488,323,"D");\r
outtextxy(488,339,"E");\r
outtextxy(488,355,"F");\r
+ \r
+ if(byo16[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(496,111,623,366);\r
+ floodfill(500,120,RED);\r
+ line(496,111,623,366);\r
+ line(623,111,496,366);\r
+ return;\r
+ }\r
\r
for(int l=0;l<256;++l)\r
{\r
ab[0]=abc[lit/16];\r
outtextxy(488,115+16*(lit/16),ab);\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB16[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB16[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,GREEN);\r
else\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
}\r
else\r
{\r
- if((SFB16[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB16[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,GREEN);\r
else\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
- }\r
+ }*/\r
+ if(SFB16[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(496+b+(l%16)*8,111+a+(l/16)*16,GREEN);\r
+ else\r
+ putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
}\r
else\r
{\r
\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB16[cp].lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB16[cp]->lit[l].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BROWN);\r
else\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
}\r
else\r
{\r
- if((SFB16[cp].lit[l].lin[a]/0x80)==1)\r
+ if((SFB16[cp]->lit[l].lin[a]/0x80)==1)\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BROWN);\r
else\r
putpixel(496+b+(l%16)*8,111+a+(l/16)*16,EGA_BLACK);\r
- }\r
+ }*/\r
+ if(SFB16[cp]->lit[l].lin[a]&(0x80>>b))\r
+ putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BROWN);\r
+ else\r
+ putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
}\r
}\r
}\r
}\r
void lit8()\r
{\r
+ if(!any)\r
+ return;\r
setcolor(BLACK);\r
for(int z=0;z<128;++z)\r
line(16,32+z,143,32+z);\r
outtextxy(8,116,"5");\r
outtextxy(8,132,"6");\r
outtextxy(8,148,"7");\r
+ \r
+ if(byo8[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(16,32,143,159);\r
+ floodfill(20,40,RED);\r
+ line(16,32,143,159);\r
+ line(143,32,16,159);\r
+ return;\r
+ }\r
\r
for(int a=0;a<8;++a)\r
{\r
ab[0]=abc[cury];\r
outtextxy(8,36+16*cury,ab);\r
rectangle(0x10+b*0x10,0x20+a*0x10,0x1f+b*0x10,0x2f+a*0x10);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB8[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB8[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
floodfill(0x11+b*0x10,0x21+a*0x10,GREEN);\r
}\r
else\r
{\r
- if((SFB8[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB8[cp]->lit[lit].lin[a]/0x80)==1)\r
floodfill(0x11+b*0x10,0x21+a*0x10,GREEN);\r
- }\r
+ }*/\r
+ if(SFB8[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ floodfill(0x11+b*0x10,0x21+a*0x10,GREEN);\r
setcolor(BLACK);\r
rectangle(0x11+b*0x10,0x21+a*0x10,0x1e+b*0x10,0x2e+a*0x10);\r
}\r
{\r
\r
setcolor(BROWN);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB8[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB8[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
{\r
rectangle(0x10+b*0x10,0x20+a*0x10,0x1f+b*0x10,0x2f+a*0x10);\r
floodfill(0x11+b*0x10,0x21+a*0x10,BROWN);\r
}\r
else\r
{\r
- if((SFB8[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB8[cp]->lit[lit].lin[a]/0x80)==1)\r
{\r
rectangle(0x10+b*0x10,0x20+a*0x10,0x1f+b*0x10,0x2f+a*0x10);\r
floodfill(0x11+b*0x10,0x21+a*0x10,BROWN);\r
}\r
+ }*/\r
+ if(SFB8[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ {\r
+ rectangle(0x10+b*0x10,0x20+a*0x10,0x1f+b*0x10,0x2f+a*0x10);\r
+ floodfill(0x11+b*0x10,0x21+a*0x10,BROWN);\r
}\r
}\r
}\r
}\r
void lit14()\r
{\r
+ if(!any)\r
+ return;\r
setcolor(BLACK);\r
for(int z=0;z<224;++z)\r
line(16,223+z,143,223+z);\r
outtextxy(8,419,"C");\r
outtextxy(8,435,"D");\r
\r
+ if(byo14[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(16,223,143,446);\r
+ floodfill(20,230,RED);\r
+ line(16,223,143,446);\r
+ line(143,223,16,446);\r
+ return;\r
+ }\r
+ \r
for(int a=0;a<14;++a)\r
{\r
char ab[2]="q";\r
ab[0]=abc[cury];\r
outtextxy(8,227+16*cury,ab);\r
rectangle(16+b*16,223+a*16,31+b*16,238+a*16);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB14[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB14[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
floodfill(17+b*16,224+a*16,GREEN);\r
}\r
else\r
{\r
- if((SFB14[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB14[cp]->lit[lit].lin[a]/0x80)==1)\r
floodfill(17+b*16,224+a*16,GREEN);\r
- }\r
+ }*/\r
+ if(SFB14[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ floodfill(17+b*16,224+a*16,GREEN);\r
setcolor(BLACK);\r
rectangle(17+b*16,224+a*16,30+b*16,237+a*16);\r
}\r
{\r
\r
setcolor(BROWN);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB14[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB14[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
{\r
rectangle(16+b*16,223+a*16,31+b*16,238+a*16);\r
floodfill(17+b*16,224+a*16,BROWN);\r
}\r
else\r
{\r
- if((SFB14[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB14[cp]->lit[lit].lin[a]/0x80)==1)\r
{\r
rectangle(16+b*16,223+a*16,31+b*16,238+a*16);\r
floodfill(17+b*16,224+a*16,BROWN);\r
}\r
+ }*/\r
+ if(SFB14[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ {\r
+ rectangle(16+b*16,223+a*16,31+b*16,238+a*16);\r
+ floodfill(17+b*16,224+a*16,BROWN);\r
}\r
}\r
}\r
}\r
void lit16()\r
{\r
+ if(!any)\r
+ return;\r
setcolor(BLACK);\r
for(int z=0;z<256;++z)\r
line(336,111+z,463,111+z);\r
outtextxy(328,339,"E");\r
outtextxy(328,355,"F");\r
\r
+ if(byo16[cp]==0)\r
+ {\r
+ setcolor(RED);\r
+ setfillstyle(SOLID_FILL,BLACK);\r
+ rectangle(336,111,463,366);\r
+ floodfill(340,120,RED);\r
+ line(336,111,463,366);\r
+ line(463,111,336,366);\r
+ return;\r
+ }\r
+ \r
for(int a=0;a<16;++a)\r
{\r
char ab[2]="q";\r
ab[0]=abc[cury];\r
outtextxy(328,115+16*cury,ab);\r
rectangle(336+b*16,111+a*16,351+b*16,126+a*16);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB16[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB16[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
floodfill(337+b*16,112+a*16,GREEN);\r
}\r
else\r
{\r
- if((SFB16[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB16[cp]->lit[lit].lin[a]/0x80)==1)\r
floodfill(337+b*16,112+a*16,GREEN);\r
- }\r
+ }*/\r
+ if(SFB16[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ floodfill(337+b*16,112+a*16,GREEN);\r
setcolor(BLACK);\r
rectangle(337+b*16,112+a*16,350+b*16,125+a*16);\r
}\r
{\r
\r
setcolor(BROWN);\r
- if(b>0)\r
+ /*if(b>0)\r
{\r
- if((SFB16[cp].lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
+ if((SFB16[cp]->lit[lit].lin[a]%(0x80/pot(2,b)*2))/(0x80/pot(2,b))==1)\r
{\r
rectangle(336+b*16,111+a*16,351+b*16,126+a*16);\r
floodfill(337+b*16,112+a*16,BROWN);\r
}\r
else\r
{\r
- if((SFB16[cp].lit[lit].lin[a]/0x80)==1)\r
+ if((SFB16[cp]->lit[lit].lin[a]/0x80)==1)\r
{\r
rectangle(336+b*16,111+a*16,351+b*16,126+a*16);\r
floodfill(337+b*16,112+a*16,BROWN);\r
\r
}\r
+ }*/\r
+ if(SFB16[cp]->lit[lit].lin[a]&(0x80>>b))\r
+ {\r
+ rectangle(336+b*16,111+a*16,351+b*16,126+a*16);\r
+ floodfill(337+b*16,112+a*16,BROWN);\r
}\r
}\r
}\r
\r
void spc8()\r
{\r
- if(SFB8[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB8[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
- else\r
- SFB8[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB8[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB8[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //else\r
+ // SFB8[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB8[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
void bsp8()\r
{\r
- if(SFB8[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB8[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //if(SFB8[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB8[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ SFB8[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
void ent8()\r
{\r
- if(SFB8[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
- SFB8[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB8[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
+ // SFB8[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB8[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
void spc14()\r
{\r
- if(SFB14[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB14[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
- else\r
- SFB14[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB14[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB14[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //else\r
+ // SFB14[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB14[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
void bsp14()\r
{\r
- if(SFB14[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB14[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //if(SFB14[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB14[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ SFB14[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
void ent14()\r
{\r
- if(SFB14[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
- SFB14[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB14[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
+ // SFB14[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB14[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
void spc16()\r
{\r
- if(SFB16[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB16[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
- else\r
- SFB16[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB16[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB16[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //else\r
+ // SFB16[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB16[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
void bsp16()\r
{\r
- if(SFB16[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
- SFB16[cp].lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ //if(SFB16[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))==1)\r
+ // SFB16[cp]->lit[lit].lin[cury]-=(0x80/pot(2,curx));\r
+ SFB16[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
void ent16()\r
{\r
- if(SFB16[cp].lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
- SFB16[cp].lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ //if(SFB16[cp]->lit[lit].lin[cury]%(0x100/pot(2,curx))/(0x80/pot(2,curx))!=1)\r
+ // SFB16[cp]->lit[lit].lin[cury]+=(0x80/pot(2,curx));\r
+ SFB16[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
+\r
+\r
int otw2()\r
{\r
int a;\r
int b;\r
int c;\r
int d;\r
- for(int z=0;z<6;++z)\r
- {\r
- byo8[z]=0;\r
- byo14[z]=0;\r
- byo16[z]=0;\r
- }\r
+ int NT;\r
+ \r
+ \r
CPI=fopen(nazwap,"rb");\r
\r
if(CPI==NULL)\r
{\r
- sprintf(err,"100: B\88¥d otwarcia pliku");\r
- return 1;\r
+ sprintf(err,"100:No valid file at this path");\r
+ return 100;\r
}\r
else\r
sprintf(err,"OK");\r
- fread(&FFH,0x19,1,CPI);\r
+ FFH=new FontFileHeader;\r
+ if(!FFH)\r
+ {\r
+ sprintf(err,"116:Not enough memory for FFH");\r
+ fclose(CPI);\r
+ return 116;\r
+ }\r
+ fread(FFH,0x19,1,CPI);\r
// printf("FFH:\n");\r
// printf("id0=%2x\n",FFH.id0);\r
// printf("id=\"%c%c%c%c%c%c%c\"\n",FFH.id[0],FFH.id[1],FFH.id[2],FFH.id[3],FFH.id[4],FFH.id[5],FFH.id[6]);\r
// printf("ptyp=%2x\n",FFH.ptyp);\r
// printf("fih_offset=%p\n\n",FFH.fih_offset);\r
\r
- if(FFH.id0!=0xff)\r
+ if(FFH->id0!=0xff)\r
{\r
- sprintf(err,"101: FFH.id0!=0xff");\r
+ sprintf(err,"101:Unsupported format, id0=0x%02x",(short)(FFH->id0&0xff));\r
fclose(CPI);\r
+ deleteCPI(0);\r
return 101;\r
}\r
- if(FFH.id[0]!='F'||FFH.id[1]!='O'||FFH.id[2]!='N'||FFH.id[3]!='T'||FFH.id[4]!=' '||FFH.id[5]!=' '||FFH.id[6]!=' ')\r
+ //if(FFH->id[0]!='F' || FFH->id[1]!='O' != FFH->id[2] != 'N'||FFH->id[3]!='T' || FFH->id[4]!=' '||FFH->id[5]!=' '||FFH->id[6]!=' ')\r
+ if(!strcmp("FONT ",FFH->id))\r
+ NT=0;\r
+ else if(!strcmp("FONT.NT",FFH->id))\r
{\r
- sprintf(err,"102: FFH.id!=\"FONT \"");\r
+ NT=1;\r
+ FFH->id[4]=' ';\r
+ FFH->id[5]=' ';\r
+ FFH->id[6]=' ';\r
+ }\r
+ else\r
+ {\r
+ sprintf(err,"102:Unsupported format, id=\"%c%c%c%c%c%c%c\"",FFH->id[0],FFH->id[1],FFH->id[2],FFH->id[3],FFH->id[4],FFH->id[5],FFH->id[6]);\r
fclose(CPI);\r
+ deleteCPI(0);\r
return 102;\r
}\r
- if(FFH.pnum!=1)\r
+ if(FFH->pnum!=1)\r
{\r
- sprintf(err,"103: FFH.pnum!=1\n");\r
+ sprintf(err,"103:Wrong no. of pointers (%u)",FFH->pnum);\r
fclose(CPI);\r
+ deleteCPI(0);\r
return 103;\r
}\r
- if(FFH.ptyp!=1)\r
+ if(FFH->ptyp!=1)\r
{\r
- sprintf(err,"104: FFH.ptyp!=1\n");\r
+ sprintf(err,"104:Wrong pointer type, (%u)",(short)(FFH->ptyp&0xff));\r
fclose(CPI);\r
+ deleteCPI(0);\r
return 104;\r
}\r
- fseek(CPI,FFH.fih_offset,0);\r
- fread(&FIH,0x2,1,CPI);\r
+ FIH=new FontInfoHeader;\r
+ if(!FIH)\r
+ {\r
+ sprintf(err,"116:Not enough memory for FIH");\r
+ fclose(CPI);\r
+ deleteCPI(0);\r
+ return 116;\r
+ }\r
+ fseek(CPI,FFH->fih_offset,0);\r
+ fread(FIH,0x2,1,CPI);\r
// printf("FFI:\n\n");\r
// printf("num_codepages=%d\n\n",FIH.num_codepages);\r
- if(FIH.num_codepages>6)\r
+ if(FIH->num_codepages>16)\r
{\r
//FIH.num_codepages=6;\r
- sprintf(err,"105: FIH.num_codepages>6\n");\r
+ sprintf(err,"105:Too many codepages (%u)",FIH->num_codepages);\r
fclose(CPI);\r
+ deleteCPI(1);\r
return 105;\r
}\r
+ \r
+ if(FIH->num_codepages==0)\r
+ {\r
+ sprintf(err,"117:No codepages");\r
+ fclose(CPI);\r
+ deleteCPI(1);\r
+ return 117;\r
+ }\r
\r
- for(a=0; a<FIH.num_codepages;++a)\r
+ for(a=0; a<FIH->num_codepages;++a)\r
{\r
if (a!=0)\r
- fseek(CPI,CPEH[a-1].next_cpeh_offset,0);\r
- fread(&CPEH[a],0x1c,1,CPI);\r
+ fseek(CPI,CPEH[a-1]->next_cpeh_offset,0);\r
+ CPEH[a] = new CodePageEntryHeader;\r
+ if(!CPEH[a])\r
+ {\r
+ sprintf(err,"116:Not enough memory for CPEH[%d]",a);\r
+ deleteCPI(1);\r
+ return 116;\r
+ }\r
+ fread(CPEH[a],0x1c,1,CPI);\r
// printf("CPEH[%d]:\n",a);\r
// printf("cpeh_size=%x\n",CPEH[a].cpeh_size);\r
// printf("next_cpeh_offset=%p\n",CPEH[a].next_cpeh_offset);\r
// printf("codepage=%d\n",CPEH[a].codepage);\r
// printf("reserved=%2x%2x%2x%2x%2x%2x\n",CPEH[a].reserved[0],CPEH[a].reserved[1],CPEH[a].reserved[2],CPEH[a].reserved[3],CPEH[a].reserved[4],CPEH[a].reserved[5]);\r
// printf("cpih_offset=%p\n\n",CPEH[a].cpih_offset);\r
-\r
- if(CPEH[a].cpeh_size!=0x1c)\r
+ if(NT)\r
{\r
- sprintf(err,"106: CPEH.cpeh_size!=0x1c\n");\r
+ CPEH[a]->next_cpeh_offset+=ftell(CPI)-sizeof(CodePageEntryHeader);\r
+ CPEH[a]->cpih_offset+=ftell(CPI)-sizeof(CodePageEntryHeader);\r
+ }\r
+ if(CPEH[a]->cpeh_size!=0x1c)\r
+ {\r
+ sprintf(err,"106:Wrong CPEH[%u] size (0x%x)",a,CPEH[a]->cpeh_size);\r
fclose(CPI);\r
+ deleteCPI(2,a);\r
return 106;\r
}\r
- if(CPEH[a].device_type!=1)\r
+ if(CPEH[a]->device_type!=1)\r
{\r
- sprintf(err,"107: CPEH.device_type!=1\n");\r
+ sprintf(err,"107:Wrong device type(%u) in CPEH[%u]",CPEH[a]->device_type,a);\r
fclose(CPI);\r
+ deleteCPI(2,a);\r
return 107;\r
}\r
-\r
- fseek(CPI,CPEH[a].cpih_offset,0);\r
- fread(&CPIH[a],0x6,1,CPI);\r
+ for(short i=0;i<a;++i)\r
+ {\r
+ if(CPEH[a]->codepage==CPEH[i]->codepage)\r
+ {\r
+ sprintf(err,"114:cp%03u (%u) already in CPEH[%u]",CPEH[a]->codepage,a,i);\r
+ fclose(CPI);\r
+ deleteCPI(2,a);\r
+ return 114;\r
+ }\r
+ }\r
+ fseek(CPI,CPEH[a]->cpih_offset,0);\r
+ CPIH[a] = new CodePageInfoHeader;\r
+ if(!CPIH[a])\r
+ {\r
+ sprintf(err,"116:Not enough memory for CPIH[%d]",a);\r
+ fclose(CPI);\r
+ deleteCPI(2,a);\r
+ return 116;\r
+ }\r
+ fread(CPIH[a],0x6,1,CPI);\r
// printf("CPIH[%d]:\n",a);\r
// printf("version=%d\n",CPIH[a].version);\r
// printf("num_fonts=%d\n",CPIH[a].num_fonts);\r
// printf("size=%x\n\n",CPIH[a].size);\r
\r
- if(CPIH[a].version!=1)\r
+ if(CPIH[a]->version!=1)\r
{\r
- sprintf(err,"108: CPIH.version!=1\n");\r
+ sprintf(err,"108:Wrong version of CPIH[%u] (%u)",a,CPIH[a]->version);\r
fclose(CPI);\r
+ deleteCPI(3,a);\r
return 108;\r
}\r
- if(CPIH[a].num_fonts>3)\r
+ if(CPIH[a]->num_fonts>3)\r
{\r
- sprintf(err,"109: CPIH.numfonts>3\n");\r
+ sprintf(err,"109:Too many fonts in CPIH[%u] (%u)",a,CPIH[a]->num_fonts);\r
fclose(CPI);\r
+ deleteCPI(3,a);\r
return 109;\r
}\r
- for(b=0;b<CPIH[a].num_fonts;++b)\r
+ if(CPIH[a]->num_fonts==0)\r
{\r
- fread(&SFH[a][b],0x6,1,CPI);\r
+ sprintf(err,"115:No fonts in CPIH[%u])",a);\r
+ fclose(CPI);\r
+ deleteCPI(3,a);\r
+ return 115;\r
+ }\r
+ for(b=0;b<CPIH[a]->num_fonts;++b)\r
+ {\r
+ SFH[a][b] = new ScreenFontHeader;\r
+ if(!SFH[a][b])\r
+ {\r
+ sprintf(err,"116:Not enough memory for SFH[%d][%d]",a);\r
+ fclose(CPI);\r
+ if(b==0)\r
+ deleteCPI(3,a);\r
+ else\r
+ deleteCPI(5,a,b-1);\r
+ return 116;\r
+ }\r
+ fread(SFH[a][b],0x6,1,CPI);\r
// printf("SFH[%d][%d]:\n",a,b);\r
// printf("height=%d\n",SFH[a][b].height);\r
// printf("width=%d\n",SFH[a][b].width);\r
// printf("yaspect=%2x\n",SFH[a][b].yaspect);\r
// printf("xaspect=%2x\n",SFH[a][b].xaspect);\r
// printf("num_chars=%d\n\n",SFH[a][b].num_chars);\r
- fseek(CPI,SFH[a][b].num_chars*SFH[a][b].height*((SFH[a][b].width+7)/8),1);\r
- if(SFH[a][b].height==8)\r
+ //fseek(CPI,SFH[a][b].num_chars*SFH[a][b].height*((SFH[a][b].width+7)/8),1);\r
+ if(SFH[a][b]->height==8)\r
{\r
if (byo8[a]!=0)\r
{\r
- sprintf(err,"113: SFH.height==8 ju¾ by\88o");\r
+ sprintf(err,"113:Height 8 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
+ deleteCPI(4,a,b);\r
return 113;\r
}\r
byo8[a]=1;\r
}\r
- if(SFH[a][b].height==14)\r
+ if(SFH[a][b]->height==14)\r
{\r
if (byo14[a]!=0)\r
{\r
- sprintf(err,"114: SFH.height==14 ju¾ by\88o");\r
+ sprintf(err,"113:Height 14 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
- return 114;\r
+ deleteCPI(4,a,b);\r
+ return 113;\r
}\r
byo14[a]=1;\r
}\r
- if(SFH[a][b].height==16)\r
+ if(SFH[a][b]->height==16)\r
{\r
if (byo16[a]!=0)\r
{\r
- sprintf(err,"115: SFH.height==16 ju¾ by\88o");\r
+ sprintf(err,"113:Height 16 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
- return 115;\r
+ deleteCPI(4,a,b);\r
+ return 113;\r
}\r
byo16[a]=1;\r
}\r
\r
\r
- if(SFH[a][b].height!=8&&SFH[a][b].height!=14&&SFH[a][b].height!=16)\r
+ if(SFH[a][b]->height!=8&&SFH[a][b]->height!=14&&SFH[a][b]->height!=16)\r
{\r
- sprintf(err,"110: SFH.height!=(8 || 14 || 16)\n");\r
+ sprintf(err,"110:Wrong height (%u) in SFH[%u][%u]",(short)(SFH[a][b]->height&0xff),a,b);\r
fclose(CPI);\r
+ deleteCPI(4,a,b);\r
return 110;\r
}\r
- if(SFH[a][b].width!=8)\r
+ if(SFH[a][b]->width!=8)\r
{\r
- sprintf(err,"111: SFH.width!=8\n");\r
+ sprintf(err,"111:Wrong width (%u) in SFH[%u][%u]",(short)(SFH[a][b]->width&0xff),a,b);\r
fclose(CPI);\r
+ deleteCPI(4,a,b);\r
return 111;\r
}\r
- if(SFH[a][b].num_chars!=256)\r
+ if(SFH[a][b]->num_chars!=256)\r
{\r
- sprintf(err,"112: SFH.num_chars!=256\n");\r
+ sprintf(err,"112:Wrong no.of chars(%u)in SFH[%u][%u]",SFH[a][b]->num_chars,a,b);\r
fclose(CPI);\r
+ deleteCPI(4,a,b);\r
return 112;\r
}\r
+\r
+ if(SFH[a][b]->height==16)\r
+ {\r
+ SFB16[a] = new ScreenFontBitmap16;\r
+ if(!SFB16[a])\r
+ {\r
+ sprintf(err,"116:Not enough memory for SFB16[%d] (%d)",a,b);\r
+ fclose(CPI);\r
+ deleteCPI(4,a,b);\r
+ return 116;\r
+ }\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB16[a].lit[c],0x10,1,CPI);\r
+ fread(SFB16[a],0x10,256,CPI);\r
+ }\r
+ if(SFH[a][b]->height==14)\r
+ {\r
+ SFB14[a] = new ScreenFontBitmap14;\r
+ if(!SFB14[a])\r
+ {\r
+ sprintf(err,"116:Not enough memory for SFB14[%d] (%d)",a,b);\r
+ fclose(CPI);\r
+ deleteCPI(4,a,b);\r
+ return 116;\r
+ }\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB14[a].lit[c],0x0e,1,CPI);\r
+ fread(SFB14[a],0x0e,256,CPI);\r
+ }\r
+ if(SFH[a][b]->height==8)\r
+ {\r
+ SFB8[a] = new ScreenFontBitmap8;\r
+ if(!SFB8[a])\r
+ {\r
+ sprintf(err,"116:Not enough memory for SFB8[%d] (%d)",a,b);\r
+ fclose(CPI);\r
+ deleteCPI(4,a,b);\r
+ return 116;\r
+ }\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB8[a].lit[c],0x08,1,CPI);\r
+ fread(SFB8[a],0x08,256,CPI);\r
+ }\r
+ //fseek(CPI,SFH[a][b]->num_chars*SFH[a][b]->height*((SFH[a][b]->width+7)/8),1);\r
}\r
- for(b=0;b<CPIH[a].num_fonts;++b)\r
+ /*for(b=0;b<CPIH[a].num_fonts;++b)\r
{\r
fseek(CPI,CPEH[a].cpih_offset+0xc,0);\r
if(b>0)\r
for(c=0;c<256;++c)\r
fread(&SFB8[a].lit[c],0x08,1,CPI);\r
}\r
- }\r
+ }*/\r
}\r
\r
fclose(CPI);\r
+ offset();\r
return 0;\r
}\r
int zap2()\r
\r
if(CPI==NULL)\r
{\r
- sprintf(err,"200: B\88¥d utworzenia pliku:");\r
+ sprintf(err,"200:Cannot create file at this path");\r
return 200;\r
}\r
else\r
sprintf(err,"OK");\r
- fwrite(&FFH,0x19,1,CPI);\r
+ fwrite(FFH,0x19,1,CPI);\r
// printf("FFH:\n");\r
// printf("id0=%2x\n",FFH.id0);\r
// printf("id=\"%c%c%c%c%c%c%c\"\n",FFH.id[0],FFH.id[1],FFH.id[2],FFH.id[3],FFH.id[4],FFH.id[5],FFH.id[6]);\r
fclose(CPI);\r
return 104;\r
}*/\r
- fseek(CPI,FFH.fih_offset,0);\r
- fwrite(&FIH,0x2,1,CPI);\r
+ fseek(CPI,FFH->fih_offset,0);\r
+ fwrite(FIH,0x2,1,CPI);\r
// printf("FFI:\n\n");\r
// printf("num_codepages=%d\n\n",FIH.num_codepages);\r
/*if(FIH.num_codepages>6)\r
return 105;\r
}*/\r
\r
- for(a=0; a<FIH.num_codepages;++a)\r
+ for(a=0; a<FIH->num_codepages;++a)\r
{\r
if (a!=0)\r
- fseek(CPI,CPEH[a-1].next_cpeh_offset,0);\r
- fwrite(&CPEH[a],0x1c,1,CPI);\r
+ fseek(CPI,CPEH[a-1]->next_cpeh_offset,0);\r
+ fwrite(CPEH[a],0x1c,1,CPI);\r
// printf("CPEH[%d]:\n",a);\r
// printf("cpeh_size=%x\n",CPEH[a].cpeh_size);\r
// printf("next_cpeh_offset=%p\n",CPEH[a].next_cpeh_offset);\r
return 107;\r
}*/\r
\r
- fseek(CPI,CPEH[a].cpih_offset,0);\r
- fwrite(&CPIH[a],0x6,1,CPI);\r
+ fseek(CPI,CPEH[a]->cpih_offset,0);\r
+ fwrite(CPIH[a],0x6,1,CPI);\r
// printf("CPIH[%d]:\n",a);\r
// printf("version=%d\n",CPIH[a].version);\r
// printf("num_fonts=%d\n",CPIH[a].num_fonts);\r
fclose(CPI);\r
return 109;\r
}*/\r
- for(b=0;b<CPIH[a].num_fonts;++b)\r
+ for(b=0;b<CPIH[a]->num_fonts;++b)\r
{\r
- fwrite(&SFH[a][b],0x6,1,CPI);\r
+ fwrite(SFH[a][b],0x6,1,CPI);\r
// printf("SFH[%d][%d]:\n",a,b);\r
// printf("height=%d\n",SFH[a][b].height);\r
// printf("width=%d\n",SFH[a][b].width);\r
// printf("yaspect=%2x\n",SFH[a][b].yaspect);\r
// printf("xaspect=%2x\n",SFH[a][b].xaspect);\r
// printf("num_chars=%d\n\n",SFH[a][b].num_chars);\r
- fseek(CPI,SFH[a][b].num_chars*SFH[a][b].height*((SFH[a][b].width+7)/8),1);\r
+ //fseek(CPI,SFH[a][b]->num_chars*SFH[a][b]->height*((SFH[a][b]->width+7)/8),1);\r
/*if(SFH[a][b].height==8)\r
{\r
if (byo8[a]!=0)\r
fclose(CPI);\r
return 112;\r
}*/\r
+ if(SFH[a][b]->height==16)\r
+ {\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB16[a].lit[c],0x10,1,CPI);\r
+ fwrite(SFB16[a],0x10,256,CPI);\r
+ }\r
+ if(SFH[a][b]->height==14)\r
+ {\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB14[a].lit[c],0x0e,1,CPI);\r
+ fwrite(SFB14[a],0x0e,256,CPI);\r
+ }\r
+ if(SFH[a][b]->height==8)\r
+ {\r
+ //for(c=0;c<256;++c)\r
+ // fread(&SFB8[a].lit[c],0x08,1,CPI);\r
+ fwrite(SFB8[a],0x08,256,CPI);\r
+ }\r
+ //fseek(CPI,SFH[a][b]->num_chars*SFH[a][b]->height*((SFH[a][b]->width+7)/8),1);\r
}\r
- for(b=0;b<CPIH[a].num_fonts;++b)\r
+ /*for(b=0;b<CPIH[a]->num_fonts;++b)\r
{\r
fseek(CPI,CPEH[a].cpih_offset+0xc,0);\r
if(b>0)\r
for(c=0;c<256;++c)\r
fwrite(&SFB8[a].lit[c],0x08,1,CPI);\r
}\r
- }\r
+ }*/\r
}\r
\r
- fprintf(CPI,"\nTen plik zosta\88 wygenerowany za pomoc¥ Edytora napis¢w, wersja 1.0\n autor programu: Balthasar Szczepaäski%c",0x1a);\r
+ fprintf(CPI,"\nTen plik zosta\88 wygenerowany za pomoc¥ Edytora napis¢w, wersja 1.1\n autor programu: Balthasar Szczepaäski%c",0x1a);\r
\r
fclose(CPI);\r
return 0;\r
}\r
\r
-int otw()\r
+int newF8(short CP)\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
- setcolor(BLACK);\r
-\r
- outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ if(byo8[CP])\r
+ {\r
+ sprintf(err,"313:Height 8 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
+ }\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
+ }\r
+ if(!(SFB8[CP]=new ScreenFontBitmap8))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB8[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB8[CP],0,0x800);\r
+ byo8[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ offset();\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
\r
- setcolor(GREEN);\r
+int newF14(short CP)\r
+{\r
+ if(byo14[CP])\r
+ {\r
+ sprintf(err,"313:Height 14 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
+ }\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
+ }\r
+ if(!(SFB14[CP]=new ScreenFontBitmap14))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB14[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB14[CP],0,0xe00);\r
+ byo14[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=14;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ offset();\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
\r
- outtextxy(144,184," ±Nazwa pliku:±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
- outtextxy(144,192," ± ± ");\r
- outtextxy(144,200," ± ± ");\r
- outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
- scanf("%s",nazwap);\r
+int newF16(short CP)\r
+{\r
+ if(byo16[CP])\r
+ {\r
+ sprintf(err,"313:Height 16 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
+ }\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
+ }\r
+ if(!(SFB16[CP]=new ScreenFontBitmap16))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB16[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB16[CP],0,0x1000);\r
+ byo16[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=16;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return otw2();\r
+int newF2(short h)\r
+{\r
+ switch(h)\r
+ {\r
+ case 8:\r
+ return newF8(cp);\r
+ case 14:\r
+ return newF14(cp);\r
+ case 16:\r
+ return newF16(cp);\r
+ default:\r
+ sprintf(err,"310:Wrong height (%u)",h);\r
+ return 310;\r
+ }\r
}\r
-int zap()\r
+int delF8(short h)\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
- setcolor(BLACK);\r
-\r
- outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
-\r
- setcolor(GREEN);\r
-\r
- outtextxy(144,184," ±Nazwa pliku:±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
- outtextxy(144,192," ± ± ");\r
- outtextxy(144,200," ± ± ");\r
- outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
- scanf("%s",nazwap);\r
-\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return zap2();\r
+ short i;\r
+ delete SFB8[cp];\r
+ delete SFH[cp][h];\r
+ byo8[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ SFH[cp][i] = SFH[cp][i+1];\r
+ }\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
-int zmn()\r
+int delF14(short h)\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
- setcolor(BLACK);\r
-\r
- outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
- outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
-\r
- setcolor(GREEN);\r
-\r
- outtextxy(144,184," ±Numer strony kodowej:±±±±±±±±±±±±±±±±±±±± ");\r
+ short i;\r
+ delete SFB14[cp];\r
+ delete SFH[cp][h];\r
+ byo14[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ SFH[cp][i] = SFH[cp][i+1];\r
+ }\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
+int delF16(short h)\r
+{\r
+ short i;\r
+ delete SFB16[cp];\r
+ delete SFH[cp][h];\r
+ byo16[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ SFH[cp][i] = SFH[cp][i+1];\r
+ }\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
+\r
+int delCP()\r
+{\r
+ short i;\r
+ if(FIH->num_codepages<=1)\r
+ {\r
+ sprintf(err,"317:Last codepage");\r
+ return 317;\r
+ }\r
+ for(i=0;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ switch(SFH[cp][i]->height)\r
+ {\r
+ case 16:\r
+ delete SFB16[cp];\r
+ break;\r
+ case 14:\r
+ delete SFB14[cp];\r
+ break;\r
+ case 8:\r
+ delete SFB8[cp];\r
+ break;\r
+ //unxh!\r
+ }\r
+ delete SFH[cp][i];\r
+ }\r
+ delete CPIH[cp];\r
+ delete CPEH[cp];\r
+ \r
+ --(FIH->num_codepages);\r
+ for(i=cp;i<FIH->num_codepages;++i)\r
+ {\r
+ CPEH[i] = CPEH[i+1];\r
+ CPIH[i] = CPIH[i+1];\r
+ SFH[i][0] = SFH[i+1][0];\r
+ SFH[i][1] = SFH[i+1][1];\r
+ SFH[i][2] = SFH[i+1][2];\r
+ SFB16[i] = SFB16[i+1];\r
+ SFB14[i] = SFB14[i+1];\r
+ SFB8[i] = SFB8[i+1];\r
+ byo16[i] = byo16[i+1];\r
+ byo14[i] = byo14[i+1];\r
+ byo8[i] = byo8[i+1];\r
+ }\r
+ CPEH[FIH->num_codepages] = NULL;\r
+ CPIH[FIH->num_codepages] = NULL;\r
+ SFH[FIH->num_codepages][0] = NULL;\r
+ SFH[FIH->num_codepages][1] = NULL;\r
+ SFH[FIH->num_codepages][2] = NULL;\r
+ SFB16[FIH->num_codepages] = NULL;\r
+ SFB14[FIH->num_codepages] = NULL;\r
+ SFB8[FIH->num_codepages] = NULL;\r
+ byo16[FIH->num_codepages] = 0;\r
+ byo14[FIH->num_codepages] = 0;\r
+ byo8[FIH->num_codepages] = 0;\r
+ \r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
+ \r
+int delF()\r
+{\r
+ short h;\r
+ if(CPIH[cp]->num_fonts<=1)\r
+ {\r
+ sprintf(err,"315:Last font in CPIH[%u]",cp);\r
+ return 315;\r
+ }\r
+ for(short i=0;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ if(SFH[cp][i]->height==wys)\r
+ {\r
+ h=i;\r
+ break;\r
+ }\r
+ }\r
+ switch(wys)\r
+ {\r
+ case 8:\r
+ return delF8(h);\r
+ case 14:\r
+ return delF14(h);\r
+ case 16:\r
+ return delF16(h);\r
+ default:\r
+ sprintf(err,"510:%u WT*?",h);\r
+ return 510;\r
+ }\r
+}\r
+int newCP2(short CP,short h)\r
+{\r
+ int t;\r
+ if(!(CPEH[FIH->num_codepages] = new CodePageEntryHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for CPEH[%d]",FIH->num_codepages);\r
+ return 316;\r
+ }\r
+ if(!(CPIH[FIH->num_codepages] = new CodePageInfoHeader))\r
+ {\r
+ delete CPEH[FIH->num_codepages];\r
+ CPEH[FIH->num_codepages] = NULL;\r
+ sprintf(err,"316:Not enough memory for CPIH[%d]",FIH->num_codepages);\r
+ return 316;\r
+ }\r
+ CPEH[FIH->num_codepages]->cpeh_size=0x1c;\r
+ CPEH[FIH->num_codepages]->device_type=1;\r
+ strcpy(CPEH[FIH->num_codepages]->device_name,"EGA ");\r
+ CPEH[FIH->num_codepages]->device_name[7]=' ';\r
+ CPEH[FIH->num_codepages]->codepage=CP;\r
+ strcpy(CPEH[FIH->num_codepages]->reserved,"\0\0\0\0\0");\r
+ CPIH[FIH->num_codepages]->version=1;\r
+ CPIH[FIH->num_codepages]->num_fonts=0;\r
+ switch(h)\r
+ {\r
+ case 8:\r
+ t= newF8(FIH->num_codepages);\r
+ break;\r
+ case 14:\r
+ t= newF14(FIH->num_codepages);\r
+ break;\r
+ case 16:\r
+ t = newF16(FIH->num_codepages);\r
+ break;\r
+ case 0:\r
+ t= newF16(FIH->num_codepages);\r
+ if(t!=0)\r
+ break;\r
+ t= newF14(FIH->num_codepages);\r
+ if(t!=0)\r
+ {\r
+ delete SFB16[FIH->num_codepages];\r
+ delete SFH[FIH->num_codepages][0];\r
+ SFB16[FIH->num_codepages] = NULL;\r
+ SFH[FIH->num_codepages][0] = NULL;\r
+ byo16[FIH->num_codepages] = 0;\r
+ break;\r
+ }\r
+ t= newF8(FIH->num_codepages);\r
+ if(t!=0)\r
+ {\r
+ delete SFB16[FIH->num_codepages];\r
+ delete SFB14[FIH->num_codepages];\r
+ delete SFH[FIH->num_codepages][0];\r
+ delete SFH[FIH->num_codepages][1];\r
+ SFB16[FIH->num_codepages] = NULL;\r
+ SFB14[FIH->num_codepages] = NULL;\r
+ SFH[FIH->num_codepages][0] = NULL;\r
+ SFH[FIH->num_codepages][1] = NULL;\r
+ byo16[FIH->num_codepages] = 0;\r
+ byo14[FIH->num_codepages] = 0;\r
+ break;\r
+ }\r
+ break;\r
+ default:\r
+ sprintf(err,"510:%u WT*?",h);\r
+ t = 510;\r
+ }\r
+ if(t!=0)\r
+ {\r
+ delete CPIH[FIH->num_codepages];\r
+ delete CPEH[FIH->num_codepages];\r
+ CPEH[FIH->num_codepages] = NULL;\r
+ CPEH[FIH->num_codepages] = NULL;\r
+ return t;\r
+ }\r
+ ++(FIH->num_codepages);\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
+}\r
+ \r
+int newCPI2(short CP, short h)\r
+{\r
+ int t;\r
+ FFH=new FontFileHeader;\r
+ if(!FFH)\r
+ {\r
+ sprintf(err,"316:Not enough memory for FFH");\r
+ return 316;\r
+ }\r
+ FFH->id0=0xFF;\r
+ strcpy(FFH->id,"FONT ");\r
+ strcpy(FFH->reserved,"\0\0\0\0\0\0\0");\r
+ FFH->pnum=1;\r
+ FFH->ptyp=1;\r
+ FIH=new FontInfoHeader;\r
+ if(!FIH)\r
+ {\r
+ sprintf(err,"316:Not enough memory for FIH");\r
+ deleteCPI(0);\r
+ return 316;\r
+ }\r
+ FIH->num_codepages=0;\r
+ t = newCP2(CP,h);\r
+ if (t!=0)\r
+ {\r
+ deleteCPI(1);\r
+ return t;\r
+ }\r
+ sprintf(err,"0:Ok");\r
+ return 0;\r
+}\r
+ \r
+int newCPI()\r
+{\r
+ short CP,h;\r
+ char temp[51];\r
+ \r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±First codepage number:±±±±±±±±±±±±±±±±±±± ");\r
outtextxy(144,192," ± ± ");\r
outtextxy(144,200," ± ± ");\r
outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
\r
- scanf("%d",&CPEH[cp].codepage);\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return CPEH[cp].codepage;\r
+ scanf("%u",&CP);\r
+ \r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Initial font Height(8,14,16,all)±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ \r
+ scanf("%s",temp);\r
+ h=atoi(temp);\r
+ if(h!=0&&h!=8&&h!=14&&h!=16)\r
+ {\r
+ sprintf(err,"310:Wrong height (%u)",h);\r
+ return 310;\r
+ }\r
+ return newCPI2(CP,h);\r
+}\r
+\r
+\r
+ \r
+int newCP()\r
+{\r
+ short CP,h;\r
+ char temp[51];\r
+ if(FIH->num_codepages>=16)\r
+ {\r
+ sprintf(err,"305:Already 16 codepages in CPI");\r
+ return 305;\r
+ }\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Codepage number:±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+\r
+ scanf("%u",&CP);\r
+ for(short i=0;i<FIH->num_codepages;++i)\r
+ {\r
+ if(CP==CPEH[i]->codepage)\r
+ {\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ return 314;\r
+ }\r
+ }\r
+ \r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Initial font Height(8,14,16,all)±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ \r
+ scanf("%s",temp);\r
+ h=atoi(temp);\r
+ if(h!=0&&h!=8&&h!=14&&h!=16)\r
+ {\r
+ sprintf(err,"310:Wrong height (%u)",h);\r
+ return 310;\r
+ }\r
+ return newCP2(CP,h);\r
+}\r
+int newF()\r
+{\r
+ if(CPIH[cp]->num_fonts>=3)\r
+ {\r
+ sprintf(err,"309:Already 3 fonts in CPIH[%u]",cp);\r
+ return 309;\r
+ }\r
+ \r
+ short h;\r
+ \r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Font Height(8,14,16)±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ scanf("%u",&h);\r
+\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return newF2(h);\r
+}\r
+\r
+int otw()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Filename:±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ scanf("%s",nazwap);\r
+\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return otw2();\r
+}\r
+\r
+int zap()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Filename:±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ scanf("%s",nazwap);\r
+\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return zap2();\r
+}\r
+int zmn()\r
+{\r
+ short CP;\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(GREEN);\r
+\r
+ outtextxy(144,184," ±Codepage number:±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+\r
+ scanf("%u",&CP);\r
+ for(short i=0;i<FIH->num_codepages;++i)\r
+ {\r
+ if(CP==CPEH[i]->codepage&&i!=cp)\r
+ {\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ return 314;\r
+ }\r
+ }\r
+ CPEH[cp]->codepage=CP;\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+}\r
+int bnd()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±CPI file not loaded±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)± ");\r
+\r
+ printf("%s",err);\r
+ int a;\r
+ for(;;)\r
+ {\r
+ a=bioskey(_KEYBRD_READ);\r
+ if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+ }\r
+ if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 1;\r
+ }\r
+\r
+ }\r
+\r
+\r
+}\r
+int bnd2()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±CPI file not saved±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)± ");\r
+\r
+ printf("%s",err);\r
+ int a;\r
+ for(;;)\r
+ {\r
+ a=bioskey(_KEYBRD_READ);\r
+ if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+ }\r
+ if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 1;\r
+ }\r
+\r
+ }\r
+}\r
+\r
+int bnd8()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±CPI not created±±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)± ");\r
+\r
+ printf("%s",err);\r
+ int a;\r
+ for(;;)\r
+ {\r
+ a=bioskey(_KEYBRD_READ);\r
+ if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+ }\r
+ if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
+ {\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ return 1;\r
+ }\r
+\r
+ }\r
+}\r
+\r
+int bnd3()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±Font not created±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey± ");\r
+\r
+ printf("%s",err);\r
+ bioskey(_KEYBRD_READ);\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+\r
+\r
+\r
+}\r
+\r
+int bnd6()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±Codepage not created±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey± ");\r
+\r
+ printf("%s",err);\r
+ bioskey(_KEYBRD_READ);\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
}\r
-int bnd()\r
+\r
+int bnd4()\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
setcolor(BLACK);\r
\r
outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
\r
setcolor(BROWN);\r
\r
- outtextxy(144,184," ±Nie wczytano pliku CPI±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,184," ±Font not deleted±±±±±±±±±±±±±±±±±±±±±±±±± ");\r
outtextxy(144,192," ± ± ");\r
outtextxy(144,200," ± ± ");\r
- outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±jeszcze raz?(t/n)± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey± ");\r
\r
printf("%s",err);\r
- int a;\r
- for(;;)\r
- {\r
- a=bioskey(_KEYBRD_READ);\r
- if(a/0x100==0x14)\r
- {\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return 0;\r
- }\r
- if(a/0x100==0x31)\r
- {\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return 1;\r
- }\r
-\r
- }\r
-\r
-\r
+ bioskey(_KEYBRD_READ);\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
}\r
-int bnd2()\r
+\r
+int bnd7()\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
setcolor(BLACK);\r
\r
outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
\r
setcolor(BROWN);\r
\r
- outtextxy(144,184," ±Nie zapisano pliku CPI±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,184," ±Codepage not deleted±±±±±±±±±±±±±±±±±±±±± ");\r
outtextxy(144,192," ± ± ");\r
outtextxy(144,200," ± ± ");\r
- outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±jeszcze raz?(t/n)± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey± ");\r
\r
printf("%s",err);\r
- int a;\r
- for(;;)\r
- {\r
- a=bioskey(_KEYBRD_READ);\r
- if(a/0x100==0x14)\r
- {\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return 0;\r
- }\r
- if(a/0x100==0x31)\r
- {\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
- return 1;\r
- }\r
+ bioskey(_KEYBRD_READ);\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
+}\r
\r
- }\r
\r
+int bnd5()\r
+{\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ setcolor(BLACK);\r
+\r
+ outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,192," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,200," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+ outtextxy(144,208," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
+\r
+ setcolor(BROWN);\r
+\r
+ outtextxy(144,184," ±Number not changed±±±±±±±±±±±±±±±±±±±±±±± ");\r
+ outtextxy(144,192," ± ± ");\r
+ outtextxy(144,200," ± ± ");\r
+ outtextxy(144,208," ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey± ");\r
\r
+ printf("%s",err);\r
+ bioskey(_KEYBRD_READ);\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
+ return 0;\r
}\r
+\r
int pmc()\r
{\r
- printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
+ gotoxy(21,13);\r
+ //printf("\n\n\n\n\n\n\n\n\n\n\n\n ");\r
setcolor(BLACK);\r
\r
outtextxy(144,184," ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ");\r
\r
printf("%s",err);\r
bioskey(_KEYBRD_READ);\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
+// closegraph();\r
+// initgraph(&kart16,&tryb16,"");\r
return 0;\r
\r
\r
\r
int main(int argc,char* argv[])\r
{\r
-\r
-\r
-\r
-\r
-\r
+ nullpointers();\r
// registerbgidriver(CGA_driver);\r
registerbgidriver(EGAVGA_driver);\r
initgraph(&kart16,&tryb16,"");\r
wys=8;\r
\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- lin8();\r
- lin14();\r
- lin16();\r
+ //new8();\r
+ //menu8();\r
+ //cpwys();\r
setcolor(RED);\r
- outtextxy(184,472,"odczyt");\r
+ outtextxy(136,472,"load");\r
\r
if(argc>1)\r
{\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
sprintf(nazwap,"%s",argv[1]);\r
status=otw2();\r
+ \r
+ while(status!=0)\r
+ {\r
+ if (bnd()==0)\r
+ status=otw();\r
+ else\r
+ {\r
+ break;\r
+ //closegraph();\r
+ //deleteCPI();\r
+ //return status;\r
+ }\r
+ }\r
+ any=!status;\r
}\r
else\r
- status=otw();\r
- while(status!=0)\r
- {\r
- if (bnd()==0)\r
- status=otw();\r
- else\r
- return status;\r
- }\r
-\r
-\r
-\r
+ any=0;\r
+ \r
+ \r
+ if(byo8[0])\r
+ wys=8;\r
+ else if(byo16[0])\r
+ wys=16;\r
+ else if(byo14[0])\r
+ wys=14;\r
+ \r
\r
new8();\r
menu8();\r
key=bioskey(_KEYBRD_READ);\r
if(tab==0)\r
{\r
- if(key/0x100==0x48)\r
+ if((key&0xFF00)==0x4800&&any)\r
{\r
//w g¢r©\r
- if(cury==0)\r
- cury=wys-1;\r
- else\r
- --cury;\r
+ //if(cury==0)\r
+ // cury=wys-1;\r
+ //else\r
+ // --cury;\r
+ cury+=wys-1;\r
+ cury%=wys;\r
if(wys==8)\r
lit8();\r
if(wys==14)\r
if(wys==16)\r
lit16();\r
}\r
- if(key/0x100==0x50)\r
+ if((key&0xFF00)==0x5000&&any)\r
{\r
//w d¢\88\r
- if(cury==wys-1)\r
- cury=0;\r
- else\r
- ++cury;\r
+ //if(cury==wys-1)\r
+ // cury=0;\r
+ //else\r
+ // ++cury;\r
+ ++cury;\r
+ cury%=wys;\r
if(wys==8)\r
lit8();\r
if(wys==14)\r
lit16();\r
\r
}\r
- if(key/0x100==0x4b)\r
+ if((key&0xFF00)==0x4b00&&any)\r
{\r
//w lewo\r
- if(curx==0)\r
- curx=7;\r
- else\r
- --curx;\r
+ //if(curx==0)\r
+ // curx=7;\r
+ //else\r
+ // --curx;\r
+ --curx;\r
+ curx&=0x7;\r
if(wys==8)\r
lit8();\r
if(wys==14)\r
if(wys==16)\r
lit16();\r
}\r
- if(key/0x100==0x4d)\r
+ if((key&0xFF00)==0x4d00&&any)\r
{\r
//w prawo\r
- if(curx==7)\r
- curx=0;\r
- else\r
- ++curx;\r
+ //if(curx==7)\r
+ // curx=0;\r
+ //else\r
+ // ++curx;\r
+ ++curx;\r
+ curx&=0x7;\r
if(wys==8)\r
lit8();\r
if(wys==14)\r
if(wys==16)\r
lit16();\r
}\r
- if (key/0x100==0x39)\r
+ if ((key&0xFF00)==0x3900&&any)\r
{\r
//spacja\r
if(wys==8)\r
lin16();\r
}\r
}\r
- if (key/0x100==0x0e)\r
+ if ((key&0xFF00)==0x0e00&&any)\r
{\r
//backspace\r
if(wys==8)\r
lin16();\r
}\r
}\r
- if (key/0x100==0x1c)\r
+ if ((key&0xFF00)==0x1c00&&any)\r
{\r
//enter\r
if(wys==8)\r
}\r
else\r
{\r
- if(key/0x100==0x48)\r
+ if((key&0xFF00)==0x4800&&any)\r
{\r
//w g¢r© l\r
- if(lit<16)\r
- lit=(0xf0+lit%16);\r
- else\r
- lit=((lit/16-1)*16+lit%16);\r
+ //if(lit<16)\r
+ // lit=(0xf0+lit%16);\r
+ //else\r
+ // lit=((lit/16-1)*16+lit%16);\r
+ lit-=16;\r
+ lit&=0xFF;\r
lit8();\r
lit14();\r
lit16();\r
lin16();\r
\r
}\r
- if(key/0x100==0x50)\r
+ if((key&0xFF00)==0x5000&&any)\r
{\r
//w d¢\88 l\r
- if(lit>=0xf0)\r
- lit=(0+lit%16);\r
- else\r
- lit=((lit/16+1)*16+lit%16);\r
+ //if(lit>=0xf0)\r
+ // lit=(0+lit%16);\r
+ //else\r
+ // lit=((lit/16+1)*16+lit%16);\r
+ lit+=16;\r
+ lit&=0xFF;\r
lit8();\r
lit14();\r
lit16();\r
if (wys==16)\r
lin16();\r
}\r
- if(key/0x100==0x4b)\r
+ if((key&0xFF00)==0x4b00&&any)\r
{\r
//w lewo l\r
- if(lit%16==0)\r
- lit+=15;\r
- else\r
- --lit;\r
+ //if(lit%16==0)\r
+ // lit+=15;\r
+ //else\r
+ // --lit;\r
+ --lit;\r
+ lit&=0xFF;\r
lit8();\r
lit14();\r
lit16();\r
if (wys==16)\r
lin16();\r
}\r
- if(key/0x100==0x4d)\r
+ if((key&0xFF00)==0x4d00&&any)\r
{\r
\r
//w prawo l\r
- if(lit%16==15)\r
- lit-=15;\r
- else\r
- ++lit;\r
+ //if(lit%16==15)\r
+ // lit-=15;\r
+ //else\r
+ // ++lit;\r
+ ++lit;\r
+ lit&=0xFF;\r
lit8();\r
lit14();\r
lit16();\r
lin16();\r
}\r
}\r
- if (key/0x100==0x0f)\r
+ if ((key&0xFF00)==0x0f00&&any)\r
{\r
//tab\r
if(tab==0)\r
ramka14();\r
ramka16();\r
}\r
- if (key/0x100==0x51)\r
+ if ((key&0xFF00)==0x5100&&any)\r
{\r
//cp++\r
- if(cp==FIH.num_codepages-1)\r
- cp=0;\r
- else\r
- ++cp;\r
+ //if(cp==FIH->num_codepages-1)\r
+ // cp=0;\r
+ //else\r
+ // ++cp;\r
+ ++cp;\r
+ cp%=FIH->num_codepages;\r
+ \r
+ if(wys==8&&byo8[cp]==0)\r
+ {\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
+ }\r
+ \r
+ else if(wys==14&&byo14[cp]==0)\r
+ {\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
+ }\r
+ \r
+ else if(wys==16&&byo16[cp]==0)\r
+ {\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
+ }\r
+ cury&=0x7;\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
cpwys();\r
lin8();\r
lin14();\r
lit8();\r
lit14();\r
lit16();\r
-\r
+ \r
}\r
- if (key/0x100==0x49)\r
+ if ((key&0xFF00)==0x4900&&any)\r
{\r
//cp--\r
- if(cp==0)\r
- cp=FIH.num_codepages-1;\r
- else\r
- --cp;\r
+ //if(cp==0)\r
+ // cp=FIH->num_codepages-1;\r
+ //else\r
+ // --cp;\r
+ cp+=FIH->num_codepages-1;\r
+ cp%=FIH->num_codepages;\r
+ \r
+ if(wys==8&&byo8[cp]==0)\r
+ {\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
+ }\r
+ \r
+ else if(wys==14&&byo14[cp]==0)\r
+ {\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
+ }\r
+ \r
+ else if(wys==16&&byo16[cp]==0)\r
+ {\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
+ }\r
+ cury&=0x7;\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
cpwys();\r
lin8();\r
lin14();\r
lit16();\r
\r
}\r
- if (key/0x100==0x52)\r
+ if ((key&0xFF00)==0x4700&&any)\r
{\r
//wys--\r
if(wys==8)\r
lit8();\r
lit14();\r
lit16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
}\r
- if (key/0x100==0x53)\r
+ if ((key&0xFF00)==0x4f00&&any)\r
{\r
//wys++\r
if(wys==8)\r
lit8();\r
lit14();\r
lit16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
}\r
- if (key/0x100==0x3b)\r
+ \r
+ if ((key&0xFF00)==0x3b00)\r
{\r
- //pomoc\r
+ //new CPI\r
setcolor(RED);\r
- outtextxy(24,472,"pomoc");\r
- sprintf(err,"Przeczytaj plik \"napisy.txt\"");\r
- pmc();\r
+ outtextxy(16,472,"new");\r
+ deleteCPI();\r
+ status=newCPI();\r
+ while(status!=0)\r
+ {\r
+ if (bnd8()==0)\r
+ status=newCPI();\r
+ else\r
+ {\r
+ break;\r
+ //closegraph();\r
+ //deleteCPI();\r
+ //return status;\r
+ }\r
+ }\r
+ any=!status;\r
+ if(any)\r
+ {\r
+ strcpy(nazwap,"new CPI");\r
+ cp=0;\r
+ if(byo8[0])\r
+ wys=8;\r
+ else if(byo16[0])\r
+ wys=16;\r
+ else if(byo14[0])\r
+ wys=14;\r
+ cury%=8;\r
+ }\r
new8();\r
menu8();\r
cpwys();\r
lit8();\r
lit14();\r
lit16();\r
- cury%=8;\r
-\r
-\r
+ \r
}\r
- if (key/0x100==0x3c)\r
+ if ((key&0xFF00)==0x3c00&&any)\r
{\r
//zapisz\r
setcolor(RED);\r
- outtextxy(104,472,"zapis");\r
+ outtextxy(72,472,"save");\r
status=zap();\r
while(status!=0)\r
{\r
}\r
\r
\r
- if (key/0x100==0x3d)\r
+ if ((key&0xFF00)==0x3d00)\r
{\r
//wczytaj\r
setcolor(RED);\r
- outtextxy(184,472,"odczyt");\r
+ outtextxy(136,472,"load");\r
+ deleteCPI();\r
status=otw();\r
while(status!=0)\r
{\r
if (bnd()==0)\r
status=otw();\r
else\r
- return status;\r
+ {\r
+ break;\r
+ //closegraph();\r
+ //deleteCPI();\r
+ //return status;\r
+ }\r
}\r
+ any=!status;\r
+ cp=0;\r
+ if(byo8[0])\r
+ wys=8;\r
+ else if(byo16[0])\r
+ wys=16;\r
+ else if(byo14[0])\r
+ wys=14;\r
+ cury%=8;\r
+\r
new8();\r
menu8();\r
cpwys();\r
lit8();\r
lit14();\r
lit16();\r
- cp=0;\r
- cury%=8;\r
-\r
\r
}\r
- if(key/0x100==0x3e)\r
+ if((key&0xFF00)==0x3e00&&any)\r
{\r
{\r
//zapisz+system\r
setcolor(RED);\r
- outtextxy(104,472,"zapis u¾ycie w systemie");\r
+ outtextxy(72,472,"save use");\r
status=zap();\r
while(status!=0)\r
{\r
}\r
if(status==0)\r
{\r
- sprintf(err,"mode con:cp prep=((%d) %s )",CPEH[cp].codepage,nazwap);\r
+ sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap);\r
+ puts(err);\r
system(err);\r
- sprintf(err,"mode con:cp sel=%d",CPEH[cp].codepage);\r
+ sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage);\r
+ puts(err);\r
system(err);\r
+ delay(5000);\r
+ closegraph();\r
+ initgraph(&kart16,&tryb16,"");\r
\r
}\r
new8();\r
\r
\r
}\r
- if (key/0x100==0x3f)\r
+ if ((key&0xFF00)==0x3f00&&any)\r
{\r
//zmiana numeru\r
setcolor(RED);\r
- outtextxy(448,472,"zmiana numeru");\r
- zmn();\r
-\r
+ outtextxy(256,472,"number");\r
+ status=zmn();\r
+ if(status!=0)\r
+ bnd5();\r
new8();\r
menu8();\r
cpwys();\r
lit8();\r
lit14();\r
lit16();\r
- cury%=8;\r
-\r
-\r
}\r
- if (key/0x100==0x40)\r
+ if ((key&0xFF00)==0x4000&&any)\r
+ {\r
+ //new font\r
+ setcolor(RED);\r
+ outtextxy(336,472,"newF");\r
+ status=newF();\r
+ if(status!=0)\r
+ bnd3();\r
+ offset();\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ \r
+ }\r
+ if ((key&0xFF00)==0x4100&&any)\r
+ {\r
+ //new CP\r
+ setcolor(RED);\r
+ outtextxy(400,472,"newCP");\r
+ status=newCP();\r
+ if(status!=0)\r
+ bnd6();\r
+ else\r
+ cp=FIH->num_codepages-1;\r
+ if(wys==8&&byo8[cp]==0)\r
+ {\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
+ }\r
+ \r
+ else if(wys==14&&byo14[cp]==0)\r
+ {\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
+ }\r
+ \r
+ else if(wys==16&&byo16[cp]==0)\r
+ {\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
+ }\r
+ cury&=0x7;\r
+ offset();\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ \r
+ }\r
+ if ((key&0xFF00)==0x4200&&any)\r
+ {\r
+ //delete font\r
+ setcolor(RED);\r
+ outtextxy(472,472,"delF");\r
+ status=delF();\r
+ if(status!=0)\r
+ bnd4();\r
+ offset();\r
+ \r
+ if(wys==8&&byo8[cp]==0)\r
+ {\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
+ }\r
+ \r
+ else if(wys==14&&byo14[cp]==0)\r
+ {\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
+ }\r
+ \r
+ else if(wys==16&&byo16[cp]==0)\r
+ {\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
+ }\r
+ cury&=0x7;\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ \r
+ }\r
+ if ((key&0xFF00)==0x4300&&any)\r
+ {\r
+ //delete CP\r
+ setcolor(RED);\r
+ outtextxy(536,472,"delCP");\r
+ status=delCP();\r
+ if(status!=0)\r
+ bnd7();\r
+ offset();\r
+ \r
+ cp%=FIH->num_codepages;\r
+ \r
+ if(wys==8&&byo8[cp]==0)\r
+ {\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
+ }\r
+ \r
+ else if(wys==14&&byo14[cp]==0)\r
+ {\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
+ }\r
+ \r
+ else if(wys==16&&byo16[cp]==0)\r
+ {\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
+ }\r
+ cury&=0x7;\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ \r
+ }\r
+ if ((key&0xFF00)==0x4400)\r
{\r
//koniec\r
setcolor(RED);\r
- outtextxy(592,472,"koniec");\r
- delay(1000);\r
+ outtextxy(616,472,"end");\r
break;\r
}\r
+ while(bioskey(_KEYBRD_READY))\r
+ {\r
+ bioskey(_KEYBRD_READ);\r
+ }\r
}\r
\r
-\r
+ deleteCPI();\r
closegraph();\r
return 0;\r
}
\ No newline at end of file