TAPClean to support adjustable pulse durations

After inspecting some material provided by Pawel, I tested some experimental functionality in TAPClean that can automatically adjust pulse durations used to read/decode data within a TAP file.

The idea is quite simple: usually pilot sequences seem to be quite good to predict how much pulse durations written to tape diverge from ideal values, possibly because they are not subject to data-fetching delays at mastering time. This is not a novel approach as the CBM  ROM Loader itself adjusts timings within read routines based on the 10 second pilot tone alone, in order to compensate for variations in motor speed for different tape drives.

Tests show that recognition of a Turbotape 250 compilation can be improved significantly using the above approach, with the elimination of read errors caused by non-ideal pulse durations. I haven’t thought of a way to fully integrate the code for the generic case as it can get tricky to add this feature for every loader supported in TAPClean, unless I change all scanners in one go, which is a bit of a risky approach.

Stay tuned for more on this!

Posted in Retrocomputing, Technical | Tagged , , , , | 2 Comments

Tape loader documentation effort started

In order to share comprehensive documentation about the tape loaders I’ve studied so far, including their disassembled and commented code, I decided to start with publishing the details I gathered about the “Mega-save” utility submitted to my attention by Paul Jones.
Paul should be given full credit for having identified the “Mega-save” utility as the mastering tool used to record tapes whose loader was previously referred to as “CHR Loader”. I can’t stress out how important this discovery was in order to reconstruct the history behind this specific loader. A few similar discoveries were made by Paul, and I am sure a few more are yet to be made, so keep up the good work, Paul and all!

That said, the encoding format created by the tool known as “Mega-Save” is documented here.

Bear in mind I am just starting with this effort and therefore I realize it might take a few iterations to get the documentation in perfect shape 🙂

Posted in Retrocomputing, Technical | Tagged , , , , | 1 Comment

C2N Emulator multi-threaded GUI client available now

In the last couple of days I’ve done some work and testing on my multi-threaded C2NEmu GUI client so I am happy to share binaries for Windows and Linux here.

Posted in Retrocomputing, Technical | Tagged , , , , , , | Leave a comment

C2N Emulator multi-threaded GUI client development started

After work today I started the development of the multi-threaded GUI client for my C2N Emulator device.
I also did some initial testing this evening and I reckon I will be testing some more before releasing binaries officially.

Stay tuned!

Posted in Retrocomputing, Technical | Tagged , , , , , , | Leave a comment

C2N Emulator GUI client update

I made another update to the C2NEmu GUI playback client in order to further improve user experience.
Overall I would say I am happy with the user interface but I should plan a partial rewrite using a multi-threaded model as the one I used in the IECHost GUI client: it would improve the responsiveness of the interface so much, especially on older/slower PCs!

For the time being only Windows binaries are available but I will build the Linux version in the next few days.

Stay tuned!

Posted in Embedded systems, Retrocomputing, Technical, Uncategorized | Tagged , , , , , , | Leave a comment

Recording utility for C2NEmu published for Linux too

After work I made a Linux build of my C2N Emulator recording client and tested it successfully:

luigidifraia@shinobi1604:~/Development/embedded/c2n_emulator/software/c2nemu-record/src$ sudo ./c2nemu-record /dev/ttyACM0 helloworld.dmp
C2NEmu record utility, rel 1.0 - (C) 2017 Luigi Di Fraia
Communicates with a C2NEmu device to record tapes

Reading from /dev/ttyACM0
Issue SAVE on the host... OK
Stop the recording chain with spacebar
Filename intercepted: HELLO WORLD!
 Request to stop recording sent
Finished!
Total bytes saved: 85224

The new binary is available here.

I am quite happy with the outcome so far. If anything I am a bit frustrated with the code repetition occurring in my client applications for DC2N4-LC, C2NEmu, and IECHost. In fact, I hadn’t planned to develop any USB-serial device other than DC2N4-LC but things panned out differently so I have been improving code at each new stage of each new device, trying to backport some of the latest rationalisations when I had the time.

In retrospect, if I knew I was going to work at a few USB-serial devices I would have built a library (such as my own libtapf, libcbmhiresf, libd64fs, etc.) and used it within my applications.
I might actually get to build such a library when I get some time. It’s unlikely that I will adapt all existing applications to use it, but at least I might make significant changes to those applications I use the most and I see most value in 🙂

Posted in Retrocomputing, Technical | Tagged , , , , , , | Leave a comment

Recording utility published for my Commodore datasette emulator, C2NEmu

It has been a while since I had done any software development for C2NEmu but I thought to publish one missing utility that might be quite handy, albeit not for many: recording DMP files directly from a host computer where a saving process is running (e.g. the BASIC SAVE command or the Cyberload tape masterer is running).

For the time being only the Windows binary is available here.

The way it works is quite simple: users just run the utility on a PC pointing it to the virtual COM port C2NEmu is attached to and select an output filename.

D:\development\embedded\c2n_emulator\software\c2nemu-record\bin>c2nemu-record.exe COM9 helloworld.dmp
C2NEmu record utility, rel 1.0 - (C) 2017 Luigi Di Fraia
Communicates with a C2NEmu device to record tapes

Reading from COM9
Issue SAVE on the host... OK
Stop the recording chain with spacebar
Filename intercepted: HELLO WORLD!
Request to stop recording sent
Finished!
Total bytes saved: 85330

You might notice that the filename interceptor is available (for “CBM ROM Loader” and “Tutbotape 250″) and that multiple files can be saved to a single tape image in order to create a multiload tape or simply group together a few files. Once users are happy with the result, pressing space on the PC side stops the recording process.

Let’s have a look at TAPClean’s report for the file I saved above with SAVE”HELLO WORLD!” from BASIC:

TAPClean version: 0.35-pre8

GENERAL INFO AND TEST RESULTS

TAP Name    : D:\development\embedded\c2n_emulator\software\c2nemu-record\bin\helloworld.dmp
TAP Size    : 42506 bytes (41 kB)
TAP Version : 1
Recognized  : 100%
Data Files  : 4
Pauses      : 3
Gaps        : 0
Magic CRC32 : E594EE40
TAP Time    : 0:22.78
Bootable    : YES (1 part, name: HELLO WORLD!)
Loader ID   : n/a

Overall Result    : FAIL

Header test       : PASS [Sig: OK] [Ver: OK] [Siz: OK]
Recognition test  : PASS [42486 of 42486 bytes accounted for] [100%]
Checksum test     : PASS [4 of 4 checksummed files OK]
Read test         : PASS [0 Errors]
Optimization test : FAIL [0 of 4 files OK]






FILE FREQUENCY TABLE

PAUSE (3)
C64 ROM-TAPE HEADER (2)
C64 ROM-TAPE DATA (2)





FILE DATABASE

---------------------------------
Seq. no.: 1
File Type: PAUSE
Location: $0014 -> $0000 -> $0000 -> $0017
 - Length : 5137160 cycles (5.2141 secs)

---------------------------------
Seq. no.: 2
File Type: C64 ROM-TAPE HEADER
Location: $0018 -> $6ACC -> $79CC -> $79E1
LA: $033C  EA: $03FB  SZ: 192
File Name: HELLO WORLD!
Pilot/Trailer Size: 27136/0
Checkbyte Actual/Expected: $3F/$3F, PASS
Read Errors: 0
Unoptimized Pulses: 29961
CRC32: A104AF98
 - File ID : FIRST
 - DATA FILE type : BASIC
 - DATA FILE Load address : $0801
 - DATA FILE End address : $081E
 - DATA FILE Size (calculated) : 29 bytes

---------------------------------
Seq. no.: 3
File Type: C64 ROM-TAPE HEADER
Location: $79E2 -> $7AE5 -> $89E5 -> $8A48
LA: $033C  EA: $03FB  SZ: 192
File Name: HELLO WORLD!
Pilot/Trailer Size: 79/78
Checkbyte Actual/Expected: $3F/$3F, PASS
Read Errors: 0
Unoptimized Pulses: 2986
CRC32: A104AF98
 - File ID : REPEAT
 - DATA FILE type : BASIC
 - DATA FILE Load address : $0801
 - DATA FILE End address : $081E
 - DATA FILE Size (calculated) : 29 bytes

---------------------------------
Seq. no.: 4
File Type: PAUSE
Location: $8A49 -> $0000 -> $0000 -> $8A4C
 - Length : 327688 cycles (0.3326 secs)

---------------------------------
Seq. no.: 5
File Type: C64 ROM-TAPE DATA
Location: $8A4D -> $A001 -> $A245 -> $A25A
LA: $0801  EA: $081D  SZ: 29
Pilot/Trailer Size: 5376/0
Checkbyte Actual/Expected: $2A/$2A, PASS
Read Errors: 0
Unoptimized Pulses: 5916
CRC32: D1C5C788
 - File ID : FIRST

---------------------------------
Seq. no.: 6
File Type: C64 ROM-TAPE DATA
Location: $A25B -> $A35E -> $A5A2 -> $A605
LA: $0801  EA: $081D  SZ: 29
Pilot/Trailer Size: 79/78
Checkbyte Actual/Expected: $2A/$2A, PASS
Read Errors: 0
Unoptimized Pulses: 686
CRC32: D1C5C788
 - File ID : REPEAT

---------------------------------
Seq. no.: 7
File Type: PAUSE
Location: $A606 -> $0000 -> $0000 -> $A609
 - Length : 322880 cycles (0.3277 secs)






PULSE FREQUENCY TABLE

0x2B (49)
0x2C (3)
0x2D (2254)
0x2E (17459)
0x2F (17400)
0x30 (3)
0x3F (11)
0x40 (873)
0x41 (1185)
0x42 (2751)
0x55 (4)
0x56 (171)
0x57 (311)




And here’s the Data PRG decoded as BASIC program:

1 PRINT"HELLO WORLD!"
2 GOTO1

Not bad, is it? 🙂

Posted in Retrocomputing, Technical | Tagged , , , , , , | Leave a comment