pelrun / dsk2cdt2disc Goto Github PK
View Code? Open in Web Editor NEWConvert CPC DSK files to a tape image that will rebuild the disc when loaded.
Convert CPC DSK files to a tape image that will rebuild the disc when loaded.
When I create a tape image for Pinball Dreams, the resulting tape causes a write error on track 2. A similar problem occurs on both sides of the disk. I have reproduced this problem in an emulator for the screenshot attached, to demonstrate that it is not an issue with my physical disk or drive. I am using version 2020.2
Warning when compiling.
Compiling ./dsk2cdt-src/cdt.c
In file included from ./dsk2cdt-src/cdt.c:21:0:
./2cdt/src/2cdt.c: In function 'main_2cdt':
./2cdt/src/2cdt.c:1112:33: warning: passing argument 2 of 'ArgumentList_Execute' from incompatible pointer type [-Wincompatible-pointer-types]
if (ArgumentList_Execute(argc, argv, OptionTable, printf, NonOptionHandler)==OPTION_OK)
^
In file included from ./2cdt/src/2cdt.c:34:0,
from ./dsk2cdt-src/cdt.c:21:
./2cdt/src/opth.h:62:5: note: expected 'const char **' but argument is of type 'char **'
int ArgumentList_Execute(const int argc, const char **argv,OPTION *pOptionTable, ERROR_FUNCTION pOutputError, int (*pNonOptionHandler)(c
^
Will offer pull request.
If CALLBCA1 fails with a read error, it isn't being passed back to BASIC and exomizer then crashes the machine.
Return CALLBCA1's return value in another parameter and handle as appropriate.
The extended dsk specification says the track size table in the DIB should be uint16_t, but I've now seen multiple images where the table is uint8_t instead and storing the high byte only.
Looks like we get the format GAP#3 in the disk image. I'm setting both to this value, but the read/write value appears to normally be about half the format one. (42 for a format GAP#3 of 80/82).
That means there's probably a risk of overwriting the ID of a following sector. Easiest fix is just to set the default write GAP#3 value when we get an expected format one; the trick is figuring out what behaviour to use in the other cases. Pinball Dreams, which triggered this in the first place, seems to use 42 for the format gap!
Need to find some weird formats (Bigbonzo's worth a look) to test against.
Dsk2cdt depends on loader.txt having dos line endings (crlf) to build properly. A build on a unix system will produce CDTs that throw "Line too long" errors on the CPC when used.
Running unix2dos on loader.txt will work around the issue.
src/readme.txt reads:
Download exomizer and 2cdt and extract somewhere
Edit Makefile and change EXOMIZER_PATH and 2CDT_PATH
to point to the appropriate directories
This is insufficient. Makefile assumes availability of a Z80 assembler named z80-unknown-coff-as
.
z80-unknown-coff-as ./dsk2cdt-src/rsx.s -o rsx.o
make: z80-unknown-coff-as: Command not found
Makefile:26: recipe for target 'rsx.bin' failed
make: *** [rsx.bin] Error 127
make: Target 'dsk2cdt' not remade because of errors.
This is locally fixed on Debian and Ubuntu by installing package z80-binutils
.
This very bug can be fixed by updating the build instructions.
Not enough time left between blocks if run without remote control or a cdt player that pauses between them. Gotta give enough time to write the track without missing the start of the next block on the tape.
Hello.
Building dsk2cdt2disc fails with several undeclared identifiers.
Observed on Ubuntu 16.04 AMD64.
First error :
./dsk2cdt-src/loader.h:43:28: error: '_binary_rsx_bin_start' undeclared (first use in this function)
Run the attached straightforward script build_dsk2cdt2disc.sh.txt
Produces something executable, no error.
(... lines showing fetching dependencies and launching compilation ...)
make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
+ make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
Compiling ./dsk2cdt-src/dsk2cdt.c
In file included from ./dsk2cdt-src/dsk2cdt.c:16:0:
./dsk2cdt-src/dsk2cdt.c: In function 'main':
./dsk2cdt-src/loader.h:43:28: error: '_binary_rsx_bin_start' undeclared (first use in this function)
#define rsx_bin_start _binary_rsx_bin_start
^
./dsk2cdt-src/dsk2cdt.c:194:28: note: in expansion of macro 'rsx_bin_start'
CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
^
./dsk2cdt-src/loader.h:43:28: note: each undeclared identifier is reported only once for each function it appears in
#define rsx_bin_start _binary_rsx_bin_start
^
./dsk2cdt-src/dsk2cdt.c:194:28: note: in expansion of macro 'rsx_bin_start'
CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
^
./dsk2cdt-src/loader.h:45:28: error: '_binary_rsx_bin_size' undeclared (first use in this function)
#define rsx_bin_size _binary_rsx_bin_size
^
./dsk2cdt-src/dsk2cdt.c:194:51: note: in expansion of macro 'rsx_bin_size'
CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
^
./dsk2cdt-src/dsk2cdt.c:122:3: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
fread(dib, 0x100, 1, fin);
^
./dsk2cdt-src/dsk2cdt.c:144:7: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
fread(track, tracksize, 1, fin);
^
Makefile:31: recipe for target 'dsk2cdt.o' failed
make: *** [dsk2cdt.o] Error 1
Script content:
#!/bin/bash
set -euxv
export LC_ALL=C
rm -rf temp_build_area
mkdir temp_build_area
cd temp_build_area
wget -S http://cpctech.cpc-live.com/download/2cdt.zip || curl -O http://cpctech.cpc-live.com/download/2cdt.zip
unzip 2cdt.zip
wget -S http://csdb.dk/getinternalfile.php/141751/exomizer209.zip || curl -O http://csdb.dk/getinternalfile.php/141751/exomizer209.zip
( mkdir exomizer209 ; cd exomizer209 ; unzip ../exomizer209.zip ; )
git clone https://github.com/pelrun/dsk2cdt2disc
cd dsk2cdt2disc/src/
make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
This field is currently being treated as the high byte of the sector size, when it's apparently actually log2(bps)-7, the direct value out of the DPB. I don't know why this wasn't caught before, although the result is the same for standard 512-byte sectors, and any unusual images that still worked may have incorrectly filled this field.
Have also seen an instance (Red Sunset) where the logbps in TIB[0] is 0, but 2 in all the associated SIBs.
Write the disk image name into the loader along with the side.
Make the sector number display a bit less ambiguous.
Build fails with this error:
cdt.o: In function `SetTZXBlockWriteMethodOptionHandler':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:940: undefined reference to `ArgumentList_GetNext'
cdt.o: In function `SetDataMethodOptionHandler':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:983: undefined reference to `ArgumentList_GetNext'
cdt.o: In function `SetFileTypeOptionHandler':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:997: undefined reference to `ArgumentList_GetNext'
cdt.o: In function `SpecifySpeedWriteOptionHandler':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:903: undefined reference to `ArgumentList_GetNext'
cdt.o: In function `SetInitialPauseOptionHandler':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:966: undefined reference to `ArgumentList_GetNext'
cdt.o:.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:1042: more undefined references to `ArgumentList_GetNext' follow
cdt.o: In function `main_2cdt':
.../dsk2cdt2disc/src/./2cdt/src/2cdt.c:1112: undefined reference to `ArgumentList_Execute'
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'dsk2cdt' failed
make: *** [dsk2cdt] Error 1
ArgumentList_GetNext
and ArgumentList_Execute' are part of
2cdtand compiled to
opth.o`.
Will offer pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.