RE: About tape-loaders and the flag input

From: Laze Ristoski (
Date: 2005-08-18 15:50:26

I made a Turbo 250 reader on PC, which works partially.
I get the filename, the program starts to load, but I
always end up with a load-error.

Anyways, I tried flipping the triggering edge and nothing
loaded anymore. This proves that the datasette differentiates
the direction of polarity flip. Which, on the other hand, proves 
my experiments wrong... C'mon, I was just 14 at the time. :P

There's another experiment that can be done on an emulator,
since I guess CCS and Vice emulate this accurately. The doc
that comes with CCS says that a TAP file contains the delay
until the hardware is re-triggered again. This probably means
the length of the period. But mtap reads the lengths of the
phases (which might be combined into period length afterwards,
I need to take a closer look at the code). Anyways, if a TAP
contains the phase delays, the only way to find whether it's
0->1 or 1->0 transition is the position of the delay in the file
(i.e. odd/even position). Then I can introduce an additional
phase at the beginning. If programs no longer load successfully
from the TAP, then the datasette really keeps track of polarity.

Anyone knows what's stored in TAPs? Period or phase?

About the T250 reader, I rewrote it in pure ASM, but that
doesn't help either. There're two things that might be causing

1. The PIT of the PC is 16 bit. Now what if I access the timer
when the high byte decreases and the low byte wraps around?
I mean, what if I read the low byte before the wrap, and the
high byte after the wrap? I'll end up with an error of 256
PIT cycles. That's all it takes for a load-error. Anyway, I
write 0 to port 43h before I read the counter. This should
get the timer into latch mode. At least that's what I see
in mtap. So far I didn't manage to find a decent document
about the PIT.

2. Maybe my timer value is incorrect. This is how I calculated it:

PIT_value=T250_timer_value*(PIT_freq/C64_freq), or
PIT_value=263*(1193181/985248), which gives 318.5 (~319)

One thing I can do is to record some period lengths and then
calculate the average from them. If this doesn't work, it must
be the first case with the wrapping.


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.