1
0
mirror of https://github.com/nzeemin/ukncbtl-utils.git synced 2025-04-18 06:04:02 +03:00

AStyle, .gitignore, README.md

This commit is contained in:
nzeemin 2018-10-26 19:32:49 +03:00
parent 81fcde9afa
commit 81a7b5aae7
10 changed files with 95 additions and 55 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/Debug
/Release
*.sdf
*.opensdf

View File

@ -1,14 +1,16 @@
ESCParser -- command-line utility, ESC/P printer emulator.
The current implementation is very close to **Robotron CM 6329.01M** printer. Also the utility uses the font from the printer ROM to "print" symbols.
ESCParser can produce two output formats:
* PostScript -- with multi-page support. You can use GSView + Ghostscript to view the output and convert it to other formats.
ESCParser can produce several output formats:
* PostScript -- with multi-page support. Use GSView + Ghostscript to view the output and convert it to other formats.
* SVG -- no multi-page support. You can view the result in any modern web browser.
* PDF -- with multi-page support. Use Adobe Acrobat Reader or any modern browser to view the result.
Usage examples:
```
ESCParser -ps printer.log > DOC.ps
ESCParser -svg printer.log > DOC.svg
ESCParser -pdf printer.log > DOC.pdf
```
Test sample with ESCParser produces the following result (converted to PNG):
@ -16,4 +18,5 @@ Test sample with ESCParser produces the following result (converted to PNG):
##### See Also
* [**shokre/node-escprinter**](https://github.com/shokre/node-escprinter) -- NodeJS version by shokre.
* [shokre/node-escprinter](https://github.com/shokre/node-escprinter) -- "ESC/P2 printer command emulator with SVG output.", ESCParser NodeJS conversion by shokre.
* [epsonps](https://github.com/christopherkobayashi/TI99Utilities/tree/master/printer_listener/epsonps)

4
Sav2BkBin/!astyle.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
set ASTYLEEXE=c:\bin\astyle.exe
set ASTYLEOPT=-n -Q --options=..\astyle-cpp-options
%ASTYLEEXE% %ASTYLEOPT% *.cpp

View File

@ -30,77 +30,77 @@ static FILE* outputfile;
void Convert()
{
inputfile = fopen(inputfilename, "rb");
if (inputfile == NULL)
{
printf("Failed to open input file.");
return;
}
inputfile = fopen(inputfilename, "rb");
if (inputfile == NULL)
{
printf("Failed to open input file.");
return;
}
outputfile = fopen(outputfilename, "w+b");
if (outputfile == NULL)
{
printf("Failed to open output file.");
return;
}
outputfile = fopen(outputfilename, "w+b");
if (outputfile == NULL)
{
printf("Failed to open output file.");
return;
}
void * pHeader = calloc(512, 1);
void * pHeader = calloc(512, 1);
size_t bytesread = fread(pHeader, 1, 512, inputfile);
if (bytesread != 512)
{
printf("Failed to read the header.");
return;
}
size_t bytesread = fread(pHeader, 1, 512, inputfile);
if (bytesread != 512)
{
printf("Failed to read the header.");
return;
}
WORD baseAddress = *(((WORD*)pHeader) + 040 / 2);
WORD lastAddress = *(((WORD*)pHeader) + 050 / 2);
WORD dataSize = lastAddress + 2 - 01000;
WORD baseAddress = *(((WORD*)pHeader) + 040 / 2);
WORD lastAddress = *(((WORD*)pHeader) + 050 / 2);
WORD dataSize = lastAddress + 2 - 01000;
free(pHeader);
free(pHeader);
void * pData = calloc(dataSize, 1);
void * pData = calloc(dataSize, 1);
bytesread = fread(pData, 1, dataSize, inputfile);
if (bytesread != dataSize)
{
printf("Failed to read the data.");
return;
}
bytesread = fread(pData, 1, dataSize, inputfile);
if (bytesread != dataSize)
{
printf("Failed to read the data.");
return;
}
dataSize += 24 * 2; // for auto-start header
dataSize += 24 * 2; // for auto-start header
WORD autoStartBaseAddress = 000720;
fwrite(&autoStartBaseAddress, 1, 2, outputfile);
fwrite(&dataSize, 1, 2, outputfile);
WORD autoStartBaseAddress = 000720;
fwrite(&autoStartBaseAddress, 1, 2, outputfile);
fwrite(&dataSize, 1, 2, outputfile);
for (int i = 0; i < 24; i++) // write auto-start header
{
fwrite(&baseAddress, 1, 2, outputfile);
}
for (int i = 0; i < 24; i++) // write auto-start header
{
fwrite(&baseAddress, 1, 2, outputfile);
}
fwrite(pData, 1, dataSize, outputfile);
fwrite(pData, 1, dataSize, outputfile);
free(pData);
free(pData);
fclose(inputfile);
fclose(inputfile);
}
int main(int argc, char* argv[])
{
if (argc < 3)
{
printf("Usage: sav2bkbin <inputfile.SAV> <outputfile.BIN>");
return 255;
}
if (argc < 3)
{
printf("Usage: sav2bkbin <inputfile.SAV> <outputfile.BIN>");
return 255;
}
strcpy(inputfilename, argv[1]);
strcpy(outputfilename, argv[2]);
strcpy(inputfilename, argv[1]);
strcpy(outputfilename, argv[2]);
printf("Input:\t\t%s\n", inputfilename);
printf("Output:\t\t%s\n", outputfilename);
printf("Input:\t\t%s\n", inputfilename);
printf("Output:\t\t%s\n", outputfilename);
Convert();
Convert();
return 0;
return 0;
}

View File

@ -0,0 +1,4 @@
@echo off
set ASTYLEEXE=c:\bin\astyle.exe
set ASTYLEOPT=-n -Q --options=..\astyle-cpp-options
%ASTYLEEXE% %ASTYLEOPT% *.cpp

4
UkncComSender/README.md Normal file
View File

@ -0,0 +1,4 @@
## UkncComSender
Experimental utility, sends RT11 SAV files to UKNC using serial port.
![](https://github.com/nzeemin/ukncbtl-util/blob/master/UkncComSender/UkncComSender-20111105.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

4
sav2wav/!astyle.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
set ASTYLEEXE=c:\bin\astyle.exe
set ASTYLEOPT=-n -Q --options=..\astyle-cpp-options
%ASTYLEEXE% %ASTYLEOPT% *.cpp

10
sav2wav/.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
/Debug
/Release
/*.ncb
/*.suo
*.user
/ipch
*.sdf
*.opensdf
*.SAV
*.WAV

7
sav2wav/README.md Normal file
View File

@ -0,0 +1,7 @@
## sav2wav
Command-line utility used to convert RT-11 SAV files to bootable WAV-files for UKNC machine.
Originally written by Alexander Alexandrow aka BYTEMAN on Delphi 7.
Converted from Delphi 7 to C++ by Nikita Zimin.
Usage: `sav2wav <inputfile.SAV> <outputfile.WAV>`