Login
Search for:


Previous | Next

From: indi (all posts)
Date: 2000-08-17
Subject: Re: 1551 programming
On Thu, 17 Aug 2000 18:11:39 +0200, you wrote:

>Hi everybody,
>
>I'm back with new questions. Has anybody documentation about the C1551 drive
>internals functions? What commands can it accept at the $FEF0 ports?

I got this from the VICE project, was VERY handy for my disk emulation..

If you look inside Minus4 souce "disk.c" this is all handled there...

The SERIAL disk drive uses this register as well BTW. The system then sends this to the serial port for you...

Mike



CBM Serial Bus Control Codes

20 Talk
3F Untalk
40 Listen
5F Unlisten
60 Open Channel
70 -
80 -
90 -
A0 -
B0 -
C0 -
D0 -
E0 Close
F0 Open

How the C1541 is called by the C64:

read (drive 8)
/28 /f0 filename /3f
/48 /60 read data /5f
/28 /e0 /3f

write (drive 8)
/28 /f0 filename /3f
/28 /60 send data /3f
/28 /e0 /3f

I used '/' to denote bytes sent under Attention (ATN low).

28 == LISTEN command + device number 8
f0 == secondary address for OPEN file on channel 0

Note that there's no acknowledge bit, but timeout/EOI handshake for each
byte. Check the C64 Kernel for exact description...

Plus4 doesn't seem to use the /20+device format... for some
reason..? or perhaps I'm still not doing it right...

LOADING


- phase 1, send the filename
55 - INIT DMA
81 - serial command byte comming
20 - TALK
00 - end byte
82 - command comming
F0 - File name comming
00 - end byte

83 - actual data comming
** - file name follows here......
00 - end actual data

81 - Serial command comming
3F - UNTALK
00 - End serial command

- phase 2, recieve data
55 - Init DMA
81 - Serial command comming
40 - LISTEN
00 - end byte
82 - Command comming
60 - open channel (filename has been sent)
00 - end byte
84 - Recive data, waiting....
data is then stored inf $FEF0 to be read...
? 00 - end byte
81 - Serial command comming
5F - UNLISTEN
00 - end byte

- phase 3, close channel
55 - Init DMA
81 - Serial Command comming
20 - TALK
00 - end byte
82 - Command comming
E0 - Close channel/file
? 00 - end byte
81 - Serial command comming
3F - UNTALK
00 - end byte



This if from my Minus4 project.

void ProcessDiskDrive ( void )
{
int i,handle;

if (status==IDLE){
switch (DMA_STORE){
case 0x55 : Memory[0xfef0]=0x55; // init DMA...
Memory[1]=Memory[1]&0x3f;
if (FileLoading==1) {
if (LoadingBar==0) CloseWindow (pLoading);
pLoading=NULL;
FileLoading=0;
}
DMA_return;
case 0x20 : IO=IOWRITE; // data write
DMA_return;
case 0x42 :
case 0x40 : IO=IOREAD; // data write
DMA_return;

case 0x61 : status=FILEDATA; // file SAVE data
FIndex=0; // init file index
return;

case 0x62 : // 0x62 is SEQ files
case 0x60 : status=FILEDATA; // reveive file data
LoadFileFirst(); // load requested file into m
DMA_return;
case 0xe0 : DMA_return; // e0= close channel

case 0xf1 : // 0xf1 = GetName
(save)
case 0xf2 :
case 0xff :
case 0xf0 : status=GETNAME; // reveive file data
for (i=0;i<16;i++) DMAFileName[i]=0x0; //
match ANY n
nameindex=0;
DMA_return;
case 0x00 : DMA_return; // end seq.
(ignore)
}

Copyright © Plus/4 World Team, 2001-2024