Permalink
Browse files

init commit

  • Loading branch information...
datajerk committed Nov 24, 2014
0 parents commit 55d29a682a34befa574a9e2241231048634a83ba
Showing with 20,660 additions and 0 deletions.
  1. +12 −0 MANIFEST
  2. +14 −0 Makefile
  3. +22 −0 README.1st
  4. +267 −0 README.md
  5. +27 −0 asm/Makefile
  6. +117 −0 asm/autoload.s
  7. +545 −0 asm/diskload2.s
  8. +524 −0 asm/diskload3.s
  9. +168 −0 asm/diskload8000.s
  10. +174 −0 asm/diskload9600.s
  11. +194 −0 asm/fastload8000.s
  12. +200 −0 asm/fastload9600.s
  13. +202 −0 asm/fastloadcd.s
  14. +520 −0 asm/inflate.s
  15. +1,707 −0 c2t.c
  16. +4,352 −0 c2t.h
  17. +72 −0 c2t.h.0
  18. +1,134 −0 c2t.h.2
  19. +998 −0 fake6502.h
  20. +53 −0 makeheader
  21. +4,679 −0 miniz.h
  22. BIN windows/c2t.exe
  23. +4,679 −0 windows/miniz.h
@@ -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
@@ -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
@@ -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 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

------------------------------------------------------------------------------
@@ -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) $< $@

Oops, something went wrong.

0 comments on commit 55d29a6

Please sign in to comment.