Previous | Next
| From: TLC (all posts)
Date: 1998-07-05
Subject: Re: Turbo emulating
|
Hi!
>> Since ATN can't be written by the drive, it would make sense to use
>> CLK and DATA as datalines, and make them synchronised by alternating
>> between 0's and 1's on the ATN line from the Amiga. The synchronising
> That's nice, but there is a bit problem with this: 1541 cannot put
> data on lines right after ATN is flipped... It takes a bit time, and
> the stable sign-stand on the lines also takes a bit time... And this
> time is what I want to know... (Sajnos nem tudom mi angolul a
> pergesmentesites... Sorry english-only guys...)
Check dis out.
You present a squarewave type signal on ATN from the Amiga. Let's suppose, it's period is about 30 uSec (that makes about 30 cycles of the 6502 in the 1541). Also let's suppose, this sqrwave is symmetric
(15uSec low, 15uSec hi).
You set ATN low on the Amiga side. For the 1541 program, that means:
put databits onto CLK and DATA pins. Also, it makes sense then prepare the next two databits.
Then set ATN high, and read the state of CLK and DATA on the Amiga. This Hi will tell the floppy that these bits were received, it can wait for low and start this again. Voila'!
So, on the 1541: wait for low on ATN / put prepared databits out / prepare next 2 databits / wait for Hi on ATN / loop . (Of course, you should be sure of the number of received bytes someway).
All you should be sure of, the timings are enough for the 1541 side. ...You can estimate it, 'cos each 6502 cycle makes one uSec, at the ~~1Mhz clock.
Also, maybe, you can find the exact cycletime for the 6502 codes in some docs, like 'A Plus/4 belso felepitese' or somewhere on the Net (maybe, even the doc I sent you lately).
If the Amiga side gets out of synchronization, it's no matter (the 1541 side will wait, except if the timings turned to be too fast). So there is no need for cycle-exact timing (this could work even under Windowz 59), all you should present is a minimum of the timing. From the other side, the Amiga is blind while transmitting datas (the 1541 definitely MUST finish it's tasks in time), it doesn't know if something went wrong in the 1541. So the 1541 stuff must be written very safely, maybe, you should even disable all interrupts and such things.
>> Maybe, this would mean a small loss of the speed, in opposition of a
>> programmed, cycle timed data-transfer, but it would work much more
>> reliably (...at least, 'cos you can't present exact timing for all
>> Amiga versions with all processor and memory types, not to mention the
>> multitasking kernel of the Amiga OS).
> Not necessary loss of speed. The Amiga side can be as fast as the
> drive.
> You wouldn't know the possibilities of the Amiga OS. There IS exact
> timing of course... (And I could even forbid multitasking, if it is a
> must.)
In contrast of an 'asynchron' type data-transmission like in native Commodore programs (like cycle-timed fastloaders and copiers), it's definitely slower,
'cos you have to wait for the timing, instead of just putting bits out from the 1541 and catching them on the fly. ...But who cares, it's still much faster than the original serial routines.
Speaking of exact timing, well... Amiga OS is something different than Windoze 59.
BTW I'm just installing Linux...
Levente
|
| |
Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon |