Resident disk selecter for Amiga

HxC Floppy Emulator on Amiga support
Post Reply
Blueberry
Posts: 6
Joined: Fri Mar 07, 2014 6:20 pm

Resident disk selecter for Amiga

Post by Blueberry »

Hi!

First of all: big thanks to Jeff for an awesome product! The floppy emulator has given my old Amiga 500 new life! :-D

Anyway, I got this crazy idea that it would be a fun project to create my own (open source) HxC floppy manager software for Amiga. It is my impression from reading through some of the forum threads here that it could be useful to others as well.

These are the main features I have in mind:
- Manager is installed as a resident module, so you only have to boot the manager disk once. On reboot, it will automatically open right before booting the disk so you can select which disk to boot.
- Ability to call up manager without rebooting, or simply to switch disks without using the buttons. This seems to be a recurring request. It will of course only be possible if the system is still running (so it rules out many games and demos), but this could still cover many use cases.
- Tiny size to keep down the amount of memory that needs to be reserved for the resident module. My goal so far is to keep it below 10k of memory usage when dormant. This seems plausible from what I have gathered so far.
- Write in assembly (at least the resident parts) - mainly for the size, but also for the fun of it. :) I will strive to keep the code clean, modular and documented, and to keep Amiga specific parts separate, so the other parts could in principle be ported to other 68000-based systems.
- Reasonably colorful interface. The Amiga can show a lot of nice colors, so why not use them? :)

It should of course have the basic configuration features of the current manager. Other features that could be useful (mostly based on forum requests):
- Switch between PAL and NTSC
- Multiple configurations
- Basic file operations (copy, move, rename, delete)
- A device driver leveraging Direct Access, so you could actually mount the SD card on the Amiga. Yes, it's a crazy idea, I know, and it would be painfully slow, but why not? ;) It might alleviate the need for the file operations.

The status of the project so far: I have studied the source code for the current manager and have Direct Access up and running in some test code. The loading and resident module code is working. And I have familiarized myself with the FAT32 filesystem. And brainstormed a lot. :)

I have a few other projects going on at the moment, so it will be at least a couple of months before there will be anything to see. But I thought I could just as well present the idea here now, to get some feedback.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Resident disk selecter for Amiga

Post by Jeff »

Nice ! Can't wait to see the final result! :D

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Resident disk selecter for Amiga

Post by Jeff »

Nice ! Can't wait to see the final result! :D

- A device driver leveraging Direct Access, so you could actually mount the SD card on the Amiga. Yes, it's a crazy idea, I know, and it would be painfully slow, but why not? ;) It might alleviate the need for the file operations.
Not so crazy. Someone have done this on Atari ST !

Blueberry
Posts: 6
Joined: Fri Mar 07, 2014 6:20 pm

Re: Resident disk selecter for Amiga

Post by Blueberry »

Jeff wrote:Nice ! Can't wait to see the final result! :D
Me too. :)

I'll probably have some questions long the way as I get deeper down into the details. Well, I know where to ask. ;)

Feature requests and other comments are more than welcome!

Blueberry
Posts: 6
Joined: Fri Mar 07, 2014 6:20 pm

Re: Resident disk selecter for Amiga

Post by Blueberry »

A status update and a few questions:

I am making good progress now and then. I have fully working FAT32 directory listing in around 800 bytes and am now working on the low-level disk access.


The floppy interface description in the AHRM specifies a step pulse of 1 us, and at least 3 ms between pulses (18 ms when reversing direction). As far as I can see from the source code, the current manager uses a pulse of 1 ms with a 1 ms pause. In my experiments, it seems the HxC accepts arbitrarily short pulses and pauses.

It is nice to be able to enter Direct Access mode instantaneously, so it could be ideal to use very short (i.e. microsecond) pauses, but just to be sure: what is the official minimum pulse length and pause that the HxC supports?


When Direct Access mode is exited, the HxC loads up the currently selected slot. On my Amiga 500, this works fine, but on my 060-equipped Amiga 1200, it doesn't register that the disk has changed. If I run the DiskChange command, it correctly recognizes the new disk. Same thing happens when I use the forward and back buttons to change disk (without using the middle button). Is this a known problem? Any fix/workaround? Something you want me to investigate further?


Also, is there a way to put the HxC in a "no disk in drive" state? Going to the "unselected" state using the middle button seems to register on the Amiga side as an unreadable disk.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Resident disk selecter for Amiga

Post by Jeff »

Blueberry wrote:A status update and a few questions:

I am making good progress now and then. I have fully working FAT32 directory listing in around 800 bytes and am now working on the low-level disk access.
Hi,

Good to read you. Can't wait the result. :D
Blueberry wrote: The floppy interface description in the AHRM specifies a step pulse of 1 us, and at least 3 ms between pulses (18 ms when reversing direction). As far as I can see from the source code, the current manager uses a pulse of 1 ms with a 1 ms pause. In my experiments, it seems the HxC accepts arbitrarily short pulses and pauses.

It is nice to be able to enter Direct Access mode instantaneously, so it could be ideal to use very short (i.e. microsecond) pauses, but just to be sure: what is the official minimum pulse length and pause that the HxC supports?
100/200us should be supported by the emulator BUT there is other factors : The floppy ribbon length, the external case filters and others stuffs may slow down the signal switching. So i think that 1 ms is a reasonnable minimum value.
Blueberry wrote: When Direct Access mode is exited, the HxC loads up the currently selected slot. On my Amiga 500, this works fine, but on my 060-equipped Amiga 1200, it doesn't register that the disk has changed. If I run the DiskChange command, it correctly recognizes the new disk. Same thing happens when I use the forward and back buttons to change disk (without using the middle button). Is this a known problem? Any fix/workaround? Something you want me to investigate further?

Also, is there a way to put the HxC in a "no disk in drive" state? Going to the "unselected" state using the middle button seems to register on the Amiga side as an unreadable disk.
Quite strange : This look likes your disk change signal isn't working. Is the switch/jumper setting right ? Have you tried another floppy ribbon ?
Have you tried the lastest beta version ? :
https://hxc2001.com/download/floppy_driv ... rmware.zip
There is some faster IO routines into this one.

Blueberry
Posts: 6
Joined: Fri Mar 07, 2014 6:20 pm

Re: Resident disk selecter for Amiga

Post by Blueberry »

Jeff wrote:100/200us should be supported by the emulator BUT there is other factors : The floppy ribbon length, the external case filters and others stuffs may slow down the signal switching. So i think that 1 ms is a reasonnable minimum value.
Hmm, I was hoping for something a bit smaller than that, tbh. :)

A 1 ms delay gives a Direct Access switch time (both ways) of more than half a second - not a long time to wait, true, but long enough to not have the "instantaneous" feel, which could be nice in connection with hotkey switching. And there's that beep sound too. ;)

Like I mentioned, my HxC seemed to cope perfectly with pauses of just a few microseconds (basically a tight loop just pulling the step signal up and down). Maybe my setup is somehow optimal in that regard (about 10cm ribbon, HxC rev C not in a case).

Jeff wrote:Quite strange : This look likes your disk change signal isn't working. Is the switch/jumper setting right ? Have you tried another floppy ribbon ?
The ribbon was indeed the problem. I was using a floppy ribbon from a PC motherboard. It was apparently working fine in other respects.

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Resident disk selecter for Amiga

Post by Jeff »

Blueberry wrote:
Jeff wrote:100/200us should be supported by the emulator BUT there is other factors : The floppy ribbon length, the external case filters and others stuffs may slow down the signal switching. So i think that 1 ms is a reasonnable minimum value.
Hmm, I was hoping for something a bit smaller than that, tbh. :)

A 1 ms delay gives a Direct Access switch time (both ways) of more than half a second - not a long time to wait, true, but long enough to not have the "instantaneous" feel, which could be nice in connection with hotkey switching. And there's that beep sound too. ;)

Like I mentioned, my HxC seemed to cope perfectly with pauses of just a few microseconds (basically a tight loop just pulling the step signal up and down). Maybe my setup is somehow optimal in that regard (about 10cm ribbon, HxC rev C not in a case).
yes it support smaller value... but there will have strange problems with external case or on some Amiga model.
BTW there is a command to immediatly exit the direct access without moving the heads :
https://hxc2001.com/download/floppy_driv ... s_mode.pdf
CMD_SET_TRACK_POS : 0x02

Post Reply