Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
datajerk committed Nov 24, 2014
0 parents commit 55d29a6
Show file tree
Hide file tree
Showing 23 changed files with 20,660 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MANIFEST
@@ -0,0 +1,12 @@
README
README.1st
MANIFEST
c2t
c2t.c
c2t.h
fake6502.h
miniz.h
windows/c2t.exe
windows/miniz.h
Makefile
makeheader
14 changes: 14 additions & 0 deletions Makefile
@@ -0,0 +1,14 @@


all: c2t

clean:
rm c2t.h c2t
cd asm; make clean


c2t: c2t.h
gcc -Wall -O3 -o c2t c2t.c

c2t.h:
./makeheader
22 changes: 22 additions & 0 deletions README.1st
@@ -0,0 +1,22 @@
Read the README for help.

Read c2t.c for build instructions.

Description of files:

README Documentation
README.1st This file
MANIFEST Files that should have been in this archive
c2t OS/X Intel binary
c2t.c c2t main
c2t.h c2t header including all 6502 ASM source and binaries
fake6502.h 6502 simulator source
miniz.h compression code source
windows/c2t.exe Windows Intel binary
windows/miniz.h compression code source (for windows)

To install c2t on OS/X type:

sudo cp c2t /usr/local/bin
sudo chmod 755 /usr/local/bin/c2t

267 changes: 267 additions & 0 deletions README.md
@@ -0,0 +1,267 @@
c2t Documentation


AUTHOR

Egan Ford (egan@sense.net, datajerk@gmail.com)


DESCRIPTION

c2t is a command line tool that can convert binary code/data and/or
Apple-1/II Monitor text, as well as 140K disk images, into audio files
suitable for use with the Apple-1 and II (II, II+, //e) cassette interface.

c2t offers three high-speed options for the 64K Apple II+ and Apple //e:
8000 bps, 8820 bps, and 9600 bps. The c2t compression option may be used to
speedup the delivery of data with all three as well as the native 1333 bps
cassette interface ROM routines.

8820 bps (used to burn CDs) and 9600 bps are not compatible with all II+s
and //es. If you plan to distribute your audio files, then use 8000 bps.
8820 bps and 1333 bps is not an option for disk images.

High-speed and compress options require c2t's custom loader, and at this
time that limits you to a single segment. You can overcome this limitation
by concatenating all your code together and creating your own code to
shuffle your data around, or, pad each segment with enough zeros to align
subsequent segments with their target address and then use the compress
option to minimize this overhead.

Multi-segment audio files can be created for the Apple-1, II, II+, and //e
that can be loaded using the standard cassette interface ROM routines.


WHY?

I created this because I needed a convenient way to get data loaded into my
//e without dragging my computer out of my office (2nd floor) to my mancave
(basement). IOW, I needed an iPhone/iPad/mobile solution. That, and
CFFA3000 was sold out.


SYNOPSIS

Output of "c2t -h":

usage: c2t [-vh?]
c2t [-elp] input[.mon],[addr] ... [output.mon]
c2t {-1} [-cepr] input[.mon],[addr] ... [output.[aif[f]|wav[e]]]
c2t {-2} [-abcdef8pmqr] input[.mon],[addr] ... [output.[aif[f]|wav[e]]]
c2t [-n8] input.dsk ... [output.[aif[f]|wav[e]]]

-1 or -2 for Apple I or II tape format
-8 use 48k/8bit 8000 bps transfer (Apple II/II+/IIe 64K only)
Implies -2a. Negates -f and -d.
-a assembly autoload and run (Apple II/II+/IIe 64K only)
-b basic autoload and run (Apple II+/IIe 64K only)
Implies -2a.
-c compress data
-d use fast 44.1k/16bit transfer (Apple II/II+/IIe 64K only)
Implies -2a. Negates -f and -8. Use for burning CDs.
-e pad with $00 to end on page boundary
-f use faster 48k/8bit (9600 bps) transfer (Apple II/II+/IIe 64K only)
Implies -2a. Negates -8 and -d. Unreliable on some systems.
-h|? this help
-l long monitor format (24 bytes/line)
-m jump to monitor after autoload
-n do not format disks
-p pipe to stdout
-q parameters and data only (for use with custom client)
-r #, where # overrides the sample rate (e.g. -r 48000)
-t 10 second preamble (default 4) for real tape use
-v print version number and exit

input(s) without a .mon or .dsk extension is assumed to be a binary with a 4
byte header. If the header is missing then you must append ,load_address to
each binary input missing a header, e.g. filename,800. The load address
will be read as hex.

input(s) with a .mon extension expected input format:

0280: A2 FF 9A 20 8C 02 20 4F
0288: 03 4C 00 FF 20 9E 02 A9

A single input with a .dsk extension expected to be a 140K disk image.

output must have aiff, aif, wav, wave, or mon extention.


EXAMPLES

------------------------------------------------------------------------------

Input: Apple 1 monitor file with two segments. First 4 lines:

0: 00 05 00 10 00 00 00 00
8: 00 00 00 00 00 00 00 00
280: A9 00 85 07 A9 00 A8 AA
288: 85 06 A5 00 85 04 A5 01

Command:

c2t -1 a1mt.mon a1mt.aif

Output:

Reading a1mt.mon, type monitor, segment 1, start: 0x0000, length: 16
Reading a1mt.mon, type monitor, segment 2, start: 0x0280, length: 290

Writing a1mt.aif as Apple I formatted aiff.

To load up and run on your Apple I, type:

C100R
0.FR 280.3A1R

------------------------------------------------------------------------------

Input: cc65/ca65 Apple II binary with DOS 4-byte header. The DOS header
contains the starting address of the program.

Command:

c2t -2 hello hello.wav

Output:

Reading hello, type binary, segment 1, start: 0x0803, length: 2958

Writing hello.wav as Apple II formatted wave.

To load up and run on your Apple II, type:

CALL -151
803.1390R
803G

------------------------------------------------------------------------------

Input: cc65/ca65 Apple II binary with DOS 4-byte header. The DOS header
contains the starting address of the program.

Command:

c2t hello hello.mon

Output:

Reading hello, type binary, segment 1, start: 0x0803, length: 2958

Writing hello.mon as Apple formatted monitor.

Example hello.mon output:

0803: A2 FF 9A 2C 81
0808: C0 2C 81 C0 A9 91 A0 13
0810: 85 9B 84 9C A9 91 A0 13
0818: 85 96 84 97 A9 00 A0 D4

------------------------------------------------------------------------------

Input: Binary game without DOS header that should be loaded at $801.

Command:

c2t -2 moon.patrol,801 moon.patrol.aif

Output:

Reading moon.patrol, type binary, segment 1, start: 0x0801, length: 18460

Writing moon.patrol.aif as Apple II formatted aiff.

To load up and run on your Apple II, type:

CALL -151
801.501CR
801G

------------------------------------------------------------------------------

Input: Binary game without DOS header that should be loaded at $801 as fast
as possible while being compatible with all Apple IIs.

Command:

c2t -8c moon.patrol,801 moon.patrol.aif

Reading moon.patrol, type binary, segment 1, start: 0x0801, length: 18460

Writing moon.patrol.aif as Apple II formatted aiff.

start: 0x7226, length: 18393, deflated: 0.36%, data time:18.95, inflate time:6.83
WARNING: compression disabled: no significant gain (18.11)

To load up and run on your Apple II, type:

LOAD

NOTE: Compression was disabled because it didn't help.

------------------------------------------------------------------------------

Input: Binary game without DOS header that should be loaded at $800 as fast
as possible while being compatible with all Apple IIs.

Command:

c2t -8c super_puckman,800 super_puckman.wav

Reading super_puckman, type binary, segment 1, start: 0x0800, length: 30719

Writing super_puckman.wav as Apple II formatted wave.

start: 0x886C, length: 12691, deflated: 58.69%, data time:13.25, inflate time:5.79

To load up and run on your Apple II, type:

LOAD

------------------------------------------------------------------------------

Input: Three binary files to be loaded at three different addresses.

c2t -2 foo,801 foo.obj,3ffd foo.pic,2000 foo.aif

Reading foo, type binary, segment 1, start: 0x0801, length: 91
Reading foo.obj, type binary, segment 2, start: 0x3FFD, length: 18947
Reading foo.pic, type binary, segment 3, start: 0x2000, length: 8192

Writing foo.aif as Apple II formatted aiff.

To load up and run on your Apple II, type:

CALL -151
801.85BR 3FFD.89FFR 2000.3FFFR

------------------------------------------------------------------------------

Input: DOS 3.3 140K diskette image to be loaded with maximum II
compatibility. Disk will be formatted first.

Command:

c2t -8 dos33.dsk dos33.wav

Output:

Reading dos33.dsk, type disk, segment 1, start: 0x1000, length: 28672
Reading dos33.dsk, type disk, segment 2, start: 0x1000, length: 28672
Reading dos33.dsk, type disk, segment 3, start: 0x1000, length: 28672
Reading dos33.dsk, type disk, segment 4, start: 0x1000, length: 28672
Reading dos33.dsk, type disk, segment 5, start: 0x1000, length: 28672

Writing dos33.wav as Apple II formatted wave.

Segment: 0, start: 0x459B, length: 19044, deflated: 33.58%, data time:19, inflate time:7.68
Segment: 1, start: 0x74A5, length: 7002, deflated: 75.58%, data time:7, inflate time:3.70
Segment: 2, start: 0x8514, length: 2795, deflated: 90.25%, data time:3, inflate time:2.28
Segment: 3, start: 0x6CD4, length: 9003, deflated: 68.60%, data time:9, inflate time:4.33
Segment: 4, start: 0x6DE6, length: 8729, deflated: 69.56%, data time:9, inflate time:4.27

To load up and run on your Apple II, type:

LOAD

------------------------------------------------------------------------------
27 changes: 27 additions & 0 deletions asm/Makefile
@@ -0,0 +1,27 @@
CL = cl65
CL_FLAGS = -t none --listing --list-bytes 100
#CL_FLAGS = -t apple1 -C apple1-16k.cfg --listing --list-bytes 100
CC = cl65
CC_FLAGS = --static-locals -t apple1 -C apple1-16k.cfg
C2T = c2t

ASRC = $(shell echo *.s)
AOBJ = $(ASRC:%.s=%.o)
ALST = $(ASRC:%.s=%.lst)
AMON = $(ASRC:%.s=%.mon)
ABIN = $(ASRC:%.s=%)

all: $(ABIN)

clean:
-rm -f $(ABIN) $(AOBJ) $(ALST) $(AMON)

%: %.s
$(CL) $(CL_FLAGS) $<

%: %.c
$(CC) $(CC_FLAGS) $<

%.mon: %
$(C2T) $< $@

0 comments on commit 55d29a6

Please sign in to comment.