diff --git a/sdk/src/tools/Bit2Bin.c b/sdk/src/tools/Bit2Bin.c
index e91f162..a70ca5a 100644
--- a/sdk/src/tools/Bit2Bin.c
+++ b/sdk/src/tools/Bit2Bin.c
@@ -1,7 +1,7 @@
/*
* Bit2Bin - strip .bit header and align binary to 16K.
*
- * Copyright (C) 2019-2021 Antonio Villena
+ * Copyright (C) 2019-2023 Antonio Villena
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,24 +14,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * SPDX-FileCopyrightText: Copyright (C) 2019-2021 Antonio Villena
- *
- * SPDX-License-Identifier: GPL-3.0-only
*/
#include
#include
#include
-#include
-#include
-#include
-
#define PROGRAM "Bit2Bin"
#define DESCRIPTION "strip .bit header and align binary to 16K."
-#define VERSION "0.05 (2020-02-19)"
-#define COPYRIGHT "Copyright (C) 2019-2021 Antonio Villena"
+#define VERSION "0.06 (2023-07-26)"
+#define COPYRIGHT "Copyright (C) 2019-2023 Antonio Villena"
#define LICENSE \
"This program is free software: you can redistribute it and/or modify\n" \
"it under the terms of the GNU General Public License as published by\n" \
@@ -96,51 +88,25 @@ int main(int argc, char *argv[]) {
printf("Cannot create output file: %s\n", argv[2]),
exit(-1);
j= i>>14;
- if( j>71 ){
- for ( i= 0; i<72; i++ )
- fread(mem, 1, 0x4000, fi),
- fwrite(mem, 1, 0x4000, fo);
- fclose(fo);
- argv[2][strlen(argv[2])-5]++;
- if(argv[2][strlen(argv[2])-5]==':')
- if(strlen(argv[2])==9)
- argv[2]= "CORE10.ZX3";
- else
- argv[2][4]++,
- argv[2][5]='0';
- fo= fopen(argv[2], "wb+");
- if( !fo )
- printf("Cannot create output file: %s\n", argv[2]),
- exit(-1);
- for ( i= 0; i48 )
+ if( j>48 ) // ZX3
for ( i= 0; i<71-j; i++ )
fwrite(mem, 1, 0x4000, fo);
- else if( j>28 )
+ else if( j>28 ) // ZXD
for ( i= 0; i<48-j; i++ )
fwrite(mem, 1, 0x4000, fo);
- else if( j>20 )
+ else if( j>20 ) // ZX2
for ( i= 0; i<28-j; i++ )
fwrite(mem, 1, 0x4000, fo);
- else
+ else // ZX1
for ( i= 0; i<20-j; i++ )
fwrite(mem, 1, 0x4000, fo);
}
diff --git a/sdk/windows-x86/bin/Bit2Bin.exe b/sdk/windows-x86/bin/Bit2Bin.exe
index b119cdd..e154ea6 100755
Binary files a/sdk/windows-x86/bin/Bit2Bin.exe and b/sdk/windows-x86/bin/Bit2Bin.exe differ
diff --git a/sdk/windows-x86/bin/split.bat b/sdk/windows-x86/bin/split.bat
new file mode 100644
index 0000000..27bcbf0
--- /dev/null
+++ b/sdk/windows-x86/bin/split.bat
@@ -0,0 +1,14 @@
+@echo off
+setlocal
+
+FOR %%A IN (%1) DO set size=%%~zA
+
+fpad 120000 0 padzero.int
+copy /b %1+padzero.int intfile.int
+
+echo %size%
+fcut intfile.int 0 120000 %203.ZX3
+if %size% GTR 1179648 fcut intfile.int 120000 120000 %204.ZX3
+if %size% GTR 2359296 fcut intfile.int 240000 120000 %205.ZX3
+if %size% GTR 3538944 fcut intfile.int 360000 120000 %206.ZX3
+if %size% GTR 4718592 fcut intfile.int 360000 120000 %207.ZX3