Permalink
Browse files

c2t-96h minor updates, doc updates, article added/updated, windows 96…

…h binary
  • Loading branch information...
datajerk committed Dec 31, 2015
1 parent dc09517 commit c96332b204f1bdc98078c28f5d09a2e78d8233bf
@@ -1,13 +1,16 @@


all: c2t
all: c2t c2t-96h

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

c2t: c2t.c c2t.h
gcc -Wall -O3 -o c2t c2t.c
gcc -Wall -Wno-unused-value -Wno-unused-function -O3 -o c2t c2t.c

c2t-96h: c2t-96h.c c2t.h
gcc -Wall -Wno-unused-value -Wno-unused-function -O3 -o c2t-96h c2t-96h.c

c2t.h: mon/dos33.boot1.mon mon/dos33.boot2.mon asm/autoload.s asm/diskload2.s asm/diskload3.s asm/diskload8000.s asm/diskload9600.s asm/fastload8000.s asm/fastload9600.s asm/fastloadcd.s asm/inflate.s
./makeheader
@@ -28,7 +28,8 @@ You clearly do not understand the awesomeness of the Apple II, move along.

## Version

0.996 (Nov 29 2014)
c2t 0.996 (Nov 29 2014)
c2t-96h 0.997 (Dec 31 2015)


## Installation
@@ -63,6 +64,22 @@ gcc -Wall -O3 -static -o c2t c2t.c
```
> Use the `miniz.h` in the `windows` directory.
To cross build for Windows from OS/X, first install <http://crossgcc.rts-software.org/doku.php?id=compiling_for_win32>, then type:
```
cd windows
cp ../c2t.*
cp ../fake6502.h
/usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/i586-mingw32-gcc -Wall -Wno-unused-value -Wno-unused-function -O3 -static -o c2t.exe c2t.c
```


## c2t-96h Version

`c2t-96h` is a hacked up version of `c2t` that fixes a few bugs (e.g. `.po` files) and adds working 9600 BPS code.
Both `-8` and `-f` activate this new 9600 BPS code.

`c2t-96h` will eventually replace `c2t`. IOW, use `c2t-96h` for now.


## Tested Configurations:

BIN +846 KB article/article.docx
Binary file not shown.
BIN +945 KB article/article.pdf
Binary file not shown.
BIN +187 KB article/article.pptx
Binary file not shown.
@@ -0,0 +1,34 @@
12000
12000
-2
2 main: ldy #0
4 psync: bit tapein
2 bmi psync
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
2 bpl ploop
2 cpy #$40
2 bpl endcode
2 cpy #$15
2 bpl main
2 cpy #$07
7 store: rol nnnn,x
2 asl
2 bne main
2 lda #1
2 inx
2 bne main
6 inc store+2
3 jmp main
@@ -0,0 +1,49 @@
6000
6000
-2
2 main: ldy #0
4 psync: bit tapein
2 bmi psync
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
3 bpl ploop
2 ploop: iny
4 bit tapein
2 bpl ploop
2 cpy #$40
2 bpl endcode
2 cpy #$15
2 bpl main
2 cpy #$07
7 store: rol nnnn,x
2 asl
3 bne main
2 lda #1
2 inx
3 bne main
6 inc store+2
3 jmp main
Binary file not shown.
@@ -0,0 +1,89 @@
#!/usr/bin/env python

import sys, math, os

try:
cycles_file = sys.argv[1]
except:
print "usage: %s cycles.txt" % sys.argv[0]
sys.exit(1)

f = open(cycles_file,'r')
freq0 = f.readline().strip()
freq1 = f.readline().strip()
start = int(f.readline().strip())

a2freq = 1020484.4497 # src: openemulator, src: https://discussions.apple.com/thread/559102
#rot = True
rot = False

xr = a2freq / float(freq0)
xcross = xr / float(2.0)
xc2 = int(xcross * 100) / float(100)
ycross = 0
xdiv = xcross / float(math.pi)
yb = -0.25

g = open('plot.gnuplot','w')
if rot:
g.write('set title " %d/%d KHz Cycle" offset 0,-2\n' % (int(freq0)/1000,int(freq1)/1000))
else:
g.write('set ylabel "%d/%d KHz Cycle"\n' % (int(freq0)/1000,int(freq1)/1000))
g.write('set term postscript \n')
g.write('set size ratio 0.5\n')
g.write('set output "plot.ps"\n')
g.write('set key off\n')
g.write('set grid xtics lt 0 lw 1 lc rgb "#000000"\n')
g.write('set grid ytics lt 0 lw 1 lc rgb "#000000"\n')
g.write('set xrange [%d:%f]\n' % (start,xr))
g.write('set yrange [%f:1]\n' % yb)
g.write('set xtics 1 font "courier,10"\n')
g.write('set x2tics 1 font "courier,10"\n')
g.write('set ytics 1 font "courier,10"\n')
g.write('set arrow from %d,0 to %f,0 nohead lw 1 lc rgb "black"\n' % (start,xr))
g.write('set arrow from %f,%f to %f,1 nohead lw 1 lc rgb "black"\n' % (xcross,yb,xcross))
if start < 0:
g.write('set arrow from %f,%f to %f,1 nohead lw 1 lc rgb "black"\n' % (0,yb,0))
g.write('set xtic rotate by 90 right \n')
g.write('set x2tic rotate by 90 left \n')

x2tics = {}
xtics = {}

base = start
ll = 0
for i in f.readlines():
cycles = int(i.split(' ')[0])
text = i.split(' ',1)[1].rstrip().upper()
if len(text) > ll:
ll = len(text)
xtics[str(base)] = text
x2tics[str(base)] = str(base)
base += cycles

x2tics[str(xc2)] = ' ZC'
if start < 0:
x2tics['0'] = '0 ZC'

g.write('set x2tics (')
for k, v in x2tics.iteritems():
g.write('"%s" %f, ' % (v,float(k)))
g.write(')\n')

g.write('set xtics (')
for k, v in xtics.iteritems():
g.write('"%s" %d, ' % (v + ' '*(ll-len(v)),int(k)))
g.write(')\n')

f.close()

g.write('set ytics ("0" 0, "+" 1, "-" %f)\n' % yb)
g.write('plot sin(x/%f)\n' % xdiv)
g.write('quit\n')

g.close()
os.system('gnuplot plot.gnuplot')
os.system('pstopdf plot.ps -o plot.pdf')
if rot:
os.system('pdf90 plot.pdf')

@@ -0,0 +1,74 @@
#!/usr/bin/env python

import sys, math, os

try:
timeline_file = sys.argv[1]
except:
print "usage: %s timeline.txt" % sys.argv[0]
sys.exit(1)

f = open(timeline_file,'r')
title = f.readline().strip() + " Audio Timeline"
start = 0
rot = True

g = open('timeline.gnuplot','w')
if rot:
g.write('set x2label "%s"\n' % title);
#else:
# g.write('set ylabel "%d/%d KHz Cycle"\n' % (int(freq0)/1000,int(freq1)/1000))
g.write('set term postscript \n')
#g.write('set size ratio 0.5\n')
g.write('set output "timeline.ps"\n')
g.write('set key off\n')
g.write('set grid xtics lt 0 lw 1 lc rgb "#000000"\n')
g.write('set grid ytics lt 0 lw 1 lc rgb "#000000"\n')
g.write('set yrange [0:1]\n')
g.write('set xtics 1 font "courier,9"\n')
g.write('set x2tics 1 font "courier,9"\n')
g.write('set xtic rotate by 90 right \n')
g.write('set x2tic rotate by 90 left \n')
g.write('unset ytics\n')
g.write('unset y2tics\n')

x2tics = {}
xtics = {}

ll = 0
for i in f.readlines():
if i[0] == '#':
continue
timestamp = float(i.split(',')[0])
label = i.split(',')[1].rstrip()
if len(label) > ll:
ll = len(label)
xtics[str(timestamp)] = label
x2tics[str(timestamp)] = str(timestamp)
g.write('set arrow from %f,0 to %f,1 nohead lw 1 lc rgb "black"\n' % (timestamp,timestamp))
xr = timestamp

g.write('set x2tics (')
for k, v in x2tics.iteritems():
g.write('"%s" %f, ' % (v,float(k)))
g.write(')\n')

g.write('set xtics (')
for k, v in xtics.iteritems():
#g.write('"%s" %f, ' % (v + ' '*(ll-len(v)),float(k)))
g.write('"%s" %f, ' % (v,float(k)))
g.write(')\n')

f.close()

#g.write('set ytics ("0" 0, "+" 1, "-" %f)\n' % yb)
g.write('set xrange [%d:%f]\n' % (start,xr))
g.write('plot 0\n')
g.write('quit\n')

g.close()
os.system('gnuplot timeline.gnuplot')
os.system('pstopdf timeline.ps -o timeline.pdf')
if rot:
os.system('pdf90 timeline.pdf')

BIN +3.94 KB (100%) c2t
Binary file not shown.
BIN +131 KB c2t-96h
Binary file not shown.
Oops, something went wrong.

0 comments on commit c96332b

Please sign in to comment.