USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!

Started by ikonsgr, 09:17, 01 December 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Quote from: GUNHED on 01:46, 15 December 20
Actually the command it always take from the ROM with the smallest number, because it got initialized at last.

Yeap, mea culpa!  :)  I knew that initialization rom walk starts from greatest rom number (7 for CPC464, 15 for CPC6128), but i didn't thought ,that for the KL FIND command, the opposite is true, thus rsx commands from last rom, would be the first to be searched!  :D


Yes, that's unexpected. Firmware does go backwards.
Therefore the DOS ROM with the smallest number is always dominant.  :) :) :) --> Get the revolutionary FutureOS (Update: 2022.03.09) --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)


I finally receive the new batch of usb host modules, so the "full pack" is available again! 
I've also made some optimization on the code of direct load/save routines, resulting in increased speed ~15-20%, up to ~23-24kb/sec! ;)


The way this goes if we wait a month or so it will boost the Z80 by 100% or something :D


I made a quick comparison test, using MASK II disk image.
I remembered back from the 80's that this game took quite more time to load than most games of the era, as it used the hole 128k of memory, and loads ~125kb in total.
The 4 "candidates" was: 3" floppy disk, Gotek drive, Usifac ii with fdc emulation, and Usifac ii with direct file loading.
The results are:
Loading MASK II from 3" floppy disk: ~78seconds
Loading MASK II from Gotek drive: ~80seconds
Loading MASK II from USIfAC II using FDC emulation: ~32seconds
Loading MASK II from USIfAC II using direct file mode: less than 9seconds

Obviously floppy disk and gotek drive speeds are almost identical, but what it seems rather curious is the exceptional difference between these two and the FDC emulation.
Using the same disk image on the same usb stick as with gotek drive, USIfAC II FDC emulation is ~2.5times faster than gotek/disk drive and direct file loading almost 9 times faster! I knew from previous tests with many other games that FDC emulation is faster than a disk drive/gotek drive but the difference was ~10-20%,not... 250% faster!  :)
Although some delay due to head movements and disk motor setup times is expected, and also sectors on each track of the dsk image,are not interleaved (&C1, &C6,&C2etc) for faster loading but in sequential order (&c1,&c2,&c3 etc), still, such ENORMOUS difference is something i can't explain...
Any ideas?  ::)


Your FDC emualation seems to be a big gain. Can't wait to try it with FutureOS.  :) :) :) --> Get the revolutionary FutureOS (Update: 2022.03.09) --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)


Hello, I connected device like in the image and connected it to AMSDAP42 slot which is connected to my CPC6128+

I was able to type "|USB" and "|CAT" which gave me a list with .dsk files on usb.

Then I tried "|CD bubble.dsk" and that returned some error after which I restarted computer and device and tried many times to get it working again but it looks like it's not working anymore.

There are no lights on device, no message in the boot screen.

Is it possible that I broke it? (the reset and pause buttons do work)


In order to use a dsk image, after giving the initial |USB command, you should:

- Select an image by giving: "|MG,"image name"  (the "|CD" command you where using , is for changing directory, and that's why you got the error message)
- Enable the floppy disc controller, by giving: "|FDC"
From now on, any cat,load,run,save command you give, will access the selected image!
And you can still use rsx commands, so you can still change directory, or catalogue the usb stick and by giving another "|MG" command, select another dsk image directly! ;)
Note also, that if you reset amstrad using the RESET button on the board, you don't need to select again the disk image, as board will "remember" the last image used!
Just give |USB and then |FDC and you can access again the previous selected image.
Finally,by giving: |HELP  you can have a short description of all available RSX commands.



Quote from: ikonsgr on 02:32, 28 December 20In order to use a dsk image, after giving the initial |USB command, you should:

Thanks for the "|MG" command - I didn't use it but I can't use any command since the board acts as it is not connected (after the described steps in my previous post).

Is it possible that I "killed" the hardware or the firmware somehow as there are no lights on the device and no "usifac" written on boot?

Can I somehow re-upload firmware or test where is the problem?

Can I detect where is the issue - hardware or firmware? (I posted a picture showing how I connected the wires in my previous post)


Try to give: OUT &FBD2,5
This will reset USIfAC II to ROM 5 and you should see the "USIfAC II Enhanced" message, after resetting with button from the board.
You can also try: OUT &FBD1,30
This actually calls the status routine and it should retrurn characters which can be print on screen by using this small loop:
If you get the status message on screen,this means that the MCU chip is ok.


I will send the next batch of boards early next week, including a new firmware update:

Update DSK image transfer function (RSX command:|DSK), you can now Copy DSK images to floppy disks from either a PC or usb stick (initial firmware supported  transfers only from PC)
-  Major code optimization in file access speeds on direct mode, resulting in ~20%-25% speed increase!
-  Further optimization in file loading code, witch offers ~2% extra loading speed increase!
-  Some other minor code optimizations which offer a small overall performance boost.


your amstrad news source in spanish language :


Quote from: XeNoMoRPH on 20:00, 08 January 21
It's possible to update firmware?

Yes, it is!
You will need a rather cheap PIC KIT 3 programmer.
You plug the icsp connector from pickit3 to ICSP connector on the board (on some boards might need to solder the ICSP pins) or remove PIC chip from on-board socket, and place it on a zif socket.
Then, you can use the MPLAB IPE, which is part of MPLAB IDE and you can download from here, to re-program PIC.
I will attach the latest firmware (along with a quick DIY guide) on the beggining of the thread, for anyone who wants to do it!


Another small ehancement: DSK image transfer routine from usb stick, now supports non amsdos formats too, but single side only. I've test it with a parados 80 image (80 tracks,10sectors/track giving ~400kb storage capacity), and worked fine!
I'm also thinking of the possibility to write even large dual side disk images, using "single head" amsdos routines. If you have a ribbon cable for the external 3.5" drive, that has a head selection switch, like the one i also make, it should be possible to write the entire "head 0" side,then switch to other disk side (probably by prompting on screen), and write the entire "head 1" side...  ::)


I just finished developing and testing the (hopefully) final version of the DSK image transfer from usb device function.
So now, except from weird copy protected images, you should be able to copy to disk, almost any kind of dsk image!
It supports practically any format (DATA, SYSTEM, IBM, PARADOS etc), with any number of tracks (up to 80) and any sector size from 512byte up to 4096bytes.
And for the best part: it supports writing "dual head" images too! And all this, using only the on board Amsdos Rom! :)
Now, you may ask:"how can you write dual head images to disk, when amsdos support only "single side" writing"?
Well, as already noted, i've managed to do it, by using the head  switch on external drive ribbon cable mentioned before: First, by prompting a pause message to set head switch to "Head 1", then writing all  tracks on "head 1" side, then, prompt again for switching head/side and finally writing all tracks on "Head 0" side!
It took a little more than 2minutes to write a single 40tracks/dual head /10 sectors/track (~400kb in total) RTYPE 128 single image!
I also developed a "tweak" for the write order of sectors by applying interleave sector writing (according to format sector id's order, taken from dsk image for each track), resulting in rather fast writing of less than a minute (otherwise it needs ~95 seconds...) for the typical 180kb image. And this tweak applies, not only to "normal" DATA format 9sectors/track images, but also to any format type with either 9 sectors/track or 10sectors/track!  ;)
I think it's safe to say that this is "as good as you can get" using good old Amsdos!  :D


And here is some "proof of concept":
 [ You are not allowed to view this attachment ]  
 [ You are not allowed to view this attachment ]  

It took ~4,5minutes, but even so, you can now transfer to disk a "huge" 800kb PARADOS D10 image to a single disk, using Amsdos (although you will need a PARADOS rom to access it...) ;D
But, even if you don't have a parados rom, it could be useful for copying to real disks any big "single disk"  game/demo, which is accesible using Amsdos too (for example, Rtype 128)



Hi John

This is just a thought that may be usefull ?

Is it possible to Identify that the USIfAC II is connected to a CPC464
So that it will automatically Do the equivalent of |464 and then do a reset ???
To save the operator from going through the setup requirements ??

Keep Safe

Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.


Unfortunately this can't be done. You see, CPC 464 doesn't have amsdos rom on board, so, after initial power up and initialization of ROMS, a reset is mandatory  in order to enable the direct file access mode routines (which "grab" the various Amsdos ROM 7, routines and redirect them to USIFAC II ROM).
BUT, the good thing is that, this "|464"+reset  procedure is needed ONLY at FIRST power up of your amstrad!
After that, you DON'T need to do it again.
You just reset your 464 by pressing reset button (or with a quick on/off  of power switch) and then you follow the "Standard" CPC 6128 procedure!
So in 2words, it's a 3seconds task, that needed to be done only once at initial power up of cpc 464, not much of an effort dont you think?  :)

Note also, that the same goes for accessing dks images on a  cpc 464: the lack of a 765 Floppy Disk controller, imposes the need of reset amstrad (to enable the 765 FDC emulation on USIFAC II) using the "|464" command.
Finally, the "|464" is needed on all models if you want to access a non amsdos image



Ok Thanks for the information.

I will experiment with replacing the Version 1 Basic Rom with a Version 1.1 and see what happens

Have a Look Here :-

Keep Up the Good work.

Keep Safe

Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.


Quote from: ikonsgr on 22:40, 04 December 20
From the 100's of games/programs i've tested so far, the only ones i couldn't run was:
- Batman for ever demo single disk (gave me a "wrong disk configuration", but it works from normal 180kb image file)

You should ask @Rhino what are the conditions for this message to appear. It may help solve future problems.



 After a little help from rhino (thanks for sharing the codes! ;)) and a bit study, i finally manage to load batman forever usign the large single disk image!
The problem was a little mess with physical and logical drive head selection. My code didn't distinguish between these two, and when the FDC command requests physical head 1 (the "HD" bit on the 2nd command byte) but logical head 0 (the 4th command byte), my emulation fetched data from physical head 0, thus the problem.
I have now fix this, although batman forever is the only known image that had problems with that.


 Ok,i found out that dual head images, although they seem to be written correctly on floppy disks (using the "head hack" i described earlier), and i was able to "CAT" them, there are in fact, loading problems, most probable because Amsdos routines can't manage tracks/sectors marked on Head=1, so, although i forced them (with the head select switch) to be written on the correct side of disk, they still have wrong head markings (head=0 instead of head=1).
So, finally, i manage to get rid of amsdos, and use custom fdc routines that can cope correctly with dual head images!
And now, you can use the |DSK command to directly transfer to disk (no "select head" prompt needed any more...), practically any format with any heads/tracks/sectors (except copyprotected images)!
I've already use it to tranfer succesfully:
- orion prime 800kb image,
- R-type128 400k dual head disk image (this one is the only that you couldn't load using FDC emulation too  ;) )
- 800kb parados 80tracks/dual head image
- 720kb pcw/+3dos and vortex images!
Of course,dual head images can be written only on a 3.5" disk drive, as 3" drives have only one head...  ;D

So,it seems that now, you will be able to use amstrad cpc to copy spectrum +3 and amstrad pcw images to floppy disks too!
For a typical 180kb cpc image ~55seconds is needed, where for larger images, time is proportinally longer, e.g. for ~400kb images 2x that time,  for 800kb images 4x that time.
Also, unusual tracks (e.g. without 9 or 10 sectors/track and 512byte/sector) will need extra time too.


"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Powered by SMFPacks Menu Editor Mod