- //CPI EDITOR vresion 1.2b\r
+ //CPIED version 1.3a\r
// Balthasar Szczepaäski Copyright 2013\r
//\r
- // This file is part of CPIED also known as the CPI EDITOR or EDYTOR NAPISàW\r
+ // This file is part of CPIED\r
// \r
//CPIED is free software: you can redistribute it and/or modify\r
// it under the terms of the GNU General Public License as published by\r
//\r
//You should have received a copy of the GNU General Public License along\r
// with CPIED (copying.txt). If not, see <http://www.gnu.org/licenses/>.\r
- // \r
- //\r
-// Compiled with Turbo C++ 3.0\r
-#include <graphics.h>\r
+\r
+#define BLACK 0\r
+#define GRAY 8\r
+#define BLUE 1\r
+#define LBLUE 9\r
+#define GREEN 2 \r
+#define LGREEN 10\r
+#define CYAN 3\r
+#define LCYAN 11\r
+#define RED 4\r
+#define LRED 12\r
+#define MAGEN 5\r
+#define LMAGEN 13\r
+#define BROWN 6\r
+#define YELLOW 14\r
+#define LGRAY 7\r
+#define WHITE 15\r
+\r
+//#define C_BACK BLACK\r
+#define C_SET BROWN\r
+#define C_NON RED\r
+#define C_SEL GREEN\r
+\r
+#include <graph.h>\r
#include <stdio.h>\r
#include <conio.h>\r
#include <string.h>\r
#include <mem.h>\r
#include <dos.h>\r
#include <bios.h>\r
+#include <process.h>\r
\r
#define resetMaus setMaus\r
\r
-//Strustures in the CPI file format\r
+//Structures in the CPI file format\r
struct FontFileHeader\r
{\r
unsigned char id0;\r
int status;\r
char nazwap[256]="Nie_wybrano_pliku";\r
char err[256];\r
-\r
- int kart16=VGA;\r
-\r
- int tryb16=VGAHI;\r
-\r
+ unsigned char NOFONT[8]={\r
+ 0x80,\r
+ 0x00,\r
+ 0x08,\r
+ 0x00,\r
+ 0x80,\r
+ 0x00,\r
+ 0x08,\r
+ 0x00};\r
+ unsigned char FULLF[8]={\r
+ 0xff,\r
+ 0xff,\r
+ 0xff,\r
+ 0xff,\r
+ 0xff,\r
+ 0xff,\r
+ 0xff,\r
+ 0xff};\r
+ \r
FILE *CPI;\r
FontFileHeader *FFH;\r
FontInfoHeader *FIH;\r
\r
void new8 ();\r
void menu8 ();\r
-void cpwys ();\r
+void cpwys (int mode=0);\r
void redraw();\r
\r
void displayDialog(int color, char *text, int type=0);\r
}\r
void new8()\r
{\r
- cleardevice();\r
- setcolor(GREEN);\r
- \r
- outtextxy(0,0, "CPI editor 1.2±");\r
- outtextxy(0,8, "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
- //outtextxy(600,16,"v1.2b");\r
+ _clearscreen(_GCLEARSCREEN);\r
+ _setcolor(C_SEL);\r
+ _moveto(0,0);\r
+ _outgtext("CPIED 1.3a±");\r
+ _moveto(0,8);\r
+ _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
}\r
void menu8()\r
{\r
- setcolor(GREEN);\r
- outtextxy(609,449,",");\r
- outtextxy(472,456,"Balthasar Szczepanski");\r
- outtextxy(0,464,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
+ _setcolor(C_SEL);\r
+ _moveto(609,449);\r
+ _outgtext(",");\r
+ _moveto(472,456);\r
+ _outgtext("Balthasar Szczepanski");\r
+ _moveto(0,464);\r
+ _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\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
+ {\r
+ _moveto(0,472);\r
+ _outgtext("1.new°°2.save°°3.load°°4.use°°5.number°°6.newF°°7.newCP°°8.delF°°9.delCP°°10.end");\r
+ }\r
else\r
- outtextxy(0,472,"1.new°°°°°°°°°°3.load°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°10.end");\r
+ {\r
+ _moveto(0,472);\r
+ _outgtext("1.new°°°°°°°°°°3.load°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°10.end");\r
+ }\r
}\r
-void cpwys()\r
+void cpwys(int mode)\r
{\r
char cpw[256];\r
- setfillstyle(EMPTY_FILL,BLACK);\r
- bar(120,0,639,7);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,120,0,639,7);\r
if(any)\r
{\r
if((unsigned)(CPEH[cp]->codepage)>=1000)\r
}\r
else\r
strcpy(cpw, "°No CPI open°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");\r
- setcolor(GREEN);\r
-\r
- outtextxy(120,0,cpw);\r
+ _setcolor(C_SEL);\r
+ _moveto(120,0);\r
+ _outgtext(cpw);\r
+ if(mode||!any)\r
+ return;\r
+ for(short i=0;i<FIH->num_codepages;++i)\r
+ {\r
+ if(i==cp)\r
+ _setcolor(C_SEL);\r
+ else\r
+ _setcolor(C_NON);\r
+ _moveto(328+(i%6)*48,16+(i/6)*8);\r
+ if((unsigned)(CPEH[i]->codepage)>=1000)\r
+ sprintf(cpw,"%5u",CPEH[i]->codepage);\r
+ else\r
+ sprintf(cpw," %03u",CPEH[i]->codepage);\r
+ _outgtext(cpw);\r
+ }\r
}\r
void redraw()//\r
{\r
\r
void displayDialog(int color,char *text,int type)\r
{\r
- gotoxy(21,13);\r
+ _settextposition(13,21);\r
char t1[43]="±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±";\r
strcpy(t1+1,text);\r
t1[strlen(t1)]='±';\r
- setfillstyle(EMPTY_FILL,BLACK);\r
- bar(152,184,487,215);\r
- setcolor(color);\r
- outtextxy(152,184,t1);\r
- outtextxy(152,192,"± ±");\r
- outtextxy(152,200,"± ±");\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,152,184,487,215);\r
+ _setcolor(color);\r
+ _moveto(152,184);\r
+ _outgtext(t1);\r
+ _moveto(152,192);\r
+ _outgtext("± ±");\r
+ _moveto(152,200);\r
+ _outgtext("± ±");\r
switch(type)\r
{\r
case 2:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±");\r
+ _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±");\r
break;\r
case 1:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±");\r
+ _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±");\r
break;\r
case 0:\r
default:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
+ _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
break;\r
}\r
}\r
{\r
if (type!=2)\r
{\r
- displayDialog(BROWN,text,1);\r
+ displayDialog(C_SET,text,1);\r
printf("%s",value);\r
- bioskey(_KEYBRD_READ);\r
+ _bios_keybrd(_KEYBRD_READ);\r
return 0;\r
}\r
else\r
{\r
- displayDialog(BROWN,text,2);\r
+ displayDialog(C_SET,text,2);\r
printf("%s",value);\r
- int a;\r
+ unsigned short a;\r
for(;;)\r
{\r
- a=bioskey(_KEYBRD_READ);\r
+ a=_bios_keybrd(_KEYBRD_READ);\r
if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
return 0;\r
if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
}\r
inline void question(char *text, char *result)\r
{\r
- displayDialog(GREEN,text);\r
+ displayDialog(C_SEL,text);\r
scanf("%s",result);\r
}\r
inline unsigned question(char *text)\r
if(!any)\r
return;\r
if(tab==0&&wys==8)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(15,31,144,160);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,15,31,144,160);\r
if(tab!=0&&wys==8)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(175,31,304,160);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,175,31,304,160);\r
}\r
void ramka14()\r
{\r
if(!any)\r
return;\r
if(tab==0&&wys==14)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(15,223,144,448);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,15,223,144,448);\r
if(tab!=0&&wys==14)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(175,223,304,448);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,175,223,304,448);\r
}\r
void ramka16()\r
{\r
if(!any)\r
return;\r
if(tab==0&&wys==16)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(335,111,464,368);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,335,111,464,368);\r
if(tab!=0&&wys==16)\r
- setcolor(GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- setcolor(RED);\r
- rectangle(495,111,624,368);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GBORDER,495,111,624,368);\r
}\r
void lin8(int mode)\r
{\r
if(mode==3)\r
{\r
if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(176+curx+((lit&15)<<3),32+cury+((lit>>4)<<3),GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- putpixel(176+curx+((lit&15)<<3),32+cury+((lit>>4)<<3),BLACK);\r
+ _setcolor(BLACK);\r
+ _setpixel(176+curx+((lit&15)<<3),32+cury+((lit>>4)<<3));\r
return;\r
}\r
char ab[2]="X";\r
- int color1,color2;\r
+ short color1,color2;\r
if(byo8[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(176,32,303,159);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,176,32,303,159);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,176,32,303,159);\r
return;\r
}\r
if(wys==8)\r
{\r
- color1=GREEN;\r
- color2=GREEN;\r
+ color1=C_SEL;\r
+ color2=C_SEL;\r
}\r
else\r
{ \r
- color1=BROWN;\r
- color2=RED;\r
+ color1=C_SET;\r
+ color2=C_NON;\r
}\r
int l;\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if((pre&15)!=(lit&15))\r
{\r
ab[0]=abc[pre&15];\r
- outtextxy(176+((pre&15)<<3),24,ab);\r
+ _moveto(176+((pre&15)<<3),24);\r
+ _outgtext(ab);\r
}\r
if(pre>>4!=lit>>4)\r
{\r
ab[0]=abc[pre>>4];\r
- outtextxy(168,32+((pre>>4)<<3),ab);\r
+ _moveto(168,32+((pre>>4)<<3));\r
+ _outgtext(ab);\r
}\r
- setfillpattern(SFB8[cp]->lit[pre].lin,BROWN);\r
- bar(176+((pre&15)<<3),32+((pre>>4)<<3),183+((pre&15)<<3),39+((pre>>4)<<3));\r
+ _setfillmask(SFB8[cp]->lit[pre].lin);\r
+ _setcolor(C_SET);\r
+ _rectangle(_GFILLINTERIOR,176+((pre&15)<<3),32+((pre>>4)<<3),183+((pre&15)<<3),39+((pre>>4)<<3));\r
\r
\r
case 3:\r
case 1:\r
- setcolor(color2);\r
+ _setcolor(color2);\r
ab[0]=abc[lit&15];\r
- outtextxy(176+((lit&15)<<3),24,ab);\r
+ _moveto(176+((lit&15)<<3),24);\r
+ _outgtext(ab);\r
ab[0]=abc[lit>>4];\r
- outtextxy(168,32+((lit>>4)<<3),ab);\r
- setfillpattern(SFB8[cp]->lit[lit].lin,color1);\r
- bar(176+((lit&15)<<3),32+((lit>>4)<<3),183+((lit&15)<<3),39+((lit>>4)<<3));\r
- \r
- \r
+ _moveto(168,32+((lit>>4)<<3));\r
+ _outgtext(ab);\r
+ _setfillmask(SFB8[cp]->lit[lit].lin);\r
+ _setcolor(color1);\r
+ _rectangle(_GFILLINTERIOR,176+((lit&15)<<3),32+((lit>>4)<<3),183+((lit&15)<<3),39+((lit>>4)<<3));\r
break;\r
case 0:\r
default:\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,176,32,303,159);\r
for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
if((lit&15)==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(176+(l<<3),24,ab);\r
+ _setcolor(C_NON);\r
+ _moveto(176+(l<<3),24);_outgtext(ab);\r
if(lit>>4==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(168,32+(l<<3),ab);\r
+ _setcolor(C_NON);\r
+ _moveto(168,32+(l<<3));_outgtext(ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
if(l==lit)\r
- setfillpattern(SFB8[cp]->lit[l].lin,color1);\r
+ _setcolor(color1);\r
else\r
- setfillpattern(SFB8[cp]->lit[l].lin,BROWN);\r
- bar(176+((l&15)<<3),32+((l>>4)<<3),183+((l&15)<<3),39+((l>>4)<<3));\r
+ _setcolor(C_SET);\r
+ _setfillmask(SFB8[cp]->lit[l].lin);\r
+ _rectangle(_GFILLINTERIOR,176+((l&15)<<3),32+((l>>4)<<3),183+((l&15)<<3),39+((l>>4)<<3));\r
}\r
break;\r
}\r
if(mode==3)\r
{\r
if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(176+curx+((lit&15)<<3),224+cury+(lit>>4)*14,GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- putpixel(176+curx+((lit&15)<<3),224+cury+(lit>>4)*14,BLACK);\r
+ _setcolor(BLACK);\r
+ _setpixel(176+curx+((lit&15)<<3),224+cury+(lit>>4)*14);\r
return;\r
}\r
char ab[2]="X";\r
- int color1,color2;\r
+ short color1,color2;\r
if(byo14[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(176,224,303,447);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,176,224,303,447);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,176,224,303,447);\r
return;\r
}\r
if(wys==14)\r
{\r
- color1=GREEN;\r
- color2=GREEN;\r
+ color1=C_SEL;\r
+ color2=C_SEL;\r
}\r
else\r
{ \r
- color1=BROWN;\r
- color2=RED;\r
+ color1=C_SET;\r
+ color2=C_NON;\r
}\r
int a,l;\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if((pre&15)!=(lit&15))\r
{\r
ab[0]=abc[pre&15];\r
- outtextxy(176+((pre&15)<<3),216,ab);\r
+ _moveto(176+((pre&15)<<3),216);_outgtext(ab);\r
}\r
if(pre>>4!=lit>>4)\r
{\r
ab[0]=abc[pre>>4];\r
- outtextxy(168,227+(pre>>4)*14,ab);\r
+ _moveto(168,227+(pre>>4)*14);_outgtext(ab);\r
}\r
a=(pre>>4)&3;\r
+ _setcolor(C_SET);\r
if(a)\r
{\r
- setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1)-8,BROWN);\r
- bar(176+((pre&15)<<3),224+(pre>>4)*14,183+((pre&15)<<3),223+(a<<1)+(pre>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[pre].lin+(a<<1)-8);\r
+ _rectangle(_GFILLINTERIOR,176+((pre&15)<<3),224+(pre>>4)*14,183+((pre&15)<<3),223+(a<<1)+(pre>>4)*14);\r
}\r
- setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1),BROWN);\r
- bar(176+((pre&15)<<3),224+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),231+(a<<1)+(pre>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[pre].lin+(a<<1));\r
+ _rectangle(_GFILLINTERIOR,176+((pre&15)<<3),224+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),231+(a<<1)+(pre>>4)*14);\r
if(a!=3)\r
{\r
- setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1)+8,BROWN);\r
- bar(176+((pre&15)<<3),232+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),237+(pre>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[pre].lin+(a<<1)+8);\r
+ _rectangle(_GFILLINTERIOR,176+((pre&15)<<3),232+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),237+(pre>>4)*14);\r
}\r
case 3:\r
case 1:\r
- setcolor(color2);\r
+ _setcolor(color2);\r
ab[0]=abc[lit&15];\r
- outtextxy(176+((lit&15)<<3),216,ab);\r
+ _moveto(176+((lit&15)<<3),216);_outgtext(ab);\r
ab[0]=abc[lit>>4];\r
- outtextxy(168,227+(lit>>4)*14,ab);\r
+ _moveto(168,227+(lit>>4)*14);_outgtext(ab);\r
a=(lit>>4)&3;\r
+ _setcolor(color1);\r
if(a)\r
{\r
- setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1)-8,color1);\r
- bar(176+((lit&15)<<3),224+(lit>>4)*14,183+((lit&15)<<3),223+(a<<1)+(lit>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[lit].lin+(a<<1)-8);\r
+ _rectangle(_GFILLINTERIOR,176+((lit&15)<<3),224+(lit>>4)*14,183+((lit&15)<<3),223+(a<<1)+(lit>>4)*14);\r
}\r
- setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1),color1);\r
- bar(176+((lit&15)<<3),224+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),231+(a<<1)+(lit>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[lit].lin+(a<<1));\r
+ _rectangle(_GFILLINTERIOR,176+((lit&15)<<3),224+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),231+(a<<1)+(lit>>4)*14);\r
if(a!=3)\r
{\r
- setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1)+8,color1);\r
- bar(176+((lit&15)<<3),232+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),237+(lit>>4)*14);\r
+ _setfillmask(SFB14[cp]->lit[lit].lin+(a<<1)+8);\r
+ _rectangle(_GFILLINTERIOR,176+((lit&15)<<3),232+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),237+(lit>>4)*14);\r
} \r
break;\r
case 0:\r
default:\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,176,224,303,447);\r
for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
if((lit&15)==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(176+(l<<3),216,ab);\r
+ _setcolor(C_NON);\r
+ _moveto(176+(l<<3),216);\r
+ _outgtext(ab);\r
if(lit>>4==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(168,227+l*14,ab);\r
+ _setcolor(C_NON);\r
+ _moveto(168,227+l*14);\r
+ _outgtext(ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
a=(l>>4)&3;\r
if(l==lit)\r
+ _setcolor(color1);\r
+ else\r
+ _setcolor(C_SET);\r
+ if(a)\r
{\r
- if(a)\r
- {\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)-8,color1);\r
- bar(176+((l&15)<<3),224+(l>>4)*14,183+((l&15)<<3),223+(a<<1)+(l>>4)*14);\r
- }\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1),color1);\r
- bar(176+((l&15)<<3),224+(a<<1)+(l>>4)*14,183+((l&15)<<3),231+(a<<1)+(l>>4)*14);\r
- if(a!=3)\r
- {\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)+8,color1);\r
- bar(176+((l&15)<<3),232+(a<<1)+(l>>4)*14,183+((l&15)<<3),237+(l>>4)*14);\r
- }\r
+ _setfillmask(SFB14[cp]->lit[l].lin+(a<<1)-8);\r
+ _rectangle(_GFILLINTERIOR,176+((l&15)<<3),224+(l>>4)*14,183+((l&15)<<3),223+(a<<1)+(l>>4)*14);\r
}\r
- else\r
+ _setfillmask(SFB14[cp]->lit[l].lin+(a<<1));\r
+ _rectangle(_GFILLINTERIOR,176+((l&15)<<3),224+(a<<1)+(l>>4)*14,183+((l&15)<<3),231+(a<<1)+(l>>4)*14);\r
+ if(a!=3)\r
{\r
- if(a)\r
- {\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)-8,BROWN);\r
- bar(176+((l&15)<<3),224+(l>>4)*14,183+((l&15)<<3),223+(a<<1)+(l>>4)*14);\r
- }\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1),BROWN);\r
- bar(176+((l&15)<<3),224+(a<<1)+(l>>4)*14,183+((l&15)<<3),231+(a<<1)+(l>>4)*14);\r
- if(a!=3)\r
- {\r
- setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)+8,BROWN);\r
- bar(176+((l&15)<<3),232+(a<<1)+(l>>4)*14,183+((l&15)<<3),237+(l>>4)*14);\r
- }\r
+ _setfillmask(SFB14[cp]->lit[l].lin+(a<<1)+8);\r
+ _rectangle(_GFILLINTERIOR,176+((l&15)<<3),232+(a<<1)+(l>>4)*14,183+((l&15)<<3),237+(l>>4)*14);\r
}\r
+ \r
}\r
break;\r
}\r
if(mode==3)\r
{\r
if(SFB16[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(496+curx+((lit&15)<<3),112+cury+((lit>>4)<<4),GREEN);\r
+ _setcolor(C_SEL);\r
else\r
- putpixel(496+curx+((lit&15)<<3),112+cury+((lit>>4)<<4),BLACK);\r
+ _setcolor(BLACK);\r
+ _setpixel(496+curx+((lit&15)<<3),112+cury+((lit>>4)<<4));\r
return;\r
}\r
char ab[2]="X";\r
- int color1,color2;\r
+ short color1,color2;\r
if(byo16[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(496,112,623,367);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,496,112,623,367);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,496,112,623,367);\r
return;\r
}\r
if(wys==16)\r
{\r
- color1=GREEN;\r
- color2=GREEN;\r
+ color1=C_SEL;\r
+ color2=C_SEL;\r
}\r
else\r
{\r
- color1=BROWN;\r
- color2=RED;\r
+ color1=C_SET;\r
+ color2=C_NON;\r
}\r
int l;\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if((pre&15)!=(lit&15))\r
{\r
ab[0]=abc[pre&15];\r
- outtextxy(496+((pre&15)<<3),104,ab);\r
+ _moveto(496+((pre&15)<<3),104);\r
+ _outgtext(ab);\r
}\r
if(pre>>4!=lit>>4)\r
{\r
ab[0]=abc[pre>>4];\r
- outtextxy(488,116+((pre>>4)<<4),ab);\r
- }\r
- setfillpattern(SFB16[cp]->lit[pre].lin,BROWN);\r
- bar(496+((pre&15)<<3),112+((pre>>4)<<4),503+((pre&15)<<3),119+((pre>>4)<<4));\r
- setfillpattern(SFB16[cp]->lit[pre].lin+8,BROWN);\r
- bar(496+((pre&15)<<3),120+((pre>>4)<<4),503+((pre&15)<<3),127+((pre>>4)<<4));\r
+ _moveto(488,116+((pre>>4)<<4));\r
+ _outgtext(ab);\r
+ }\r
+ _setcolor(C_SET);\r
+ _setfillmask(SFB16[cp]->lit[pre].lin);\r
+ _rectangle(_GFILLINTERIOR,496+((pre&15)<<3),112+((pre>>4)<<4),503+((pre&15)<<3),119+((pre>>4)<<4));\r
+ _setfillmask(SFB16[cp]->lit[pre].lin+8);\r
+ _rectangle(_GFILLINTERIOR,496+((pre&15)<<3),120+((pre>>4)<<4),503+((pre&15)<<3),127+((pre>>4)<<4));\r
case 3: \r
case 1:\r
- setcolor(color2);\r
+ _setcolor(color2);\r
ab[0]=abc[lit&15];\r
- outtextxy(496+((lit&15)<<3),104,ab);\r
+ _moveto(496+((lit&15)<<3),104);\r
+ _outgtext(ab);\r
ab[0]=abc[lit>>4];\r
- outtextxy(488,116+((lit>>4)<<4),ab);\r
- setfillpattern(SFB16[cp]->lit[lit].lin,color1);\r
- bar(496+((lit&15)<<3),112+((lit>>4)<<4),503+((lit&15)<<3),119+((lit>>4)<<4));\r
- setfillpattern(SFB16[cp]->lit[lit].lin+8,color1);\r
- bar(496+((lit&15)<<3),120+((lit>>4)<<4),503+((lit&15)<<3),127+((lit>>4)<<4));\r
+ _moveto(488,116+((lit>>4)<<4));\r
+ _outgtext(ab);\r
+ _setcolor(color1);\r
+ _setfillmask(SFB16[cp]->lit[lit].lin);\r
+ _rectangle(_GFILLINTERIOR,496+((lit&15)<<3),112+((lit>>4)<<4),503+((lit&15)<<3),119+((lit>>4)<<4));\r
+ _setfillmask(SFB16[cp]->lit[lit].lin+8);\r
+ _rectangle(_GFILLINTERIOR,496+((lit&15)<<3),120+((lit>>4)<<4),503+((lit&15)<<3),127+((lit>>4)<<4));\r
break;\r
case 0:\r
default:\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,496,112,623,367);\r
for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
if((lit&15)==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(496+(l<<3),104,ab);\r
+ _setcolor(C_NON);\r
+ _moveto(496+(l<<3),104);_outgtext(ab);\r
if(lit>>4==l)\r
- setcolor(color2);\r
+ _setcolor(color2);\r
else\r
- setcolor(RED);\r
- outtextxy(488,116+(l<<4),ab);\r
+ _setcolor(C_NON);\r
+ _moveto(488,116+(l<<4));_outgtext(ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
if(l==lit)\r
- {\r
- setfillpattern(SFB16[cp]->lit[l].lin,color1);\r
- bar(496+((l&15)<<3),112+((l>>4)<<4),503+((l&15)<<3),119+((l>>4)<<4));\r
- setfillpattern(SFB16[cp]->lit[l].lin+8,color1);\r
- bar(496+((l&15)<<3),120+((l>>4)<<4),503+((l&15)<<3),127+((l>>4)<<4));\r
- }\r
+ _setcolor(color1);\r
else\r
- {\r
- setfillpattern(SFB16[cp]->lit[l].lin,BROWN);\r
- bar(496+((l&15)<<3),112+((l>>4)<<4),503+((l&15)<<3),119+((l>>4)<<4));\r
- setfillpattern(SFB16[cp]->lit[l].lin+8,BROWN);\r
- bar(496+((l&15)<<3),120+((l>>4)<<4),503+((l&15)<<3),127+((l>>4)<<4));\r
- }\r
+ _setcolor(C_SET);\r
+ _setfillmask(SFB16[cp]->lit[l].lin);\r
+ _rectangle(_GFILLINTERIOR,496+((l&15)<<3),112+((l>>4)<<4),503+((l&15)<<3),119+((l>>4)<<4));\r
+ _setfillmask(SFB16[cp]->lit[l].lin+8);\r
+ _rectangle(_GFILLINTERIOR,496+((l&15)<<3),120+((l>>4)<<4),503+((l&15)<<3),127+((l>>4)<<4));\r
}\r
break;\r
}\r
{\r
if(!any)\r
return;\r
- int color;\r
- setcolor(RED);\r
+ short color;\r
+ _setcolor(C_NON);\r
if(byo8[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(16,32,143,159);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16,32,143,159);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,16,32,143,159);\r
return;\r
}\r
char ab[2]="q";\r
if(wys==8)\r
- color=GREEN;\r
+ color=C_SEL;\r
else\r
- color=RED;\r
+ color=C_NON;\r
+ _setfillmask(FULLF);\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(20+(prex<<4),24,ab);\r
+ _moveto(20+(prex<<4),24);\r
+ _outgtext(ab);\r
}\r
if(prey<8)\r
{\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(8,36+(prey<<4),ab);\r
+ _moveto(8,36+(prey<<4));\r
+ _outgtext(ab);\r
}\r
if(SFB8[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(prex<<4),32+(prey<<4),31+(prex<<4),47+(prey<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(prex<<4),32+(prey<<4),31+(prex<<4),47+(prey<<4));\r
}\r
case 1:\r
- setcolor(color);\r
+ _setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(20+(curx<<4),24,ab);\r
+ _moveto(20+(curx<<4),24);\r
+ _outgtext(ab);\r
if(cury<8)\r
- {\r
+ {\r
ab[0]=abc[cury];\r
- outtextxy(8,36+(cury<<4),ab);\r
+ _moveto(8,36+(cury<<4));\r
+ _outgtext(ab);\r
if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
if(wys==8)\r
{\r
- setcolor(GREEN);\r
- rectangle(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
}\r
}\r
break;\r
for(int l=0;l<8;++l)\r
{\r
if(l==curx)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
\r
- outtextxy(20+(l<<4),24,ab);\r
+ _moveto(20+(l<<4),24);\r
+ _outgtext(ab);\r
if(l==cury)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
- outtextxy(8,36+(l<<4),ab);\r
+ _moveto(8,36+(l<<4));\r
+ _outgtext(ab);\r
}\r
for(int a=0;a<8;++a)\r
{\r
for(int b=0;b<8;++b)\r
{\r
if(SFB8[cp]->lit[lit].lin[a]&(0x80>>b))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(b<<4),32+(a<<4),31+(b<<4),47+(a<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(b<<4),32+(a<<4),31+(b<<4),47+(a<<4));\r
}\r
}\r
if(wys==8)\r
{\r
- setcolor(GREEN);\r
- rectangle(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
}\r
break;\r
}\r
{\r
if(!any)\r
return;\r
- int color;\r
- setcolor(RED);\r
+ short color;\r
+ _setcolor(C_NON);\r
if(byo14[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(16,224,143,447);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16,224,143,447);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,16,224,143,447);\r
return;\r
}\r
char ab[2]="q";\r
if(wys==14)\r
- color=GREEN;\r
+ color=C_SEL;\r
else\r
- color=RED;\r
+ color=C_NON;\r
+ _setfillmask(FULLF);\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(20+(prex<<4),216,ab);\r
+ _moveto(20+(prex<<4),216);\r
+ _outgtext(ab);\r
}\r
if(prey<14)\r
{\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(8,228+(prey<<4),ab);\r
+ _moveto(8,228+(prey<<4));\r
+ _outgtext(ab);\r
}\r
if(SFB14[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(prex<<4),224+(prey<<4),31+(prex<<4),239+(prey<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(prex<<4),224+(prey<<4),31+(prex<<4),239+(prey<<4));\r
}\r
case 1:\r
- setcolor(color);\r
+ _setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(20+(curx<<4),216,ab);\r
+ _moveto(20+(curx<<4),216);\r
+ _outgtext(ab);\r
if(cury<14)\r
{\r
ab[0]=abc[cury];\r
- outtextxy(8,228+(cury<<4),ab);\r
+ _moveto(8,228+(cury<<4));\r
+ _outgtext(ab);\r
if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
if(wys==14)\r
{\r
- setcolor(GREEN);\r
- rectangle(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
}\r
}\r
break;\r
for(int l=0;l<14;++l)\r
{\r
if(l==curx)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
if(l<8)\r
- outtextxy(20+(l<<4),216,ab);\r
+ {\r
+ _moveto(20+(l<<4),216);\r
+ _outgtext(ab);\r
+ }\r
if(l==cury)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
- outtextxy(8,228+(l<<4),ab);\r
+ _moveto(8,228+(l<<4));\r
+ _outgtext(ab);\r
}\r
for(int a=0;a<14;++a)\r
{\r
for(int b=0;b<8;++b)\r
{\r
if(SFB14[cp]->lit[lit].lin[a]&(0x80>>b))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(16+(b<<4),224+(a<<4),31+(b<<4),239+(a<<4)); \r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,16+(b<<4),224+(a<<4),31+(b<<4),239+(a<<4)); \r
}\r
}\r
if(wys==14)\r
{\r
- setcolor(GREEN);\r
- rectangle(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
}\r
break;\r
}\r
{\r
if(!any)\r
return;\r
- int color;\r
- setcolor(RED);\r
+ short color;\r
+ _setcolor(C_NON);\r
if(byo16[cp]==0)\r
{\r
- setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(336,112,463,367);\r
+ _setfillmask(FULLF);\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,336,112,463,367);\r
+ _setfillmask(NOFONT);\r
+ _setcolor(C_NON);\r
+ _rectangle(_GFILLINTERIOR,336,112,463,367);\r
return;\r
}\r
char ab[2]="q";\r
if(wys==16)\r
- color=GREEN;\r
+ color=C_SEL;\r
else\r
- color=RED;\r
+ color=C_NON;\r
+ _setfillmask(FULLF);\r
switch(mode)\r
{\r
case 2:\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(340+(prex<<4),104,ab);\r
+ _moveto(340+(prex<<4),104);\r
+ _outgtext(ab);\r
}\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(328,116+(prey<<4),ab);\r
+ _moveto(328,116+(prey<<4));\r
+ _outgtext(ab);\r
}\r
if(SFB16[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(336+(prex<<4),112+(prey<<4),351+(prex<<4),127+(prey<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,336+(prex<<4),112+(prey<<4),351+(prex<<4),127+(prey<<4));\r
case 1:\r
- setcolor(color);\r
+ _setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(340+(curx<<4),104,ab);\r
+ _moveto(340+(curx<<4),104);\r
+ _outgtext(ab);\r
ab[0]=abc[cury];\r
- outtextxy(328,116+(cury<<4),ab);\r
+ _moveto(328,116+(cury<<4));\r
+ _outgtext(ab);\r
if(SFB16[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4)); \r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4)); \r
if(wys==16)\r
{\r
- setcolor(GREEN);\r
- rectangle(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
}\r
break;\r
case 0:\r
for(int l=0;l<16;++l)\r
{\r
if(l==curx)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
if(l<8)\r
- outtextxy(340+(l<<4),104,ab);\r
+ {\r
+ _moveto(340+(l<<4),104);\r
+ _outgtext(ab);\r
+ }\r
if(l==cury)\r
- setcolor(color);\r
+ _setcolor(color);\r
else\r
- setcolor(RED);\r
+ _setcolor(C_NON);\r
ab[0]=abc[l];\r
- outtextxy(328,116+(l<<4),ab);\r
+ _moveto(328,116+(l<<4));\r
+ _outgtext(ab);\r
}\r
for(int a=0;a<16;++a)\r
{\r
for(int b=0;b<8;++b)\r
{\r
if(SFB16[cp]->lit[lit].lin[a]&(0x80>>b))\r
- {\r
- setcolor(BROWN);\r
- setfillstyle(SOLID_FILL,BROWN);\r
- }\r
+ _setcolor(C_SET);\r
else\r
- {\r
- setcolor(BLACK);\r
- setfillstyle(SOLID_FILL,BLACK);\r
- }\r
- bar(336+(b<<4),112+(a<<4),351+(b<<4),127+(a<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GFILLINTERIOR,336+(b<<4),112+(a<<4),351+(b<<4),127+(a<<4));\r
}\r
}\r
if(wys==16)\r
{\r
- setcolor(GREEN);\r
- rectangle(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
- setcolor(BLACK);\r
- rectangle(337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
+ _setcolor(C_SEL);\r
+ _rectangle(_GBORDER,336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
+ _setcolor(BLACK);\r
+ _rectangle(_GBORDER,337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
}\r
}\r
}\r
{\r
int a;\r
int b;\r
- int c;\r
- int d;\r
- int NT;\r
+ //int c;\r
+ //int d;\r
+ bool NT=false;\r
+ bool CPX=false;\r
\r
CPI=fopen(nazwap,"rb");\r
if(CPI==NULL)\r
{\r
- sprintf(err,"100:No valid file at this path");\r
+ sprintf(err,"100:No valid file at this path\n");\r
return 100;\r
}\r
else\r
FFH=new FontFileHeader;\r
if(!FFH)\r
{\r
- sprintf(err,"116:Not enough memory for FFH");\r
+ sprintf(err,"116:Not enough memory for FFH\n");\r
fclose(CPI);\r
return 116;\r
}\r
fread(FFH,0x19,1,CPI);\r
if(FFH->id0!=0xff)\r
{\r
- sprintf(err,"101:Unsupported format, id0=0x%02x",(short)(FFH->id0&0xff));\r
- fclose(CPI);\r
- deleteCPI(0);\r
- return 101;\r
+ if(FFH->id0==0x81&&FFH->id[0]==0xfc)//maybe it's a CPX?\r
+ {\r
+ fclose(CPI);\r
+ deleteCPI(0);\r
+ status=spawnlp(P_WAIT,"cpx2cpi","cpx2cpi",nazwap,"tempcpi","q",NULL);\r
+ if(status)\r
+ {\r
+ sprintf(err,"101:Unsupported format, id0=0x81\n");\r
+ if (status<3)\r
+ remove("tempcpi");\r
+ return 101;\r
+ }\r
+ CPX=true;\r
+ CPI=fopen("tempcpi","rb");\r
+ if(CPI==NULL)\r
+ {\r
+ sprintf(err,"101:Unsupported format, id0=0x81\n");\r
+ return 101;\r
+ }\r
+ FFH=new FontFileHeader;\r
+ if(!FFH)\r
+ {\r
+ sprintf(err,"116:Not enough memory for FFH\n");\r
+ fclose(CPI);\r
+ remove("tempcpi");\r
+ return 116;\r
+ }\r
+ fread(FFH,0x19,1,CPI);\r
+ if(FFH->id0!=0xff)\r
+ {\r
+ sprintf(err,"101:Unsupported format, id0=0x%02x\n",(short)(FFH->id0&0xff));\r
+ fclose(CPI);\r
+ remove("tempcpi");\r
+ deleteCPI(0);\r
+ return 101;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ sprintf(err,"101:Unsupported format, id0=0x%02x\n",(short)(FFH->id0&0xff));\r
+ fclose(CPI);\r
+ deleteCPI(0);\r
+ return 101;\r
+ }\r
}\r
- if(!strcmp("FONT ",FFH->id))\r
- NT=0;\r
- else if(!strcmp("FONT.NT",FFH->id))\r
+ if(!strcmp("FONT ",(char *)(FFH->id)))\r
+ ;\r
+ else if(!strcmp("FONT.NT",(char *)(FFH->id)))\r
{\r
- NT=1;\r
+ NT=true;\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
+ sprintf(err,"102:Unsupported format, 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
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(0);\r
return 102;\r
}\r
if(FFH->pnum!=1)\r
{\r
- sprintf(err,"103:Wrong no. of pointers (%u)",FFH->pnum);\r
+ sprintf(err,"103:Wrong no. of pointers (%u)\n",FFH->pnum);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(0);\r
return 103;\r
}\r
if(FFH->ptyp!=1)\r
{\r
- sprintf(err,"104:Wrong pointer type, (%u)",(short)(FFH->ptyp&0xff));\r
+ sprintf(err,"104:Wrong pointer type, (%u)\n",(short)(FFH->ptyp&0xff));\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(0);\r
return 104;\r
}\r
FIH=new FontInfoHeader;\r
if(!FIH)\r
{\r
- sprintf(err,"116:Not enough memory for FIH");\r
+ sprintf(err,"116:Not enough memory for FIH\n");\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(0);\r
return 116;\r
}\r
fread(FIH,0x2,1,CPI);\r
if(FIH->num_codepages>16)\r
{\r
- sprintf(err,"105:Too many codepages (%u)",FIH->num_codepages);\r
+ sprintf(err,"105:Too many codepages (%u)\n",FIH->num_codepages);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(1);\r
return 105;\r
}\r
if(FIH->num_codepages==0)\r
{\r
- sprintf(err,"117:No codepages");\r
+ sprintf(err,"117:No codepages\n");\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(1);\r
return 117;\r
}\r
CPEH[a] = new CodePageEntryHeader;\r
if(!CPEH[a])\r
{\r
- sprintf(err,"116:Not enough memory for CPEH[%d]",a);\r
+ sprintf(err,"116:Not enough memory for CPEH[%d]\n",a);\r
+ fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(1);\r
return 116;\r
}\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
+ sprintf(err,"106:Wrong CPEH[%u] size (0x%x)\n",a,CPEH[a]->cpeh_size);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(2,a);\r
return 106;\r
}\r
if(CPEH[a]->device_type!=1)\r
{\r
- sprintf(err,"107:Wrong device type(%u) in CPEH[%u]",CPEH[a]->device_type,a);\r
+ sprintf(err,"107:Wrong device type(%u) in CPEH[%u]\n",CPEH[a]->device_type,a);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(2,a);\r
return 107;\r
}\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
+ sprintf(err,"114:cp%03u (%u) already in CPEH[%u]\n",CPEH[a]->codepage,a,i);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(2,a);\r
return 114;\r
}\r
CPIH[a] = new CodePageInfoHeader;\r
if(!CPIH[a])\r
{\r
- sprintf(err,"116:Not enough memory for CPIH[%d]",a);\r
+ sprintf(err,"116:Not enough memory for CPIH[%d]\n",a);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(2,a);\r
return 116;\r
}\r
fread(CPIH[a],0x6,1,CPI);\r
if(CPIH[a]->version!=1)\r
{\r
- sprintf(err,"108:Wrong version of CPIH[%u] (%u)",a,CPIH[a]->version);\r
+ sprintf(err,"108:Wrong version of CPIH[%u] (%u)\n",a,CPIH[a]->version);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(3,a);\r
return 108;\r
}\r
if(CPIH[a]->num_fonts>3)\r
{\r
- sprintf(err,"109:Too many fonts in CPIH[%u] (%u)",a,CPIH[a]->num_fonts);\r
+ sprintf(err,"109:Too many fonts in CPIH[%u] (%u)\n",a,CPIH[a]->num_fonts);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(3,a);\r
return 109;\r
}\r
if(CPIH[a]->num_fonts==0)\r
{\r
- sprintf(err,"115:No fonts in CPIH[%u])",a);\r
+ sprintf(err,"115:No fonts in CPIH[%u])\n",a);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(3,a);\r
return 115;\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
+ sprintf(err,"116:Not enough memory for SFH[%d][%d]\n",a);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
if(b==0)\r
deleteCPI(3,a);\r
else\r
{\r
if (byo8[a]!=0)\r
{\r
- sprintf(err,"113:Height 8 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
+ sprintf(err,"113:Height 8 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 113;\r
}\r
{\r
if (byo14[a]!=0)\r
{\r
- sprintf(err,"113:Height 14 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
+ sprintf(err,"113:Height 14 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 113;\r
}\r
{\r
if (byo16[a]!=0)\r
{\r
- sprintf(err,"113:Height 16 already in cp%03u (%u;%u)",CPEH[a]->codepage,a,b);\r
+ sprintf(err,"113:Height 16 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 113;\r
}\r
}\r
if(SFH[a][b]->height!=8&&SFH[a][b]->height!=14&&SFH[a][b]->height!=16)\r
{\r
- sprintf(err,"110:Wrong height (%u) in SFH[%u][%u]",(short)(SFH[a][b]->height&0xff),a,b);\r
+ sprintf(err,"110:Wrong height (%u) in SFH[%u][%u]\n",(short)(SFH[a][b]->height&0xff),a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 110;\r
}\r
if(SFH[a][b]->width!=8)\r
{\r
- sprintf(err,"111:Wrong width (%u) in SFH[%u][%u]",(short)(SFH[a][b]->width&0xff),a,b);\r
+ sprintf(err,"111:Wrong width (%u) in SFH[%u][%u]\n",(short)(SFH[a][b]->width&0xff),a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 111;\r
}\r
if(SFH[a][b]->num_chars!=256)\r
{\r
- sprintf(err,"112:Wrong no.of chars(%u)in SFH[%u][%u]",SFH[a][b]->num_chars,a,b);\r
+ sprintf(err,"112:Wrong no.of chars(%u)in SFH[%u][%u]\n",SFH[a][b]->num_chars,a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 112;\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
+ sprintf(err,"116:Not enough memory for SFB16[%d] (%d)\n",a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 116;\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
+ sprintf(err,"116:Not enough memory for SFB14[%d] (%d)\n",a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 116;\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
+ sprintf(err,"116:Not enough memory for SFB8[%d] (%d)\n",a,b);\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
deleteCPI(4,a,b);\r
return 116;\r
}\r
}\r
}\r
fclose(CPI);\r
+ if(CPX)\r
+ remove("tempcpi");\r
offset();\r
return 0;\r
}\r
void otw3()//\r
{\r
- setcolor(RED);\r
- outtextxy(136,472,"load");\r
+ _setcolor(C_NON);\r
+ _moveto(136,472);\r
+ _outgtext("load");\r
deleteCPI();\r
status=otw();\r
while(status!=0)\r
{\r
int a;\r
int b;\r
- int c;\r
- int d;\r
+ //int c;\r
+ //int d;\r
\r
CPI=fopen(nazwap,"wb");\r
if(CPI==NULL)\r
{\r
- sprintf(err,"200:Cannot create file at this path");\r
+ sprintf(err,"200:Cannot create file at this path\n");\r
return 200;\r
}\r
else\r
}\r
}\r
\r
- fprintf(CPI,"\r\nThis file was created with the CPI editor version 1.2b",0x1a);\r
+ fprintf(CPI,"\r\nThis file was created with the CPI editor version 1.3a",0x1a);\r
fclose(CPI);\r
return 0;\r
}\r
void zap3()//\r
{\r
- setcolor(RED);\r
- outtextxy(72,472,"save");\r
+ _setcolor(C_NON);\r
+ _moveto(72,472);\r
+ _outgtext("save");\r
status=zap();\r
while(status!=0)\r
{\r
\r
void use3()///\r
{\r
- setcolor(RED);\r
- outtextxy(72,472,"save use");\r
+ _setcolor(C_NON);\r
+ _moveto(72,472);\r
+ _outgtext("save use");\r
status=zap();\r
while(status!=0)\r
{\r
puts(err);\r
system(err);\r
delay(5000);\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
+ //closegraph();\r
+ //initgraph(&kart16,&tryb16,"");\r
+ _setvideomode(_VRES16COLOR);\r
\r
}\r
redraw();\r
{\r
if(CP==CPEH[i]->codepage&&i!=cp)\r
{\r
- sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]\n",CP,i);\r
return 314;\r
}\r
}\r
}\r
void zmn3()//\r
{\r
- setcolor(RED);\r
- outtextxy(256,472,"number");\r
+ _setcolor(C_NON);\r
+ _moveto(256,472);\r
+ _outgtext("number");\r
status=zmn();\r
if(status!=0)\r
message("Number not changed",err);\r
int newCPI()\r
{\r
short CP,h;\r
- char temp[51];\r
+ //char temp[51];\r
CP=question("First codepage number:");\r
h=question("Initial font height(8,14,16,all)");\r
if(h!=0&&h!=8&&h!=14&&h!=16)\r
{\r
- sprintf(err,"310:Wrong height (%u)",h);\r
+ sprintf(err,"310:Wrong height (%u)\n",h);\r
return 310;\r
}\r
return newCPI2(CP,h);\r
FFH=new FontFileHeader;\r
if(!FFH)\r
{\r
- sprintf(err,"316:Not enough memory for FFH");\r
+ sprintf(err,"316:Not enough memory for FFH\n");\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
+ strcpy((char *)(FFH->id),"FONT ");\r
+ strcpy((char *)(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
+ sprintf(err,"316:Not enough memory for FIH\n");\r
deleteCPI(0);\r
return 316;\r
}\r
}\r
void newCPI3()//\r
{\r
- setcolor(RED);\r
- outtextxy(16,472,"new");\r
+ _setcolor(C_NON);\r
+ _moveto(16,472);\r
+ _outgtext("new");\r
deleteCPI();\r
status=newCPI();\r
while(status!=0)\r
int newCP()\r
{\r
short CP,h;\r
- char temp[51];\r
+ //char temp[51];\r
if(FIH->num_codepages>=16)\r
{\r
- sprintf(err,"305:Already 16 codepages in CPI");\r
+ sprintf(err,"305:Already 16 codepages in CPI\n");\r
return 305;\r
}\r
CP=question("Codepage number:");\r
{\r
if(CP==CPEH[i]->codepage)\r
{\r
- sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]\n",CP,i);\r
return 314;\r
}\r
}\r
h=question("Initial font height(8,14,16,all)");\r
if(h!=0&&h!=8&&h!=14&&h!=16)\r
{\r
- sprintf(err,"310:Wrong height (%u)",h);\r
+ sprintf(err,"310:Wrong height (%u)\n",h);\r
return 310;\r
}\r
return newCP2(CP,h);\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
+ sprintf(err,"316:Not enough memory for CPEH[%d]\n",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
+ sprintf(err,"316:Not enough memory for CPIH[%d]\n",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
+ strcpy((char *)(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
+ strcpy((char *)(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
break;\r
default:\r
- sprintf(err,"510:%u WT*?",h);\r
+ sprintf(err,"510:%u ***?",h);\r
t = 510;\r
}\r
if(t!=0)\r
}\r
void newCP3()//\r
{\r
- setcolor(RED);\r
- outtextxy(400,472,"newCP");\r
+ _setcolor(C_NON);\r
+ _moveto(400,472);\r
+ _outgtext("newCP");\r
status=newCP();\r
if(status!=0)\r
message("Codepage not created",err);\r
short i;\r
if(FIH->num_codepages<=1)\r
{\r
- sprintf(err,"317:Last codepage");\r
+ sprintf(err,"317:Last codepage\n");\r
return 317;\r
}\r
for(i=0;i<CPIH[cp]->num_fonts;++i)\r
}\r
void delCP3()//\r
{\r
- setcolor(RED);\r
- outtextxy(536,472,"delCP");\r
+ _setcolor(C_NON);\r
+ _moveto(536,472);\r
+ _outgtext("delCP");\r
status=delCP();\r
if(status!=0)\r
message("Codepage not deleted",err);\r
short h;\r
if(CPIH[cp]->num_fonts>=3)\r
{\r
- sprintf(err,"309:Already 3 fonts in CPIH[%u]",cp);\r
+ sprintf(err,"309:Already 3 fonts in CPIH[%u]\n",cp);\r
return 309;\r
}\r
h=question("Font height(8,14,16)");\r
case 16:\r
return newF16(cp);\r
default:\r
- sprintf(err,"310:Wrong height (%u)",h);\r
+ sprintf(err,"310:Wrong height (%u)\n",h);\r
return 310;\r
}\r
}\r
void newF3()//\r
{\r
- setcolor(RED);\r
- outtextxy(336,472,"newF");\r
+ _setcolor(C_NON);\r
+ _moveto(336,472);\r
+ _outgtext("newF");\r
status=newF();\r
if(status!=0)\r
message("Font not created",err);\r
{\r
if(byo8[CP])\r
{\r
- sprintf(err,"313:Height 8 already in cp%03u",CPEH[CP]->codepage);\r
+ sprintf(err,"313:Height 8 already in cp%03u\n",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
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]\n",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
+ sprintf(err,"316:Not enough memory for SFB8[%d]\n",CP);\r
delete SFH[CP][CPIH[CP]->num_fonts];\r
SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
return 316;\r
{\r
if(byo14[CP])\r
{\r
- sprintf(err,"313:Height 14 already in cp%03u",CPEH[CP]->codepage);\r
+ sprintf(err,"313:Height 14 already in cp%03u\n",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
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]\n",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
+ sprintf(err,"316:Not enough memory for SFB14[%d]\n",CP);\r
delete SFH[CP][CPIH[CP]->num_fonts];\r
SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
return 316;\r
{\r
if(byo16[CP])\r
{\r
- sprintf(err,"313:Height 16 already in cp%03u",CPEH[CP]->codepage);\r
+ sprintf(err,"313:Height 16 already in cp%03u\n",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
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]\n",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
+ sprintf(err,"316:Not enough memory for SFB16[%d]\n",CP);\r
delete SFH[CP][CPIH[CP]->num_fonts];\r
SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
return 316;\r
ramka16();\r
break;\r
}\r
- cpwys();\r
+ cpwys(1);\r
return;\r
}\r
void nextF()//\r
ramka16();\r
break;\r
}\r
- cpwys();\r
+ cpwys(1);\r
return;\r
}\r
\r
short h;\r
if(CPIH[cp]->num_fonts<=1)\r
{\r
- sprintf(err,"315:Last font in CPIH[%u]",cp);\r
+ sprintf(err,"315:Last font in CPIH[%u]\n",cp);\r
return 315;\r
}\r
for(short i=0;i<CPIH[cp]->num_fonts;++i)\r
case 16:\r
return delF16(h);\r
default:\r
- sprintf(err,"510:%u WT*?",h);\r
+ sprintf(err,"510:%u ***?\n",h);\r
return 510;\r
}\r
}\r
void delF3()//\r
{\r
- setcolor(RED);\r
- outtextxy(472,472,"delF");\r
+ _setcolor(C_NON);\r
+ _moveto(472,472);\r
+ _outgtext("delF");\r
status=delF();\r
if(status!=0)\r
message("Font not deleted",err);\r
SFH[cp][i] = SFH[cp][i+1];\r
}\r
SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
+ sprintf(err,"0:OK\n");\r
return 0;\r
}\r
int delF14(short h)\r
SFH[cp][i] = SFH[cp][i+1];\r
}\r
SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
+ sprintf(err,"0:OK\n");\r
return 0;\r
}\r
int delF16(short h)\r
SFH[cp][i] = SFH[cp][i+1];\r
}\r
SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
+ sprintf(err,"0:OK\n");\r
return 0;\r
}\r
\r
}\r
else\r
any=0;\r
-\r
- status=registerbgidriver(EGAVGA_driver);\r
- if (status < 0)\r
+ if(!_setvideomode(_VRES16COLOR))\r
{\r
- printf("g%d:%s\n",status,grapherrormsg(status));\r
- return status;\r
+ printf("400:Cannot enter graphic mode\n");//change number\r
+ return 400;\r
}\r
- initgraph(&kart16,&tryb16,"");\r
- status=graphresult();\r
- if (status != grOk)\r
- {\r
- printf("g%d:%s\n",status,grapherrormsg(status));\r
- return status;\r
- }\r
-\r
+ _setplotaction(_GPSET); \r
if(byo8[0])\r
wys=8;\r
else if(byo16[0])\r
showMaus();\r
for(;;)\r
{\r
- if(bioskey(_KEYBRD_READY))\r
+ if(/*_bios_keybrd(_KEYBRD_READY)*/kbhit())\r
{\r
- key=bioskey(_KEYBRD_READ);\r
+ key=_bios_keybrd(_KEYBRD_READ);\r
if(maus)\r
hideMaus();\r
if(tab==0)\r
if ((key&0xFF00)==0x4400)\r
{\r
//koniec\r
- setcolor(RED);\r
- outtextxy(616,472,"end");\r
+ _setcolor(C_NON);\r
+ _moveto(616,472);\r
+ _outgtext("end");\r
if(maus)\r
resetMaus();\r
break;\r
}\r
- while(bioskey(_KEYBRD_READY))\r
+ while(kbhit())\r
{\r
- bioskey(_KEYBRD_READ);\r
+ _bios_keybrd(_KEYBRD_READ);\r
}\r
if(maus&&mausv)\r
showMaus();\r
wys=16;\r
cury&=0xf;\r
tab=1;\r
- lit=((mausy-111)/16)*16+((mausx-496)/8);\r
+ lit=((mausy-112)/16)*16+((mausx-496)/8);\r
if (pre==lit)\r
{\r
switch(prew)\r
}\r
}\r
}\r
- \r
+ else if(any&&klik&&!prek&&mausx>=328&&mausx<616&&mausy>=16&&mausy<40)\r
+ {\r
+ int selcp;\r
+ hideMaus();\r
+ mausv=0;\r
+ selcp=(mausx-328)/48+((mausy-16)/8)*6;\r
+ if(selcp<FIH->num_codepages)\r
+ {\r
+ cp=selcp;\r
+ normCP();\r
+ } \r
+ }\r
else if(any&&klik&&!prek&&mausx>=128&&mausx<184&&mausy<8)\r
{\r
hideMaus();\r
{\r
hideMaus();\r
mausv=0;\r
- setcolor(RED);\r
- outtextxy(616,472,"end");\r
+ _setcolor(C_NON);\r
+ _moveto(616,472);\r
+ _outgtext("end");\r
resetMaus();\r
break;\r
}\r
\r
else\r
{\r
- mausv=1;\r
- showMaus();\r
+ //if(!mausv)\r
+ //{\r
+ mausv=1;\r
+ showMaus();\r
+ //}\r
}\r
}\r
}\r
\r
deleteCPI();\r
- closegraph();\r
+ _setvideomode(_DEFAULTMODE); \r
return 0;\r
-}
\ No newline at end of file
+}\r