Z tąd
https://github.com/rkrajnc/sd2iec/blob/master/doc/dreamload.txtThe DreamLoad Fast Loader Protocol
==================================
analysed by Thomas Giesel
This document describes the fast loader protocol implemented in DreamLoad. The
description may not be accurate in any point.
DreamLoad is a two bit IRQ fast loader. This means that the timing of the C64
(host) may be deferred by IRQs at any time. The timing is given by the host,
so the drive code must be always listening. The only exception is after the
host sent a command to load a sector to the drive. Then the host starts the
protocol after having seen the first two bits (always 0) on the bus.
All the directory and sector chain stuff is done by the host.
DRIVE DETECTION
===============
DreamLoad reads out some bytes from the drive memory using "m-r" to detect the
drive type. To find a 1541 it expects following values:
0xfea0: 0x0d
0xe5c6: 0x34 0xb1
Then it uploads the initial loader using "m-w".
INITIAL LOADER
==============
The first part of code uploaded by the host into the drive is a short program
which has the task to download the final drive code using the send protocol
described below. The initial loader contains the length of the final drive
code. It's a simple loop which receives 1024 bytes from the host, stores them
into the drive RAM and starts the final drive code.
BYTE TO DRIVE PROTOCOL
======================
This protocol is used by the host to send the final drive code and in newer
versions of DreamLoad also to send commands to the drive.
The ATN line is not used for this transfer.
The drive has to wait for CLOCK to become low. A short time later it reads
bit 7 from DATA (low = 1). After the next CLOCK high bit 6 is read from DATA
This procedure is repeated 4 times to read all 8 bits.
Note that the host write CLOCK and DATA at once, nevertheless the drive must
read them in two steps to avoid race conditions cause by the ramp times.
OLD BYTE TO DRIVE PROTOCOL
==========================
Older implementations of DreamLoad us a different protocol for the command
bytes.
The drive waits for ATN low, then it reads bit 5 from DATA and 7 from CLOCK.
After the next ATN high bit 4 follows on DATA and bit 6 on CLOCK.
This is repeated for bits 1, 3, 0, 2.
BYTE TO HOST PROTOCOL
=====================
This protocol is used to send bytes from the drive to the host.
Bit 0 of each byte is sent on CLOCK, bit 1 on DATA. High level means 1. This
bit pair is acknowledged by the host by pulling ATN down. Directly after this
ack the drive must put the next two bytes on CLOCK and DATA, the will be ack'd
with a high level on ATN. The rest of the byte follow in the same manner.
If there there are no additional bytes to be transfered, the drive releases
DATA and CLOCK to high.
BLOCK TO HOST PROTOCOL
======================
The first byte is a status code. If it is 0 a block of 256 bytes will follow.
As the host waits for DATA to become low before receiving this byte, bit 1 must
always be zero in this byte.
Is the value is not 0, it is an error indication. No additional bytes follow in
this case. The C64 code returns an error flag to the application in this case.
After a block a checksum follows. All bytes of the block are EORed beginning
with 0, the result is transfered as checksum.
DREAMLOAD VARIANTS
==================
This is a list of DreamLoad version at the programs they were found in.
EORing all bytes of the final code gives the version code used below.
The versions 0xac and 0xdc use the old byte protocol.
Checksum 0x48:
Cauldron by Exceed, Resource, The Dreams (2008)
http://noname.c64.org/csdb/release/?id=64204state: works
8-bit Garden by Digital Sounds System (2008)
http://noname.c64.org/csdb/release/?id=64142state: works
Breakpoint 2008 Invitation by Resource, The Dreams (2008)
http://noname.c64.org/csdb/release/?id=62891state: works
Checksum 0xac:
Perfect Pixels by Chorus (2007)
http://noname.c64.org/csdb/release/?id=59862state: works
69 positions 100% by Vulture Design (2006)
http://noname.c64.org/csdb/release/?id=45031state: works, including disk change
Deep 90% by Chorus (2006)
http://noname.c64.org/csdb/release/?id=36852state: works
The True Story About Knoops by The Dreams (2003)
http://noname.c64.org/csdb/release/?id=9748state: works
Flut by K2 (2004)
http://noname.c64.org/csdb/release/?id=12744state: works, including disk change
Checksum 0xdc:
Darwin by The Dreams (2004)
http://noname.c64.org/csdb/release/?id=12732state: works
Checksum 0xbf:
Error 23 91% by Resource, The Dreams (2006)
http://noname.c64.org/csdb/release/?id=32411state: 91% version works, older 90% version doesn't
10 Years HVSC by HVSC Crew (2006)
http://noname.c64.org/csdb/release/?id=44014state: works, including disk change