From 036c2bfe2212cef0bc6c7eef0b51cd11cb85045a Mon Sep 17 00:00:00 2001 From: b Date: Sat, 3 Aug 2013 23:49:00 +0200 Subject: [PATCH] - Dialog boxes can now cancelled with Esc or empty string - Added warnings before deleting a font, a codepage or closing the program when a file is open --- appinfo/cpied.lsm | 14 ++ {DOC => doc/cpied}/COPYING.TXT | 0 {DOC => doc/cpied}/readthis.txt | 51 ++-- {SRC => source/cpied}/CPIED.CPP | 360 +++++++++++++++++++---------- {SRC => source/cpied}/cpitrick.asm | 0 {SRC => source/cpied}/cpx2cpi.c | 10 +- {SRC => source/cpied}/makefile | 0 7 files changed, 297 insertions(+), 138 deletions(-) create mode 100644 appinfo/cpied.lsm rename {DOC => doc/cpied}/COPYING.TXT (100%) rename {DOC => doc/cpied}/readthis.txt (87%) rename {SRC => source/cpied}/CPIED.CPP (86%) rename {SRC => source/cpied}/cpitrick.asm (100%) rename {SRC => source/cpied}/cpx2cpi.c (92%) rename {SRC => source/cpied}/makefile (100%) diff --git a/appinfo/cpied.lsm b/appinfo/cpied.lsm new file mode 100644 index 0000000..9d9f3ce --- /dev/null +++ b/appinfo/cpied.lsm @@ -0,0 +1,14 @@ +Begin3 +Title: cpied +Version: 1.3a +Entered-date: 2013-08-01 +Description: a GUI-driven CPI font editor +Keywords: cpi,cpx,font,editor +Author: Balthasar Szczepanski +Maintained-by: - +Primary-site: http://baltixy.w.interia.pl/cpied/index.htm +Alternate-site: - +Original-site: - +Platforms: DOS +Copying-policy: GNU/GPL +End diff --git a/DOC/COPYING.TXT b/doc/cpied/COPYING.TXT similarity index 100% rename from DOC/COPYING.TXT rename to doc/cpied/COPYING.TXT diff --git a/DOC/readthis.txt b/doc/cpied/readthis.txt similarity index 87% rename from DOC/readthis.txt rename to doc/cpied/readthis.txt index 6ebb290..cdd4a2a 100644 --- a/DOC/readthis.txt +++ b/doc/cpied/readthis.txt @@ -3,11 +3,11 @@ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ Û Û ÛÛ ÛÛÛÛÛ ÛÛ ÛÛÛÛ ÛÛ ÛÛ Û Û -ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛ Û ÛÛ A +ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛ Û ÛÛ B ÛÛ ÛÛ ÛÛ ÛÛ ÛÛ Û ÛÛ ÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛ Balthasar Szczepaäski - CPIED 1.3a - the CPI editor + CPIED 1.3b - the CPI editor ============================================================ @@ -53,7 +53,9 @@ Windows*** operating system or a DOS emulator****. MS-DOS 7.1 - no problems FreeDOS 1.0 - no problems FreeDOS 1.1 - no problems - PTS-DOS 6.8 - a small display error in dialog boxes + PTS-DOS 6.8 - no problems, but in "safe mode" there is a + small display bug and cpx2cpi crashes the + system ***The program should run without problems on any DOS-based version of Windows. It was tested on following systems: @@ -77,7 +79,9 @@ There can be problems in NT-based versions of windows: were no problems. The previous version of the program (1.0) does not run on DOSBox 0.63. No other emulators were tested. -cpx2cpi was not tested on those systems yet! +The program is not tested on all of the systemsafter every +update! + ============================================================ 3. Features and limitations @@ -121,10 +125,10 @@ The following actions can be performed: *4 a CPI file is saved and used as a parameter to the DOS "mode" command which loads a codepage into the video card memory: - - mode con:cp prep=((number) path) - mode con:cp sel=number - + + mode con:cp prep=((number) path) + mode con:cp sel=number + This will not work if mode.com or display.sys are not installed on the system. It will also not work on Windows XP or newer or DOS 3.3. DOS will not be able to @@ -167,6 +171,12 @@ previous font Home right click the "8x__" text *The function of arrow keys is changed with Tab. +Dialog boxes: + Some actions require user input. Type your answer and + press Enter. To cancel press Esc or leave an empty string. + When asked for a number everything that is not a number + will become 0. + Command line: cpied [cpifile] - edir cpi or cpx files @@ -174,8 +184,8 @@ cpied [cpifile] - edir cpi or cpx files cpx2cpi cpxfile cpifile [q] - convert cpx to cpi cpxfile - input file, cpx - cpxfile - output file, cpi - q - no console output + cpxfile - output file, cpi + q - no console output ============================================================ @@ -222,24 +232,29 @@ beta: - Added a list of codepages which is also clickable - Removed dependancy on Borland's EGAVGA driver: Code ported to Open Watcom, Borland's graphic functions - replaced with Open Watcom's equivalents - + replaced with Open Watcom's equivalents +1.3b + - Dialog boxes can now cancelled with Esc or empty string + - Added warnings before deleting a font, a codepage or + closing the program when a file is open + ============================================================ 6. Planned features - - Saving FONT.NT files + - Saving CPX files - Exporting codepages to CP files - Importing codepages from CP flies - Exporting fonts to bitmaps - Importing fonts from bitmaps - - Warnings ============================================================ 7. Known bugs -Dialog boxes need improving. +Filename is not checked for reserved symbols + +Coordinates of a deleted font are sometimes displayed. ============================================================ @@ -249,10 +264,10 @@ Compiling: Requirements: cpx2cpi: - NASM - Turbo C + ASM + Turbo C cpied: - Open Watcom + Open Watcom The makefile should be processed by a make program. I used Borland's make, the real-mode version, makeR. Open diff --git a/SRC/CPIED.CPP b/source/cpied/CPIED.CPP similarity index 86% rename from SRC/CPIED.CPP rename to source/cpied/CPIED.CPP index 82f8859..4f1d637 100644 --- a/SRC/CPIED.CPP +++ b/source/cpied/CPIED.CPP @@ -1,4 +1,4 @@ - //CPIED version 1.3a + //CPIED version 1.3b // Balthasar Szczepaäski Copyright 2013 // // This file is part of CPIED @@ -197,10 +197,10 @@ void menu8 (); void cpwys (int mode=0); void redraw(); -void displayDialog(int color, char *text, int type=0); -int message (char *text, char *value, int type=1); -void question (char *text, char *result); -unsigned question (char *text); +void displayDialog(int color, char *text, int type=0); +int message (char *text, char *value, int type=1); +unsigned question (char *text, char *result); +unsigned question (char *text, unsigned *result); void ramka8 (); void ramka14(); @@ -250,6 +250,7 @@ void nextCP(); void prevCP(); int delCP (); +int delCP2(); void delCP3(); int newF (); @@ -263,7 +264,8 @@ void prevF(); void nextF(); int delF (); -void delF3(); +int delF2 (); +void delF3 (); int delF8 (short h); int delF14(short h); int delF16(short h); @@ -350,7 +352,7 @@ void new8() _clearscreen(_GCLEARSCREEN); _setcolor(C_SEL); _moveto(0,0); - _outgtext("CPIED 1.3a±"); + _outgtext("CPIED 1.3b±"); _moveto(0,8); _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±"); } @@ -462,23 +464,27 @@ void displayDialog(int color,char *text,int type) _outgtext("± ±"); _moveto(152,200); _outgtext("± ±"); + _moveto(152,208); switch(type) { + case 3: + _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±y/n±"); + break; case 2: - _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±"); + _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±"); break; case 1: - _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±"); + _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±"); break; case 0: default: - _moveto(152,208);_outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±"); + _outgtext("±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±"); break; } } int message(char *text, char *value, int type) { - if (type!=2) + if (type<2) { displayDialog(C_SET,text,1); printf("%s",value); @@ -487,29 +493,61 @@ int message(char *text, char *value, int type) } else { - displayDialog(C_SET,text,2); + displayDialog(C_SET,text,type); printf("%s",value); unsigned short a; for(;;) { a=_bios_keybrd(_KEYBRD_READ); - if((a&0xFF)==0x59||(a&0xFF)==0x79) + if((a&0xFF)==0x59||(a&0xFF)==0x79)//y return 0; - if((a&0xFF)==0x4e||(a&0xff)==0x6e) + if((a&0xFF)==0x4e||(a&0xff)==0x6e)//n return 1; } } } -inline void question(char *text, char *result) +unsigned question(char *text, char *result) { + unsigned short p=0; displayDialog(C_SEL,text); - scanf("%s",result); + for(;;) + { + key=_bios_keybrd(_KEYBRD_READ); + switch(key&0xFF00) + { + case 0x0100: //esc + return 1; + case 0x1c00: //enter + if(!p) + return 1; + result[p]=0; + return 0; + case 0x0e00: //backspace + if(p) + { + putch(8); + putch(32); + putch(8); + --p; + } + break; + default: + if(key&=0x00FF) + { + result[p++]=key; + putch(key); + } + } + } } -inline unsigned question(char *text) +unsigned question(char *text, unsigned short *result) { char temp[256]; - question(text,temp); - return atoi(temp); + unsigned st; + st=question(text,temp); + if(!st) + *result=atoi(temp); + return st; } void ramka8() @@ -1264,7 +1302,9 @@ inline void ent16() int otw() { - question("Filename",nazwap); + if(question("Filename",nazwap)==1) + return 1; + //deleteCPI(); return otw2(); } int otw2() @@ -1282,9 +1322,7 @@ int otw2() sprintf(err,"100:No valid file at this path\n"); return 100; } - else - sprintf(err,"OK"); - + deleteCPI(); FFH=new FontFileHeader; if(!FFH) { @@ -1295,7 +1333,7 @@ int otw2() fread(FFH,0x19,1,CPI); if(FFH->id0!=0xff) { - if(FFH->id0==0x81&&FFH->id[0]==0xfc)//maybe it's a CPX? + if(FFH->id0==0x81&&FFH->id[0]==0xfc)//Looks like a CPX { fclose(CPI); deleteCPI(0); @@ -1439,7 +1477,7 @@ int otw2() } if(CPEH[a]->device_type!=1) { - sprintf(err,"107:Wrong device type(%u) in CPEH[%u]\n",CPEH[a]->device_type,a); + sprintf(err,"107:Wrong device type(%u) in cp%03u\n",CPEH[a]->device_type,CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1450,7 +1488,7 @@ int otw2() { if(CPEH[a]->codepage==CPEH[i]->codepage) { - sprintf(err,"114:cp%03u (%u) already in CPEH[%u]\n",CPEH[a]->codepage,a,i); + sprintf(err,"114:cp%03u duplicated in this CPI\n",CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1482,7 +1520,7 @@ int otw2() } if(CPIH[a]->num_fonts>3) { - sprintf(err,"109:Too many fonts in CPIH[%u] (%u)\n",a,CPIH[a]->num_fonts); + sprintf(err,"109:Too many fonts in cp%03u (%u)\n",CPEH[a]->codepage,CPIH[a]->num_fonts); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1491,7 +1529,7 @@ int otw2() } if(CPIH[a]->num_fonts==0) { - sprintf(err,"115:No fonts in CPIH[%u])\n",a); + sprintf(err,"115:No fonts in cp%03u\n",CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1519,7 +1557,7 @@ int otw2() { if (byo8[a]!=0) { - sprintf(err,"113:Height 8 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b); + sprintf(err,"113:Height 8 duplicated in cp%03u\n",CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1532,7 +1570,7 @@ int otw2() { if (byo14[a]!=0) { - sprintf(err,"113:Height 14 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b); + sprintf(err,"113:Height 14 duplicated in cp%03u\n",CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1545,7 +1583,7 @@ int otw2() { if (byo16[a]!=0) { - sprintf(err,"113:Height 16 already in cp%03u (%u;%u)\n",CPEH[a]->codepage,a,b); + sprintf(err,"113:Height 16 duplicated in cp%03u\n",CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1556,7 +1594,7 @@ int otw2() } if(SFH[a][b]->height!=8&&SFH[a][b]->height!=14&&SFH[a][b]->height!=16) { - sprintf(err,"110:Wrong height (%u) in SFH[%u][%u]\n",(short)(SFH[a][b]->height&0xff),a,b); + sprintf(err,"110:Wrong height (%u) in cp%03u\n",(short)(SFH[a][b]->height&0xff),CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1565,7 +1603,7 @@ int otw2() } if(SFH[a][b]->width!=8) { - sprintf(err,"111:Wrong width (%u) in SFH[%u][%u]\n",(short)(SFH[a][b]->width&0xff),a,b); + sprintf(err,"111:Wrong width (%u) in cp%03u\n",(short)(SFH[a][b]->width&0xff),CPEH[a]->codepage); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1574,7 +1612,7 @@ int otw2() } if(SFH[a][b]->num_chars!=256) { - sprintf(err,"112:Wrong no.of chars(%u)in SFH[%u][%u]\n",SFH[a][b]->num_chars,a,b); + sprintf(err,"112:Wrong no.of chars(%u)in cp%03ux%02u\n",SFH[a][b]->num_chars,CPEH[a]->codepage,SFH[a][b]->height); fclose(CPI); if(CPX) remove("tempcpi"); @@ -1636,29 +1674,37 @@ void otw3()// _setcolor(C_NON); _moveto(136,472); _outgtext("load"); - deleteCPI(); status=otw(); - while(status!=0) + switch(status) { - if (message("CPI file not loaded",err,2)==0) - status=otw(); - else - break; + case 100: //not loaded but nothing is lost + message("CPI file not loaded",err); + case 1: //cancelled + redraw(); + return; + case 0: //success + any=1; + cp=0; + if(byo8[0]) + wys=8; + else if(byo16[0]) + wys=16; + else if(byo14[0]) + wys=14; + redraw(); + return; + default: //fail + message("CPI file not loaded",err); + any=0; + redraw(); + return; } - any=!status; - cp=0; - if(byo8[0]) - wys=8; - else if(byo16[0]) - wys=16; - else if(byo14[0]) - wys=14; - redraw(); } int zap() { - question("Filename",nazwap); + if(question("Filename",nazwap)==1) + return 1; return zap2(); } int zap2() @@ -1707,7 +1753,7 @@ int zap2() } } - fprintf(CPI,"\r\nThis file was created with the CPI editor version 1.3a",0x1a); + fprintf(CPI,"\r\nThis file was created with the CPI editor version 1.3b",0x1a); fclose(CPI); return 0; } @@ -1717,39 +1763,30 @@ void zap3()// _moveto(72,472); _outgtext("save"); status=zap(); - while(status!=0) - { - if (message("CPI file not saved",err,2)==0) - status=zap(); - else - break; - } + if(status>1) + message("CPI file not saved",err); redraw(); return; } -void use3()/// +void use3()///needs to be improved { _setcolor(C_NON); _moveto(72,472); _outgtext("save use"); status=zap(); - while(status!=0) - { - if (message("CPI file not saved",err,2)==0) - status=zap(); - else - break; - } + if(status>1) + message("CPI file not saved",err); if(status==0) { + _setvideomode(_DEFAULTMODE); sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap); puts(err); system(err); sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage); puts(err); system(err); - delay(5000); + //delay(5000); //closegraph(); //initgraph(&kart16,&tryb16,""); _setvideomode(_VRES16COLOR); @@ -1761,13 +1798,14 @@ void use3()/// int zmn() { - short CP; - CP=question("Codepage number"); + unsigned short CP; + if(question("Codepage number",&CP)==1) + return 1; for(short i=0;inum_codepages;++i) { if(CP==CPEH[i]->codepage&&i!=cp) { - sprintf(err,"314:cp%03u already in CPEH[%u]\n",CP,i); + sprintf(err,"314:cp%03u already in this CPI\n",CP); return 314; } } @@ -1780,17 +1818,19 @@ void zmn3()// _moveto(256,472); _outgtext("number"); status=zmn(); - if(status!=0) + if(status>1) message("Number not changed",err); redraw(); } int newCPI() { - short CP,h; + unsigned short CP,h; //char temp[51]; - CP=question("First codepage number:"); - h=question("Initial font height(8,14,16,all)"); + if(question("First codepage number:",&CP)==1) + return 1; + if(question("Initial font height(8,14,16,all)",&h)==1) + return 1; if(h!=0&&h!=8&&h!=14&&h!=16) { sprintf(err,"310:Wrong height (%u)\n",h); @@ -1801,6 +1841,7 @@ int newCPI() int newCPI2(short CP, short h) { int t; + deleteCPI(); FFH=new FontFileHeader; if(!FFH) { @@ -1834,18 +1875,16 @@ void newCPI3()// _setcolor(C_NON); _moveto(16,472); _outgtext("new"); - deleteCPI(); status=newCPI(); - while(status!=0) - { - if (message("CPI not created",err,2)==0) - status=newCPI(); - else - break; - } - any=!status; - if(any) + switch(status) { + case 310: //not created but nothing is lost + message("CPI not created",err); + case 1: //cancelled + redraw(); + return; + case 0: //success + any=1; strcpy(nazwap,"new CPI"); cp=0; if(byo8[0]) @@ -1855,8 +1894,14 @@ void newCPI3()// else if(byo14[0]) wys=14; cury&=7; + redraw(); + return; + default: //fail + message("CPI not created",err); + any=0; + redraw(); + return; } - redraw(); } void deleteCPI(short st,short a,short b) @@ -1961,23 +2006,25 @@ void deleteCPI(short st,short a,short b) int newCP() { - short CP,h; + unsigned short CP,h; //char temp[51]; if(FIH->num_codepages>=16) { - sprintf(err,"305:Already 16 codepages in CPI\n"); + sprintf(err,"305:Already 16 codepages in this CPI\n"); return 305; } - CP=question("Codepage number:"); + if(question("Codepage number:",&CP)==1) + return 1; for(short i=0;inum_codepages;++i) { if(CP==CPEH[i]->codepage) { - sprintf(err,"314:cp%03u already in CPEH[%u]\n",CP,i); + sprintf(err,"314:cp%03u already in this CPI\n",CP); return 314; } } - h=question("Initial font height(8,14,16,all)"); + if(question("Initial font height(8,14,16,all)",&h)==1) + return 1; if(h!=0&&h!=8&&h!=14&&h!=16) { sprintf(err,"310:Wrong height (%u)\n",h); @@ -2071,16 +2118,28 @@ void newCP3()// _moveto(400,472); _outgtext("newCP"); status=newCP(); - if(status!=0) + switch(status) + { + case 305: + case 310: + case 314: message("Codepage not created",err); - else + case 1: + redraw(); + return; + case 0: cp=FIH->num_codepages-1; - offset(); - new8(); - menu8(); - - normCP(); - return; + offset(); + new8(); + menu8(); + normCP(); + return; + default: + message("Codepage not created",err); + offset(); + redraw(); + return; + } } void normCP()// @@ -2138,14 +2197,22 @@ void prevCP()// return; } -int delCP() +int delCP() { - short i; + char temp[41]; if(FIH->num_codepages<=1) { sprintf(err,"317:Last codepage\n"); return 317; } + sprintf(temp,"Delete cp%03u?\n",CPEH[cp]->codepage); + if(message("WARNING",temp,3)==1) + return 1; + return delCP2(); +} +int delCP2() +{ + short i; for(i=0;inum_fonts;++i) { switch(SFH[cp][i]->height) @@ -2201,8 +2268,13 @@ void delCP3()// _moveto(536,472); _outgtext("delCP"); status=delCP(); - if(status!=0) - message("Codepage not deleted",err); + if(status) + { + if(status>1) + message("Codepage not deleted",err); + redraw(); + return; + } offset(); cp%=FIH->num_codepages; new8(); @@ -2213,20 +2285,21 @@ void delCP3()// int newF() { - short h; + unsigned short h; if(CPIH[cp]->num_fonts>=3) { - sprintf(err,"309:Already 3 fonts in CPIH[%u]\n",cp); + sprintf(err,"309:Already 3 fonts in cp%03u\n",CPEH[cp]->codepage); return 309; } - h=question("Font height(8,14,16)"); + if(question("Font height(8,14,16)",&h)==1) + return 1; return newF2(h); } int newF2(short h) { switch(h) { - case 8: + case 8: return newF8(cp); case 14: return newF14(cp); @@ -2243,11 +2316,25 @@ void newF3()// _moveto(336,472); _outgtext("newF"); status=newF(); - if(status!=0) + switch(status) + { + case 309: + case 310: + case 313: message("Font not created",err); - offset(); - redraw(); - return; + case 1: + redraw(); + return; + case 0: + offset(); + redraw(); + return; + default: + message("Font not created",err); + offset(); + redraw(); + return; + } } int newF8(short CP) { @@ -2485,12 +2572,21 @@ void nextF()// int delF() { - short h; + char temp[41]; if(CPIH[cp]->num_fonts<=1) { - sprintf(err,"315:Last font in CPIH[%u]\n",cp); + sprintf(err,"315:Last font in cp%03u\n",CPEH[cp]->codepage); return 315; } + sprintf(temp,"Delete 8x%02u in cp%03u?\n",wys,CPEH[cp]->codepage); + if(message("WARNING",temp,3)==1) + return 1; + return delF2(); +} +int delF2() +{ + short h; + for(short i=0;inum_fonts;++i) { if(SFH[cp][i]->height==wys) @@ -2518,8 +2614,13 @@ void delF3()// _moveto(472,472); _outgtext("delF"); status=delF(); - if(status!=0) - message("Font not deleted",err); + if(status) + { + if(status>1) + message("Font not deleted",err); + redraw(); + return; + } offset(); new8(); menu8(); @@ -2932,9 +3033,20 @@ int main(int argc,char* argv[]) _setcolor(C_NON); _moveto(616,472); _outgtext("end"); - if(maus) - resetMaus(); - break; + if(!any) + { + if(maus) + resetMaus(); + break; + } + else if(!message("WARNING","A CPI is open; continue anyway?\n",3)) + { + if(maus) + resetMaus(); + break; + } + else + redraw(); } while(kbhit()) { @@ -3478,8 +3590,18 @@ int main(int argc,char* argv[]) _setcolor(C_NON); _moveto(616,472); _outgtext("end"); - resetMaus(); - break; + if(!any) + { + resetMaus(); + break; + } + else if(!message("WARNING","A CPI is open; continue anyway?\n",3)) + { + resetMaus(); + break; + } + else + redraw(); } else diff --git a/SRC/cpitrick.asm b/source/cpied/cpitrick.asm similarity index 100% rename from SRC/cpitrick.asm rename to source/cpied/cpitrick.asm diff --git a/SRC/cpx2cpi.c b/source/cpied/cpx2cpi.c similarity index 92% rename from SRC/cpx2cpi.c rename to source/cpied/cpx2cpi.c index e8cfe14..21e8060 100644 --- a/SRC/cpx2cpi.c +++ b/source/cpied/cpx2cpi.c @@ -98,7 +98,8 @@ int main(int argc,char* argv[]) } /* we do NOT free malloced buf later - happens on exit anyway. */ - + //Not so sure about that, got memory errors from command.com + /** Read the buffer **/ /* if memory model is TINY (.com file), we need our */ @@ -114,6 +115,7 @@ int main(int argc,char* argv[]) if(con) printf("%s read error, code %u.\n",argv[1], r.x.ax); close (cpf); + farfree(buf); return 6; } @@ -128,6 +130,7 @@ int main(int argc,char* argv[]) { if(con) puts("Not a CPI or CPX"); + farfree(buf); return 5; } else if (m == 1) @@ -139,6 +142,7 @@ int main(int argc,char* argv[]) if(con) printf("%s is already a CPI\n",argv[1]); close (cpf); + farfree(buf); return 4; } //create the cpi @@ -146,6 +150,7 @@ int main(int argc,char* argv[]) { if(con) printf("could not create %s\n",argv[2]); + farfree(buf); return 3; } close (cpf); @@ -154,6 +159,7 @@ int main(int argc,char* argv[]) { if(con) printf("could not open %s\n",argv[2]); + farfree(buf); return 2; } sregs.ds = FP_SEG(buf); @@ -166,11 +172,13 @@ int main(int argc,char* argv[]) { if(con) printf("%s write error, code %u.\n",argv[2], r.x.ax); + farfree(buf); close (cpf); return 1; } close (cpf); if(con) printf("%s converted to %s\n",argv[1],argv[2]); + farfree(buf); return 0; } diff --git a/SRC/makefile b/source/cpied/makefile similarity index 100% rename from SRC/makefile rename to source/cpied/makefile -- 2.30.2