datajerk / c2t Goto Github PK
View Code? Open in Web Editor NEWRetro Code (Apple II, Cosmac VIP) to Tape/Text
License: BSD 3-Clause "New" or "Revised" License
Retro Code (Apple II, Cosmac VIP) to Tape/Text
License: BSD 3-Clause "New" or "Revised" License
Apologies if this issue is not the right place to post notice of the explorations I've made. I have a prototype of 23kbps transfer to an Apple IIe (work done at the Recurse Center), and think it might be practical to port this into c2t. However, I have concerns about repeatability. I would also be quite willing to push my prototype to a branch if people are interested in experimenting with it.
The basic plan for my work is to try to encode 4 bits of information per audio cycle. I encode 2 bits in the top half of the pulse, 2 in the bottom. Each pulse width is (44 + 27 * sym) µs where sym is 0 through 3, and the pulses are generated in a band-limited way. This image should illustrate the technique:
To decode, my code senses top and bottom half pulse widths separately, and each shifts 2 bits into the accumulator. Two of those cycles produce a byte. The full asm code is a shade over 128 bytes. Assuming an average symbol of 1.5, 2 bits per "pulse", 2 / (44 + 27 * 1.5) µs = ~23.6kbps. In testing, I've been transferring images to the hi-res buffer (8kB), and that takes around 2.5s, as expected.
I've prototyped my waveform generation code in Python, but it's not actually all that complicated, and I'd be happy to redo it in C. I'm particularly proud of the band-limited pulse generation approach, as I believe that it's much less sensitive to the sampling rate of the audio path (in fairness, I've only tested at 48KHz).
Now for the part I'm most uncertain about: in exploring the analog pathway with an oscilloscope, I find that the comparator output is biased pretty strongly to "1". This oscilloscope photo should show what I mean:
I've studied the schematic and info about the 741 op-amp, and don't understand why this is happening - the effect is much larger than the DC offset suggested in the datasheet. I also suspect that the amount is not consistent. If the waveform requires calibration to a specific device, it makes it much less appealing.
Is it worth pursuing this? Would other Apple 2 owners be willing to run tests on their machines, and maybe poke with a scope? Would you be open to having this land in c2t?
Hello.
After I make an audio file out of a disk image and try to load it in my apple 2e it gives me an error right after saying it started loading instadisk, eta 9 sec. I also can't load files from the apple disk server. What might cause this problem?
P.S. I read somewhere that it only supports NTSC computers and not PAL ones. (USA and Euro ones). I am using my computer in Europe but I ordered it from the USA, so I believe that it's not a Euro version.
Thanks in advance.
Maybe not an issue, but I had to change #INCLUDE <fake6502.h>
to read #INCLUDE "fake6502.h"
for the compiler to find it. I had to do it for the #INCLUDE <c2t.h>
as well.
This on on Windows 10 v1809 and MinGW v2013072200 (MinGW is not installed on my boot drive).
Just an FYI. After those edits, it compiled and ran beautifully.
just edit Makefile adding "-lm" to all gcc commands to fix :-)
Hi, I am trying to build from source on Linux Mint but I am getting several errors.
First the tar command fails:
curl -sLO https://github.com/mrdudz/cc65-old/raw/master/cc65-sources-2.13.3.tar.bz2
tar zxf cc65-sources-2.13.3.tar.bz2
I installed cc65 and removed the requirement of cc65-2.13.3/bin/cl65 from the Makefile.
Now I can have make to try to build the code but I get multiple compiler errors: all related to undeclared symbols:
c2t-96h.c:710:42: error: ‘inflatecode’ undeclared (first use in this function); did you mean ‘inflateEnd’?
710 | for(j=0;j<sizeof(inflatecode)/sizeof(char);j++) {
| ^~~~~~~~~~~
| inflateEnd
Same for fastload8000, fastloadcd, diskload8000, diskload9600, diskloadcode2 and diskloadcode3.
What am I doing wrong? I don't see these arrays declared in the c2t.c source.
Hello, I am not able to compile on ubuntu 22.04
I am getting the following error.
Despite following https://github.com/datajerk/c2t/blob/master/ubuntu_notes.md
make: xcrun: No such file or directory
xcrun is a macOS related module I don't get why this is happening
Many thanks in advance
Consider enabling -Wextra
and -Wpedantic
to see a bunch of warnings about your code such as:
c2t.c:244:12: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for(j=0;j<strlen(argv[i]);j++) {
~^~~~~~~~~~~~~~~~
and:
c2t.c:1436:11: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
void usage()
^
void
and:
./fake6502.h:995:22: warning: assigning to 'void (*)()' from 'void *' converts between void pointer and function pointer [-Wpedantic]
loopexternal = funcptr;
^ ~~~~~~~
You currently repeat the warning flags in several places in the Makefile. Consider using a variable to store them so you only have to update them in one place in the future.
I have no disk drive, only the cassette port. I wanted to play some games from my computer, but can't find any working disk images.
I compiled version 0.997 and it is generally working amazingly well. This is a truly impressive concept and program.
However I am having difficulty determining if I can use this utility to package a ProDOS disk image of file type '.po' and how/if I would do that?
When using the 'c2t -8 prodos243.po prodos243.wav' for example, the wave file is produced in 28k segments.
The resultant .wav file is loaded on my old iPhone SE (with audio out jack).
Applesoft LOAD command loads the file successfully, formats the blank disk in drive 1 and writes the data.
However the Apple II crashes to monitor when I try and boot the disk, presumably because the interleave and sector formats of a ProDOS disk are quite different than a DOS 3.3 that the program is designed to handle.
Attempts to read the catalog of the produced disk from a known utility program is also unsuccessful.
Is there any particular or recommended mechanism of managing a .po image with c2t ?
With the disk image: https://archive.org/download/a2_asimov_dangerous_dave
When doing ./c2t dangerous_dave.dsk dangerous_dave.wav
I get the following errors:
WARNING: simulated inflate failed at 1000
Segment: 0, start: 0x503D, length: 16322, deflated: 43.07%, data time:14, inflate time:0.00
WARNING: simulated inflate failed at 1000
Segment: 1, start: 0x5960, length: 13983, deflated: 51.23%, data time:12, inflate time:0.00
WARNING: simulated inflate failed at 1001
Segment: 2, start: 0x6CE7, length: 8984, deflated: 68.67%, data time:8, inflate time:0.00
WARNING: simulated inflate failed at 1000
Segment: 3, start: 0x5B2D, length: 13522, deflated: 52.84%, data time:12, inflate time:0.00
WARNING: simulated inflate failed at 1000
Segment: 4, start: 0x7071, length: 8078, deflated: 71.83%, data time:7, inflate time:0.00
From glancing through the code, I'm not sure why compression is on by default. I thought it would be controlled by the flag here:
It's awesome that you are emulating the decompression!
Hello,
what do you think is possible (in theory) to do the same for this Apple-II clone?
https://en.wikipedia.org/wiki/Microprofessor_II
I was not able to find any information about cassette data format of MPF-II, but comparing WAV files from Apple-II and MPF-II, it becomes clear that they are different.
Do you think it would be possible to reverse engineer an audio file from MPF-II if, for example, save a block of memory from Monitor with known bytes to a file?
How to create a .wav without "INSTA-DISK" app?
Is there something missing in the docs for creating the self-launching tape .wav files as are in http://asciiexpress.net/gameserver/ ?
I'm trying to convert a .dsk to .wav without "INSTA-DISK" as I don't have a disk drive.
I've yet to produce a file from -96h (or any other 9600 file) that loads. Consistently all fail checksum and dump to monitor. I've tried this from multiple output devices, at various output levels, with the same result. I've tested this with my 65C02 and 6502, and with the full enhancement kit installed or not. Nothing seems to get 9600 to succeed.
I know the intent was for -96h to be quite a bit more compatible hardware-wise but I think I've got an outlier here. Anything that'd be useful for me to test or experiment with to narrow things down?
cc65 now outputs AppleSingle files. These encapsulate both the executable program and its metadata such as its load address. AppleCommander can add such AppleSingle files to a disk image properly.
But to use these files with c2t, I first have to decode the file (applesingle file.as -o file
) and then give the decoded file to c2t, telling it what load address to use.
Might c2t be enhanced to natively support AppleSingle input files so that manually specifying the load address would not be necessary?
Hi!
I thought it would be interesting to have a purely web-based version of c2t. I've made a prototype, and I'd love to discuss how/whether it would make sense to integrate with c2t, co-host and promote as a sibling project to Apple Disk/Game Server, etc.
The prototype (source at https://github.com/jepler/web-c2t/) allows you to upload a disk image (dsk, do, po) and perform the conversion to audio locally within the web browser. No data is transmitted on the internet, and no server or back-end is necessary. This lacks a ton of polish, format/no-format and hifi/8k options, etc. I know enough about web technology to cobble, but not to make a polished final product.
Similar to the Apple ][ Disk Server, after conversion you just LOAD on the Apple II and then hit play on the generated audio file.
I've transferred a couple of disks this way, such as Zork III and it seems to work just as well as the Disk Server or using c2t locally.
When I try to build both v0.996 and the current master, I get the following error:
cl65 -t none --listing --list-bytes 100 autoload.s
cl65: Don't know what to do with `100'
make[1]: *** [autoload] Error 1
hexdump: autoload: No such file or directory
hexdump: autoload: Bad file descriptor
hexdump: autoload: No such file or directory
hexdump: autoload: Bad file descriptor
hexdump: inflate: No such file or directory
hexdump: inflate: Bad file descriptor
hexdump: inflate: No such file or directory
hexdump: inflate: Bad file descriptor
hexdump: fastload9600: No such file or directory
hexdump: fastload9600: Bad file descriptor
hexdump: fastload9600: No such file or directory
hexdump: fastload9600: Bad file descriptor
hexdump: fastload8000: No such file or directory
hexdump: fastload8000: Bad file descriptor
hexdump: fastload8000: No such file or directory
hexdump: fastload8000: Bad file descriptor
hexdump: fastloadcd: No such file or directory
hexdump: fastloadcd: Bad file descriptor
hexdump: fastloadcd: No such file or directory
hexdump: fastloadcd: Bad file descriptor
hexdump: diskload9600: No such file or directory
hexdump: diskload9600: Bad file descriptor
hexdump: diskload9600: No such file or directory
hexdump: diskload9600: Bad file descriptor
hexdump: diskload8000: No such file or directory
hexdump: diskload8000: Bad file descriptor
hexdump: diskload8000: No such file or directory
hexdump: diskload8000: Bad file descriptor
hexdump: diskload2: No such file or directory
hexdump: diskload2: Bad file descriptor
hexdump: diskload2: No such file or directory
hexdump: diskload2: Bad file descriptor
hexdump: diskload3: No such file or directory
hexdump: diskload3: Bad file descriptor
hexdump: diskload3: No such file or directory
hexdump: diskload3: Bad file descriptor
-i used with no filenames on the command line, reading from STDIN.
-i used with no filenames on the command line, reading from STDIN.
-i used with no filenames on the command line, reading from STDIN.
-i used with no filenames on the command line, reading from STDIN.
-i used with no filenames on the command line, reading from STDIN.
-i used with no filenames on the command line, reading from STDIN.
Despite this, the build process continues. However, the released version builds only c2t
(the current master builds both c2t
and c2t-96h
.
Using macOS Sierra with command-line tools from the latest Xcode (9.0), and cl65 V2.16 installed with Homebrew (brew install cc65
).
Edit: added cl65 version.
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.