CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: ikonsgr on 09:17, 01 December 20

Title: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 09:17, 01 December 20
For a "Quick Start Guide" see at the end of post!


 Universal Serial Interface for Amstrad CPC II (a.k.a. USIfAC II or... THE GOTEK KILLER FOR AMSTRAD CPC!  :D), is an evolution of my  previous Design (http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc) USIfAC (with which is fully compatible), based on a modern and much more powerful 40pin 18F47Q10@64Mhz  8bit PIC microcontroller, which offers many new amazing features:

 

* usifacii_new_small.jpg
(169.18 kB, 815x486 - viewed 1324 times)


   
Here (https://www.youtube.com/watch?v=AmeqV5Z8Ziw&t) is a small presentation of the board using a usb flash drive on a CPC 6128 and Here (https://www.youtube.com/watch?v=4ZjLQcK0i98) on a CPC 464!.
(Mind also that it can be perfectly used with CPC 464 too, in fact USIfAC II might be the easiest fastest and cheapest solution for loading games on a CPC464! )

All previous utilities (like terminal, file copy, format disk etc) are now easily accessible through RSX commands, with the addition of some new RSX commands for easy setup and configure Serial port speed (|SET), Wifi/Bluetooth Modules (|WiFi,|COM), show status of Interface(|STAT), and finally, an on line help (|HELP) which gives you a short description of all RSX commands supported!
  Here (https://www.dropbox.com/sh/ezzga2dppm6jlm7/AACwFC_rv2QatWh_ndKc9fhma?dl=0) you can find:
- The new User's Guide  (Amstrad CPC Serial Interface II User Guide.pdf)
- The new windows utility program ('Windows program' folder), for Direct connection with a PC, that have some improvements too (for example, direct mode now works with WiFi module too,and program have more stable operation)
- CPCLoad utility that offers an easy batch extraction of files from dsk images, in order to benefit from the amazing loading speeds!
- A Dsk manager for easy mounting images manually, to the 4 available slots (Multi_dsk_manager.zip)
- Basic loader creator utility (cpc_loader.zip) for creating small Basic loaders for your games/programs, and make loading process much easier:

 

* loader_util1.jpg
(142.5 kB, 614x594 - viewed 1151 times)


It supports direct file folders, DSK images and SNA snapshot files. It will be especially useful for CPC 464, where giving RSX commands with arguments is rather tiresome (instead of giving directly commands,like with CPC 6128, you need to set first a string variable, for example, the command: |CD,"DIR",  is given as: A$="DIR":|CD,@A$)

Also, here (https://www.dropbox.com/sh/hzp3a4b7fktcn8c/AAAj2U8otKw26j-chnd8uUxla?dl=0)  you can find a public list of good games that are tested,and with your help (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/) i intend to update it constantly!

And now, for the best part, i can offer:

- Stand alone Board+usb host module (if you have an MX4 or similar board) for  20 euros

- Board+usb host module+edge connector cable for 23 euros

- Board+usb host module+centronics connector cable for 25 euros

All prices include registered/tracked postage!

Anyone interested, please contact at: ikonsgr745@hotmail.com

Quick Start Guide:

|HELP: Get a list of all available RSX commands with short descriptions

AMSTRAD CPC 664/6128:
For direct file access:
- |USB to enable usb host module (with firmware _2d and newer, this required only once,after initial power up)
- |CAT to get a catalogue of root directory
- |CD,"dir" to change directory to "dir"
- |CAT to get catalaogue of "dir"
Then you just give RUN"NAME" of the BAS/BIN file, exactly like you do when using a floppy disk!

For Amsdos dsk image access:
- |USB to enable usb host module
- |CAT to get a catalogue
- |MG,"name" to select the image file you want to use
- |FDC, to enable Floppy Disk Controller emulation
From now on, any CAT,LOAD,RUN,SAVE command will access dsk image!
And by giving again "|FDC" command, FDC emulation will be disabled and CAT,LOAD,RUN,SAVE commands will access again  the floppy disk drive!

For Parados dsk image access:
Follow the above first 3 steps,but then give:
- |DOS,2,for Selecting PARADOS Emulation
- |464 ,Amstrad will reset, and then you can access the PARADOS dsk image using CAT,LOAD,RUN,SAVE commands.
Note that RSX commands can't be used in this mode of operation, until you RESET Amstrad again.

AMSTRAD CPC 464:
For direct file access:
- ONLY ONCE, after first power up you should give: |464 and then press RESET button on the board  No need to do it with boards sent after Feb 2021,(firmware 2c and newer,)
- |USB to enable usb host module
- |CAT to get a catalogue of root directory
- a$="dirname"
- |CD,@a$ to change directory to "dirname"
- |CAT to get catalaogue of subdir
Then you just give RUN"NAME" of the BAS/BIN file, exactly like you do when using a floppy disk!

For Amsdos dsk image access:
- ONLY ONCE, after first power up you should give: |464 and then press RESET button on the board No need to do it with boards sent after Feb 2021,(firmware 2c and newer,)
- |USB to enable usb host module
- |CAT to get a catalogue
- a$="imagename"
- |MG,@a$ to select the above disk image file
- |DOS,1,for Selecting AMSDOS Emulation
- |464, Amstrad will Reset, to enable Floppy Disk Controller & DOS emulation,
From now on, any CAT,LOAD,RUN,SAVE command will access dsk image!

For Parados dsk image access:
Follow the above first 4-5 steps,but then give:
- |DOS,2,for Selecting PARADOS Emulation
- |464 ,Amstrad will reset, and then you can access the PARADOS dsk image using CAT,LOAD,RUN,SAVE commands.
Note that RSX commands can't be used in this mode of operation, until you RESET Amstrad again.

Update Firmware:

Latest firmware release: 8/6/2021
  18F47Q10_4b: https://www.dropbox.com/s/4umrq6qox22k5tw/18f47q10_4b.zip?dl=0 (for new white boards with dsk swap button)
 
* 18f47q10_2d.zip
(123.51 kB - downloaded 39 times)
(for older boards without the extra dsk_swap button)
 
List of updates since initial version (1/12/2020):
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.
-  Dsk image transfer,now 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.Also writing speed to disk, is increased with most images (having 9sectors/track & 10sectors/track,either in sequential or interleaved order)
- No need for performing the CPC 464 Initial procedure after first power up, now Amstrad automatically resets a couple of times after "cold start", and then you can directly give "|USB" command, exactly like for CPC 6128!
- No need to give |USB command after every Reset,but only after Amstrad's initial power up (for ALL Amstrad models, with firmware _3a and newer).
- NEW feature added: Access multiple dsk images "on the fly"! Using the new "dsk swap" button on the new board, you can "round select" up to 4 different dsk images,and be able to load ALL mutli image games/programs/demos!
- Bug fix: File extension was ommited when saving a file with full 8+3 characters (e.g. "filename.bas" was saved as "filename" without the extension)
- Get faster catalogue lists from Usb device (~25% faster on mode 1, and ~50% faster on mode 2, firmware _3 and newer)
- Amsdos/Parados Emulation is now saved into PIC's EEPROM, so Board will always "remember" your choice.
- New ability:choose if you want to Return to Usb device Root directory after Reset, just give OUT &FBD1,66 to enable or OUT &FBD1,65 to disable. Again, board will "Remember" your choice. This could be very usefull if you use the BASIC loader listings mentioned above to load  Games/programs, as after RESET, you will automatically return to Root directory, without needing to give |CDR command!  ;)
- |STAT command now shows Firmware revision and if return2root directory after Reset is enabled.
- Bug fix: When saving a file, Dsk Image name in slot 1, changed to name of saved file.
- Code optimization of Board's Rom assembly code.
- |CD & |CAT arguments, now support lower case letters too.
- New Command: |SNA, for loading SNA snapshot files.
- RSX commands: |SET,|COM,|WIFI,|TER,|GALA,|PACMAN,|KGOR are now executed directly on CPC464, without needing to give "RUN" anymore!
- SNA routine now checks if Amstrad has 64k only, and loads only the 1st 64k ram dump even if snapshot file is for 128k. The reason i did this is because i noticed that the snapshot archive has a lot of game files that are 128k but actually only the 1st 64k iis used, so now you will be able to load most of the SNA files on CPC464 too.
- Minor optimization of  board's ROM code this time:replace "cp 0" with "or A" , reduce the size of hex file by dumping initial zeros of arrays & variables used in routines transferred to RAM.
- Fix a small bug in |format routine- now shows correctly  formatted track numbers.
- Fix a bug in |2PC routine when use the "invert file selection" function.

Quick PIC program Guide:
- You will need a rather cheap PIC KIT 3 programmer (https://www.ebay.ie/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=pickit+3+programmer&_sacat=0&LH_TitleDesc=0&_osacat=0&_odkw=pic+kit+32).
- 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 cheap zif socket (https://www.ebay.ie/itm/PIC-ICD2-PICKit-2-PICKIT-3-Programming-Adapter-Universal-Programmer-Seat-board/191851404539?hash=item2cab3c1cfb:g:rncAAOSwd3dXFaZ-).
- Use the MPLAB IPE (https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-integrated-programming-environment#), (which is part of MPLAB IDE and you can download from here (https://www.microchip.com/mplabx-ide-windows-installer)), to re-program PIC (18F47Q10).
After re-programming PIC MCU, you should assign a rom number to the board, by giving: out &FBD2,5 on basic prompt, and then reset.

Finally, Here (https://www.dropbox.com/s/pymv4sbxch3psin/Updating%20the%20Firmware%20of%20USIfAC%20II%20via%20ICSP%20v1.pdf?dl=0) you will find a very detailed guide for updating firmware made by good CPCWiki member Richard_Lloyd (thanks Richard!)


Guide for older boards, to manually connect a usb host module on the board

The usb host module is connected easily through the 4 dupont wires (which i will also send you) as follows:
 

* DSCN1328.JPG
(112.1 kB, 424x471 - viewed 2421 times)

Board with module attached should look like this:
 

* DSCN1329.JPG
(203.26 kB, 826x422 - viewed 2568 times)

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: XeNoMoRPH on 09:36, 01 December 20
I am interested in a unit, please :)
Title: Re: USIfAC II:Make your PC or USB stick an HDD for Amstrad,access dsk and many more!
Post by: Gryzor on 09:49, 01 December 20
So you can actually run games normally from their files (not dsk images) from the mass storage? At this price it's really good!!! How about compatibility?
Title: Re: USIfAC II:Make your PC or USB stick an HDD for Amstrad,access dsk and many more!
Post by: ikonsgr on 09:57, 01 December 20
So you can actually run games normally from their files (not dsk images) from the mass storage? At this price it's really good!!! How about compatibility?

Yeap! Exactly that! Practically the usb stick is converted to a huge HDD for your amstrad! And the GREAT benefit of "getting rid" of  the dsk container is... SPEED! Loading is so fast that is actually compared to a rom board, most games load in 2-3 seconds!  :)
Check the small presentation (https://www.youtube.com/watch?v=AmeqV5Z8Ziw&t) i've made, and see for yourself!
Compatibility is very good too, most multi-file games load just fine, only "drawback" is that you can't load games that use track loaders or non standard amsdos routines. But for these, i developed a floppy controller emulation in order to access dsk images too! So in practice USIfAC II is like having an HDD flash drive disk along with a gotek drive together! ;-)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: Gryzor on 10:16, 01 December 20
Holy cow this sounds beautiful! I want one, please :)

Yeah I realise that some games will run into problems loading but I guess there are always cracked releases one could use. But if there's a solution to also access dsk images... then wow.

I did watch (most of) the presentation before rushing here to post, I didn't see anything about this last part, I now saw it's around the 2:30 mark!
Title: Re: USIfAC II:Make your PC or USB stick an HDD for Amstrad,access dsk and many more!
Post by: TotO on 10:38, 01 December 20
At this price it's really good!!!
The price of the CPC passion by not selling for the features.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: ikonsgr on 10:44, 01 December 20
I did watch (most of) the presentation before rushing here to post, I didn't see anything about this last part, I now saw it's around the 2:30 mark!

Also at the begining of the video, the 1st load of star sabre is done through a dsk image, where loading is like from a normal drive ~4-5kb/second, but after that, i'm using the direct file method to load the same game and speed is "boosted" to ~18-19kb/sec!
The last loading in video, is done through a very large and bulky 800kb parados image file, and that's why speed is rather slow, but if you use normal amsdos dsk images,  actual speed is usually a bit faster than a real disk drive.
Mind also that games using large images but with amsdos boot sectors (like orion prime for example), are loading VERY fast, even from the dsk image! ;-)
Title: Re: USIfAC II:Make your PC or USB stick an HDD for Amstrad,access dsk and many more!
Post by: ikonsgr on 10:49, 01 December 20
The price of the CPC passion by not selling for the features.

Well,if i had to consider the 100's and 100's of hours in the last many months, that took me to develop these features, then i should sell it for 100euros!  :)
But again, the main purpose is to offer fetaures to the community as practical, as easy and... as CHEAP as it can be!  ;)
Title: Re: USIfAC II:Make your PC or USB stick an HDD for Amstrad,access dsk and many more!
Post by: TotO on 10:54, 01 December 20
Well,if i had to consider the 100's and 100's of hours in the last many months, that took me to develop these features, then i should sell it for 100euros!  :)
Exactly. And some games on CPC have to be sold for 500/1000€ instead of being free! ;D
Your new expansion is a really promising alternative to a bunch of other hardware. 8)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: krusty_benediction on 11:23, 01 December 20
Hello; it seems to be a great affordable interface that combines both HXC-like features and M4-like features !I have looked at the documentation, and available functionalities are fascinating.However, I'm not a gamer and my CPC use case probably differ of what most users expects. There are some points that forbid me to buy it at the moment:
- have you planned to add a snapshot loading  ability (I mainly test my developments by creating a snapshot sent to the CPC over wifi with the M4); without that I would have no use of this card- have you planned to write an os agnostic PC tool (I mainly develop from Linux) or a kind of HTTP API as the M4; without that I could not automatize PC project construction and CPC test by typing a single line of command
For the FDC emulation stuff, does it also work when the dsk in on the PC and accessible over the WIFI connection ?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: Gryzor on 11:37, 01 December 20
SNA loading would be interesting indeed, especially with the latest SNA batches!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: ikonsgr on 13:12, 01 December 20
- have you planned to add a snapshot loading  ability (I mainly test my developments by creating a snapshot sent to the CPC over wifi with the M4);

I'm not sure if understand that correctly, you mean the ability to directly load a file from pc and place it anywhere in Amstrad's ram? This can be already done in a way, as you can directly load a binary file from pc and if you want to load a headerless file, you can do it as ascii (which are also supported) using either "openout" and "read #9" commands from basic or CAS_IN_OPEN and CAS_IN_CHAR from assemly. Of course this would be rather slow, but i think it would be rather easy to add another RSX command in order to load any file from PC and place it anywhere in RAM very fast and without restrictions!  ;)

have you planned to write an os agnostic PC tool (I mainly develop from Linux) or a kind of HTTP API as the M4; without that I could not automatize PC project construction and CPC test by typing a single line of command
For the development of windows utility program, i mainly used DELPHI (or RAD STUDIO XE3 to be more exact). All functions are embedded into main's program source code,  but if you want to develop any software for USIfAC everything is going down to simple input/output commands using only 2 ports! Btw, here are a couple of "3rd party" software that utilized the previous Usifac interface (and most probable will work on the new one too, as they are 100% compatible on the serial port section)
A midi interface (https://www.youtube.com/watch?v=960FIh6B_3g&feature=youtu.be)
Real time player using a Arkos sound tracker (https://www.youtube.com/watch?v=wZ8rREBnknM&feature=emb_rel_pause)
And as far as i remember both of the guys told me that it was rather easy to make them!  :)

For the FDC emulation stuff, does it also work when the dsk in on the PC and accessible over the WIFI connection ?
Yes, you can use dsk images either in a usb flash drive mounted on the CH376 host module, or access them directly from a PC using Wifi module or Direct serial/bluetooth module connection.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: krusty_benediction on 13:14, 01 December 20
I'm not sure if understand that correctly, you mean the ability to directly load a file from pc and place it anywhere in Amstrad's ram? This can be already done in a way, as you can directly load a binary file from pc and if you want to load a headerless file, you can do it as ascii (which are also supported) using either "openout" and "read #9" commands from basic or CAS_IN_OPEN and CAS_IN_CHAR from assemly. Of course this would be rather slow, but i think it would be rather easy to add another RSX command in order to load any file from PC and place it anywhere in RAM very fast and without restrictions!

No, I was literally talking of snapshots ;) https://www.cpcwiki.eu/index.php/Snapshot. (https://www.cpcwiki.eu/index.php/Snapshot)
For example, M4 allows to do that xfer -y cpcip file.sna to load the snapsjot on  cpc
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: ikonsgr on 14:58, 01 December 20
No, I was literally talking of snapshots ;) https://www.cpcwiki.eu/index.php/Snapshot. (https://www.cpcwiki.eu/index.php/Snapshot)
For example, M4 allows to do that xfer -y cpcip file.sna to load the snapsjot on  cpc
Well, to tell you the truth i never got involved with snapshots...  :) What exactly you do with these files?
My main goal with USIfAC II, was not to take the "traditional" approach of trying to "adapt" and utilize the existed file containers and tools developed for Amstrad emulators, (like dsk image files or sna files)but instead, provide a simple,fast and straight forward file access to large storage devices (either an HDD of a connected PC or a usb flash drive).
By doing this, i was freed from floppy controller constraints (that imposed by the strictly use of dsk image containers) and manage to acheive MUCH faster read/write access to files! ;)
Of course, in the end, i've decided to add dsk image access functionality too, in order to be able to load some games/programs that used "low level" sector loaders, or for any game/program that the direct file loading didn't work for some reason.
In 2 words, USIfAC II is aimed mainly for the simple Amstrad user who want an easy fast and rather cheap way to load games/programs and also offer some extra functions for floppy disks (like quick format or copy files to floppy disks) for any "hard core" Amstrad user, that prefers the... "real thing"  :)
And i think, it's the easiest,fastest and probably the cheapest way to have a lot of fun with a CPC 464!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: Gryzor on 15:32, 01 December 20
Indeed it is. For a simple user like myself, it sounds near perfect*. But the addition of snapshot support would probably eliminate much of the incompatibility cases, that's where the use would lie, for me!

Now, how can I buy one? :)

*if someone can make a case for it... ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: krusty_benediction on 18:02, 01 December 20
Well, to tell you the truth i never got involved with snapshots...  :) What exactly you do with these files?

We specify the content of each memory byte as well as the content of crtc, z80 registers and some information for the gate array. So it is simply the state of a program when loaded in memory.
It is really useful when you have not yet created the loader/linker of the program.
For my case, I code each demo effect screen individually and test them in real time on CPC with snapshot send by the PC on the M4 that fill it in the CPC. Was doing the same when coding https://www.pouet.net/prod.php?which=87382 (https://www.pouet.net/prod.php?which=87382)
For other guyz, I guess it is interesting to start a game at a specific point during the play
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad's HDD,access dsk's,and many more!
Post by: ikonsgr on 19:52, 01 December 20
We specify the content of each memory byte as well as the content of crtc, z80 registers and some information for the gate array. So it is simply the state of a program when loaded in memory.
It is really useful when you have not yet created the loader/linker of the program.
For my case, I code each demo effect screen individually and test them in real time on CPC with snapshot send by the PC on the M4 that fill it in the CPC. Was doing the same when coding https://www.pouet.net/prod.php?which=87382 (https://www.pouet.net/prod.php?which=87382)
For other guyz, I guess it is interesting to start a game at a specific point during the play
I see...but how you create such snapshots? Can you take a snapshot with M4 on a real amstrad? Because otherwise, i don't think it's very practical, at least from a "game point of view".. I mean, if you can take a snapshot only from an emulator, you would need to start playing a game on emulator, reach some point in game, then take a snapshot, and then continue to a real amstrad cpc with a M4 board ... Not very practical don't you think?  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: krusty_benediction on 21:06, 01 December 20
On my cases, I build them from scratch on my PC when assembling my asm code.
For the others, I do not know ;) But I'm pretty sure such interface (or M4) associated to an Hacker-like rom could build such snapshots. No idea if someone has implemented that already with M4.
Anyway, I'll follow this project and eventually buy one card lateer
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: slugman on 22:19, 01 December 20
Nice device! I sent you a PM for buying one  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 22:30, 01 December 20
What an great idea and expansion!!!

Can it actually simulate the Vortex F1-D FDC with different I/O addresses too?

Can we use X-DDOS instead of ParaDOS?

Well, I would like to sign up for 3 devices.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:47, 01 December 20
Can it actually simulate the Vortex F1-D FDC with different I/O addresses too?
We already discussed (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg190714/#msg190714) that, and i believe  that  Vortex will be directly supported too!

Can we use X-DDOS instead of ParaDOS?
Well, if you want to have amsdos and X-DDOS emulation, tell me which one of the X-DDOS ROM file (https://www.cpcwiki.eu/index.php/X-DDOS) you want, and i'll "custom" replace parados with it, for your boards! ;-)




Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: remax on 23:42, 01 December 20
Count me in !
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 02:57, 02 December 20
Hi ikonsgr


PM Sent


Thanks for all your work


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: VintageAdvantage on 18:35, 02 December 20
This is brilliant and a great example of what can be done if the MCU is fast enough - everything that requires extra glue logic chips for address decoding with slower MCUs can just be done in software with all these extra MHz's. Did you program the firmware in ASM or C? Good choice of the MCU.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 19:36, 02 December 20
We already discussed (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg190714/#msg190714) that, and i believe  that  Vortex will be directly supported too!Well, if you want to have amsdos and X-DDOS emulation, tell me which one of the X-DDOS ROM file (https://www.cpcwiki.eu/index.php/X-DDOS)you want, and i'll "custom" replace parados with it, for your boards! ;-)

Thanks a lot for your answer. Sorry, I don't know the usifac 2 as well as you. So don't bother if I ask something twice. If Vortex FDC works, this will be great. I would volunteer for testing if you want.

About the X-DDOS ROM... the best one is attached to this post. See below.



Can we burn the chip on the card by myself to alter the ROM content? Maybe this would make things more easy for you
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:20, 02 December 20
This is brilliant and a great example of what can be done if the MCU is fast enough - everything that requires extra glue logic chips for address decoding with slower MCUs can just be done in software with all these extra MHz's. Did you program the firmware in ASM or C? Good choice of the MCU.

 Well, actually the extra logic needed for the required address bus and signal decoding, wasn't done in software at all (even at that speed, analyzing the required address bits and Cpu signals in software loops, would affect seriously responce and speed).
 Instead i use an extra  feature of these Microcontrollers called "Configurable Logic Cells" or CLC's.
These are small programmable logic modules where you can assign type of logic (AND OR gates, Flip-Flops etc,and even combination of them), and set for, up to 4 inputs and an output. When module is activated (which can be done "on the fly" in microcontroller program) it will act like a real logic chip, e.g. have INSTANT responce on input signal changes!  :)
 So,i design separate logic cell modules to accommodate various functions, like when Amstrad is addressed to Serial Port or Floppy disk controller,or when it reads upper rom or when gate array selects rom number (e.g. an out &DF00,x is sent from Gate Array chip). All in all, i needed to design 5 different logic modules, 4 for the above functions, and one "master" module ,that take the outputs of the other modules and gives a single ouput that pauses Amstrad (ready signal forced to '0') and enables Microcontroller program.
 By doing that, the only thing that needs to run constantly on the PIC microcontroller, is a small loop for checking the output of master module, which can be done VERY fast, every ~0.15 usec! ;-)
 I use cow basic (http://gcbasic.sourceforge.net/Typesetter/index.php/Home) as main tool for PIC program developing, which produce REALLY good and optimized asm code!  ;)
And finally, for anyone interested, you can find the assembly code for the main USIfAC II ROM, which holds the code for the dozens of  RSX commands ,in the attached file (this can also be very helpful for anyone wants to use the CH376 USB host module, as the documentation was not very good, it took me A LOT of testing and effort to finally make it work as it should...  :) ).
The binary of this code is placed inside a table into PIC's program.
I also used a "trick": When Amstrad reads from USIfAC II Rom and code reaches specific addresses,it jumps to start reading from first byte @&C000,while at the same time, Microcontroller program changes table to other tables (that hold large utlitites or the 3 games included). By doing that,i've managed to fit ~80kb of data into a 16kb address space of a single upper rom!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: VintageAdvantage on 20:41, 02 December 20
These are small programmable logic modules where you can assign type of logic (AND OR gates, Flip-Flops etc,and even combination of them), and set for, up to 4 inputs and an output. When module is activated (which can be done "on the fly" in microcontroller program) it will act like a real logic chip, e.g. have INSTANT responce on input signal changes! 

That is interesting. How do you program these? Is that done from the MPLAB Microchip IDE?
And the main firmware is in BASIC? Wow! I should switch over to PICs...

So this is combinational logic only it seems. No Flipflops or Latches in the logic cells possible? It seems you still need to pause the Z80 via pulling READY to not "miss" the databus... correct?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:43, 02 December 20

Thanks a lot for your answer. Sorry, I don't know the usifac 2 as well as you. So don't bother if I ask something twice.
No bother at all my friend! I didn't remember the details too, but i remembered we had discussed the matter a few months ago, so i've made a quick search and gave you the link directly!  ;)

About the X-DDOS ROM... the best one is attached to this post. See below.[/font]
Can we burn the chip on the card by myself to alter the ROM content? Maybe this would make things more easy for you

My friend, changing parados to X-DDOS rom, is half a minute work: Just convert the binary to a large pile of numbers with commas (i've already developed such a utility and used it all the time) ,and copy it into PIC's program in place of PARADOS table!  ;) 
If you have a PICKIT3 i can give you the custom HEX file with X-DDOS and burn it yourself easily, this time i add an ICSP connector to the board, so you can flash PIC directly on board!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 20:59, 02 December 20
Oh, the PIC is too new for my Vspeed Stager (2015). Maybe I can get a software update for it.


Do you have the ParaDOS at position 7 like the Amsdos? In this case I wouldn't need XDDOS. Need to read the USIfAC manual again...


Cant't wait to use it to emulate an real FDC.  :) :) :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:08, 02 December 20
That is interesting. How do you program these? Is that done from the MPLAB Microchip IDE?
Yes, these need to be configured through MPLAB's MCC (MPLAB Code Configurator),then i export the configuration file for each CLC and place it into Cow basic's source code, once you learn to do it it's rather easy task.

And the main firmware is in BASIC? Wow! I should switch over to PICs...
Yes,the source code for PIC microcontroller was made using COW Basic as i already told you. But the compiler produces a very good and optimized assembly code!
It's really a very good tool, which makes programming 8bit PIC's (especially for large complex projects as this one) a much easier and enjoyable task!  :)

So this is combinational logic only it seems. No Flipflops or Latches in the logic cells possible?
Well, not exactly. This is taken from PIC 18F47Q10 data sheet:
Possible configurations include:
• Combinatorial Logic:
– AND
– NAND
– AND-OR
– AND-OR-INVERT
– OR-XOR
– OR-XNOR
• Latches:
– S-R
– Clocked D with Set and Reset
– Transparent D with Set and Reset
– Clocked J-K with Reset


And there are 8 CLC's in total, enough to develop quite complex logic, don't you think?  :)
 Practically it's like having a small CLPD or PAL inside Pic!  ;)

It seems you still need to pause the Z80 via pulling READY to not "miss" the databus... correct?
Well since most of the tasks,when interface is enabled, usually need some microseconds, Amstrad must be paused.But the good thing is that the procedure of unpausing amstrad and unlatching data bus (after finishing the job),is made in "real time" without any added delays (like with previous usifac). And this is where the extra speed becasue of running at 64Mhz, really helped!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:24, 02 December 20
Oh, the PIC is too new for my Vspeed Stager (2015). Maybe I can get a software update for it.
Do you have the ParaDOS at position 7 like the Amsdos? In this case I wouldn't need XDDOS. Need to read the USIfAC manual again...
Cant't wait to use it to emulate an real FDC.  :) :) :)
Well, yes i suppose it does. If you give "|DOS,2" to select Parados for emulation, and then "|464" command, Amstrad will reset (in this state ,you can't use any RSX commands as upper rom 7 is exclusively points to either AMsods or Parados emulation tables) ,and any rom read from Upper ROM 7 will be done from Parados table inside PIC's code!
 I could even run the parados utility program by giving |DRIVE, but of course, disk drive doesn't work. In this special mode, you can only access the dsk image you have previously selected.
 I named this function |464 because its main purpose is to give a cpc464 the ability to access dsk images. And in order to do that, you need to "replace"-emulate both missing 765FDC and AMsods/parados rom chips. However, on Amstrad cpc664/6128 ,because Amsdos rom already exists, you only need to emulate 765FDC ("|FDC" command), in order to gain access on a dsk image . This offers speed (responce is a bit faster than using a real gotek/disk drive)  and you can also use all RSX commands too! What i found out though,is that you can also use this special mode for 464, with a cpc6128 too, in order to have access to parados dsk images (i demonstrate this in the presentation video too)! It's like having a rom switcher that provides both amsdos and parados!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:54, 04 December 20
I took a look at the snapshot sna file structure (http://cpctech.cpcwiki.de/docs/snapshot.html), that some noted before, and i think it might be not too difficult to develop a routine for using them with Usifac II too.
But, as i never got involved with snapshots, and before i start, i would like to ask some things first:

- Is the ability to use sna files on real CPC, something useful for the average user or it's more of a tool, addressed to the advanced user/developer/programmer?

- I've noticed in sna archive  (https://www.cpcwiki.eu/index.php/Snapshot_Archive) that almost all snapshots are for CPC464. Does this mean, that their main usefulness concerns CPC464? And is this because quite a few games found in dsk images can't be loaded on a CPC464? (i've noticed this while testing usifac ii on CPC 464 too, some games ,for example Cauldron II or ikari warriors, couldn't load on CPC 464 , giving error messages or hang up/crash, while others, i had to "tamper" the basic loader listing to remove any "CPC6128" only commands they have)

-On the technical side, i suppose there must be a specific way to properly restore all the registers, counters and interrupts apart from memory dump. Can someone give me a rough "walkthrough" of how exactly i will do that? (i have a rough idea of how to restore registers from various chips using proper OUT commands (http://www.cpctech.org.uk/docs/iopord.html) but what about restoring interrupts or special counters of CRTC? And what about the order of restoring?)

- Finally, is there a way to create a snapshot on a real amstrad apart from using multiface II (although i'm not quite sure that snapshot files taken with multiface ii are the same as sna files...)? And how exactly could someone do that? Maybe activating NMI (non maskable interrupt) on Z80, and placing @&0066 RAM address, an RST3 call to a routine?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 22:00, 04 December 20
As a simple user I'd find snapshot support useful for those programs that refuse to load, for whatever reasons, from the device...
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:40, 04 December 20
As a simple user I'd find snapshot support useful for those programs that refuse to load, for whatever reasons, from the device...

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)
- R-Type 128, at some point stops loading, (this was impossible for me to fix, what ever i tried... :( )
- Dragon Ninja, original, crashed after loading (but the cracked version works fine  ;D )

This means that,statistically, you can probably load, either directly from files or dsk images, more than 99% of existed games/programs.
So, if the only practical use of snapshot is a way of loading games that refuse to load, i don't think it would be very useful for USIfAC II...  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: XeNoMoRPH on 09:39, 05 December 20
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) , with http://cngsoft.no-ip.org/cpcec.htm , takes custom snapshots of used memory: automatically detects if the first 64k is enough.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:05, 05 December 20
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) , with http://cngsoft.no-ip.org/cpcec.htm , takes custom snapshots of used memory: automatically detects if the first 64k is enough.

Ok,but i was talking of taking snapshots from a real CPC not  from an emulator.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 12:01, 05 December 20
If compatibility is so high then I guess it's a small luxury😊

Of course hunting for a version that will work is a waste of time, but now we're talking first world problems😁
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Takis Kalatzis on 16:18, 06 December 20

First of all, congratulations for your excellent work regarding this board! It looks like the most straightforward way to have your entire collection at one USB stick and run everything from there!

As a happy owner of the excellent Duke's M4 board, I have some questions regarding USifAC II.


1. Since M4 has already the ability to load games (either from files or from .DSK), what are the benefits of running games/programs through USifAC? I guess the loading time will be faster, but will I be able to run programs that are not cracked? For example, I have not been able to run "The Pawn" through M4 in whatever version I tried.


2. Shall I need a Mother X4 board (or similar) in order to have both M4 and USifAC connected at the same time? My understanding is that they both use CPC's expansion port (and for those who have Mother X4: can I connect an M4 with an Edge Adapter directly on Mother X4 or will I need another cable/adapter?)


Keep up the good work!


Takis
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:51, 06 December 20
1. Since M4 has already the ability to load games (either from files or from .DSK), what are the benefits of running games/programs through USifAC? I guess the loading time will be faster, but will I be able to run programs that are not cracked? For example, I have not been able to run "The Pawn" through M4 in whatever version I tried.

 Well,i would say that, the most obvious difference is COST! USIfAC II is a LOT cheaper than a M4 board (~less than half the price)!  ;D
Also,i think that M4 doesn't offer the "direct mode" to load files directly from a usb flash drive instead from image containers, at least not at such great speeds of ~20kb/sec. (false assumption... :) )
Of course, M4 is a much more  powerful and modern/proffesional board (it uses very powerful ARM 32bit MCU and smd chips), and also, it's been developed for years ,offering many extra tools and functionality. USIfAC II it's more of a hobbyist "low budget" board. But if you see it from the "average Amstrad user" perspective, where the main thing they want, is an easy, fast and cheap way to load games, USIfAC II might be the best "Value for money" choice for that!  ;)
Especially for CPC 464 users, i think it's BY FAR the most affordable way to load easy and fast games compared to everything else on the market.

2. Shall I need a Mother X4 board (or similar) in order to have both M4 and USifAC connected at the same time? My understanding is that they both use CPC's expansion port (and for those who have Mother X4: can I connect an M4 with an Edge Adapter directly on Mother X4 or will I need another cable/adapter?)
Keep up the good work!
Takis

Well,i suppose you could do that, but if you already have a M4 board, i don't find any reason for having a USIfAC II,unless you are an Amstrad collector and you want to have all existed hardware ...
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:18, 06 December 20
I have not been able to run "The Pawn" through M4 in whatever version I tried.

You mean this (https://www.mobygames.com/game/cpc/pawn) game?
I found it in my collection, this is a 2 dsk image game, so you need a way to "change disks" in order to load it.
I don't know if you can change "on the fly" mounted images with M4, but currently you can't do that with USIfAC II. BUT, i happen to be in a process of developing such an ability for a future version (where you will be able to mount up to 3 dsk images, and "round" select them "on the fly" by pressing a small button like the one i have for RESET  :)) and i gave it a try. Game loaded just fine  ;D  (i've also test it with XYPHOBES (a 3 dsk image game!), Savage, OUT RUN europa and turbo out run, all 2 dsk image games, and also they seem to load fine!). Of course, only a very small portion of  games is more than a dsk image in size, and most of them ,(especially recent games)you can find them in  "big" single dsk images too (like the very good adventure "orion prime", which i've played it using a single 800kb image, instead of having 4 "normal" images), which USIfAC II also supports.
 All in all, compatibility seems to be very good, out of 100's of games/demos i've tried only a few didn't seem to load. But even for these games you can usually find them in cracked versions which most probable will work!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Duke on 23:34, 06 December 20
Also,i think that M4 doesn't offer the "direct mode" to load files directly from a usb flash drive instead from image containers, at least not at such great speeds of ~20kb/sec.

Quote
Well,i suppose you could do that, but if you already have a M4 board, i don't find any reason for having a USIfAC II, unless,perhaps, you want to load games even faster! 

Well you are wrong.
Just for the kicks I quickly wrote a simple basic test to measure the speed of accessing the microSD card via firmware on M4 board.
The speed after a 4 minute run is around 100 KB/s.

Unless my program is completely wrong, you could try it on your device aswell:

10 MEMORY &1FFF     
20 MODE 2
30 u = TIME
40 t = 0
50 a = TIME
60 FOR i=1 TO 10
70 LOAD"32KB_BLK.BIN",&2000
80 t=t+32
90 NEXT
100 b = TIME
110 PRINT 320/((b-a)/300);" KB/s - total : ",t;" KB/", (TIME-u)/300;" Sec"
120 GOTO 50

First save a 32KB block, ie. like this save"32KB_BLK.BIN",b,&2000,&8000
And you may want to start a timer next to it in case you have any interrupt disabling (I used my phone and ran the test for 4 minutes).

Also it could be much faster written in assembler and doing direct access. The microSD on M4 board is connected via SDIO 4 bit, its very fast if the card allows it ;)

Other than that. Congrats on your device, it looks promising - good job :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 02:11, 07 December 20
Well you are wrong.
Just for the kicks I quickly wrote a simple basic test to measure the speed of accessing the microSD card via firmware on M4 board.
The speed after a 4 minute run is around 100 KB/s.
Unless my program is completely wrong, you could try it on your device aswell:
10 MEMORY &1FFF     
20 MODE 2
30 u = TIME
40 t = 0
50 a = TIME
60 FOR i=1 TO 10
70 LOAD"32KB_BLK.BIN",&2000
80 t=t+32
90 NEXT
100 b = TIME
110 PRINT 320/((b-a)/300);" KB/s - total : ",t;" KB/", (TIME-u)/300;" Sec"
120 GOTO 50

First save a 32KB block, ie. like this save"32KB_BLK.BIN",b,&2000,&8000
And you may want to start a timer next to it in case you have any interrupt disabling (I used my phone and ran the test for 4 minutes).

Also it could be much faster written in assembler and doing direct access. The microSD on M4 board is connected via SDIO 4 bit, its very fast if the card allows it ;)

Other than that. Congrats on your device, it looks promising - good job :)

 100kb/sec? Wow!  :o  Although it  seems a bit... "too much",i mean, even copying a memory block in Amstrad's RAM  can't be faster than ~60-65kb/sec.... Unless you are using MCU's internal RAM and not Amstrad's ram.... ::)
Anyway, i would be surprised if your 32bit ARM "monster" with ~200MIPS "horse power", couldn't do less than that and be..."defeated" by my "puny" 8bit PIC, giving "only" 16MIPS.... :)

Bur since you got bother answering my ...."challenge"  :), perhaps you could clear up some things about M4:

- Apart from the above speed test, can M4 also run games/programs directly from files at such speeds? Because the ~20kb/sec USIfAC II can achieve,  is not just a speed test, but the ACTUAL average loading speed of REAL games!
 
- Does M4 is able to also take snapshots or only load ones? And could you give some details on how exactly you do that? (i never got involved with snapshots, so i would appreciate any help on that)

- Can M4 mount more than one dsk images and somehow select them "on the fly", for supporting "in game" disk (image) swapping? (i'm experimenting on that too with USIfAC II)

- Does M4 support dsk image access of large non AMSDOS formats, like the various  dual head and/or 80tracks PARADOS formats of up to 800kb?

Thanks again for looking at my "humble" project "master" Duke!   ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Duke on 03:40, 07 December 20
100kb/sec? Wow!  :o  Although it  seems a bit... "too much",i mean, even copying a memory block in Amstrad's RAM  can't be faster than ~60-65kb/sec.... Unless you are using MCU's internal RAM and not Amstrad's ram.... ::)
Actually as far as I remember we can move around 4KB of data per frame using ldi/ldir/stack on CPC, so that would amount to roughly 200 KB/s.

Quote
- Apart from the above speed test, can M4 also run games/programs directly from files at such speeds? Because the ~20kb/sec USIfAC II can achieve,  is not just a speed test, but the ACTUAL average loading speed of REAL games!
 
Yes, of course, there really isnt any difference.
Quote
- Does M4 is able to also take snapshots or only load ones? And could you give some details on how exactly you do that? (i never got involved with snapshots, so i would appreciate any help on that)
 
Yes, it can take snapshots via the HACK menu... The HACK menu source code is available here, if it can be of any help:
https://github.com/M4Duke/m4hackmenu (https://github.com/M4Duke/m4hackmenu)

Quote
- Can M4 mount more than one dsk images and somehow select them "on the fly", for supporting "in game" disk (image) swapping? (i'm experimenting on that too with USIfAC II)
You can change .dsk´s using the web-interface. An option to do it via hack menu was planned...

Quote
- Does M4 support dsk image access of large non AMSDOS formats, like the various  dual head and/or 80tracks PARADOS formats of up to 800kb?
Yes it does. Ie. ROMDOS (D1/D2/D10/D20/D40) and PARADOS 80.

And lets not derail your thread even further, it should not be about M4 but your project, I only had to correct the incorrect assumptions :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 03:55, 07 December 20
Actually as far as I remember we can move around 4KB of data per frame using ldi/ldir/stack on CPC, so that would amount to roughly 200 KB/s.
Do you have any video of loading a game directly from files? I would LOVE to see running a game in... half a second!  :)

Yes, it can take snapshots via the HACK menu... The HACK menu source code is available here, if it can be of any help:
https://github.com/M4Duke/m4hackmenu (https://github.com/M4Duke/m4hackmenu)
That's really could be great help! Thanks a lot for letting me know! One last question: to enable my "save snapshot" routine installed in interface's rom, i should place at boot (probable in the initialization routine of usifac's rom) an RST3 command @&66 ram address, so when NMI is activated, execution will  jump to &66 ,and from there, call my routine. Is this the correct approach?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Duke on 08:55, 07 December 20
Do you have any video of loading a game directly from files? I would LOVE to see running a game in... half a second!  :)
Sure, why not..
First example it loads a 38KB binary (zorro).
2nd example, I run Commando, save a 64 KB snapshot and reload it.
Both take less than 1 second.
Here you go:
https://www.youtube.com/watch?v=8A7eV4mu6SY (https://www.youtube.com/watch?v=8A7eV4mu6SY)

Quote
That's really could be great help! Thanks a lot for letting me know! One last question: to enable my "save snapshot" routine installed in interface's rom, i should place at boot (probable in the initialization routine of usifac's rom) an RST3 command @&66 ram address, so when NMI is activated, execution will  jump to &66 ,and from there, call my routine. Is this the correct approach?
Yes you will need to have your NMI jump at &66, best is to map the area with your own lower-rom replacement.
Prior to that you will need to store the hardware regs so they can be retrieved once you enter your nmi rom/code.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 09:37, 07 December 20
@Duke (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1624)


Unable to Play Video


"Private". ??


Thanks


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Duke on 10:02, 07 December 20
Unable to Play Video
Oups, fixed now I hope. Thanks.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 10:30, 07 December 20
@Duke (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1624)


Ok Thanks


Keep Safe


Ray

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 21:00, 07 December 20
Well,i suppose you could do that, but if you already have a M4 board, i don't find any reason for having a USIfAC II,unless you are an Amstrad collector and you want to have all existed hardware ...
Well, ...
- Real fast serial interface
- FDC emulation (of Vortex FDC too!!!)
- And if you want, to learn how to work with an external CPU
- Also much more I still don't know

Even if most CPC users have an FDC, the possibility of FDC hardware emulation is IMHO super awesome. Imagine for example how easy it will be to copy an 0,7 MB format DSK to a real 3.5" disc and vice versa.
Also backup copies of real 0.7 MB format discs to DSK will be super easy now.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 21:19, 07 December 20
Yes it does. Ie. ROMDOS (D1/D2/D10/D20/D40) and PARADOS 80.
Please - everybody - consider to also support the 0,7 MB Vortex format. In Gemany (at least) it still is/was the 80 track standard format for floppy discs. The big companies like Dobbertin, Vortex ... all did support it.  :) :) :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:20, 07 December 20
Well, ...
- Real fast serial interface
- FDC emulation (of Vortex FDC too!!!)
- And if you want, to learn how to work with an external CPU
- Also much more I still don't know
Well, regarding speeds, M4 board is undoubtly the champion!  :)
 But, as USIfAC II uses an 8bit MCU and DIP socket, i would say it seems a lot more "close" and familiar to an amstrad cpc.
USIfAC II board looks like a "physical" extension to Amstrd cpc motherboard, while a M4 board looks more like a... BORG implant on Amstrad, from 24th century!  :P

Even if most CPC users have an FDC, the possibility of FDC hardware emulation is IMHO super awesome. Imagine for example how easy it will be to copy an 0,7 MB format DSK to a real 3.5" disc and vice versa.
Also backup copies of real 0.7 MB format discs to DSK will be super easy now.

 If anyone want to try to develop such "low level" disk routines based on the fdc emulation, it would be awesome! For the moment, i only have the utility developed for the previous USIfAC e.g. transfer only amsdos dsk images to floppy disks from a pc.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:23, 07 December 20
Please - everybody - consider to also support the 0,7 MB Vortex format. In Gemany (at least) it still is/was the 80 track standard format for floppy discs. The big companies like Dobbertin, Vortex ... all did support it.  :) :) :)

If you want, give me me a couple of such images, and i'll try them on USIfAC II!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 21:30, 07 December 20
If you want, give me me a couple of such images, and i'll try them on USIfAC II!  ;)
Great, thanks. At the moment I'm far off home, but you find plenty of them at www.futureos.de (http://www.futureos.de)
Because FutureOS does support it. All 0.7 MB DSKs there are in Vortex format

From memory:
- 80 tracks
- two sides
- First two tracks are system tracks
- The directory is 4 KB and has space for 128 DIR entries
- Block size is 4 KB
- Space free is 704 KB
- 9 sectors per track (on each side)
- Sector numbers are 1 to 9
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:05, 07 December 20
Well,i've tried this: create a vortex 0.7mb image using cpcdiskxp, copy it to a usb stick and then mount it on usifac ii. I select vortex image,then PARADOS emulation and reset. At this "dual emulation mode" (where both FDC and DOS ROM are emulated at the same time), i was able to cat vortex image and i also tried to save a sceen dump and then load it from it, everything was done fine! I suppose this means you can access 0.7mb vortex images through usifac ii and parados emulation.
Only draw back, is a bit slow because of the dual emulation mode,  screen dump took ~7 sec to load from vortex image....
BUT, if you have a real VORTEX ROM installed on your Amstrad, you should be able to use vortex images directly (giving the usual: "|FDC" command) at "full speed"!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: remax on 23:16, 07 December 20
Sure, why not..
First example it loads a 38KB binary (zorro).
2nd example, I run Commando, save a 64 KB snapshot and reload it.
Both take less than 1 second.
Here you go:
https://www.youtube.com/watch?v=8A7eV4mu6SY (https://www.youtube.com/watch?v=8A7eV4mu6SY)


Well you are obviously using an emulator !  ;D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: reidrac on 12:55, 08 December 20
I got people to ask me to put a pause in the loading screen because the games load so fast from M4 that they can't see it  :laugh:

I already have an M4 with a 3D printed enclosure (not perfect, but close!), but this project looks fantastic!

I know it is hard for one single person to have all the skills, enough that people like Duke, ikonsgr, ToTo, etc gift us with these devices for our CPCs; but I was wondering if it would be possible to get an enclosure designed for this. I guess it is a more general thought, independently of the project (and only if it makes sense, really).

Having small children at home, I'm not a fan of having naked PCBs sticking out of my 8-bit machines.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 14:08, 08 December 20
Ok, but could you please stop referring and comment about M4 board on this thread? 
I'm afraid it might transform it, to a... M4-BORG drone, like it did with Amstrad CPC!

We are the M4-Board....
Lower your disks and surrender your Amstrad.....
We will add it's technological distinctiveness to our own.....
Your Amstrad will adapt to service M4-Board...

Resistance is futile


  :laugh:  :laugh: :laugh: :laugh: :laugh:

btw,that could be a great advertise for M4 board, don't you think?  :P
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: remax on 14:24, 08 December 20
My M4 Board is looking for someone named "Sarah Connor", never heard of her...
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 14:26, 08 December 20
Does the M4 work with an Atari Portfolio?

Ok, ok, enough off topic really, let's get back on track :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 23:56, 08 December 20
Great to hear that Vortex format works. Yes, ParaDOS can work with it, but it needs to be switched on in the 'Format Menu', or use VaraDOS (that's ParaDOS with switched ON Vortex format).


All the 664, 6128 and 464+DDI1 already have a floppy, but the FDC emulation can be used by them, so they can have some drives more. Great thing!  :) :) :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Sykobee (Briggsy) on 12:27, 09 December 20
Can this work alongside an Albireo, and given the Albireo+Albidos has some SD/USB support at the filesystem level is this card useful for providing .dsk image support/fdc emulation?


I also have a DDI-4, I feel i'll end up with too many stacked up AMSDOS replacements.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:13, 12 December 20
I just want to let you know that i have open a new topic (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/msg195289/#msg195289), in order to update the public list (https://www.dropbox.com/sh/hzp3a4b7fktcn8c/AAAj2U8otKw26j-chnd8uUxla?dl=0)  of tested games with more "Worth to play" games (i thought it would be a great idea,instead of having the usual BULKY and hard to manage HUGE lists of 1000's of games, to create a rather smaller compilation of "worth to play" games), so feel free to go there and suggest any game you would like to add!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 21:04, 12 December 20
Great stuff!

Perhaps this would be more suitable for the wiki proper?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: slugman on 13:10, 14 December 20
Hi Ikonsgr, I received the board, thanks!

Is it possible to run games or apps directly from .dsk files stored on the usb key?, I looked at the pdf manual but I don't see if it's possible.

(https://i.ibb.co/qrkhvhN/IMG-20201214-120500.jpg) (https://ibb.co/qrkhvhN)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:01, 14 December 20
Hi Ikonsgr, I received the board, thanks!

Is it possible to run games or apps directly from .dsk files stored on the usb key?, I looked at the pdf manual but I don't see if it's possible.

(https://i.ibb.co/qrkhvhN/IMG-20201214-120500.jpg) (https://ibb.co/qrkhvhN)

 Yes,it is. First you have to select an image by giving: "|MG,"image name"  (the "|CD" command you where using in the screenshot, is for changing directory, and that's why you got the error message)
Then, you only have to enable the floppy disc controller, by giving: "|FDC"*
From now on, any cat,load,run,save etc 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.

* This is needed, because the default operation is the "Direct file" mode,which is enabled with"|EN" command (it's done automatically with |USB command). And with "|STAT" you can see the currently selected mode.Also "|FDC" and "|USB" commands are used for both enable/disable the fdc controller and usb host module, e.g. if your in "FDC mode" and give "|FDC" it will be disabled, giving again "|FDC" will enable it again.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:27, 14 December 20
And don't forget that if you have a lot of image files in your usb stick, you can filter the catalogues, by using argument with |CAT command.
For example,if you want to get a list of images starting from "IK" you just give: |CAT,"IK"!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 18:44, 14 December 20
Does the on board software have any sort of help?

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:10, 14 December 20
Yes,give "|HELP" and you will get a list of all rsx commands with short descriptions and usage!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 23:23, 14 December 20
Please find attached the VaraDOS for CPC and Plus computers.
This is the newest ParaDOS with Vortex formats enabled by default.
Feel free to use it or put it into the Wiki.


Yes,give "|HELP" and you will get a list of all rsx commands with short descriptions and usage!  ;)

Maybe this can be renamed to "|UHELP", because lot's of ROMs already use the "|HELP" command.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 00:08, 15 December 20
@GUNHED (https://www.cpcwiki.eu/forum/index.php?action=profile;u=2029)


Perhaps the help could be " |Vhelp " to indicate VaraDos


Keep Safe


Merry Christmas


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 00:11, 15 December 20
@GUNHED (https://www.cpcwiki.eu/forum/index.php?action=profile;u=2029)
Perhaps the help could be " |Vhelp " to indicate VaraDos
Keep Safe
Merry Christmas
Ray
But it's purpose it to indicate USIfAC II
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 00:13, 15 December 20
@GUNHED (https://www.cpcwiki.eu/forum/index.php?action=profile;u=2029)


Ok Just a thought.


Keep Safe


Merry Christmas


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 01:12, 15 December 20
Please find attached the VaraDOS for CPC and Plus computers.
This is the newest ParaDOS with Vortex formats enabled by default.
Feel free to use it or put it into the Wiki.
Ok, i'll integrate this varados version and give it a try. I've already tested the newer PARADOS 1.2 from 2015 and it worked fine (although 1.2+ is not, i suppose because this was meant for plus models  ::) )
 

Maybe this can be renamed to "|UHELP", because lot's of ROMs already use the "|HELP" command.

Hmmm, you think so? I wonder what will happen if there are 2 expansions having the same HELP rsx command. What will happen if you give |HELP? I guess it will execute the command from the board with the greatest rom number? Btw, for added compatibility with other expansion cards, you can change the rom number of USIFAC II ,by giving a simple OUT &FBD2,x, so if any other card you might have, uses the default USIfAC II rom 5, you can easily change it to another. And this change will be permanent,  as it is stored in the integrated EEPROM of PIC MCU!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 01:46, 15 December 20
Ok, i'll integrate this varados version and give it a try. I've already tested the newer PARADOS 1.2 from 2015 and it worked fine (although 1.2+ is not, i suppose because this was meant for plus models  ::) )
You're right, the + Version is for 6128 Plus only. The Varados equals the Parados 2015.

I wonder what will happen if there are 2 expansions having the same HELP rsx command. What will happen if you give |HELP? I guess it will execute the command from the board with the greatest rom number?  ;)
Actually the command it always take from the ROM with the smallest number, because it got initialized at last. To have different commands would be great, then the commands of all ROMs could be used. The !HELP command usually displays a list of ROMs or RSX of a rom when used with the parameter rom_number.
So !UHELP would be very helpful, because it's not part of any other ROM.

Btw, for added compatibility with other expansion cards, you can change the rom number of USIFAC II ,by giving a simple OUT &FBD2,x, so if any other card you might have, uses the default USIfAC II rom 5, you can easily change it to another. And this change will be permanent,  as it is stored in the integrated EEPROM of PIC MCU!  ;)
Ah, we can use OUT &FBD2,rom_number to set any ROM number. That's awesome!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 17:23, 15 December 20
Yes,give "|HELP" and you will get a list of all rsx commands with short descriptions and usage!  ;)


Great stuff. Many times I've attached a peripheral I haven't touched in a while and I'm thinking "hm, must go to the PC and download a manual"... :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:52, 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
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 19:24, 15 December 20
Yes, that's unexpected. Firmware does go backwards.
Therefore the DOS ROM with the smallest number is always dominant.  :) :) :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:58, 24 December 20
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! ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Gryzor on 11:00, 24 December 20
The way this goes if we wait a month or so it will boost the Z80 by 100% or something :D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:04, 24 December 20
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?  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 00:02, 25 December 20
Your FDC emualation seems to be a big gain. Can't wait to try it with FutureOS.  :) :) :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: teopl on 22:07, 27 December 20
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)

(https://i.ibb.co/rFmDPHS/usifac2.jpg) (https://ibb.co/7jXscK5)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 02:32, 28 December 20
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.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:23, 29 December 20
I've just upload a new presentation video (https://www.youtube.com/watch?v=4ZjLQcK0i98), this time on CPC 464!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: teopl on 00:41, 30 December 20
In 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)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 01:02, 30 December 20
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:
10 IF INP(&FBD1)=255 THEN PRINT CHR$(INP(&FBD0));:GOTO 10
If you get the status message on screen,this means that the MCU chip is ok.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:20, 08 January 21
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.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: XeNoMoRPH on 20:00, 08 January 21
It's possible to update firmware?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:32, 08 January 21
It's possible to update firmware?

Yes, it is!
You will need a rather cheap PIC KIT 3 programmer (https://www.ebay.ie/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=pickit+3+programmer&_sacat=0&LH_TitleDesc=0&_osacat=0&_odkw=pic+kit+32).
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 (https://www.microchip.com/en-us/development-tools-tools-and-software/embedded-software-center/mplab-integrated-programming-environment#), which is part of MPLAB IDE and you can download from here (https://www.microchip.com/content/dam/mchp/documents/DEV/ProductDocuments/SoftwareTools/mplabx-v5.45-windows-installer.exe), 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!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 23:20, 09 January 21
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 (https://www.ebay.ie/itm/272378426083), 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...  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 01:13, 11 January 21
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
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:34, 11 January 21
And here is some "proof of concept":
 

* 800k1.JPG
(255.63 kB, 1095x821 - viewed 528 times)

 

* 800k2.JPG
(308.09 kB, 1095x821 - viewed 498 times)


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)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 11:51, 14 January 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


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 ??

Thanks
Keep Safe
Ray

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:56, 14 January 21
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

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 00:21, 15 January 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)

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 :- https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/250/.

Keep Up the Good work.

Keep Safe

Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: vasilisk on 20:55, 22 January 21
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 (https://www.cpcwiki.eu/forum/index.php?action=profile;u=174) what are the conditions for this message to appear. It may help solve future problems.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:14, 22 January 21
Thanks for the suggestion, i've already sent a pm!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:21, 26 January 21
 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.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:07, 31 January 21
 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.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: TotO on 10:12, 01 February 21
Great. Have you tried with the Phortem and Phx demo too?  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:22, 01 February 21
Great. Have you tried with the Phortem and Phx demo too?  :)
I've tried both and they load just fine from usb stick using the FDC emulation.And also transfer to a 3.5" disk works too!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: JimQML on 23:42, 09 February 21
Thank you for this nice device, I received it this january ! I've just tested it this evening but I can't manage to copy a file from a CPC disk to an USB key!
I tried this:
|USB
|2PC
then when I select a file and press return, the message:
Transfering myfile... appears at the bottom of the screen, but everything is frozen and then the file is created on the USB key but the file is empty (0 bytes)...
I tried with different USB keys from 16Gb to 1Gb... I tried to create smaller partitions from 250Mb to 10Mb (FAT) but none of these tries is working, the result is always the same: the file is created but everything freezes and the result file is empty !
Any clues to help me ?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: vasilisk on 23:08, 10 February 21
I tried the same as you and it succesfully copied the selected files in the usb stick
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: JimQML on 23:22, 10 February 21
ah ok  :o
What do you suggest ? Is it because I'm using a CPC 6128+ or because I'm not lucky with my USB keys and I should try others ?

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: vasilisk on 23:24, 10 February 21
ah ok  :o
What do you suggest ? Is it because I'm using a CPC 6128+ or because I'm not lucky with my USB keys and I should try others ?


I dont know. Only ikonsgr can answer that  ;D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Skunkfish on 14:29, 12 February 21
I've not had much of a chance to play with my USIfAC II much - but I'm also having issues on my 6128 Plus with some random crashing....
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:16, 12 February 21
Unfortunately i don't own a 6128+ so no testing was made on that machine. Moreover, i don't know much about hardware/firmware differences and "peculiarities"  of "plus" machines, so, i'm afraid i can't provide any help with problems on "plus" machines...  ::)
BUT, what i DO know though, is that, at least "basic" functionality of loading games (either directly or form dsk images) seems to work on 6128+ too.  ;)

p.s: If you haven't done it, try to update the firmware (check 1st post of this thread), maybe this will help resolve the problem on 6128 plus.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: vasilisk on 23:00, 12 February 21
I tried something today, out of curiocity. I exported the files of random games (with managedsk) that consist of more than one 1 dsk. I put them all in a folder and run the game. To my surprise, I had partial success. When the game required to insert disc2 or side2, it bypassed it and continue. Needs testing though because games with hidden sectors or loaders etc are not read well by managedsk
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 02:02, 13 February 21
For that, i use CPCLOADER included in CPCGamesCD, as you can "Batch" extract 1000's of dsk images into separate folders in a few seconds!  :)
Unfortunately some multi dsk image games, are using custom sector/track loaders so there are no files to be extracted,thus you can't use the direct file loading method. Also, it's better to use separate folders for each multi dsk game to avoid conflicts in names etc.
Anyway, in then near future,i'm planing of Resolving the problem of how to load multi dsk image games, by adding on the board, a "hot dsk swap" button (similar to the reset button), and also, add multiple |MG commands (|MG2, |MG3 etc) in order to mount multiple dsk images (up to four). These images would  be "round" selected, "on the fly", by pressing the swap button! I've already test this, using a prototype board and seems to work very well! And using this method, you should be able to load multi dsk games that use sector loaders too! ;-)



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: vasilisk on 11:57, 13 February 21
Also, it's better to use separate folders for each multi dsk game to avoid conflicts in names etc.

Even if we do that, I dont think we "change" discs during game. Correct?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:10, 13 February 21
Changing actual disk images will be "literrally" done, using the swap button i mentined before.
But, in direct file loading method, there is no meaning of "change disks" ,since you get rid of the disk images and access files directly!  ;)
So, for now, you can try to extract all files from all dsk images of a multi-image game, into a single folder. Then you can try to run game as usual.
Of course this method has some restrictions:
- Game must use Amsdos FILE routines and not sector/track loaders
- File names in different dsk images should have different names (otherwise you will have conflicts when extracted on the same folder)
If game fulfills the above conditions, then it should run without problem, since game code will be able to find all required files directly from the folder!
If you are in a mood, you can try some and give us the results  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: XeNoMoRPH on 12:02, 25 February 21
Any new firmware uptades maybe ? hehe  :D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:44, 28 February 21
Ok,i just upload a new firmware (_2b) which contains the updated |DSK command for writing any kind of image using custom floppy drive routines instead of Amsdos.
Also, this is how the new boards will be:
 

* new_usifacii.JPG
(223.65 kB, 692x546 - viewed 542 times)

As you can see,the usb host module is now soldered on the main board, which saves the need for extra wires and making the interface a neater, compact single board!  ;)
I'm also working on adding the ability to load snapshot files (|SNA command). As there are now more than 200 snapshots in the cpcwiki snapshot archive  (https://www.cpcwiki.eu/index.php/Snapshot_Archive), these can proove useful for CPC 464 users, as many games from dsk images, can't load on a CPC 464, so you can use a snapshot instead. Of course, there is another option to use directly files (like most games in this list (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/)), but it's good to have another alternative :-)


Btw, i'm still waitng for the new batches of usb host modules, but i believe i will have them pretty soon...
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 19:29, 03 March 21
While I am waiting for my USIFAC, I am trying to understand how it works from the hardware side.It would be nice to have  a wiki on simple port expansion communication (but I have not found it, if I manage to get a clear idea, I can write an simple expansion card wiki)

Following explanations for expansion port communications from http://magic-cookie.co.uk/CPC/expport.html
I have seen that IOREQ, WR, RD lines are used to  communicate with the Z80.
Thus, writing on data port OUT &FBD0,x  should activate IOREQ and WR and place the bits in D0-D7?For the way back, INP(&FBD0) will check if RD activated from MCU and read D0-D7 ?

Maybe all these questions are solved in usifac code, don't know if it is available or not.

Sorry if this is not the appropriate thread for these questions, but I guess, here are the main experts.

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:25, 03 March 21
Check here:
http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg169466/#msg169466
here:
http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg170045/#msg170045
and here:
http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg190714/#msg190714
It's from the previous usifac project thread, but the principles are the same, and you will get a lot of "inner workings"  ;)
The 2 major hardware differences with USIfAC II is ,first that i use CLC's (Configurable Logic Cells, a feature of the 18F47Q10 PIC mcu) instead of discrete logic chips for all address/signal decoding, and  with the procedure of unlatching the data bus, the new PIC is fast enough to do it "on the fly" without needing to have a "pause/unpause" procedure and "sample&hold" circuit of READY signal i described above!  ;)

Now,i have uploaded another firmware update, this time for all CPC 464 users: It ELIMINATES the need for the "Start up" procedure of giving "|464" and then pressing "Reset" button!  ;)
The only "side effect" is that, at "cold start", your CPC 464 will reset automatically a couple of times...  :D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:21, 05 March 21
I finally receive the usb host modules today, so anyone interested please contact: ikonsgr745@hotmail.com
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:13, 07 March 21
I just spoke with a friend of mine that has a 3D printer, and he wants to start designing a case for USIFAC II!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 17:36, 08 March 21
Nice.
I would recommend you to add mouning holes to the pcb. Thus, in the case you can put threaded inserts, captive nuts or just nuts on the outside part.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:46, 13 March 21
Nice.
I would recommend you to add mouning holes to the pcb. Thus, in the case you can put threaded inserts, captive nuts or just nuts on the outside part.

  Well,i'm not involved in case design,but my friend told me that he can do it without adding any holes to the pcb, probably case will have some kind of inner ledges at the bottom, for the board to fix in place.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:53, 13 March 21
Ι have just upload another firmware update, adding another small usability improvement: You don't need to type |USB after every RESET of Amstrad,but only once, at initial power up!
This means that,after you finish playing a game,you just press reset button, board will automatically enable usb host module,set to "direct mode",and then,you can access directly the usb stick, without needing to re-issue |USB command!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: amai on 17:41, 16 March 21




is it possible to order a complete set but with a centronics connector for schneider cpc6128?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 09:13, 17 March 21
Hi Ikonsgr, interested in a full package.
can you tell me if it's possible ? no matter when, no hurry.


Thanks


Phil
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:53, 17 March 21
is it possible to order a complete set but with a centronics connector for schneider cpc6128?

Yeap! That's why i use a dual row pin connector on the board, to use it directly on a MX4 or similar board, or with edge connector cable for "classic" Amstrad CPC's, or with centronics cable for schneider cpc's!  ;)
Give me a note at ikonsgr745@hotmail.com to arrange it.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:53, 17 March 21
Hi Ikonsgr, interested in a full package.
can you tell me if it's possible ? no matter when, no hurry.
Thanks
Phil

Give me a note at ikonsgr745@hotmail.com to arrange it.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 14:23, 17 March 21
great - email sent
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 20:27, 18 March 21
Hello


First of all, congratulations about your work. I'm sure you have learnt a lot developing it.


I have seen there is a 4-pin slot for wifi module.  Does it mean that we can connect an ESP-01 and connect to a wifi?  Are there commands to configure wifi and download files from web?


How easy is it to update it with new firmware?


Thank you for all.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:56, 18 March 21
Hello
First of all, congratulations about your work. I'm sure you have learnt a lot developing it.
I've spent more than 1000 hours in the last 15 months on this project, so i think that i've learn one or two things in the process... :D

I have seen there is a 4-pin slot for wifi module.  Does it mean that we can connect an ESP-01 and connect to a wifi?  Are there commands to configure wifi and download files from web?
Yes, there is an RSX command |WIFI, for easy configuring the module (set serial speed, connect to access point and then to a tcp server) in order to connect to a PC that runs the windows utility i've also developed, (which activates a small TCP server where the esp module connects as client). There is also |COM command, a small terminal specifically designed for comunicating with wifi modules through AT commands.You can find more details in USER'S GUIDE available at the 1st post.

How easy is it to update it with new firmware?
Check the 1st post on this thread at "update firmware" section.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 22:17, 18 March 21
I think  a rsx command like |wget (for example) is indispensable, downloading a file from web with AT commands is very tedious.


I don't know how difficult was replace one of the ROMS using the same method of firmware update.  (I don't know if I mean well)


And last doubt: Can you use |CPM too after |mg,"cpm22.dsk" (for example) ?



I'll get one soon.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 17:52, 19 March 21
Actually the utility i've developed for windows PC, take it FAR more than just ..."downloading" a file. After you connect to the TCP server (which activated automatically when you run the windows utility) ,using the wifi module connected on USIfAC II, you can actually RUN "on the fly" games ,directly through internet! You can also access dsk images, transfer dsk files from your pc, direclty to your Amstrad 3" or 3.5" drive, and of course copy  files between your PC and Amstrad! And all these functions are controlled from Amstrad using RSX commands!
For more details, please check USER'S MANUAL (https://www.dropbox.com/s/ibua98leg79uxgr/Amstrad%20CPC%20Serial%20Interface%20II%20User%20Guide.pdf?dl=0) on "windows communication utility" section.

p.s. you can perfectly use images of cp/m disks too,i've already test a few games that used CPM to load (by giving "|CPM" at basic prompt) and worked just fine!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:52, 19 March 21
MAJOR UPDATE!

 New board design, with an amazing new feature: Access multiple Dsk images "on the fly" and be able to run ALL multi-image Games/demos/utilities!
Along with the pre-existing command |MG that places an image to the default slot 1, some extra RSX commands are added:
- |MG2,"image name"  places "image name" to slot 2
- |MG3,"image name"  places "image name" to slot 3
- |MG4,"image name"  places "image name" to slot 2
Finally with |SMG command you will get a list of all images placed in the 4 different slots,along with the currently selected slot!

The "ring selection" of the dsk image (e.g. every time you press "Dsk_Swap" button, selects the next slot: 1->2->3->4->1 ,of course empty slots are omitted) is made "on the fly" by using an extra small button on the board. I've already test it with a few multi image games like OUTRUN EUROPA (2 images), SAVAGE (2 images), Xyphoes (3 images), TURBO OUT RUN(2 images) and PAWN (2 images).
In most cases, when game needs another image it will give you rolling bars at the border, when you see this, you just press the swap button and the loading continues!  ;)
Soon i will start adding these games on the "Classic and worth to play (http://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/)" list, and also i'm thinking of adding a small Basic loader on each game, which will automatically load all images to slots and run game directly ,so you will not have to do anything by yourself! ;)

 

* IMG_20210319_191930_569.jpg
(129.11 kB, 832x624 - viewed 318 times)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: shifters74 on 19:34, 19 March 21
So is the new board called USIfAC II+ or USIfAC III   :P

Another good job from the ikonsgr group  :laugh:

shifters
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Skunkfish on 20:02, 19 March 21
That's awesome, is it possible for me to add this button myself? Which pins do I need to attach it to?  ;D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 20:08, 19 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Got some questions before I order one ...


As you may remember (maybe not) I already purchased Usifac I from you and I use it with my mp3 module .... is it possible to use both ? Or better : is it possible to attach USB Host Module AND mp3 module at the same time ?


If not : is it possible to use Usifac I and II at the same time ???


I guess both answers will be "NO" but hey, have to ask anyway :D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 20:12, 19 March 21
 New board design, w

this means new hardware?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:18, 19 March 21
That's awesome, is it possible for me to add this button myself? Which pins do I need to attach it to?  ;D
Indeed, the only thing you need to do is to add a button and attach one end on a specific pin:
  [ You are not allowed to view attachments ]  

The other end of the button goes to gnd. If you do that on older boards you can actaully use the new firmware and have the new  feature!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:21, 19 March 21
this means new hardware?
Not exactly, i would say it's more of a small extension to add the new feature. The only difference from older design (apart from the color of board and  bit different placement of parts) is the addition of the small dsk swap button! Of course there is also a new firmware for PIC MCU (hex file) to include the extra RSX commands.
So, if you have an older board version without the dsk swap button, then yes, it would need to have the new board, although it's possible to add this feature on older boards too (see above post)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 20:42, 19 March 21
Is there somebody using USIfAC II with FutureOS and clicked at drive E, F, G or H to see if FDC emulation actually works with the Vortex FDC?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:59, 19 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)
Got some questions before I order one ...
As you may remember (maybe not) I already purchased Usifac I from you and I use it with my mp3 module .... is it possible to use both ? Or better : is it possible to attach USB Host Module AND mp3 module at the same time ?
If not : is it possible to use Usifac I and II at the same time ???
I guess both answers will be "NO" but hey, have to ask anyway :D

  Since the usb module is now soldered on board, the 4pin UART port is available to add another device.
So in theory, if connected devices use the same serial speed, you might be able to use both mp3 module along with the usb host module. Of course this would require writing custom software for it, and managing comunication with each module without conflicts or interferences between them, might be tricky...
Btw, you can't use both USIfAC and USIfAC II as they respond to the same ports. On the other hand, USIfAC II is 100% "backward compatible" with previous USIfAC, so any software written for USIfAC should work directly with II too!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 21:04, 19 March 21
So in theory, if connected devices use the same serial speed, you might be able to use both mp3 module along with the usb host module. :)
This should work, because the MP3 module expects its commands embedded in key bytes. Well, that's at least the case with the one I use.  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 21:36, 19 March 21
Well, that's at least the case with the one I use.  :)


I also use the Catalex device as your LS does, and since this is just given instructions via some OUT codes in basic, the speed of the serial port shouldn't matter ... guess I´ll give it a try  ;D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 13:25, 20 March 21
Ok, i've updated the game list (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/) with a few multi image games, and also i've add in all games folders, that are in dsk image form (~10 in total), a small Basic loader that sets image(s) to slots, enables floppy controller emulation, and runs the game directly, so you can now run games from dsk images directly!
This also could be a great idea for simplify loading process for any game in dsk image form!
Ιt's very easy to do it by yourself, and it will save you the need to re-place image and re-enable FDC controller emulation for every game!
The procedure is really very simple:
- Go to the folder with the image(s) you want to use (using the known |CD,"dirname" command)
- Get a list of all images by giving: |CAT
Make a small Basic program in the form:

Code: [Select]
10 |MG,"1st image name"
20 |MG2,"2nd image name" (this is needed if game has 2nd image)
30 |MG3,"2nd image name" (this is needed if game has 3rd image)
40 |MG4,"2nd image name" (this is needed if game has 4th image)
50 |FDC

Then you just save the above basic program into current game's directory by giving: save"name.bas"
From now on,every time you want to play the game,you just run the above basic program and then, directly give CAT and RUN to load it, without needing to retype all the above commands!  ;)
Finally, if you want to take it a bit further with "automation" of the loading process, you can also include the RUN command into the Basic listing.
For this, after running the above program and give a CAT command (that will give you the contents of the image placed in the 1st slot), you just give:
- |FDC to disable FDC emulation,
- |EN,
And then add a Basic line at the bottom of the listing:
60 RUN"(Name of game loader inside Dsk image)"
Save the program, and you are Ready!
Now, next time you want to load the game,you will run this small basic program you just saved, and it will automatically run the game!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 23:29, 20 March 21

I also use the Catalex device as your LS does, and since this is just given instructions via some OUT codes in basic, the speed of the serial port shouldn't matter ... guess I´ll give it a try  ;D


IIRC, the speed was 9600 Baud, but see their doc (well, it's not complete I'm afraid).


No reason not to work with the USIfAC.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 23:33, 20 March 21

IIRC, the speed was 9600 Baud, but see their doc (well, it's not complete I'm afraid).


No reason not to work with the USIfAC.
I know it works with USifAC I ... so it should with II  ;D


The big question is, does it work side by side with the USB Host Module ... guess I'll find out when package arrives ;) :D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 09:54, 21 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)

Hi John

I have a small concern.
I am using the 2nd generation board.
I am using a CPC464.
I have just updated to Version 2c which works well no Problems
As I have a few spare 18f47q10s I flashed an other with 2D
The concerns are, Unable to intermittently enable the USB (The light comes on)
But I am unable to restart the USB, Power off for 20 seconds power up again then it MAY enable the USB

Can you help

I have gone back to Version 2C.

Keep Safe

Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 13:20, 21 March 21
 Well,i haven't noticed something like that with my tests on CPC464 and _2d firmware. After some more thorough tests,the only "bug" i discover is that sometimes you get a "bad command" at initial screen after reset (and it might shown when executing some rsx commands) but this doesn't seem to affect the operation of the board, everything seems to works fine despite this msg.
So, if you are using the same board+usb host module with the same usb stick and you just changed the PIC CHIP with another flashed with _2d firmware, this would be really very strange...
 BUT, what i have discovered from my experience so far, is that one VERY "sensitive" matter is the good contact of the edge connector to the expansion port of Amstrad!
I remember some time ago, i wanted to test some boards, and suddenly i began to have very strange behaviors, for example, hung-ups out of the blue, delayed respond on execution of RSX commands,and the most strange of all: direct file loading worked fine, but i got problems when accessing dsk images (something that is completely insane,either both loading methods should work or both methods should NOT work...)! ???
In the end,i discover that the ribbon cable i was using (obviously from the 100's plug on and offs, as i'm using it for many months now), developed some kind of "contact fatigue", which caused all the problems! When i've changed it with a brand new ribbon cable, all boards worked perfect!  :)
And this "contact" issue goes to EVERYTHING that can be plugged on/off, e.g. usb stick, ribbon cable ,expansion port. And since you've changed the PIC CHIP, even a bad contact between socket and chip legs could cause a problem!

[UPDATE]
After more thorough testing,i've decided to remove the "|USB" automation for CPC 464, as the absenece of Amsdos Rom, seem to cause some bugs to this process (the "bad command" appearence on boot screen, and rare hung-ups when accessing usb stick after initial "cold start" booting of Amstrad).
Both Firmwares are updated on the 1st post (with some extra minor updates for the new "_3" firmware,check 1st post for details), with this change. Note that these affect ONLY cpc464 behavior, there is nothing different for CPC 6128 models. Mind also that you can use the new _3 firmware on older boards too, but the extra RSX commands for using multiple image files, will have no affect as there is no "dsk swap" button present on board.

btw,i test a couple of multi image games on CPC 464, and it seems they work fine too!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 00:37, 22 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Ok Thanks for the update information.
I will have a GOOD look at the Expansion (Male) connector.
and if needed I will solder a 50 Pin header socket to the CPC464 ( this is my test computer that I use)
I also had the same error messages.
I will flash the update to 3 ?


Thanks for your quick work


Thanks


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 11:31, 22 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


The fault turned out to be a "Soft" Z80 ? It could not handle the extra load of the USIfAC II
Replaced the Z80 and away it went on the CPC464.


PS:-  all my tests are using xxxx.dsk Images.

I am having Problems with Version 3 at the moment- Will leave more detail Later.

Thanks

Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 13:56, 23 March 21
Hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


I'm enjoying experimenting with the Usifac. Thanks again. What are the chances of a virtual romboard?

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 16:42, 23 March 21
A ROM board got nothing to do with a serial interface.
To ask for a ROM board here is like to ask "And how to have a beer with my toaster".
For a virtual ROM board look at the thread of the M4 card.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 18:08, 23 March 21
A ROM board got nothing to do with a serial interface.
To ask for a ROM board here is like to ask "And how to have a beer with my toaster".
For a virtual ROM board look at the thread of the M4 card.


Well this serial interface comes with a FDC emulator, games and utilities and serves up its own rom. So I guess it must do Rom decoding.


So my question is if I can have bacon with my toaster may I have a beer too? :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:52, 23 March 21
@kolleykibber (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4071), well,i don't know if you can call it "rom board", but since the PIC is equipped with 1kb EPROM, i add a few rsx commands to utilize it!
You can load data either from memory or from a binary file directly (|WROM), and then use another rsx command (|LROM) to retrieve the data! You  can also access it in asm code using a simple RST3,&FC00 (on the rom number of USIFAC interface, deafult:5).
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:21, 23 March 21
 And now something that i think you would love it, especially the CPC 464 owners.....
As i already wrote you, i made a few small basic loaders for the multi image games, in order to save you from placing each image into slot and enabling FDC controller manually.
And then it hits me: Amstrad Basic, can load, apart from basic listings, AND plain text ascii files that contain a basic listing! You can check this if you save into usb stick a basic program, using 'a' attribute (e.g. save"filename.bas",a) and then take usb stick and open it from your pc, you will see that it will give you the BASIC listing!
So, since i already supported ascii files on usb stick, what if i make a small PC utility to expand these small BASIC loaders for ANY game, either in file or dsk image form?
Well, it took me a few hours, but i finally manage to make such a utility and use it to create 100's of loaders for all games in the known list (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/), in a split of a second!  ;)
 I uploaded a small zip file here: https://www.dropbox.com/s/cdd59bfubyv9g7f/loaders.zip?dl=0

 You can download it and extract all the files into the root of your usb stick. Then, you just copy the "direct load games" folder into usb's stick root dir, and that's it!
 Instead of manually using |CD, |MG, |FDC etc commands, you can just run the small basic loader!
Each listing is custom made depending on the specific game form:

- For games in dsk images, it will change directories, mount the image and then either reset using |464 (for CPC 464) or enabling FDC emulation and directly give you a CAT list!
- For games in file form, it will also change directories and give you a cat list, and so you can choose the game loader and run it directly!

The program searches and create Basic loaders, for multiple dsk image files in a single folder, and for files or dsk images in separate sub-folders for each game!
Here is an example:
Code: [Select]
10 A$="DIRECT~1":|CD,@A$
20 A$="SUBHUN~1":|CD,@A$
30 IF INP(&FBDC)=&83 THEN 40 ELSE 50
40 A$="SUBHUN~1.DSK":|MG,@A$:|464
50 A$="SUBHUN~1.DSK":|MG,@A$:|FDC:CAT

This is the procedure to use SUBHUN~1.DSK image file inside DIRECT~1/SUBHUN~1/ subfolder.
As you can see,i'm using the Basic 1.0 form of loading arguments in RSX commands, in order for the listings to load on CPC 464 too!
You can also see the "smart" selection of actions according to you CPC model! Judging from my quick experience on a CPC 464, this method can VASTLY improve the speed and "Ease of use" for loading games,especially for CPC 464!  ;)
Soon i will upload the utility, for anyone to create loaders for his custom game collections! ;)


 
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 00:14, 24 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Hi John


Tha Zip file (Basic Loader for any Game) on dropbox has been deleted ??


Thanks


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:23, 24 March 21
There must be an issue with the [ url  ] [ /url ] tags,anyway i post the link directly now, but you can also get it from the 1st post from user's manual and windows program link too! :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 03:38, 24 March 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Hi John


Thanks


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 18:09, 24 March 21
Well this serial interface comes with a FDC emulator, games and utilities and serves up its own rom. So I guess it must do Rom decoding.
So my question is if I can have bacon with my toaster may I have a beer too? :)
It got few space on chip left! But that's not an unlimited ROM box. So Cheers!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:21, 24 March 21
ok,i just finish the small utility:
 

* loader_util.jpg
(142.5 kB, 614x594 - viewed 327 times)


As you can see, i've include a mini help guide, so, no need to explain anything!  ;)
You can download it from here:
https://www.dropbox.com/s/jk5sgeey2f5zor8/cpc_loader.zip?dl=0

So, if you have a CPC 464 and you got tired of giving all the time:
 A$="mplampla":|RSX COMMNAND,@A$ commands...
This utility will definitely..."ease your pain"!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:42, 24 March 21
Ι have a small request to make:
If you happen to have an Amstrad with custom ROMs or a CPC 664, i would like to give a:
print peek(6)
just after boot, and report me the number you receive.
Standard Amstrad CPC 6128 should give '145' and standard CPC 464 '128', and because i'm using these values to find out the CPC model, it would help me make the code more precise with "custom" models!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 23:57, 24 March 21
Hi John


CPC664 Info

THIS has been corrected I misread it to be &78 - Real Value &7B

The rom used is a 40022
The Byte info is :-
&7B   (Hex)
123   (Decimal)


Included is the Rom


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:03, 25 March 21
Hi John
CPC664 Info
The rom used is a 40022
The Byte info is :-
&78   (Hex)
120   (Decimal)
Included is the Rom
Keep Safe
Ray

Thanks Ray! That will definetely help to distinguish CPC 664 from CPC 464 as obviously 664 doesn't need the boot proccess of 464 as it is equipped with Amsdos and FDC ;-)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ajcasado on 13:41, 25 March 21
Hi,
My CPC664 gives a value of 123 (dec).
ROM is also a 40022.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 16:04, 25 March 21
Hi have just seen that @llopis (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1728) is doing model detection for his Amstrad Diagnostics.
Maybe it can help.
https://github.com/llopis/amstrad-diagnostics/blob/42c1dd99cd86d8d3fbe8ac3739d87464fc5b8c8c/src/Model.asm
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 19:25, 25 March 21
@kolleykibber (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4071), well,i don't know if you can call it "rom board", but since the PIC is equipped with 1kb EPROM, i add a few rsx commands to utilize it!
You can load data either from memory or from a binary file directly (|WROM), and then use another rsx command (|LROM) to retrieve the data! You  can also access it in asm code using a simple RST3,&FC00 (on the rom number of USIFAC interface, deafult:5).


Thanks for the explanation.


I'm curious if it would be possible to serve roms from the usb using the ready signal trickery that you mention? Or would it just be too slow? Maybe page in 1k rom data into the memory to reduce reads?


Otherwise i need to get myself an MX4 expansion board!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:56, 25 March 21
Thanks for the explanation.
I'm curious if it would be possible to serve roms from the usb using the ready signal trickery that you mention? Or would it just be too slow? Maybe page in 1k rom data into the memory to reduce reads?
Otherwise i need to get myself an MX4 expansion board!

 Well, back at last summer ,when i was developing all the functions of the board,i was planing on making such a thing,e.g. use usb stick to access 16kb rom files as extra roms, but unfortunately, speed and responce prooved to be very slow, comparing to a real ROM, so i decided to abandon it.
 To have a measure of it, when you use |464 command to enable virtual amsdos/parados from PIC along with FDC controller on a CPC464, you will notice a significant delay (~50%) in responce of various Disk commands (CAT, LAOD ,RUN, SAVE ) compared to that of a CPC 6128, where no AMSDOS/PARADOS emulation is done (and FDC emulation gives slgihthly faster responces ~10-20% than with a real gotek/disk drive). Now imagine that a ROM emulation from a file accessed from a usb stick, will add extra overhead+delays, so in theory a virtual "Rom board" can be done, but in practice , responce will be so slow (i guess it will be at least ~15-20times slower than a real rom) that it will have no practical use  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:24, 25 March 21
Hi,
My CPC664 gives a value of 123 (dec).
ROM is also a 40022.

Thanks for noting. What Basic version CPC 664 has? v1.0 like cpc 464 or v1.1 like cpc 6128?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ajcasado on 01:46, 26 March 21
Thanks for noting. What Basic version CPC 664 has? v1.0 like cpc 464 or v1.1 like cpc 6128?


Basic v1.1 like the 6128, but the basic rom is different.


RetroVirtualMachine emulator also gives 123.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 05:55, 26 March 21
Hi John


Corrected the ID  Byte to 7B I had read the Hex incorrectly  Grrrr


also a Photo of the USIfAC II and Voltmeter Hmnnnn


Keep safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 13:24, 26 March 21
That's surely ok. I'm using mine, with ~4.4volts at Usifac's power pins and works perfect!  ;)
Btw, in most cases  voltage drop from ~5volts (usually given from a 5V PSU), happens when you use extra power leads, obviously due to the extra small impedance of the power cables. 
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 13:27, 26 March 21
Basic v1.1 like the 6128, but the basic rom is different.
RetroVirtualMachine emulator also gives 123.

 Do you have a USIfAC II board? And if yes, did you test it with a CPC 664? As far as i can remeber, i never had any feedback from someone with CPC664...
But then,CPC664 owners its kind of a... "rare spiece"  :laugh:
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 13:33, 26 March 21

also a Photo of the USIfAC II and Voltmeter Hmnnnn

Inside CPC, the voltage drops around 0.3V.
I am using a 5.2V dc power supply (from an old PDA) which results in 4.8V-4.9V.

An option could be sth like this https://aliexpress.com/item/32996444485.html
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ajcasado on 17:00, 26 March 21
Do you have a USIfAC II board? And if yes, did you test it with a CPC 664? As far as i can remeber, i never had any feedback from someone with CPC664...
But then,CPC664 owners its kind of a... "rare spiece"  :laugh:
Yes, I'm the one that sent you a PM when corrupted the PIC flash switching the usifac off and on with the MX4 motherboard PSU switch ( :picard: again). I reprogrammed it and works ok.

About being a rare species, I guess that my 664 could be the only one working in mainland african continent so definitively yes  :P .
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 17:08, 26 March 21
Hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


I continue on my investigations with your interesting piece of kit!


I've bought a few ESP-07s and have tried them on the board. But if I call |WIFI I get 'NO WiFi module detected!'.
I have a cpc6128, the ESP-07s are switched to UART (I tried program too!).
I've tried |USB on and off, before I call |WIFI. I've used the ESP-07 reset switch, before the RSX.
If I call |WIFI a second time the system crashes.
The ESP-07 is connected correctly (GND to GND) and the lights come on and you can hear the wifi signal pulsing through the CPC's speaker.
I've tried different ESP-07s


Am I doing something wrong?


Thanks!



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:34, 27 March 21
First, usb host module MUST be "off", when using Wifi modules so definitely you DONT enable it using |USB.
Also, mind that wifi modules can draw a lot of current (up to a few 100's mAmps) so they need a decent power supply that can hold at least 4.7-4.8volts on power pins of  USIFAC board.
Now,i would suggest first, to try communicate with module, using a PC terminal and a usb2serial cable, just to see if module is ok. Wifi modules usually have 115200  as default serial speed.
Then try to set USIFAC's serial port speed at 115200 using |SET command and then try |WIFI.
You can also use the small terminal i have,|COM, in order to communicate manually with module by giving AT commands.

 Judging from my experience with Wifi modules,i would say that they  are a bit "picky" at boot, you need to let them a few seconds to boot before trying to communicate.
 Also, they don't seem to be very reliable either, i have an esp-07 and an esp-01 module that worked perfect a few months ago, but when i try to use them a few days ago, one was not responding at all, and the other, was not able to connect to the TCP server of the windows utility! I even tried to reflash them but with no success....

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 01:50, 27 March 21
I do not know how do you power the ESP module  but it should be powered with 3.3VFrom the photos of usifac (still waiting for mine, pls postman hurry up) I cannot see the 3.3V the regulator in usifac board.
If there is no 3.3V on usifac you could get it from the regulator of the usb board.
Also TX/RX lines for WIFI module should be 3.3VFrom the ESP side TX could probably be like it is (3.3V) and the microcontroller will read 3.3 has HIGH.  For RX a simple resistor divider R1=10k R2=20k would convert it from 5V to 3.3V
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:50, 27 March 21
I do not know how do you power the ESP module  but it should be powered with 3.3VFrom the photos of usifac (still waiting for mine, pls postman hurry up) I cannot see the 3.3V the regulator in usifac board.
If there is no 3.3V on usifac you could get it from the regulator of the usb board.
Also TX/RX lines for WIFI module should be 3.3VFrom the ESP side TX could probably be like it is (3.3V) and the microcontroller will read 3.3 has HIGH.  For RX a simple resistor divider R1=10k R2=20k would convert it from 5V to 3.3V

There are "5v adapter boards" where you can use esp-01 modules without problems.Also esp-07 can be used directly with 5v supply, i note this in user's manual:
 

* 12.jpg
(48.66 kB, 448x460 - viewed 173 times)


I'm using these wifi modules for years (since with 1st USIfAC board) and never had any problems, most probable all the extra circuits that required for esp modules to be "5v tollerant" are on these adapter boards.  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 13:05, 27 March 21
 :) Yes, these modules look good (1117 regulator for power and transistors for RX/TX signals) . I thought you were using normal 3.3v modules.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 15:14, 27 March 21
Hi Friends,
I design a little box with my 3D printer. for those interested....Attached the STL (2 parts and 2 buttons).
inside this archive, 2 Top cover (one for those like me who need a hole for adding a 7cm button  for disk swap / one without)


pictures :

https://ibb.co/ZBcdRs3 (https://ibb.co/ZBcdRs3)

https://ibb.co/ftLkZxq (https://ibb.co/ftLkZxq)

(https://ibb.co/ZBcdRs3)
(https://ibb.co/ZBcdRs3)
++
Phil


(https://ibb.co/ftLkZxq)
(https://ibb.co/ZBcdRs3)

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: WrathOfThePixel on 20:06, 27 March 21
Hi, is it possible to copy from and to a .dsk in USB drive and real floppy in FDD please ?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 21:20, 27 March 21
just one question John.
I noticed on a CPC464, after a disk mount and play, or when you simply do nothing, when you push the Pause button, and reset, screen flashes grey like a bad Z80 Rom. Even if you turn the computer completly off and restart after a few seconds, the same happens until you push the Pause Button again.


When you do a hard reset, the rom of the cart is not reseted ?

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 22:00, 27 March 21

Hello,


Can you make a pair of drawings where we can watch how we must use esp-07 and esp-01 with Usifac??


Excuse, but my English isn't good and some things I don't understand very well.


Thank you.

There are "5v adapter boards" where you can use esp-01 modules without problems.Also esp-07 can be used directly with 5v supply, i note this in user's manual:
 

I'm using these wifi modules for years (since with 1st USIfAC board) and never had any problems, most probable all the extra circuits that required for esp modules to be "5v tollerant" are on these adapter boards.  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 01:42, 28 March 21
just one question John.
I noticed on a CPC464, after a disk mount and play, or when you simply do nothing, when you push the Pause button, and reset, screen flashes grey like a bad Z80 Rom. Even if you turn the computer completly off and restart after a few seconds, the same happens until you push the Pause Button again.


When you do a hard reset, the rom of the cart is not reseted ?


Great, so the pause button works perfectly.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 02:11, 28 March 21
Hi, is it possible to copy from and to a .dsk in USB drive and real floppy in FDD please ?
You can't copy files from a dsk image directly, but you can first copy the entire image to a real disk (using |DSK), and then, use |2PC command,to copy  files containing in the dsk image to the usb device.
 Also, you can use |COPY to do the opposite, copy files from usb device to the real disk.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 02:13, 28 March 21
Hello,Can you make a pair of drawings where we can watch how we must use esp-07 and esp-01 with Usifac??
Excuse, but my English isn't good and some things I don't understand very well.Thank you.

Check the user's guide:
https://www.dropbox.com/preview/Amstrad%20serial%20port%20II/Amstrad%20CPC%20Serial%20Interface%20II%20User%20Guide.pdf?role=personal
 I have detailed info and instructions regarding setup and use of Wifi modules with USIfAC II!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 19:56, 28 March 21
Sorry, I didn't understand GUNHEAD note about my question.
But from what I understand, a hard reset of the CPC doesn't produce a full reset of the USIFAC card...That's it ?


2 others questions/remarks, is there a way to know what version of the eeprom we have before updating IT ? and do you plan a better Emualtion of disks (protected disks or CPM disks for example) ? If you really want to kill our Goteks... :P

[/size][size=78%]Thanks anyway [/size]
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Skunkfish on 21:24, 28 March 21
Hi Philippe,

I believe the pause button works by physically pulling Pin 39 (Ready) to ground, thereby stalling the Z80 in the CPC until it is released (pin 39 connects to the /WAIT pin on the Z80).


That's why it's unaffected by resetting the CPC or the USifAC.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:32, 28 March 21
Hi Philippe,
I believe the pause button works by physically pulling Pin 39 (Ready) to ground, thereby stalling the Z80 in the CPC until it is released (pin 39 connects to the /WAIT pin on the Z80).
That's why it's unaffected by resetting the CPC or the USifAC.
Exactly that!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:30, 28 March 21
Sorry, I didn't understand GUNHEAD note about my question.
But from what I understand, a hard reset of the CPC doesn't produce a full reset of the USIFAC card...That's it ?
2 others questions/remarks, is there a way to know what version of the eeprom we have before updating IT ? and do you plan a better Emualtion of disks (protected disks or CPM disks for example) ? If you really want to kill our Goteks... :P
Thanks anyway

 Pause switch, just enables the WAIT signal on Z80 CPU, thus Amstrad will wait as long as Switch is enabled.
Reset button on the other hand, is the one that really resets BOTH amstrad & USIfAC board.
About FDC emulation, i'm afraid this is as far as it can goes, but apart from a few hard protected dsk game images (which most certain you can find them in cracked versions ...;D ), everything else seem to work fine! You can access almost any kind of dsk image existed, from usual Amsdos images, up to CP/M disks, PARADOS disks, even spectrum +3 and PCW disks should be readable too!  ;) Mind also that, |DSK command which transferrs an image to a real disk, has almost the same compatibility (as i finally got rid of amsdos routines and use low level custom routines that communicate directly with 765 FDC).
Now i consider USIfAC II a "gotek killer" for amstrad, not so much for offering the "perfect/load everything" compatibility with dsk images that gotek offers (thanks to the extraordinay work of keir freiser, the creator of Flash FLoppy, the firmware that all gotek drives are flashed with), but mostly for EASE of use and easily manage 100's (or even 1000's) of dsk images, especially now with the addition of the Basic loader creator utility, which practically eliminates the need of typing RSX commands!
 Just imagine that you have a usb stick with 100's of dsk images in it, and you want to access a specific image using gotek....
Endless pressings of gotek buttons to find the image you want, and even if you have popular addons, like rotary enconders or oled screens , you will still end up turning left-right the enconder (like trying to tune with a radio station  :laugh: ), and continiously struggling to read the image names from the tiny oled screen...  ;D
 Same thing using USIfAC is a "piece of cake": just give a filtered |CAT command and you will instantly get the image (or a very small list of images) you want!

BUT, the thing is, that USIfAC II, is not just a "gotek replacement", it is MUCH more than a mere floppy drive emulator:
- It transforms any connected usb device, to a HUGE HDD for Amstrad cpc, where you can load/save/delete files directly (at ~5 times faster than gotek), as change/make/delete directories too!
- It offers many extra functionality, like use of bluetooth/wifi modules, copy files between flopy disks and usb device, copy images to real disks, format disks etc.
- You can use it directly with Amstrad CPC 464 (gotek connects only to 664/6128, for 464 you need to have a rather expensive DDI like interface)
- It costs MUCH less than a gotek drive and extra equipment needed, for external (ribbon cable+power cable) connection or internal (cable adapter+front face) replacement of the 3" drive! Especially if you want to have the extra addons like oled screen+rotary encoder, total cost for a "full Gotek pack" for Amstrad, can be more than 3 times the cost of USIfAC II!

Or, in 2 words... A TRUE GOTEK KILLER FOR AMSTRAD CPC!  :P

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 23:03, 28 March 21
Very true! Why should a CPC expansion care about some weird disc formats of other systems?
It's for CPC and that's good that way! Amazing how U2 does evolve every week!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 00:18, 29 March 21
First, usb host module MUST be "off", when using Wifi modules so definitely you DONT enable it using |USB.
Also, mind that wifi modules can draw a lot of current (up to a few 100's mAmps) so they need a decent power supply that can hold at least 4.7-4.8volts on power pins of  USIFAC board.
Now,i would suggest first, to try communicate with module, using a PC terminal and a usb2serial cable, just to see if module is ok. Wifi modules usually have 115200  as default serial speed.
Then try to set USIFAC's serial port speed at 115200 using |SET command and then try |WIFI.
You can also use the small terminal i have,|COM, in order to communicate manually with module by giving AT commands.

 Judging from my experience with Wifi modules,i would say that they  are a bit "picky" at boot, you need to let them a few seconds to boot before trying to communicate.
 Also, they don't seem to be very reliable either, i have an esp-07 and an esp-01 module that worked perfect a few months ago, but when i try to use them a few days ago, one was not responding at all, and the other, was not able to connect to the TCP server of the windows utility! I even tried to reflash them but with no success....


Turns out my DM-101 ( ESP-07 ESP-8266 ) modules had no firmware on them at all. The flashing process is a bit involved. These modules seem to work only with old firmware.  ESP_8266_BIN0.92.bin (attached) was the one I got working. It's possible that newer firmware will work, but I had no joy. I set up the access point though the usb-ttl and then stuck it in the usifac.


But it's recognised by the usifac now and I can communicate with it through the 464. So all is good :)


Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 01:45, 29 March 21
@ kolleykibber Great!  :)
Btw, you could do all the Wifi module setup directly from Amstrad using |WIFI too. The Utility first checks for ESP's serial port speed and ask you if you want to change it, then it asks for Access point name&password, and after it is connected, asks for ip address and port no. of the tcp server to be connected (these are given on the windows utility i made for USIfAC II, but i suppose it could work with any other TCP server you might want to use for  ;) )
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ajcasado on 12:00, 29 March 21
Pause switch, just enables the WAIT signal on Z80 CPU, thus Amstrad will wait as long as Switch is enabled.
I thought that you cannot maintain *WAIT signal low indefinitely because it prevents the DRAM to be refreshed.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 14:54, 29 March 21
Pause switch, just enables the WAIT signal on Z80 CPU, thus Amstrad will wait as long as Switch is enabled.
Reset button on the other hand, is the one that really resets BOTH amstrad & USIfAC board.
About FDC emulation, i'm afraid this is as far as it can goes, but apart from a few hard protected dsk game images (which most certain you can find them in cracked versions ... ;D ), everything else seem to work fine! You can access almost any kind of dsk image existed, from usual Amsdos images, up to CP/M disks, PARADOS disks, even spectrum +3 and PCW disks should be readable too!  ;) Mind also that, |DSK command which transferrs an image to a real disk, has almost the same compatibility (as i finally got rid of amsdos routines and use low level custom routines that communicate directly with 765 FDC).
Now i consider USIfAC II a "gotek killer" for amstrad, not so much for offering the "perfect/load everything" compatibility with dsk images that gotek offers (thanks to the extraordinay work of keir freiser, the creator of Flash FLoppy, the firmware that all gotek drives are flashed with), but mostly for EASE of use and easily manage 100's (or even 1000's) of dsk images, especially now with the addition of the Basic loader creator utility, which practically eliminates the need of typing RSX commands!
 Just imagine that you have a usb stick with 100's of dsk images in it, and you want to access a specific image using gotek....
Endless pressings of gotek buttons to find the image you want, and even if you have popular addons, like rotary enconders or oled screens , you will still end up turning left-right the enconder (like trying to tune with a radio station  :laugh: ), and continiously struggling to read the image names from the tiny oled screen...  ;D
 Same thing using USIfAC is a "piece of cake": just give a filtered |CAT command and you will instantly get the image (or a very small list of images) you want!

BUT, the thing is, that USIfAC II, is not just a "gotek replacement", it is MUCH more than a mere floppy drive emulator:
- It transforms any connected usb device, to a HUGE HDD for Amstrad cpc, where you can load/save/delete files directly (at ~5 times faster than gotek), as change/make/delete directories too!
- It offers many extra functionality, like use of bluetooth/wifi modules, copy files between flopy disks and usb device, copy images to real disks, format disks etc.
- You can use it directly with Amstrad CPC 464 (gotek connects only to 664/6128, for 464 you need to have a rather expensive DDI like interface)
- It costs MUCH less than a gotek drive and extra equipment needed, for external (ribbon cable+power cable) connection or internal (cable adapter+front face) replacement of the 3" drive! Especially if you want to have the extra addons like oled screen+rotary encoder, total cost for a "full Gotek pack" for Amstrad, can be more than 3 times the cost of USIfAC II!

Or, in 2 words... A TRUE GOTEK KILLER FOR AMSTRAD CPC!  :P


Hi John, thanks for the clarifications.


Agree with all the things you said. It's a great tool for our 464 especially. Thanks for that, no offense as your tools are always great  :D


You did not answer to the question : how to check the version numer of the program flashed into the PIC ?


cheers.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:25, 29 March 21
I thought that you cannot maintain *WAIT signal low indefinitely because it prevents the DRAM to be refreshed.

 Well,i think that DRAM refresh is made by 40010 Gate Array Chip, and because this is working even when Z80 is paused, this might explain the fact that you can pause Amstrad without time limit.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:36, 29 March 21
You did not answer to the question : how to check the version numer of the program flashed into the PIC ?

 Well, you can't, at least not directly using some command. But there are indirect ways to find out, for example, on CPC 464, if you get multiple resets on "cold start", then you have a newer firmware installed. Also, boards sent after february have the latest firmware too.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 02:32, 30 March 21
Hi John


Would it be possible to Put the revision number in the |help text ?


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 23:59, 30 March 21
Well, it would be  easier to use the |STAT command, i could add a remark with the firmware rev. number (which will be "Hard coded" with each different revision), but of course you will need the new frimware for the board to see it
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: xyphoes on 11:23, 03 April 21
Hi all, I made some tests using USIfACII for calling a BBS with success ^^

I use TCPSER for emulate a modem and made a Telnet connection, (maybe I will try with a real modem)  => https://github.com/go4retro/tcpser
https://ibb.co/sKkydwW 

BBS => http://amstrad.simulant.uk/

It's fun  ;D   
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:14, 03 April 21
A small firmware update (_3a):

- On CPC 464, you can (again  :) ) eliminate giving |USB after Reset, this time i think i made it  work right (no "bad command" messages upon reset any more...)! :D

- Amsdos/Parados Emulation is now saved into PIC's EEPROM, so Board will always "remember" your choice.

- New ability:choose if you want to Return to Usb device Root directory after Reset (until now,board always remembered the directory you were before reset), just give OUT &FBD1,66 to enable or OUT &FBD1,65 to disable. Again, board will "Remember" your choice.
This could be very usefull if you use the BASIC loader listings mentioned above to load  Games/programs, as after RESET, you will automatically return to Root directory (where all the BASIC loader programs are), without needing to give |CDR command!  ;)

- |STAT command now shows Firmware revision and if "return2root directory after Reset" is enabled:

 

* IMG_20210403_113323_846.jpg
(106.98 kB, 658x513 - viewed 225 times)


The "Direct Mode 1 Enabled" message on boot screen, is shown when you Reset CPC464 with Usb module enabled, and then, you can directly access usb stick, without giving any extra commands!  ;)
Note also the additions of firmware rev. number and Return2root dir after reset, mentioned above.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 08:58, 06 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Unfortunately the new Firmware continually reboots ?
This is on a STANDARD CPC464 (No Modifications)


Late Update :- This also happens on a STANDARD CPC6128.

I did not have a chance to do the OUT FBD2,5 ?
The screen shows the USBIfAC II and then reboots.

Thanks

keep Safe

Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:42, 06 April 21
 Well, i've tried the new firmware with all 3 Amstrad CPCs i have, two CPC6128 (one with dual amsdos/parados rom and a modern CMOS Z80/20Mhz) and one Schneider CPC464, and in all cases worked fine, so most probable the problem you mention doesn't have to do with firmware.
In most cases, such behavior is more hardware related, than software. For example, there might be connection problems, between Amstrad and USIFAC II board (for example, bad connection of the ribbon cable with the edge connector). Also, there might be some kind of short circuit somewhere that causes these repeated reboots.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 01:12, 07 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Ok Point taken


I have a second USIfAC II board I will set that up and see what happens.


The 464 has pin headers soldered to the expansion and an appopriate cable.
The 6128 is a standard edge connector and a standard cable.


Keep Safe
Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 09:36, 07 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Ok have setup the second board and the same result using 3a (I am NOT having problems with version 3 √√√√)


some information using MPLAB IPE below :-


The CP=OFF Checksum is different for Version 3a ??

18f47q10 Version 3 Firmware Checksums:- shown Using MPLAB IPE


CP=OFF Checksum = CD79
Below that
Checksum = CD79

I am able to Verify this Firmware after programming √√√√. GOOD



The faulty one is below - 3a ???

18f47q10 Version 3a Firmware Checksums:-

CP=OFF Checksum = FAD0. ??? ??? ??? ??
Below that
Checksum = 13A6

I am UNABLE to Verify this Firmware after programming. XXXXX

I can write the firmware and it says verified BUT
When I do a seperate Verify Pass it FAILS (4 Chips Tested) ??? ?

Perhaps there is a concern with the File 18f47q10 Version 3a

Thanks

Keep Safe

Ray
 
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:12, 08 April 21
Yes, checksum of 3a version is CD79, but it seems that i enabled code protection when i compiled the hex file, that's why you can't verify it.
So, since previous firmware works ok, and you only have problems with 3a (when it works perfect on all Amstrads i have), the only logical thing to assume, is that somehow, your programmer+software can't handle properly code protected hex files  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 13:50, 08 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Ok I don't know how to write ? Protected hex files.


Perhaps as I use the same Programmer software as what was recommended you could tell me what I have to do to write them correctly ?


I spent some hours trying to find a solution but was unable to write a working file ?


Or as an option release an UnProtected file as none of the other files that you have release are Protected ?


Thanks
Keep Safe
Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Skunkfish on 11:04, 09 April 21
Will firmware 3a work with my older (non-white) board?

I assume so, I'm planning to update the firmware and install a push button today.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:51, 09 April 21
There is no actual hardware difference between the old boards and the new white one, appart from the added dsk swap button, so you can perfectly use the latest firmware with old boards too, but if you don't have the button, then all extra rsx commands for supporting multiple dsk image access will be useless  ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 14:52, 09 April 21
@ikongsgr


I just flashed the firmware with 3a version from page 1 and same problem Audronic has.
keep reseting, no access to CPC and bad Checksum.
Don't have the 3.0 firm on computer, where to download it ? or can we have the actual firm unprotected ?

Tried to reflash with the 2D and OUT &FBD2,5 is ok). so Erase, reflash with 3A and no luck...
helppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp. I mounted the Swap Button. Would like to use it.

Thanks.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:18, 10 April 21
Ok,i just confirm the problem myself.
It seems that using pickit3 to update new firmware is causing this problem, but everything works ok, when you use PICKIT4 programmer (which i'm lately using) ::)
Anyway, i've correct the problem, and now you should be able to use the latest _3a firmware (i uploaded at 1st post) with PICKIT3 programmer too.
Sorry for the incovenience! ;)


Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 12:37, 10 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Well done.
I will test the 3a Update tomorrow.


Thanks for all your work on this project


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 12:45, 10 April 21
Great, thanks. Gonna try it now and tell you if it's ok


EDIT : Ok tried it and working well. But I need to check wires on my Swap button as it doesn't swap... :P


Thanks

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 20:27, 10 April 21
Sorry
but getting MAD with the SWAP Button
solder GND to WIFI GND connection and other to pin on the PIC.
When I press the button, it sometimes swap to next disk, sometimes jump from disk 1 to 4, and most of the time freeze the CPC or blurry the screen or send a TAPE CAT command...


What's wrong according to you ?
attached a photo of the cart. video too if interested https://1fichier.com/?u5ob5v6wlly6znwazj0s


Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:19, 10 April 21
Well, it sounds like bad contact to me. I can't see form photo if you have soldered the cable to PIC's pin, but it's better to do it from the bottom of the board by soldering the cable to socket's pin. Mind also that, while button is pressed, Amstrad freezes, and also you should have dsk images mounted on at least slot 1 & another slot (2-4), in order for the swap to work.
And don't forget you can check current state by giving |SMG.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 02:22, 11 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


Hi John

Well done it works well.
Tested on a CPC464, and a CPC6128.

I did not have to do an “ out &fbd2,5 “ ( ROM 5) on the CPC464 Only as it automatically does this to ROM 4.
Does it matter if the Interface Rom is 4 or 5 ?
Or do I just leave the default ROM 4 for version 3a

Thanks

Keep Safe
Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:09, 11 April 21
@Audronic (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1169), as long as there is no other device using rom 4, it doesn't make any difference.
After reflashing PIC, and according to the initial value of the EEPROM byte where the rom number is stored, it might indeed work directly, without needing to give OUT &FBD2,5 to set it.
 In anycase, you could give the out command just to ensure that board gets the correct rom number, afterall, this needs to be done only once after re-flashing pic  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:11, 11 April 21
I've added a small txt file (https://www.dropbox.com/s/ux5ujgy2kn8ilkc/help.txt?dl=0) which includes the |HELP text, so you can easily print all the RSX commands in a single paper for quick reference!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 12:25, 11 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


I will set my systems up for your default of ROM 5 .
Thanks for the Help documentation it is appreciated.


Keep up the good work 


Keep Safe


Ray



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 17:34, 11 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) please as I'm a total noob, what is the best GND pin that I should solder the cable for disk swap button ?
I don't want to fire the cart...
tested the button putting the GND to a metal thing and it works.
maybe my button has too much impedance or something like that...

so I prefer asking you
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 14:40, 13 April 21
[SOLVED] I forgot to activate it with OUT &FBD2,5   (as described in https://www.dropbox.com/s/pymv4sbxch3psin/Updating%20the%20Firmware%20of%20USIfAC%20II%20via%20ICSP%20v1.pdf?dl=0 (https://www.dropbox.com/s/pymv4sbxch3psin/Updating%20the%20Firmware%20of%20USIfAC%20II%20via%20ICSP%20v1.pdf?dl=0))

Hi all, finally postal service has delivered my USIFAC (last green version I guess)
But the problem is I am getting "Unknown command" for each RSX function I call  |HELP   |CAT , ...., etc

At startup I do not get any USIFAC message, is it normal? Reset and pause button work.Votlage on + - is 4.6V which I assume is enough
I am going to clean again the expansion port contacts.

Any hint?
BR.

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 15:11, 13 April 21
Does it say "USIfAC II Enhanced" on Bootscreen ? if not, try a "OUT &FBD2,5" to set the rom to slot 5 and restart the USIfAC with the reset button ... worth a try
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:26, 13 April 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) please as I'm a total noob, what is the best GND pin that I should solder the cable for disk swap button ?
I don't want to fire the cart...
tested the button putting the GND to a metal thing and it works.
maybe my button has too much impedance or something like that...
so I prefer asking you

 On my development board (it's one of the 1st pcbs i designed), i'm using the same gnd pin you used (gnd from the 4pin WiFi module connector) but i got a small cable soldered at the bottom of the board that goes to a button exactly the same as the reset button.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 12:47, 15 April 21
Hi all, I keep on exploring USIFAC2 and now I want to connect to wifi
I have selected 115200 bps with OUT &FBD1,16 and |STAT says it is like this but |WIFI gets "NO Wifi module detected!"  :( I am using an ESP-07 WIFI board with the switch in the UART position (down) and the led is ON.

I had to flash the file @kolleykibber (https://www.cpcwiki.eu/forum/profile/?u=4071) provided, and now it is communicating BUT  SSID and PASSWD is skipped   ???  (see atached image)

Connecting to the module from the PC, it seems that firmware does not have  AT+CWJAP neither AT+CWLAP and maybe USIFAC is ignoring it and thus it is not asking for SSID/PASS

My version of AT firmware is
AT+GMR
00170901Which version are you using?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 14:35, 15 April 21
YES, my RCA conversion is horrible)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:49, 15 April 21
You can try |COM to get a small terminal that can be used for giving AT commands. I used various v1.6 and v1.7 firmwares for esp8266 modules, either esp-01 or esp-07.

bTW, SSID and passwd is skipped, when the module is already connected to an access point (usually router's), so it directly asks for ip and port no. , and tries to connect to a TCP server (a tcp server is activated every time you run my windows utility for usifac ii, but i suppose it could work with any other tcpserver too  :) )
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 23:44, 15 April 21
Ok, in addition to the auto mount script from ikonsgr I wrote a little basic program that let's you easily switch between DSK images to all 4 Slots and after that just use them with the image switch button on the USIfAC II.


So, how does this work ?


First of all, put the USB Stick in your PC, open a command prompt and navigate to your directory with some DSK files in it. Once there, just do : DIR *.DSK /-N > INDEX.TXT


Be sure not to forget the "/-N" option, because we need 8+3 naming for the CPC to recognize the image files. After that just add the NC.BAS file (attached to this post) in the same directory as the INDEX.TXT !


Now put the USB Stick back into the USIfAC II , navigate to the folder where those files are and simply type RUN"NC.BAS". After you finished using the DSK images, just do a reset on USIfAC, type |USB and RUN"NC.BAS" again to change your chosen images. This is nothing fancy or well coded, it just helps to save time and typing :)


Of course you can do that for all the directories on your USB Stick if wanted. You can also edit the INDEX.TXT with any editor and put DSK files in there if you want, just be sure to stick to the 8+3 filename.

Limitations : only 60 DSK images in a folder are allowed



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:49, 16 April 21
Finally, "3rd party support" for USIfAC II  started!
Well done!  ;)
btw, if you want, we could add this in the download link of usifac ii windows utility prorgam,and why not, add a section in User's guide too!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:57, 16 April 21
And here is the Basic utility in ascii text form:
  [ You are not allowed to view attachments ]  
In this form, you can easily edit/view the listing from your PC and run it directly to your Amstrad!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: SkulleateR on 01:11, 16 April 21
Finally, "3rd party support" for USIfAC II  started!
Well done!  ;)
btw, if you want, we could add this in the download link of usifac ii windows utility prorgam,and why not, add a section in User's guide too!  ;)


You are of course free to do so ... I'm still working on larger directory support with more DSK files but the main structure stays the same... And of course still investigate the issue we wrote about  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 18:47, 16 April 21

Turns out my DM-101 ( ESP-07 ESP-8266 ) modules had no firmware on them at all. The flashing process is a bit involved. These modules seem to work only with old firmware.  ESP_8266_BIN0.92.bin (attached) was the one I got working. It's possible that newer firmware will work, but I had no joy. I set up the access point though the usb-ttl and then stuck it in the usifac.


But it's recognised by the usifac now and I can communicate with it through the 464. So all is good :)



Hi, got the same problem. Can we flash the module with the Pickit 3.5 ? or do you have a noob procedure for us to do that ?


Thanks
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 20:13, 16 April 21

Hi, got the same problem. Can we flash the module with the Pickit 3.5 ? or do you have a noob procedure for us to do that ?


Thanks
No, Philippe, this should be done with a usb-serial module like this one https://es.aliexpress.com/item/1005001510943320.html
In particular I use the black one with CP2102 but you could use others for example PL2303HX that is used in the documentation for Direct Serial Connection https://www.dropbox.com/sh/ezzga2dppm6jlm7/AACwFC_rv2QatWh_ndKc9fhma?dl=0&preview=Amstrad+CPC+Serial+Interface+II+User+Guide.pdf
For flashing it you can find instructions in http://nerdclub-uk.blogspot.com/2016/09/upgrading-firmware-in-esp8266-wifi.html

But I guess, maybe your module is OK and you just need to change the baudrateIf it is reporting strange characters (it is working but in an unknown baudrate probably)
It looks that some of the modules use 9600bps and also the "exotic"  74880bps , so you could give a try to set that baudrate in the arduino serial monitor or in Realterm or in CPC with |TER
Additionally, in my case I needed to  set station mode for wifi  AT+CWMODE=1  and then AT+CWJAP="WIFINAME","YOURPASS"Then , setup baudrate  AT+CIOBAUD=115200   and the same speed in USIFAC
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 20:19, 16 April 21
Thanks. Gonna look for it. Stay tuned.
Phil
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:15, 17 April 21
Hi, got the same problem. Can we flash the module with the Pickit 3.5 ? or do you have a noob procedure for us to do that ?
Thanks

 Download this: https://www.dropbox.com/s/vkq6ghmf39a0qx7/ESP8266_flasher.zip?dl=0
Just run "esp8266_flasher.exe", click "BIN" button and select the included: "HS06F014 ESP-01S.bin", set your com port number and press "download".
This must be the easiest way to flash a wifi module.
Btw, i found out why mysteriously all my wifi modules stopped working: firewall blocked access to windows utility TCP server (i suspect the antivirus involved in this...)
So, if your Wifi module can't connect to PC check windows firewall settings, if there is any inbound rule that block access of the Amstrad utility.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 23:16, 17 April 21
But I guess, maybe your module is OK and you just need to change the baudrateIf it is reporting strange characters (it is working but in an unknown baudrate probably)
It looks that some of the modules use 9600bps and also the "exotic"  74880bps , so you could give a try to set that baudrate in the arduino serial monitor or in Realterm or in CPC with |TER
Additionally, in my case I needed to  set station mode for wifi  AT+CWMODE=1  and then AT+CWJAP="WIFINAME","YOURPASS"Then , setup baudrate  AT+CIOBAUD=115200   and the same speed in USIFAC

 Well, you can do all that, by simply giving |WIFI. There is also no need to preset wifi module's speed to usufac's serial port speed, as program will scan all available speeds automatically and set to current speed of the wifi module (i simply give an AT command and check respond, if it's the right one then obviously this is the correct serial port speed!  ;) btw, the |WIFI utility is in BASIC, so it can be a good source for learning too!  ;))
After that, you'll be asked if you want to change the speed, and then set Access point name+password (this is ommited if module is already connected to an access point), and finally establish a TCP conection by giving ip address+port  of a tcp server.
The only thing that you need to take care, is that, after initial power up (of Amstrad+usifac+wifi module), you should wait for a few seconds for the wifi module to boot properly, and then give "|WIFI" command. If you give the command too quick, you might get a lot of garbage on screen, even hang-ups and resets, although no harm is done with that, as you can simply reset amstrad and give "|WIFI" again!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 23:42, 17 April 21
btw, the |WIFI utility is in BASIC, so it can be a good source for learning too!  ;) )
Nice info @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) but how can this BASIC code be listed? (BTW, I still have to learn how to program RSX commands  :) )
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 23:59, 17 April 21
Well, after finishing setting up wifi module, you just give "LIST" at basic prompt, and you will get the BASIC listing!  :D
And here is the asm code for the |WIFI command:
Code: [Select]
data_size equ 3465
addr equ &170
org &c000
ld hl, setwifi_code
ld de, addr
ld bc, data_size
ldir
ld a ,#FB
in a,(#Dc)
ld l, a
ld h,&ae
ld de,data_size+&170
ld B,4

patch_mems: ;length+1678+368 (&170)

ld (HL),e
INC HL
LD (HL),d
INC HL
dec b
jr nz,patch_mems

ld a,l
cp &6e
jp z,runcommand
ret

runcommand:
ld hl,&ae29
ld a,0
ld (hl),a
ld hl, run_code
ld de, &7900
ld bc, 8
ldir
jp &7900

Run_code:
defb 14,0,33,149,234,205,27,0


setwifi_code:

defb 19,0,10,0,173,32,16,1,130,32,14,32,32,32,32,32,32,32,0,31,0,17,0,185,32,28,208,251,44,25,43,1,185,32,28,208,251,44,25,43,1,185
defb 32,28,208,251,44,25,43,0,60,0,20,0,147,32,3,0,0,83,208,40,25,10,41,1,13,0,0,115,101,114,115,112,101,101,228,239,25,24,1,13,0
defb 0,99,117,114,115,112,101,101,228,239,255,11,40,28,221,251,41,32,32,32,32,32,32,32,32,32,0,25,0,30,0,162,32,14,44,15,1,162,32,16,44
defb 14,1,186,32,16,1,138,32,32,32,0,10,0,40,0,159,32,30,136,19,0,36,0,50,0,3,0,0,225,239,34,65,84,43,67,87,77,79,68,69,61
defb 49,34,1,159,32,30,176,4,32,32,32,32,32,32,32,0,19,0,100,0,197,32,115,101,114,105,97,108,32,115,101,116,117,112,0,60,0,110,0,138,1
defb 216,32,35,14,44,25,18,44,25,55,44,17,44,22,1,124,0,83,84,65,212,1,216,32,35,14,44,25,18,44,25,55,44,18,44,22,1,138,1,216,32
defb 35,14,44,15,44,25,79,44,15,44,25,25,0,60,0,115,0,169,32,25,22,44,19,1,191,34,83,101,116,32,110,101,119,32,115,112,101,101,100,63,32
defb 40,89,47,78,41,34,1,131,32,28,3,187,1,13,0,0,111,102,102,115,101,244,239,14,32,32,32,32,32,32,32,0,34,0,116,0,161,32,255,10,40
defb 25,43,41,239,14,32,235,32,30,120,0,32,32,32,32,32,32,32,32,32,32,32,32,32,0,41,0,117,0,161,32,255,10,40,25,46,41,239,14,32,235
defb 32,13,0,0,111,102,102,115,101,244,239,25,11,1,160,32,30,84,1,32,32,32,32,32,0,10,0,118,0,160,32,30,116,0,0,58,0,120,0,191,1
defb 191,34,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,80,114,101,115,115,58,34,1,158,32,13,0,0,248,239
defb 21,32,236,32,25,14,32,32,32,32,0,75,0,130,0,195,32,3,0,0,83,208,40,13,0,0,248,245,20,41,1,169,32,25,32,44,13,0,0,248,1
defb 191,32,34,60,34,59,172,40,255,25,40,13,0,0,216,245,20,41,44,16,44,15,41,59,34,62,58,34,59,3,0,0,83,208,40,13,0,0,248,245,20
defb 41,32,32,0,11,0,140,0,176,32,13,0,0,248,0,60,0,160,0,140,32,57,54,48,48,44,53,55,54,48,48,44,49,49,53,50,48,48,44,50,51
defb 48,52,48,48,44,52,54,48,56,48,48,44,53,55,54,48,48,48,44,57,50,49,54,48,48,44,49,48,54,53,54,48,48,0,21,0,170,0,13,0,0
defb 115,101,114,115,240,239,14,1,131,32,28,3,187,0,51,0,180,0,161,32,255,10,40,25,64,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25
defb 12,1,3,0,0,83,208,239,34,57,54,48,48,34,32,32,32,32,32,32,32,32,32,0,54,0,190,0,161,32,255,10,40,25,65,41,239,14,32,235,32
defb 13,0,0,115,101,114,115,240,239,25,15,1,3,0,0,83,208,239,34,53,55,54,48,48,34,32,32,32,32,32,32,32,32,32,32,32,0,52,0,200,0
defb 161,32,255,10,40,25,57,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,16,1,3,0,0,83,208,239,34,49,49,53,50,48,48,34,32,32
defb 32,32,32,32,32,32,0,51,0,210,0,161,32,255,10,40,25,56,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,17,1,3,0,0,83,208
defb 239,34,50,51,48,52,48,48,34,32,32,32,32,32,32,32,0,50,0,220,0,161,32,255,10,40,25,49,41,239,14,32,235,32,13,0,0,115,101,114,115
defb 240,239,25,18,1,3,0,0,83,208,239,34,52,54,48,56,48,48,34,32,32,32,32,32,32,0,54,0,230,0,161,32,255,10,40,25,48,41,239,14,32
defb 235,32,13,0,0,115,101,114,115,240,239,25,19,1,3,0,0,83,208,239,34,53,55,54,48,48,48,34,32,32,32,32,32,32,32,32,32,32,0,44,0
defb 240,0,161,32,255,10,40,25,41,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,21,1,3,0,0,83,208,239,34,57,50,49,54,48,48,34
defb 0,51,0,250,0,161,32,255,10,40,25,40,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,23,1,3,0,0,83,208,239,34,49,48,54,53
defb 54,48,48,34,32,32,32,32,32,32,0,25,0,24,1,161,32,13,0,0,115,101,114,115,240,239,14,32,235,32,160,32,30,180,0,0,54,0,44,1,3
defb 0,0,193,239,34,65,84,43,85,65,82,84,95,68,69,70,61,34,244,3,0,0,83,208,244,34,44,56,44,49,44,48,44,48,34,32,32,32,32,32,32
defb 32,32,32,32,32,32,32,0,33,0,54,1,159,32,30,176,4,1,185,32,28,209,251,44,13,0,0,115,101,114,115,240,1,185,32,28,209,251,44,15,0
defb 25,0,64,1,158,32,13,0,0,233,239,15,32,236,32,25,100,1,176,32,13,0,0,233,0,110,0,84,1,216,32,35,16,44,15,44,25,79,44,25,21
defb 245,13,0,0,79,70,70,83,69,212,44,25,25,245,13,0,0,79,70,70,83,69,212,1,186,32,35,16,44,14,1,187,32,35,16,44,15,1,216,32,35
defb 17,44,15,44,25,79,44,25,19,245,13,0,0,79,70,70,83,69,212,44,25,20,245,13,0,0,79,70,70,83,69,212,1,186,32,35,17,44,14,1,187
defb 32,35,17,44,15,1,159,32,30,208,7,0,37,0,86,1,3,0,0,225,239,34,65,84,43,67,73,80,77,79,68,69,61,49,34,1,159,32,30,176,4
defb 32,32,32,32,32,32,32,0,28,0,89,1,3,0,0,225,239,34,65,84,43,67,73,80,83,69,78,68,34,1,159,32,30,176,4,0,55,0,94,1,169
defb 32,25,30,44,25,22,245,13,0,0,79,70,70,83,69,212,1,191,34,87,105,70,105,32,77,111,100,117,108,101,32,99,111,110,110,101,99,116,101,100,33
defb 34,32,32,32,32,32,32,32,0,17,0,104,1,131,32,28,3,187,1,152,32,32,32,32,32,0,31,0,176,4,197,32,83,69,78,68,32,65,84,32,67
defb 79,77,77,65,78,68,83,32,82,79,85,84,73,78,69,0,24,0,196,4,158,32,13,0,0,235,239,15,32,236,32,255,14,40,3,0,0,225,41,0,29
defb 0,206,4,185,32,28,208,251,44,255,1,40,172,40,3,0,0,193,44,13,0,0,203,44,15,41,41,0,11,0,216,4,176,32,13,0,0,203,0,24,0
defb 226,4,185,32,28,208,251,44,28,13,0,1,185,32,28,208,251,44,28,10,0,0,12,0,236,4,3,0,0,193,239,34,34,0,6,0,246,4,201,0,24
defb 0,0,5,197,32,83,69,78,68,32,84,69,88,84,32,82,79,85,84,73,78,69,0,25,0,60,5,158,32,13,0,0,235,239,15,32,236,32,255,14,40
defb 3,0,0,225,41,32,0,38,0,70,5,185,32,28,208,251,44,255,1,40,172,40,3,0,0,193,44,13,0,0,203,44,15,41,41,32,32,32,32,32,32
defb 32,32,32,0,14,0,80,5,176,32,13,0,0,203,32,32,32,0,36,0,85,5,161,32,13,0,0,99,114,108,230,238,14,32,235,32,185,32,28,208,251
defb 44,25,13,1,185,32,28,208,251,44,25,10,0,36,0,90,5,191,32,35,15,44,255,3,40,25,10,41,244,255,3,40,25,13,41,1,3,0,0,225,239
defb 34,34,32,32,32,32,32,0,6,0,100,5,201,0,22,0,208,7,197,32,87,73,70,73,32,67,79,78,78,69,67,84,73,79,78,0,22,0,210,7,3
defb 0,0,193,239,34,65,84,69,48,34,1,159,32,30,176,4,0,12,0,213,7,185,32,28,209,251,44,15,0,10,0,218,7,159,32,30,184,11,0,10,0
defb 223,7,131,32,28,3,187,0,32,0,224,7,161,32,13,0,0,83,84,65,84,85,211,239,14,32,235,32,13,0,0,83,84,65,84,85,211,239,15,0,40
defb 0,228,7,178,32,13,0,0,115,116,97,116,117,243,32,160,32,30,2,8,44,30,152,8,44,30,238,7,44,30,152,8,44,30,2,8,32,32,0,6,0
defb 238,7,201,0,52,0,2,8,169,32,25,27,44,25,19,245,13,0,0,111,102,102,115,101,244,1,163,34,65,46,80,46,32,115,115,105,100,58,34,44,3
defb 0,0,115,115,105,228,32,32,32,32,32,32,32,32,0,52,0,12,8,169,32,25,28,44,25,20,245,13,0,0,111,102,102,115,101,244,1,163,34,112,97
defb 115,115,119,111,114,100,58,34,44,3,0,0,112,97,115,243,32,32,32,32,32,32,32,32,32,0,73,0,22,8,3,0,0,225,239,34,65,84,43,67,87
defb 74,65,80,95,68,69,70,61,34,244,255,3,40,25,34,41,244,3,0,0,83,83,73,196,244,255,3,40,25,34,41,244,34,44,34,244,255,3,40,25,34
defb 41,244,3,0,0,80,65,83,211,244,255,3,40,25,34,41,0,15,0,32,8,159,32,30,176,4,32,32,32,32,32,0,53,0,42,8,169,32,25,30,44
defb 25,21,245,13,0,0,111,102,102,115,101,244,1,191,34,67,111,110,110,101,99,116,105,110,103,46,46,46,34,59,32,32,32,32,32,32,32,32,32,32,32
defb 32,32,0,10,0,52,8,159,32,30,184,11,0,45,0,62,8,161,32,13,0,0,115,116,97,116,117,243,239,16,32,235,32,191,34,79,75,34,1,138,32
defb 35,17,1,160,32,30,228,7,32,32,32,32,32,32,32,32,0,73,0,72,8,169,32,25,15,44,25,22,245,13,0,0,111,102,102,115,101,244,1,191,34
defb 69,114,114,111,114,58,82,101,116,114,121,40,49,41,32,111,114,32,73,110,115,101,114,116,32,110,101,119,32,65,99,99,101,115,115,32,80,111,105,110,116
defb 40,50,41,63,34,32,32,0,36,0,82,8,161,32,255,10,40,25,64,41,239,14,32,235,32,138,32,35,16,1,160,32,30,32,8,32,32,32,32,32,32
defb 32,32,0,46,0,92,8,161,32,255,10,40,25,65,41,239,14,32,235,32,138,32,35,16,1,138,32,35,17,1,131,32,28,3,187,1,160,32,30,2,8
defb 32,32,32,32,32,32,32,0,10,0,102,8,160,32,30,82,8,0,60,0,152,8,138,32,35,16,1,131,32,28,3,187,1,169,32,25,27,44,25,19,245
defb 13,0,0,111,102,102,115,101,244,1,163,34,72,111,115,116,32,105,112,58,34,44,3,0,0,104,111,115,244,32,32,32,32,32,32,32,0,52,0,162,8
defb 169,32,25,30,44,25,20,245,13,0,0,111,102,102,115,101,244,1,163,34,112,111,114,116,58,34,44,3,0,0,112,111,114,244,32,32,32,32,32,32,32
defb 32,32,32,32,32,32,0,53,0,172,8,3,0,0,72,79,83,212,239,255,3,40,25,34,41,244,3,0,0,72,79,83,212,244,255,3,40,25,34,41,244
defb 34,44,34,244,3,0,0,80,79,82,212,32,32,32,32,32,32,32,0,56,0,182,8,3,0,0,225,239,34,65,84,43,67,73,80,83,84,65,82,84,61
defb 34,244,255,3,40,25,34,41,244,34,84,67,80,34,244,255,3,40,25,34,41,244,34,44,34,244,3,0,0,72,79,83,212,0,25,0,192,8,3,0,0
defb 99,111,110,110,101,99,244,239,3,0,0,225,32,32,32,32,32,0,10,0,197,8,159,32,30,176,4,0,56,0,202,8,169,32,25,30,44,25,21,245,13
defb 0,0,111,102,102,115,101,244,1,191,34,67,111,110,110,101,99,116,105,110,103,46,46,46,34,59,1,159,32,30,184,11,32,32,32,32,32,32,32,32,32
defb 32,0,22,0,212,8,161,32,13,0,0,83,84,65,84,85,211,239,17,32,235,32,201,0,70,0,222,8,169,32,25,15,44,25,22,245,13,0,0,111,102
defb 102,115,101,244,1,191,34,69,114,114,111,114,58,82,101,116,114,121,40,49,41,32,111,114,32,73,110,115,101,114,116,32,110,101,119,32,72,111,115,116,32
defb 83,101,114,118,101,114,40,50,41,63,34,0,31,0,232,8,161,32,255,10,40,25,64,41,239,14,32,235,32,138,32,35,16,1,160,32,30,182,8,32,32
defb 32,0,38,0,242,8,161,32,255,10,40,25,65,41,239,14,32,235,32,138,32,35,16,1,138,32,35,17,1,160,32,30,152,8,32,32,32,32,32,0,10
defb 0,252,8,160,32,30,232,8,0,13,0,184,11,197,32,115,116,97,116,117,115,0,12,0,189,11,185,32,28,209,251,44,15,0,38,0,194,11,3,0,0
defb 225,239,34,65,84,43,67,73,80,83,84,65,84,85,83,34,1,159,32,30,176,4,32,32,32,32,32,32,32,32,0,11,0,204,11,13,0,0,201,239,15
defb 0,40,0,214,11,214,32,40,13,0,0,201,241,22,41,32,250,32,40,255,11,40,28,209,251,41,239,25,255,41,32,32,32,32,32,32,32,32,32,32,0
defb 38,0,224,11,13,0,0,193,239,255,11,40,28,208,251,41,1,13,0,0,201,239,13,0,0,201,244,15,32,32,32,32,32,32,32,32,32,0,6,0,234
defb 11,213,0,25,0,244,11,13,0,0,83,84,65,84,85,211,239,255,11,40,28,208,251,41,245,25,48,0,42,0,249,11,161,32,40,13,0,0,83,84,65
defb 84,85,211,241,16,41,32,252,32,40,13,0,0,115,116,97,116,117,243,238,19,41,32,235,32,30,189,11,0,6,0,254,11,201,0,18,0,160,15,13,0
defb 0,225,239,15,1,13,0,0,233,239,14,0,27,0,170,15,214,32,40,13,0,0,225,239,15,41,32,250,32,40,13,0,0,233,241,25,15,41,0,29,0
defb 180,15,13,0,0,225,239,255,11,40,28,209,251,41,1,13,0,0,233,239,13,0,0,233,244,15,0,6,0,190,15,213,0,6,0,200,15,201,0,46,0
defb 136,19,197,32,97,117,116,111,109,97,116,105,99,32,115,112,101,101,100,32,100,101,116,101,99,116,105,111,110,32,111,102,32,119,105,102,105,32,32,32,32
defb 32,32,0,21,0,146,19,185,32,28,209,251,44,15,32,32,32,32,32,32,32,32,32,0,19,0,156,19,3,0,0,225,239,34,65,84,34,32,32,32,32
defb 32,0,16,0,166,19,159,32,30,176,4,1,159,32,30,160,15,0,19,0,176,19,161,32,13,0,0,193,239,15,32,235,32,30,196,19,0,51,0,186,19
defb 13,0,0,225,239,255,11,40,28,208,251,41,1,161,32,13,0,0,225,239,25,65,32,252,32,13,0,0,225,239,25,13,32,252,32,13,0,0,225,239,25
defb 79,32,235,32,201,0,30,0,196,19,13,0,0,83,69,82,83,80,69,69,196,239,13,0,0,83,69,82,83,80,69,69,196,245,15,0,77,0,201,19,161
defb 32,13,0,0,83,69,82,83,80,69,69,196,239,23,32,235,32,185,32,28,209,251,44,13,0,0,67,85,82,83,80,69,69,196,1,191,34,78,79,32,87
defb 105,70,105,32,109,111,100,117,108,101,32,100,101,116,101,99,116,101,100,33,34,1,152,32,32,32,32,32,32,32,0,28,0,206,19,185,32,28,209,251,44
defb 13,0,0,115,101,114,115,112,101,101,228,1,160,32,30,146,19,0,0,0

This is actaully a method of passing Basic files through assembly code, and i'm using it in many other RSX commands!
The bytes transferred to &170 is the actual basic listing, and it's nothing more that the saved BAS file, without the first 128 bytes of header!  ;)
After that, you only need to set some variables in memory (the "patch_mems" section) , and you are ready!
And finally, the best part: the few bytes in the "run code" section, allows you to automatically run the inserted basic program, without giving "RUN" command!  ;)
It's only a few instructions:
Code: [Select]
ld c,0
ld hl,&ea92
call &001b

This,as small as it may seems, was rather tricky and hard to accomplish, as it required to intercept the "Run" command in basic rom at specific address (far call RST 3 to &ea92 of rom 0=Basic (http://cpctech.cpcwiki.de/docs/basic.asm))!
And because i couldn't find a dissasmble code of CPC 464 BASIC 1.0 rom, this automation is only available for CPC 6128  :)

btw, here is all you need to know about creating your own rsx commands: http://cpctech.cpc-live.com/docs/manual/s158se09.pdf

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 13:04, 18 April 21
@SkulleateR (https://www.cpcwiki.eu/forum/index.php?action=profile;u=3124) , i made a simple windows app,in order to create the index.txt without needing writing a cli command, and added all (multi_dsk_manager.zip) to USIfAC II assets directory!. First post also updated to include a short description of new additions!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 14:35, 18 April 21
Well, after finishing setting up wifi module, you just give "LIST" at basic prompt, and you will get the BASIC listing!  :D
I thought about LIST but it seemed too obvious. :)

Thanks for the explanation, this is what I like from projects like USIFAC, learning from experts and sharing knowledge is priceless. I hope one day I will be able to develop an expansion card.

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 03:14, 19 April 21
If anyones interested, I've gone down the rabbit hole of the strange world of the esp8266 and have flashed ESP-Link. I've connected the module to the uart connector instead of the wifi plug on the usifac. This gives the CPC a web server and I can telnet to it using the |ter and |com programs. It's all very exciting. I imagine Duke is using something like a customised version of esplink in the M4 board.


I can't connect the CPC to a shell yet. I've tried ncat -e and socat but the encoding appears to be bad. Any tips?


Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:38, 19 April 21
@kolleykibber (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4071) , How exactly you connect to this shell you mention?
Did you use |WIFI command?
Also take a look at user manual (https://www.dropbox.com/s/ibua98leg79uxgr/Amstrad%20CPC%20Serial%20Interface%20II%20User%20Guide.pdf?dl=0) in Configure esp8266 module section, you will find a list of most useful commands for setting up module manually,use module as TCP server etc
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 02:39, 20 April 21
Hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) ,


It's an alternative firmware  https://github.com/jeelabs/esp-link (https://github.com/jeelabs/esp-link).


It provides a serial-wifi bridge. After flashing you connect your pc/mac directly to the module's ssid and then through web pages, connect to your local network. Then you can telnet directly to the ip address of the module and communicate over serial directly to the UART pins.


It can also be used to flash the microcontroller over wifi. There's examples for Arduino and ARM. I read something about updating a PIC bootloader to flash over the UART rather than ISCP, but I can't find it now..


I set the speed of the Usifac though your |set command and matched the speed of the esp though the admin web page. I was trying to get a reverse shell from osx using ncat/netcat/socat but I had no joy. I think it's a unix TERM issue.


Using


ncat IPADDRESS 23 -e /bin/sh


commands were sent from your |ter program but not recognised. I had no problems sending plain text each way.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 09:23, 20 April 21
Since you can send/receive characters without problem, maybe commands need <CR>+<LF> at the end to be executed, just like AT commands.
I've added this kind of functionality on |TER terminal, by pressing <clr> key. So, before giving the ncat command, press clr,you will get <CR>+<LF>=ON message (this means that <CR>+<LF> will be also sent at the end of string), and then type the command, maybe this way it ill work.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 11:25, 20 April 21
Hi, I am trying Amstrad Diagnostics (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/amstrad-diagnostics-rom/ (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/amstrad-diagnostics-rom/))
I think it would be nice to make it work and have it available under |DIAG command or similar (if there is still space on the PIC)

I attach the 2 files I have tested (built from last version https://github.com/llopis/amstrad-diagnostics ):
- If I try the bin file (|USB ,run "DIAG)  i get "Line too long"
- If I try the  dsk file   (|USB, |MG,"AMSTRA~1.DSK", |FDC, RUN "DIAG) it get a red screen that vanishes into blue and gets stacked while it should not.
I have contacted @llopis (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1728) and he says this about the dsk execution "What you describe is the lower RAM test, which sounds like it runs through, but then it gets stuck maybe trying to page out lower ROM or something like that."
Any hint?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: llopis on 12:04, 20 April 21
With a DSK build, the lower RAM test only works on the screen, so that shouldn't be it. I suspect the problem comes from paging ROMs in and out maybe?
Unfortunately I don't have one of those devices (hoping they become available soon again because I'd love to try it), but since you're building the diagnostics yourself, you can try narrowing down the problem by commenting out some of these calls:
https://github.com/llopis/amstrad-diagnostics/blob/main/src/SystemInfo.asm


Try doing it without the CalculateTotalUpperRAM call and without the DetectModel call and let me know which of those two fixes it. That should help quite a bit. Maybe there's something I can fix from my end to make it work then.
Thanks!

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 12:40, 20 April 21
Thanks Noel, commenting out "call CalculateTotalUpperRAM" made it work  8) . (Pls, see attached DSK file without Upper RAM function)

Then checking Lower ROM works good until ROM5 which is the slot using USFIAC and it is filled with small yellow dots but we are on the good track.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:20, 20 April 21
Nice utility, but unfortunately the diag.bin inside dsk (i used |DSK command to copy image to a real disk and run it from floppy disk  ;D ), dosen't seem to work on my CPC 6128.
It gives the vanishing red pixels, one long beep, then 2 short beeps and then.... nothing. I tried it, with and without USIfACII connected, i got exactly the same behavior.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 19:07, 20 April 21
Have you tried the DSK without upper RAM (DIAGWOUR.DSK https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/?action=dlattach;attach=34254 (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/?action=dlattach;attach=34254) )  or the one in the first post?
Anyway, @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) how could USIFAC be enabled/disabled/detected?

I tried OUT &FBD1,30 in order to detect it but it gives me error.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 19:16, 20 April 21
Ok, DIAGWOUR.DSK loads program, but it crashes on rom checking when it goes where USIfAC II rom is (i got "Unknown" with red letters on Rom 5)
If you want to disable completely USIfAC board you can just select a rom number bigger the 15 for example: out &fbd2,16. This should set board's rom number to 16, so it will never initialized, thus it would be like board is not connected (and you will not get the USIfAC message on boot) :-)
As for detection, i think the "USIfAC II Enhanced" message on boot screen is quite straight forward :)
Finally, you can check the status of various functions with |STAT command, if all is "OFF", then it's like be in "Stand by" mode, only RSX commands are functioning (and if you want to disable it completely you can set rom number as i already told you).
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 20:12, 20 April 21
Yes, Diagnostics fails when analising ROM5 which is USIFAC default and could probably be avoided disabling USIFAC with the command you provided.

Boot message is ok for human interaction but I was thinking a way of detecting USIFAC from code like reading an port address and get a status byte or some signature.Thus Diagnostics could detect USIFAC, disable it, perform ROM tests, and enable it again.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 22:18, 20 April 21
The problem is not the usifac, it's the test rom. it needs to be adapted.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: llopis on 22:37, 20 April 21
Ok, DIAGWOUR.DSK loads program, but it crashes on rom checking when it goes where USIfAC II rom is (i got "Unknown" with red letters on Rom 5)
If you want to disable completely USIfAC board you can just select a rom number bigger the 15 for example: out &fbd2,16. This should set board's rom number to 16, so it will never initialized, thus it would be like board is not connected (and you will not get the USIfAC message on boot) :-)
Yes, that's not a problem that it says unknown. It says that about any ROM that is not one of the official system ROMs. The part I should try to fix is why it crashes when checking the upper RAM total. USIfAC doesn't add any RAM, right? That's really puzzling.


If nobody figures it out before and sends a fix, whenever I get my own USIfAC board I'll try to figure it out and see if I can modify the diagnostics ROM to work with it.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:52, 20 April 21
Yes, Diagnostics fails when analising ROM5 which is USIFAC default and could probably be avoided disabling USIFAC with the command you provided.
Boot message is ok for human interaction but I was thinking a way of detecting USIFAC from code like reading an port address and get a status byte or some signature.Thus Diagnostics could detect USIFAC, disable it, perform ROM tests, and enable it again.

Ok, here is an "advance" trick,to find out if a USIfAC II board is installed (even if it doesn't show boot msg e.g. give a non initiliazed rom number):
 out &fbd1,30: if inp(&fbd0)=83 then print "USIfAC II board is installed" 
kids don't try it at home!  :laugh:

Btw,i tried what you proposed and it seems to work: if you give an out &fbd2,16, usifac is disabled (no program will find anything at rom 5  :) ) , but then you can change it back to rom 5 (by simply giving again out &fbd2,5) , and everything works again, without needing to reset or anything!  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: llopis on 23:01, 20 April 21
Ok, here is an "advance" trick,to find out if a USIfAC II board is installed (even if it doesn't show boot msg e.g. give a non initiliazed rom number):
 out &fbd1,30: if inp(&fbd0)=83 then print "USIfAC II board is installed" 
kids don't try it at home!  :laugh:
In theory there's nothing that USIfAC does that should be causing that. So I'd rather figure out what's going on than add a detection and disable it. It's just an upper ROM, right? I can't imagine why it would be causing the program to hang like that.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 23:06, 20 April 21
@llopis (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1728), if it helps, this is the starting part and initialization code of the USIfAC II rom code:
Code: [Select]
ORG #C000 ;Start of ROM
DEFB 1 ;Background ROM
DEFB 0 ;Mark 0
DEFB 5 ;Version 5
DEFB 0 ;Modification 0
DEFW NAME_TABLE ;Address of name table

JP initialize
JP terminal
JP help
JP galachip
JP pacman
JP kgor
JP setwifi
JP format
JP change_dir
JP enable
JP enable2
JP topc
JP frompc
JP catalogue
JP comm
JP image
JP fdc
JP setspeed
JP dsk
JP delete
JP cpc464
JP status
JP usbset
JP filecopy
JP writerom
JP readrom
JP rootdir
JP deleteroutine
JP dos
JP makedir
JP disable
JP image2
JP image3
JP image4
JP showimage
JP snap

NAME_TABLE:

DEFB ' IREC','T'+#80
DEFB 'TE','R'+#80
DEFB 'HEL','P'+#80
DEFB 'GAL','A'+#80
DEFB 'PACMA','N'+#80
DEFB 'KGO','R'+#80
DEFB 'WIF','I'+#80
DEFB 'FORMA','T'+#80
DEFB 'C','D'+#80
DEFB 'E','N'+#80
DEFB 'EN','2'+#80
DEFB '2P','C'+#80
DEFB '2CP','C'+#80
DEFB 'CA','T'+#80 
DEFB 'CO','M'+#80
DEFB 'M','G'+#80
DEFB 'FD','C'+#80 
DEFB 'SE','T'+#80
DEFB 'DS','K'+#80
DEFB 'DE','L'+#80
DEFB '46','4'+#80 
DEFB 'STA','T'+#80
DEFB 'US','B'+#80
DEFB 'COP','Y'+#80
DEFB 'WRO','M'+#80
DEFB 'LRO','M'+#80
DEFB 'CD','R'+#80
DEFB 'DEL','D'+#80
DEFB 'DO','S'+#80
DEFB 'M','D'+#80
DEFB 'DI','S'+#80
DEFB 'MG','2'+#80
DEFB 'MG','3'+#80
DEFB 'MG','4'+#80
DEFB 'SM','G'+#80
DEFB 'SN','A'+#80

DEFB 0 ;End of table marker

; ######################################----initialize----##################################################
initialize:
push de
push hl
ld bc,&fbd1
ld hl,init_message
call printmessage

ld bc,&fbd9
ld a,1
out (c),a
ld a,&FB
        in a,(&D3)
cp "/"
jr z,no_clear_path

ld bc,&fbd1
ld a,53
out (c),a    ;start of sub dir, 0=no sub dir

no_clear_path:

ld bc,&FBD4
ld hl,&0006
ld a,(hl)
cp 128 ;128=cpc 464, 145=cpc6128
jr nz,cpc6128

ld a,&FB
        in a,(&DC)
cp &83
jr z,con464

cp 120
jr z,set464

LD a,120
out (c),a
ld bc,&FBD1
ld a,5
out (c),a
call 0

set464:
LD a,&83
out (c),a
ld bc,&FBD1
ld a,4
out (c),a
call 0

con464:
ld hl,&be7d
ld a,&ff
ld (hl),a
ld a,&FB
        in a,(&De)
cp 0
jr z,end3_init
call enable
jr end3_init

cpc6128:
LD a,&66
out (c),a

end3_init:
pop hl
pop de
scf
ret

init_message:
defb " USIfAC II Enhanced",13,10,13,10,0

As you said, is nothing more than a "usual" upper rom, and in compliance with register usage for background roms:
http://cpctech.cpc-live.com/docs/manual/s158se09.pdf
Entry:
DE contains the address of the lowest byte in the memory pool.
HL contains the address of the highest byte in the memory pool.
Exit:
If the initialization was successful:
Carry true.
DE contains the new address of the lowest byte in the memory pool.
HL contains the new address of the highest byte in the memory pool.  (HL ,DE returned unchanged)
If the initialization failed:
Carry false.
DE and HL preserved.
 Always:
A, BC and other flags corrupt.
All other registers preserved.

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 13:35, 01 May 21
I was going to check that FW but the file appears not to be available anymore. :(

[EDIT] [SOLVED] You can get it from here https://www.dropbox.com/sh/ezzga2dppm6jlm7/AACwFC_rv2QatWh_ndKc9fhma?dl=0 (https://www.dropbox.com/sh/ezzga2dppm6jlm7/AACwFC_rv2QatWh_ndKc9fhma?dl=0)

I have fought a lot in order to flash the ESP-07, thus I leave here some recipes that I hope it will help you (if you try in Linux you should be in dialout group  and maybe you will require root privileges)
Before start flashing I recommend to back up the existing fw, so you can always go back.
#backup
esptool.py --port /dev/ttyUSB0 read_flash 0x00000 0x100000 backup.bin
#flash
esptool.py --port /dev/ttyUSB0 write_flash --flash_size 1MB --flash_mode dout 0x00000 YOUR_NEW_FW.bin

Esptool can be installed with  "pip install –upgrade esptool"


Download this: https://www.dropbox.com/s/bt29v0a32ucktvv/ESP8266_flasher.zip?dl=0 (https://www.dropbox.com/s/bt29v0a32ucktvv/ESP8266_flasher.zip?dl=0)
Just run "esp8266_flasher.exe", click "BIN" button and select the included: "HS06F014 ESP-01S.bin", set your com port number and press "download".
This must be the easiest way to flash a wifi module.
Btw, i found out why mysteriously all my wifi modules stopped working: firewall blocked access to windows utility TCP server (i suspect the antivirus involved in this...)
So, if your Wifi module can't connect to PC check windows firewall settings, if there is any inbound rule that block access of the Amstrad utility.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: zhulien on 19:13, 02 May 21
Please - everybody - consider to also support the 0,7 MB Vortex format. In Gemany (at least) it still is/was the 80 track standard format for floppy discs. The big companies like Dobbertin, Vortex ... all did support it.  :) :) :)


Please everyone support the Vortex CP/M format too, that is super popular here in Australia and we usually use the SUPER formatter on the SUPER ROM which is easily available online.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:47, 03 May 21
@issalig (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4140), link is working again  :)
@zhulien (https://www.cpcwiki.eu/forum/index.php?action=profile;u=58), most probable Vortex is directly supported as explained (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg190714/#msg190714) to Gunhead some time ago
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 12:49, 03 May 21
Great - now Everything is working well after reflashing my ESP Wifi Module.


fully opérationnal.


Thanks for your help mates


+
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: GUNHED on 19:04, 03 May 21
@zhulien (https://www.cpcwiki.eu/forum/index.php?action=profile;u=58), most probable Vortex is directly supported as explained (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/universal-serial-interface-for-amstrad-cpc/msg190714/#msg190714) to Gunhead some time ago
Let's be careful. One is a disc format - the other one is a disc drive. But I'm confident they both work.  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: zhulien on 03:50, 04 May 21
has anyone tried a USB floppy drive with USIfAC II?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 06:04, 04 May 21
@zhulien (https://www.cpcwiki.eu/forum/index.php?action=profile;u=58)


Yes, it does not work


I tried 5 external USB Drives


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:48, 04 May 21
Major Update:

Firmware update (ver. 4):
- Bug fix: When saving a file, Dsk Image name in slot 1, changed to name of saved file.
- Code optimization of Board's Rom assembly code.
- |CD & |CAT arguments, now support lower case letters too.
- New Command: |SNA, for loading SNA snapshot files (note that snapshot files must be uncompressed)!

Update Amstrad CPC Loader creator program: Add support for sna snapshot files, along with direct files & dsk images. Also Subfolders inside main folder,can now have multiple .dsk or .sna files  (previous version supported only one dsk image in each subfolder)!

Update User's Guide: Many additions and changes to match the new board with extra features.

Add a new "inner working" section: Here: https://www.dropbox.com/sh/ua4vgf6qjjmqlnq/AACT6kqTr-sst-iqDeBnE9gRa?dl=0], you can find all assembly code used in the Usifac II project, along with board schematics, and hex file/assembly source code for PIC18F47Q10 mcu.

Now, this one (loading snapshot files),as easy as it may sound (just copy mem dump to amstrad's memory and set all registeres), was really tough to make it work right, to get an idea, here is the code for the routine:
Code: [Select]
snap:
cp 0
jp z,no_file_sel
ld b,a
call check_usb_en
ld a,b
cp 1
jr z,sna_def_addr
cp 2
jr z,sna_load_addr
jp error_ucd ;error more than one parameters!

sna_def_addr:
ld a,220
ld bc,&fbde ;next_in=220
out (c),a
ld c,&d7 ;with no address argument set fix address=&ffa6
ld a,&a6 ;low byte of final code address
out (c),a ;put it to buffer(220)
ld a,&ff ;high byte of final code address
out (c),a ;put it to buffer(221)
call get_arg ;e=snapshot name size, hl=address of name
jr continue_1

sna_load_addr:

ld a,220
ld bc,&fbde ;next_in=220
out (c),a
ld c,&d7
ld a,(ix+0) ;low byte of final code address
out (c),a ;put it to buffer(220)
ld a,(ix+1) ;high byte of final code address
out (c),a ;put it to buffer(221)

ld l,(ix+2) ;image name is on the 2nd argument
ld h,(ix+3)
call get_arg2

continue_1:
call set_directory
ld bc,&fbd0
ld a,&57
out (c),a
ld a,&ab
out (c),a
ld a,&2f
out (c),a

ld c,&d9
ld a,1
out (c),a
ld c,&d0
ld a,&FB
        in a,(&D3)
cp 0
jp nz,continue_snaopen
ld a,"/"
out (c),a

continue_snaopen:
inc b
outi ; ld a,(hl)->out (c),a->hl=hl+1
dec e
jr nz,continue_snaopen

xor a
out (c),a

call clear_buffer
ld a,&57
out (c),a
ld a,&ab
out (c),a
ld a,&32
out (c),a

call check_responce2
ld A,&FB
        in A,(&D0) 
cp &14
jp z,continue_snaload
inc c
ld a,5
out (c),a
jp no_file_sel

continue_snaload: ;; &1f2 first 7 bytes checksum fro snapshot files!

ld hl,0
ld de,0
call seek
in a,(c)
cp &14
jp nz,error_ucd
ld e,8
call fetch
ld b,8
ld hl,0
ld de,0
crc_sum:
ld a,&FB
        in a,(&D0)
ld e,a
add hl,de
djnz ,crc_sum
; dec b
; jr nz,crc_sum

ld a,l
cp &f2
jp nz,no_file_sel
ld a,h
cp 1
jp nz,no_file_sel

ld bc,&fbd0
ld hl,&6b
ld de,0
call seek
in a,(c)
cp &14
jp nz,error_ucd
ld e,1
call fetch

in a,(c) ;;byte &6b, MEMORY DUMP SIZE:&80=128kb else 64kb
ld c,&dc
out (c),a

ld c,&d0
ld hl,&180 ;set sna file pointer to 1st byte of 1st 64k memory dump
ld de,0
call seek
in a,(c)
cp &14
jp nz,error_ucd

;#######################----------------------------------------------------------------------------------
di

ld bc,&7f84
out (c),c ;disable lower rom

sna_ram_code:
ld hl, sna_code
ld de, 0
ld bc, 102
ldir
ld hl,&7f
ld sp,hl ;set temporary stack pointer to &7f

ld hl,&80 ;#####
ld bc,&fbd1
ld a,40 ;empty data buffer=0
out (c),a
dec c
jp ;call routine to transfer all 64K except first 128bytes
inc c
ld a,41 ;empty data buffer=1
out (c),a
;--------------------------------------------------
ld hl,&bff0 ;temporary stack pointer @ &bff0
ld sp,hl ;set temporary stack pointer
dec hl ;hl=sp-1 address position

ld bc,&fbde
ld a,210
out (c),a ;next_in=210

ld e,10
ld c,&d7
stack_save:
ld a,(hl) ;save 5 postions of temp stack pointer to buffer(210-219)
out (c),a
dec hl
dec e
jr nz,stack_save
;--------------------------------------------------
ld c,&d0 ;bc=&fbd0
ld a,&FB
        in a,(&D7) ;if inp(&fbd7)=128 then copy 2nd 64k dump
cp 128
jr z,large_sna
cp 100 ;if inp(&fbd7)=100 then copy of 2nd 64k dump is finished proceed
jr nz,normal_sna ; else
ld de,1
call sna_copy_128
ld hl,&bfef ;hl=sp->-1 address position &bff0-1
ld bc,&fbdb
ld a,210
out (c),a ;next_out=210
ld e,10
ld c,&d0
stack_load3: ;restore 5 postions of temp stack pointer from buffer(210-219)
in a,(c)
ld (hl),a
dec hl
dec e
jr nz,stack_load3

ld b,&7f
ld a,192
out (c),a ;change to 1st 64k RAM bank

jp end_sna_routine

normal_sna:
ld de,0
call sna_copy_128
ld hl,&bfef ;hl=sp->-1 address position &bff0-1
ld bc,&fbdb
ld a,210
out (c),a ;next_out=210
ld e,10
ld c,&d0
stack_load: ;restore 5 postions of temp stack pointer from buffer(210-219)
in a,(c)
ld (hl),a
dec hl
dec e
jr nz,stack_load
jr end_sna_routine

large_sna:
ld de,0
call sna_copy_128
ld hl,&bfef ;hl=sp->-1 address position &bff0-1
ld bc,&fbdb
ld a,210
out (c),a ;next_out=210
ld e,10
ld c,&d0
stack_load2: ;restore 5 postions of stack pointer to buffer(210-219)
in a,(c)
ld (hl),a
dec hl
dec e
jr nz,stack_load2

ld b,&7f
ld a,194
out (c),a ;change to 2nd 64k RAM bank
ld bc,&fbdc
ld a,100 ;from now on inp(&FBD7) will return 100
out (c),a

ld c,&D0
ld de,1
ld hl,&180 ;set file pointer to 1st byte of 1st 64k memory dump
call seek
in a,(c)
cp &14
jp nz,error_ucd
jp sna_ram_code

;-----------------------------####################################---------------------------------------------------

sna_copy_128:
ld hl,&100 ;set file pointer to 1st byte of 1st 64k memory dump
call seek
in a,(c)
cp &14
jp nz,error_ucd
ld e,128
call fetch
ld hl,0
ld bc,&fbd0
 load_data_loop2:
inc c
 check_sna:
in a,(c)
cp 1
        JR Z,check_sna
dec c
ini
inc b
dec e
jr nz, load_data_loop2
ret

;--------------###############################################-----------------------

end_sna_routine:


ld bc,&fbde ;set next_in=150
ld a,150
out (c),a

ld hl,temp_code
ld d,5
ld c,&d7
save_bytes:
ld a,(hl) ;buffer(next_in)=(hl) ;save the 5bytes where temp_code goes,to restore them in final code
out (c),a
inc hl
dec d
jr nz,save_bytes

ld hl,temp_code+4
ld sp,hl ;put temporary stack pointer at address (temp code+4)

ld bc,&fbd0
ld de,0
ld hl,0 ;set file pointer to 1st byte of 1st 64k memory dump
call seek
in a,(c)
cp &14
jp nz,error_ucd

ld e,115
call fetch

ld bc,5000
call delay_loop ;give time to recieve 115 bytes from header snap file

ld bc,&fbd0
ld a,&57 ;close file
out (c),a
ld a,&ab
out (c),a
ld a,&36
out (c),a
xor a
out (c),a

;##############################--------------snap_registers---------------------------############################

call get_final_addr
ld e,l
ld d,h

ld hl, final_code      ;this is the final code & executed from ram just before jump to PC
ld bc, 41
ldir

ld bc,&fbdb
ld a,&1b              ;buffer pointer to &19 position R register
out (c),a

ld a,&FB ;R register
        in a,(&D0)
ld r,a
ld a,&FB ;I register
        in a,(&D0)
ld i,a

ld a,&FB ;interrupt Flip flop
        in a,(&D0)
cp 0
jr z,cont_sna_2
call get_final_addr
ld bc,37             ;offset +37 for save interrupt FLIP-FLOP state at final code
add hl,bc
ld a,&fb ;&FB=EI
ld (hl),a 


cont_sna_2:

; out (c),a

ld a,&FB ;IFF2=IFF1 pass to next byte
        in a,(&D0) 

ld a,&FB
        in a,(&D0)  ;a=X
ld l,a
ld a,&FB
        in a,(&D0)  ;a=I
ld h,a
push hl
pop IX

ld a,&FB
        in a,(&D0)  ;a=Y
ld l,a
ld a,&FB
        in a,(&D0)  ;a=I
ld h,a
push hl
pop IY

ld bc,&fbde ;next_in=200
ld a,200
out (c),a

ld a,&FB ;Save Stack pointer at buffer(200+201)
        in a,(&D0)  ;a=P
ld c,&d7
out (c),a

ld a,&FB
        in a,(&D0)  ;a=S
out (c),a

call get_final_addr
ld bc,&27 ;offset for placing Program counter to final code
add hl,bc
ld a,&FB
        in a,(&D0) 
ld (hl),a
inc hl
ld a,&FB
        in a,(&D0) 
ld (hl),a

ld a,&FB ;interrupt mode
        in a,(&D0)

cp 0
jr nz, not_im0
im 0
jr cont_sna_1
not_im0:
cp 1
jr nz, not_im1
im 1
jr cont_sna_1
not_im1:
im 2

cont_sna_1:

ld a,&FB
        in a,(&D0)  ;a=F'
ld l,a
ld a,&FB
        in a,(&D0)  ;a=A'
ld h,a
push hl
pop af
ex af,af'

ld a,&FB
        in a,(&D0)  ;a=C'
ld c,a
ld a,&FB
        in a,(&D0)  ;a=B'
ld b,a
ld a,&FB
        in a,(&D0)  ;a=E'
ld e,a
ld a,&FB
        in a,(&D0)  ;a=D'
ld d,a
ld a,&FB
        in a,(&D0)  ;a=L'
ld l,a
ld a,&FB
        in a,(&D0)  ;a=H'
ld h,a
exx

ld bc,&fbdb ;+2 offset for all bytes from buffer
ld a,&43 ;buffer pointer to &1a position R register
out (c),a
ld a,&FB ; ram config
        in a,(&c0) ;&FBC0=REVERSE order next_out=next_out-1!
or &c0 ;set bit 7&6 to '1'->setup ram configuration
ld bc,&7f00
out (c),a

call get_final_addr
ld bc,&12
add hl,bc ;place GA multi configuration byte to final code
ld a,&FB ;GA multi configuration byte, screen mode & roms upper/lower en/dis
        in a,(&C0)
set 7,a
res 6,a ;bit 7=1, bit 5,6=0
res 5,a

ld (hl),a ;place GA multi configuration byte to final code
inc hl
ld a,&7f
ld (hl),a


ld bc,&7F10

SNA_SetupGA:
out (c),c
ld a,&FB
        in a,(&C0)
set 6,a
out (c),a
dec c
jp p,SNA_SetupGA

; Select last active pen
ld a,&FB
        in a,(&C0)
out (c),a 
; CRTC setup

ld bc,&fbdb ;+2 offset for all bytes from buffer
ld a,&57 ; current rom selection and then CRTC registers
out (c),a

call get_final_addr ;;place upper rom selection byte to final code
ld bc,&17
add hl,bc
ld a,&FB
        in a,(&C0)
ld (hl),a
inc hl
ld a,&df
ld (hl),a

ld bc,&BC00+17
SNA_SetupCRTC: ;out &bcxx select register out &BDXX WRITE REGISTER

out (c),c
ld a,&FB
        in a,(&C0)
inc b
out (c),a
dec b
dec c
jp p,SNA_SetupCRTC
; Select active CRTC register
ld a,&FB
        in a,(&C0)
out (c),a

ld bc,&f782
out (c),c ;set PSG PORT A to output for writing registers first!

ld bc,&fbdb ;+2 offset for all bytes from buffer
ld a,&6c ;buffer pointer to &1a position R register
out (c),a
ld e,15
SNA_SetupAY3:
ld bc,&F4C0
out (c),e
ld b, &F6
out (c),c
defb &ED, &71
dec b
dec b
ld a,&FB
        in a,(&C0)
out (c),a

ld bc,&F680
out (c),c
defb &ED, &71

dec e
jp p,SNA_SetupAY3
; Select last active AY3 register
ld bc,&F4C0
ld a,&FB
        in a,(&C0)
out (c),a
ld b,&F6
out (c),c
defb &ED, &71

ld bc,&f700
ld a,&FB ;PPI control port byte
        in a,(&C0)
out (c),a

ld l,a
ld b,&F6
ld a,&FB ;set PORT C byte
        in a,(&C0)
out (c),a

ld a,l
cp &82
jr nz,no_set_porta
ld a,&FB ;PORT B byte, always input-no use
        in a,(&C0)
ld a,&FB ;set PORT A byte
        in a,(&C0)
ld b,&F4
out (C),a

no_set_porta:
;------end of routine

ld bc,&fbdb
ld a,&13 ;buffer pointer to &12 position F register
out (c),a

ld a,&FB
        in a,(&D0)  ;a=F
ld l,a
ld a,&FB
        in a,(&D0)  ;a=A
ld h,a
push hl

ld bc,&fbde ;next_in=202
ld a,202
out (c),a
ld c,&d7 ;save A register to buffer(202)
out (c),h

call get_final_addr
ld bc,&1c ;place BC to final code
add hl,bc

ld a,&FB
        in a,(&D0)  ;a=C
ld (hl),a
inc hl
ld a,&FB
        in a,(&D0)  ;a=B
ld (hl),a

ld a,&FB
        in a,(&D0)  ;a=E
ld e,a
ld a,&FB
        in a,(&D0)  ;a=D
ld d,a

inc hl
inc hl

ld a,&FB ;place HL to final code
        in a,(&D0)  ;a=L
ld (hl),a
inc hl
ld a,&FB
        in a,(&D0)  ;a=H
ld (hl),a


cont_sna_end:

pop af ;restore flag register from temporary stack@address temp_code+4

ld bc,temp_code
ld a,&ed ;ED 79= OUT(C),A
ld (bc),a
inc bc
ld a,&79
ld (bc),a
inc bc
ld a,&c3 ;JUMP TO
ld (bc),a

ld l,c
ld h,b
ld bc,&fbde
ld a,220
out (c),a ;next_in=220
ld c,l
ld b,h
inc bc
ld a,&fb        ;a=buffer(next_in)
in a,(&c1)
ld (bc),a
inc bc
ld a,&fb        ;a=buffer(next_in)
in a,(&c1)
ld (bc),a

ld bc,&fbdb        ;restore SP from buffer(200-201)
ld a,200
out (c),a
ld a,&fb
in a,(&d0)
ld l,a
ld a,&fb
in a,(&d0)
ld h,a
ld sp,hl

ld bc,&7f00
ld a,&8c   ;disable both upper+lower roms!
ld hl,temp_code

jp temp_code ;last instruction!

final_code:

defb 1,222,251,62,150,237,121,6,5,62,251,219,193,119,35,16,248,1,0,0,237,73,1,0,0,237,73,1,0,0,33,0,0,62,251,219,208,0,195,0,0

sna_code:

defb 30,128,205,95,0,62,87,237,121,62,171,237,121,62,58,237,121,237,89,175,237,121,205,88,0,237,120,205,95,0,62,87,237,121,62,171,237,121,62,39,237,121
defb 205,88,0,237,120,202,144,245,95,12,237,120,40,252,13,237,162,4,29,32,244,205,95,0,62,87,237,121,62,171,237,121,62,59,237,121,205,88,0,124,181
defb 32,171,195,144,245,12,237,120,40,252,13,201,12,62,1,237,121,13,201

 The main problem i encountered was placement of the Stack and a small final code  that needs to be executed from ram (GA rom configuraton and final jump to PC along with restoring of a few bytes). Using spare parts in video memory (for example: &FFD0-&FFFF) is not working all the time, because tests revealed that games often use these parts for placing code! So in order to find a way to overcome this problem, i designed |SNA command with an optional memory address argument (|SNA,"name",&xxxx) to place final code into the specific address instead of the deafult @&FFA6 (e.g. some screen bytes at right bottom corner,which prooved to have better results than using a spare part).
But where will that address be, you may ask?
Well, in order to find out that,i  expand the Basic loader creator utlity, to include sna files, that, apart from creating the required commands in the Basic listing, it also searches the entire snapshot memory dump to find an "empty" place (search for 40 sequnetial bytes that have same value) for the final code. Using this method, i've have tested more than 100 sna files and all seem to load fine!
The only "problem" i still have is that sna files need to be uncompressed, but the sna archive (https://www.cpcwiki.eu/index.php/Snapshot_Archive) in cpc wiki have all files in compressed form. Is there any easy way to create uncompressed sna files from compressed ones?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 12:33, 04 May 21
Wow, this is a great update. I am gonna flash the new FW ASAP

And thanks a lot @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) for sharing the "Inner Workings".
There is a lot of interesting stuff there. In the beginning I was surprised you coded the PIC directly in ASM  :o , but then I have realized that GBC generates those files before linking them into  the hex file. Now struggling to generate flash from asm file. It looks that pic18f47q10.inc is missing in GBC distribution, maybe mpasm has it.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:09, 05 May 21
Wow, this is a great update. I am gonna flash the new FW ASAP

And thanks a lot @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) for sharing the "Inner Workings".
There is a lot of interesting stuff there. In the beginning I was surprised you coded the PIC directly in ASM  :o , but then I have realized that GBC generates those files before linking them into  the hex file. Now struggling to generate flash from asm file. It looks that pic18f47q10.inc is missing in GBC distribution, maybe mpasm has it.

This is an intermediate file generated by cowbasic compiler so i doubt you can find it anywhere. :)
Anyway, i've added the GCB source code too (18f47q10_gcb_source), so you can install cowbasic (use the latest RC from here: https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/ ) and compile it from there  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ajcasado on 11:52, 05 May 21
Anyway, i've added the GCB source code too
Thanks for the source!!!, it's a great contribution.
Title: "no USB Device found"
Post by: eto on 22:47, 05 May 21
what am I doing wrong if I get that message after typing |USB?

USB Stick is 4GB Fat32, USB 2.0


Update:
I tried with 2 more sticks: USB 3.0, 32GB and 64GB

First the 32GB stick didn't work. I could type |USB, but then it said it would be empty. As I had to format with the 64GB stick with a third party tool, I recognized  that this stick was accepted and showed the contents. I then also formatted the 32GB stick with the same tool, and then the stick was recognized and worked also.
 

Unfortunately the 4GB sticks still don't work, even if formatted with the same tool.

Is there any known limitation regarding which sticks will not be accepted?
Title: Re: "no USB Device found"
Post by: ikonsgr on 23:39, 05 May 21
what am I doing wrong if I get that message after typing |USB?
USB Stick is 4GB Fat32, USB 2.0
Update:
I tried with 2 more sticks: USB 3.0, 32GB and 64GB
First the 32GB stick didn't work. I could type |USB, but then it said it would be empty. As I had to format with the 64GB stick with a third party tool, I recognized  that this stick was accepted and showed the contents. I then also formatted the 32GB stick with the same tool, and then the stick was recognized and worked also.
Unfortunately the 4GB sticks still don't work, even if formatted with the same tool.
Is there any known limitation regarding which sticks will not be accepted?

Indeed, some usb host modules seem to be a bit "picky", regarding the flash drive you will use, but i have found an easy solution to that: Just create a small (like 256mb or so) FAT partition:
https://www.diskpart.com/articles/how-to-partition-usb-drive-3889.html
I've try this method with 4gb and 32gb usb sticks and worked, so i guess this "trick" most probable will solve the problem.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 00:02, 06 May 21
so i guess this "trick" most probable will solve the problem.


unfortunately not. They don't work :-( Too sad.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 00:11, 06 May 21
Ok, does the usb host module lights up when you give |USB?
If not, and you get an error message all the time (eve if you have a small fat partition) , then the usb stick you are using is probably... "too incompatible" for the module to recognize it at first place.
You can also try a real small usb drive (of less than 512mb), as they are still available  (https://www.ebay.ie/itm/393109671969?_trkparms=ispr%3D1&hash=item5b87299021:g:SLMAAOSwfS5gD8ly&amdata=enc%3AAQAFAAACgBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkyMJZWL%252BqFSgQ3TOOe%252FNr7tDu5VxGM0%252FuCNEA2FMfbI71%252BldQsZE1gx968SMSnwh20KZpwrKOBFobrvf7PnrGTrnmubuSg%252FlrYuh%252Fs5QfW3ZjUgWoJLz6wz9lqAW8Z143prbnbS70PMZOKq9QFoK9%252FTHgCF35zYx713OiCk66ETp1fN4t7HYdNAPQ5s78Dq6wUc%252FV5ASaS16fXBGRoEANmO1qQR9BevsznTxQAmZMZrK2s1clM2dqN3h6VNtSNTNASRy0WsrkI1qb1eAN6aRrcr0%252F1Vr%252FeVw5DQGDG82hXbEsBTmjINoK3bZLeMPYCmIN6q0wKmhFP%252BgRAuCB%252B8jaTprBcZE83GMYNJN5QZT5BCVFWGOdIlh8WVGmjR3nj8amsDw9mq%252FAn0UBFCouYt8wnYt92DNB%252BZEV2y52qIHqgi%252BpmCuX9Ds3pvfBEA1fpiIe5q6Gp8vGSGpe2bqvEIDocEcMKRK%252BlxvULeQLIJ3y8HV1nG%252BPCZVsnU0BG7pg08o6nY8lnt%252BiMi4V84nNjN77qvtKFcIXO5QzTmzZKB8sHb0RvJ1ikSlpsfW%252B5%252BpODetKhDHBML7zjJCSAjpL77fpfsxVTiCh9RbPtnKHEESheg8MdFCvpplMF33PG%252Be6o2eM5nTZWshPxTJEvIHzt%252FuxUoay9N3jbDjT38tj7Ke%252FqG0UPJNKuryp8y9jTHxiGOHyl0hEgvVvL%252BjXvWlQ2QLXgJDks2Awyemvons4YyJEhC2EApyABbAMPwU9Ls0NhADBpfu6YSaSLAilW2ReLwid3IfdKesjvqUFuUhG801NOzo%253D%7Ccksum%3A393109671969dea9c1fa6477415c8724f0bdba288f3c%7Campid%3APL_CLK%7Cclp%3A2334524)at very cheap prices
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 00:48, 06 May 21
I've try this method with 4gb and 32gb usb sticks and worked, so i guess this "trick" most probable will solve the problem.

So none of my sticks worked in the first place but I could get ALL the USB 3.0 sticks to work with their full size by doing the following:
- delete partition and then create a new partition in Windows Computer Management, assign a drive letter (e.g. X), BUT do not format it here. (Windows will assign the drive letter and immediately moan about the non-formatted stick. DO NOT FORMAT!)
- then run command line tool "h2format.exe X:" (http://www.heise.de/software/download/h2format/40825 - German, just use Google translate, pretty straight forward)

After this, the USB stick will be accepted.

The USB 2.0 sticks do still not work. The USB host module lights up, but then I get the "no USB Device found" error message.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 02:29, 06 May 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)


John I will do a test with Version 4 on my old boards and see what happens


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 02:31, 06 May 21
Two further issues:

1) One of my USIfAC II doesn't do anything. It's connected and nothing happens. Any idea what I could check?

UPDATE: out &fbd2,5 fixed this issue. It probably was because I was trying it on both the 6128 and the 464 and then on the 464 I also typed |FDC. After a reset, the Usifac was inactive. As this can easily happen, it might be good to add that to the hints section.


2) My other UsiFac works fine on my 6128, but on the 464 it behaves differently. When turning on, the 464 stops when displaying the start up screen, just before the USIFAC message should appear. After pressing reset, it boots fully to the READY prompt (at least most of the times, but not always). Then I can navigate through the USB directories and start something - but when I then press RESET, the startup screen will again stop in between and a reset will no longer help. I have to turn off the computer for a few seconds, then I can start it again.

UPDATE: added screenshot
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 02:35, 06 May 21
@eto (https://www.cpcwiki.eu/forum/index.php?action=profile;u=3625)


Perhaps the edge connection on the Motherboard is dirty ?


Keep Safe


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 02:40, 06 May 21
Perhaps the edge connection on the Motherboard is dirty ?

Unlikely. The second USIfAC works without problems.

Also the non-working USUfAC also doesn't work on a 6128 with Centronics connector.

UPDATE: non working usifac fixed. See post above
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 03:21, 06 May 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)

John I will do a test with Version 4 on my old boards and see what happens



Version 4 appears to be Ok with the old Boards, |USB OK, files OK. .DSK OK


Thanks


Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:02, 06 May 21
2) My other UsiFac works fine on my 6128, but on the 464 it behaves differently. When turning on, the 464 stops when displaying the start up screen, just before the USIFAC message should appear. After pressing reset, it boots fully to the READY prompt (at least most of the times, but not always). Then I can navigate through the USB directories and start something - but when I then press RESET, the startup screen will again stop in between and a reset will no longer help. I have to turn off the computer for a few seconds, then I can start it again.

This is most likely a connection problem, usually with the ribbon cable. I had such erratic behavior some time ago, boot problems, hang ups and crashes for no apparent reason etc.  Finally i discover that the culprit was the edge connector ribbon cable i was using. When i've change it with a new one, all problems solved!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Philippe Lardenois on 19:05, 07 May 21
Whaou. huge update.
Will test it on sunday..
Thanks for the SNA add-on


Phil
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:14, 07 May 21
I've added an SNA folder in to USIfAC II assets place:
https://www.dropbox.com/s/35p7s61gvem1r8b/SNA.zip?dl=0
It contains more than 350 snapshot files of games, along with Basic loaders for easy loading!  ;)
Just copy the entire SNA folder to a usb stick and choose any BAS file for direct loading of snapshot!:-)
Btw, is there an easy way to get the uncompressed form of a compressed snapshot file, like the ones in cpcwiki archive (https://www.cpcwiki.eu/index.php/Snapshot_Archive)?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 21:29, 10 May 21
As a linux user I have tried to use AmstradUtilityII.exe with little luck. Sometimes it works under WINE but other does not.

Option A python way
So, I decided to get Wireshark and do a python script that now has receiveFromCPC and Terminal options. The other options I guess are more difficult to implement that just sniffing network traffic.
https://github.com/issalig/cpc/blob/main/sw/usifac_transfer.py (https://github.com/issalig/cpc/blob/main/sw/usifac_transfer.py)

To get a file from the CPC just call first "python usifac_transfer.py -r -p YOURPORT"
There is also a tools to convert a binary to defb in order to call BASIC from RSX 8) https://github.com/issalig/cpc/blob/main/sw/bin2txt.py (https://github.com/issalig/cpc/blob/main/sw/bin2txt.py)


Enjoy.


Option B just from bash (simple but effective):https://github.com/issalig/cpc/blob/main/sw/usifac_receive.sh (https://github.com/issalig/usifac_tools/blob/main/usifac_transfer.py)
Code: [Select]
#Set a server listening on a given port and redirect output to a file
#|2PC on the CPC
#Then press 1 and enter on the PC to start transferring from CPC
#Finish reception with Ctrl+C when motor stops or use -w10

MYPORT="10000"

echo "Server started. Press 1 + Enter to start downloading"
echo "Set -w10 to a proper value if not enough"
nc -w10 -l $MYPORT > MYFILERAW

#Get name and remove spaces
MYFILE=`head -12c MYFILERAW | tr -d " " `

echo "Saving $MYFILE"

#Then, strip first 12 bytes and we are done
tail +13c MYFILERAW > $MYFILE

rm MYFILERAW
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 17:10, 11 May 21
Another "3rd party support" for USIfAC II, Great!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 21:03, 17 May 21
Hi, I have started looking at the code of USIFAC but I have realised I need to learn a lot of things before, thus I am documenting my learning process and you can check it on https://www.cpcwiki.eu/forum/programming/my-journey-into-z80-and-cpc/
I have included the code to write BASIC on RAM  that @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) uses and will I include more things for sure. My final idea is to describe how to do a simple foreground ROM, so that more people understand it and can contriubute to USIFAC development and new ideas.
Enjoy it!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 18:28, 21 May 21
Hi All,


I noticed a mention in the forum about getting the USIFAC working with Ewenterm, but I couldn't find any code so I had a go today and managed to get it working. Apologies if this is already up somewhere.


I'm using esp-link on the esp8266 wifi module, which has a serial/wifi socket link. And I'm using ncat on a bash box to connect to servers. I've attached a couple of pics of the amstrad BBS and a local retropie. It's very usable.


Here's an example of the netcat command I'm using where the IP address is the esp8266


stty -icanon && ncat  -C 192.168.1.124 23 -e "telnet amstrad.simulant.uk 464"


I've attached a dsk with updated readme and code.


Thanks to @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) and Ewen of Ewenterm for giving me some fun with this!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:25, 21 May 21
@kolleykibber (https://www.cpcwiki.eu/forum/index.php?action=profile;u=4071), very nice work, and well documented!  :)
I could also add this to Usifac's public folder for anyone who want to use it, under a "Connect to bbs" folder maybe?  ::)
Btw, i've extracted readme and manual text files from dsk image, for easier acccess (and maybe it would be a good idea to make a small program for reading txt files on Amstrd cpc directly  :D )
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: kolleykibber on 00:02, 22 May 21
Thanks @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541). The USIFAC has started me off on a journey into microcontrollers, so thanks for that too!


Good idea on adding to the folder, Have you thought about putting your work up on github?


Now you've been generous enough to release your code I was going to have a go at z80dart support from the usifac side. That way we could use all the old software. Need to buy more gear though :)

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 09:38, 25 May 21
I've upload a new firmware (4a), only minor optimization of  board's ROM code this time (replace "cp 0" with "or A" ,fix a small bug in |format routine- now shows correctly  formatted track numbers, reduce the size of hex file by dumping initial zeros of arrays & variables used in routines transferred to RAM).
Btw, we reach 100 USIfAC II boards produced!
It's been ~6months since initial presentation, but production was stalled for more than 2months in total (due to various part shortages), so in reality this number is acheived in less than 4months!
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 10:27, 28 May 21

How do you weld USB board and USIFAC??


I can't see how pins of each board are connected. The VCC and GND pins on USB module aren't beside TX and RX pins.


Thank you

Hi Friends,
I design a little box with my 3D printer. for those interested....Attached the STL (2 parts and 2 buttons).
inside this archive, 2 Top cover (one for those like me who need a hole for adding a 7cm button  for disk swap / one without)


pictures :

https://ibb.co/ZBcdRs3 (https://ibb.co/ZBcdRs3)

https://ibb.co/ftLkZxq (https://ibb.co/ftLkZxq)

(https://ibb.co/ZBcdRs3)
(https://ibb.co/ZBcdRs3)
++
Phil


(https://ibb.co/ftLkZxq)
(https://ibb.co/ZBcdRs3)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 10:26, 29 May 21
How do you weld USB board and USIFAC??
I can't see how pins of each board are connected. The VCC and GND pins on USB module aren't beside TX and RX pins.
Thank you

This is how underneath of board+usb host module is:

 

* IMG_20210529_101944_356.jpg
(147.04 kB, 784x571 - viewed 344 times)


As you can see,i custom design the board to accept the pins of module and solder it in place. And yes, for some reason, they didn't use the usual "4pin approach" of having Tx,Rx, 5v and gnd in a single row, but instead, CH376 module (https://www.cpcwiki.eu/forum/index.php?action=dlattach;topic=17425.0;attach=33013;image) has a 3pin connector, (with one of gnd pins in the middle...  :o ) and 5v is given through a pin in the large dual row header!
This is why the first version used dupont wires to connect the usb module.... ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: entelle42 on 12:08, 29 May 21
@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) Hi John,


First of all, congrats on your fantastic job!!  ;)


Regarding the wifi connection, can we change the host ip in your Windows Amstrad utility tool? I tried to change the ip in the setup.txt, may be i'm doing wrong, but the tool still seems to reset the ip to 192.168.56.1?


Thank you
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:18, 29 May 21
The ip is taken automatically from the ip of the computer running the Windows utility (port number can be changed though).
If you want this to be changed you will have to assign a different ip to your pc first :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: entelle42 on 13:09, 29 May 21

@ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) , Great it works ! ;D
Thank you John.

I solved my issue by deactivating my VirtualBox network adaptater (which was assigned to the ip 192.168.56.1) and then, the Windows Amstrad tool was able to get my PC ip and the cpc succeeded in  connecting to the host ip.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 15:33, 29 May 21
Sent an email - These look super cool!


(here we go!!!)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: darkhalf on 13:21, 30 May 21

When using the Multiface 2 it will freeze up during the Save. Test game was Kane from Mastertronic (using a CPC6128)


|USB
|MG,"KANE.DSK"
|FDC
run"kane"




Some of the MF2 BIN files will save in the DSK image, but not everything required to reload it again. Above procedure works fine when running the game via Gotek


I've updated the PIC to 18F47Q10_4 in this thread today


Got the MF2 board and parts from rewinding. Works great!
https://www.va-de-retro.com/foros/viewtopic.php?f=63&t=8102 (https://www.va-de-retro.com/foros/viewtopic.php?f=63&t=8102)

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:15, 31 May 21
I'm really not familiar with MF2 interface...
Does it uses the same dsk game image to save the files it needs? But i wonder, since memory dump files are pretty large (64k or 128k), there might be no room for them, if game files take up more than ~100kb on disk... ::)
If that's the case, you might try to mount a 2nd dsk image of an empty disk, and before enabling MF2, change the active dsk image, by pressing the dsk_swap button. That way, USIfAC II will use the empty disk image to store files.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: darkhalf on 16:11, 03 June 21
For this game there is enough space on the DSK image. If there is not the MF2 will report an error. I will try the game outside DSK image and see if the problem is the same. I've got USB-TTL, WIFI and Bluetooth modules on order, so keen to try these out too

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:35, 03 June 21
For this game there is enough space on the DSK image. If there is not the MF2 will report an error. I will try the game outside DSK image and see if the problem is the same. I've got USB-TTL, WIFI and Bluetooth modules on order, so keen to try these out too
One other thing that might worth a try is to  create in your usb flash drive a small partition of 256Mb (https://www.anyrecover.com/external-device-recovery-data/partition-flash-drive/?gclid=Cj0KCQiAk53-BRD0ARIsAJuNhpuV-XmTqEs_lVQwvnu_S89mZZcUEZ_KMaaHUuETleV5quw2XX6V63saAn1_EALw_wcB#tip2) and format it, using FAT file sytem. From my experience, sometimes usb host modules might be a bit "picky" with specific flash drives, especially regarding writing activities (e.g. you might have no problems reading/loading files/dsk images etc, but ONLY in writing files/images). The above method of using a small FAT partition, in most cases seems to resolve the issues.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 00:09, 04 June 21

One other thing that might worth a try is to  create in your usb flash drive a small partition of 256Mb and format it,


Have you tried to format it with a third party tool and NOT with the Windows format tool? Almost none of my sticks worked with the Windows formatter (even with just 256MB partitions) but except for a single USB drive every stick worked with its full capacity, if formatted with h2format.exe (http://translate.google.com/translate?hl=en&sl=de&u=http://www.heise.de/software/download/h2format/40825&ei=bDAHSu_CGqDCM7_M0KID&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3Dh2format%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3D9ju) .


Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 10:39, 05 June 21
Hello,


How much current does USIFAC II need to work?


Thank you
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 14:38, 07 June 21

It arrived!

After one very thorough scrub of my expansion port (fnar) it's working beautifully. I'm afraid to unplug it now because of just how firmly it's stuck in place.


(edit: i twooted a pic, and a video)


https://twitter.com/magic_bane/status/1401852804147318784

https://twitter.com/magic_bane/status/1401864000598589441
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 17:20, 07 June 21
Hello,
How much current does USIFAC II need to work?
Thank you

The board itself draws very little current, ~20-30mA, but the usb host module+usb flash drive probably need ~100mA (or even more, depending on the flash drive you use). So i would say that a rough estimation of total current consumption would be ~150-200mA
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 20:41, 07 June 21
Is there any way to tell which games in the direct loading folder *require* 128k?

Running into a lot of assumingly buggy games because they're expecting 128k but don't find it (and some that explicitly don't start without it)


EDIT:


I made a "direct load" version of Infernal Runner (a personal favourite of mine) it works on a 464, and some simple instructions are in the zip.
it should be attached to the post, now.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 22:44, 07 June 21
Well, unfortunately all "direct load" games are actually extracted from dsk images, meaning that orignally were intended only for CPC 664/6128. Although mostly compatible, there are some minor differences between 464 and 6128 regarding the "inner workings" of the machine that can cause problems for a game designed on a cpc6128,to load on a cpc464 (even if it uses only 64k ram). Also, many games that have Basic loaders, might use commands or syntax that is not recognized from CPC 464 Basic 1.0 version.
 So,in most cases, games that are not running on a cpc464 is not because they need 128k but because they were not supposed to run on cpc464 machines  :)
One solution for non working games might be to use snapshot files instead (which can be easily created from an emulator like winape), as this is the most "brutal-direct" method that forces the entire game into the RAM directly, without needing to load any files!  ;)

p.s. i add infernal runner in the official list (https://www.cpcwiki.eu/forum/games/how-about-making-a-'worth-to-play'-collection-of-amstrad-games/25/)  and with a basic loader (https://www.dropbox.com/s/cdd59bfubyv9g7f/loaders.zip?dl=0) for easy access:)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 23:05, 07 June 21
Well, unfortunately all "direct load" games are actually extracted from dsk images, meaning that orignally were intended only for CPC 664/6128. Although mostly compatible, there are some minor differences between 464 and 6128 regarding the "inner workings" of the machine that can cause problems for a game designed on a cpc6128,to load on a cpc464 (even if it uses only 64k ram). Also, many games that have Basic loaders, might use commands or syntax that is not recognized from CPC 464 Basic 1.0 version. So,in most cases, games that are not running on a cpc464 is not because they need 128k but because they were not supposed to run on cpc464 machines  :) One solution for non working games might be to use snapshot files instead (which can be easily created from an emulator like winape), as this is the most "brutal-direct" method that forces the entire game into the RAM directly, without needing to load any files!  ;) p.s. i'll see to add infernal runner in the official list  :)


Yeah, that's mostly what I thought. Probably just system specific//BASIC stuff and not particularly a RAM requirement.


Most 664 stuff should work at the very least - all four games or however many came out before it was axed - knowing which stuff is for 128k/6128-only and not for a 464 would be helpful to know.


Snapshots i'm avoiding for now (i don't really like them, and they're limited for multi-load games)


wrt: Infernal Runner / that's why i uploaded it :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 15:33, 08 June 21
Has a 3d-printable case been made for the USIfAC 2 yet? My current solution is less than ideal, and I'd prefer it in a case to prevent damaging my table/usifac2.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 19:41, 08 June 21
Hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) , I finally took the time to study your code to run basic from asm and I have some questions

defb 14,0,33,149,234,205,27,0

that corresponds to
Code: [Select]
0000 0E 00          LD C,00
0002 21 95 EA       LD HL,EA95
0005 CD 1B 00       CALL 001B    ; KL_FAR_PCHL

and you said it was LD HL, EA92 (I guess it is just a mistake when writing by heart)
 
Second question is what cp &6e  is for? You are checking  the low part of the sum of &170 + basic_code_size  to &6e, ??

Third question is what ae29 does? it is just a variable that holds 0? and what is the purpose of copying and calling defb 14,0,33,149,234,205,27,0  on 7900, could not be called just from a label before defb line?

I have also tried similar code (https://www.cpcwiki.eu/forum/programming/asm-source-code/msg158311/#msg158311 (https://www.cpcwiki.eu/forum/programming/asm-source-code/msg158311/#msg158311)) and also in M4 ROM (https://github.com/M4Duke/m4rom/blob/a8a029134bc2412896c71dcdb4fedba9d417128d/M4ROM.s#L1936 (https://github.com/M4Duke/m4rom/blob/a8a029134bc2412896c71dcdb4fedba9d417128d/M4ROM.s#L1936))  and both run in 464 that you said it was not working for you in USIFAC, you can give it a try.

- And the forth question is, what are the main differences between these two ways of running basic?In this code they detect basic version and also copy  4x times &170+basic_code_size but instead of using RST 3 and go to &ea95 (inside RUN routine)
they go directly to the beginning of RUN routine at &ea78  (cpc6128)

I have found a disassembly of CPC464 in case you need it https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf (https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf)

Yes, I had too many questions.


Well, after finishing setting up wifi module, you just give "LIST" at basic prompt, and you will get the BASIC listing!  :D
And here is the asm code for the |WIFI command:
Code: [Select]
data_size equ 3465
addr equ &170
org   &c000
   ld   hl, setwifi_code
   ld    de, addr
   ld   bc, data_size
   ldir   
   ld   a ,#FB
   in   a,(#Dc)
   ld   l, a   
   ld   h,&ae
   ld   de,data_size+&170
   ld   B,4
   
patch_mems:      ;length+1678+368 (&170)
   
   ld   (HL),e         
   INC   HL
   LD   (HL),d
   INC   HL
   dec   b
   jr   nz,patch_mems

   ld   a,l   
   cp   &6e
   jp   z,runcommand
   ret

runcommand:
   ld   hl,&ae29
   ld    a,0
   ld   (hl),a
   ld   hl, run_code
   ld    de, &7900
   ld   bc, 8
   ldir
   jp   &7900

Run_code:
   defb 14,0,33,149,234,205,27,0


setwifi_code:

defb 19,0,10,0,173,32,16,1,130,32,14,32,32,32,32,32,32,32,0,31,0,17,0,185,32,28,208,251,44,25,43,1,185,32,28,208,251,44,25,43,1,185
defb 32,28,208,251,44,25,43,0,60,0,20,0,147,32,3,0,0,83,208,40,25,10,41,1,13,0,0,115,101,114,115,112,101,101,228,239,25,24,1,13,0
defb 0,99,117,114,115,112,101,101,228,239,255,11,40,28,221,251,41,32,32,32,32,32,32,32,32,32,0,25,0,30,0,162,32,14,44,15,1,162,32,16,44
defb 14,1,186,32,16,1,138,32,32,32,0,10,0,40,0,159,32,30,136,19,0,36,0,50,0,3,0,0,225,239,34,65,84,43,67,87,77,79,68,69,61
defb 49,34,1,159,32,30,176,4,32,32,32,32,32,32,32,0,19,0,100,0,197,32,115,101,114,105,97,108,32,115,101,116,117,112,0,60,0,110,0,138,1
defb 216,32,35,14,44,25,18,44,25,55,44,17,44,22,1,124,0,83,84,65,212,1,216,32,35,14,44,25,18,44,25,55,44,18,44,22,1,138,1,216,32
defb 35,14,44,15,44,25,79,44,15,44,25,25,0,60,0,115,0,169,32,25,22,44,19,1,191,34,83,101,116,32,110,101,119,32,115,112,101,101,100,63,32
defb 40,89,47,78,41,34,1,131,32,28,3,187,1,13,0,0,111,102,102,115,101,244,239,14,32,32,32,32,32,32,32,0,34,0,116,0,161,32,255,10,40
defb 25,43,41,239,14,32,235,32,30,120,0,32,32,32,32,32,32,32,32,32,32,32,32,32,0,41,0,117,0,161,32,255,10,40,25,46,41,239,14,32,235
defb 32,13,0,0,111,102,102,115,101,244,239,25,11,1,160,32,30,84,1,32,32,32,32,32,0,10,0,118,0,160,32,30,116,0,0,58,0,120,0,191,1
defb 191,34,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,80,114,101,115,115,58,34,1,158,32,13,0,0,248,239
defb 21,32,236,32,25,14,32,32,32,32,0,75,0,130,0,195,32,3,0,0,83,208,40,13,0,0,248,245,20,41,1,169,32,25,32,44,13,0,0,248,1
defb 191,32,34,60,34,59,172,40,255,25,40,13,0,0,216,245,20,41,44,16,44,15,41,59,34,62,58,34,59,3,0,0,83,208,40,13,0,0,248,245,20
defb 41,32,32,0,11,0,140,0,176,32,13,0,0,248,0,60,0,160,0,140,32,57,54,48,48,44,53,55,54,48,48,44,49,49,53,50,48,48,44,50,51
defb 48,52,48,48,44,52,54,48,56,48,48,44,53,55,54,48,48,48,44,57,50,49,54,48,48,44,49,48,54,53,54,48,48,0,21,0,170,0,13,0,0
defb 115,101,114,115,240,239,14,1,131,32,28,3,187,0,51,0,180,0,161,32,255,10,40,25,64,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25
defb 12,1,3,0,0,83,208,239,34,57,54,48,48,34,32,32,32,32,32,32,32,32,32,0,54,0,190,0,161,32,255,10,40,25,65,41,239,14,32,235,32
defb 13,0,0,115,101,114,115,240,239,25,15,1,3,0,0,83,208,239,34,53,55,54,48,48,34,32,32,32,32,32,32,32,32,32,32,32,0,52,0,200,0
defb 161,32,255,10,40,25,57,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,16,1,3,0,0,83,208,239,34,49,49,53,50,48,48,34,32,32
defb 32,32,32,32,32,32,0,51,0,210,0,161,32,255,10,40,25,56,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,17,1,3,0,0,83,208
defb 239,34,50,51,48,52,48,48,34,32,32,32,32,32,32,32,0,50,0,220,0,161,32,255,10,40,25,49,41,239,14,32,235,32,13,0,0,115,101,114,115
defb 240,239,25,18,1,3,0,0,83,208,239,34,52,54,48,56,48,48,34,32,32,32,32,32,32,0,54,0,230,0,161,32,255,10,40,25,48,41,239,14,32
defb 235,32,13,0,0,115,101,114,115,240,239,25,19,1,3,0,0,83,208,239,34,53,55,54,48,48,48,34,32,32,32,32,32,32,32,32,32,32,0,44,0
defb 240,0,161,32,255,10,40,25,41,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,21,1,3,0,0,83,208,239,34,57,50,49,54,48,48,34
defb 0,51,0,250,0,161,32,255,10,40,25,40,41,239,14,32,235,32,13,0,0,115,101,114,115,240,239,25,23,1,3,0,0,83,208,239,34,49,48,54,53
defb 54,48,48,34,32,32,32,32,32,32,0,25,0,24,1,161,32,13,0,0,115,101,114,115,240,239,14,32,235,32,160,32,30,180,0,0,54,0,44,1,3
defb 0,0,193,239,34,65,84,43,85,65,82,84,95,68,69,70,61,34,244,3,0,0,83,208,244,34,44,56,44,49,44,48,44,48,34,32,32,32,32,32,32
defb 32,32,32,32,32,32,32,0,33,0,54,1,159,32,30,176,4,1,185,32,28,209,251,44,13,0,0,115,101,114,115,240,1,185,32,28,209,251,44,15,0
defb 25,0,64,1,158,32,13,0,0,233,239,15,32,236,32,25,100,1,176,32,13,0,0,233,0,110,0,84,1,216,32,35,16,44,15,44,25,79,44,25,21
defb 245,13,0,0,79,70,70,83,69,212,44,25,25,245,13,0,0,79,70,70,83,69,212,1,186,32,35,16,44,14,1,187,32,35,16,44,15,1,216,32,35
defb 17,44,15,44,25,79,44,25,19,245,13,0,0,79,70,70,83,69,212,44,25,20,245,13,0,0,79,70,70,83,69,212,1,186,32,35,17,44,14,1,187
defb 32,35,17,44,15,1,159,32,30,208,7,0,37,0,86,1,3,0,0,225,239,34,65,84,43,67,73,80,77,79,68,69,61,49,34,1,159,32,30,176,4
defb 32,32,32,32,32,32,32,0,28,0,89,1,3,0,0,225,239,34,65,84,43,67,73,80,83,69,78,68,34,1,159,32,30,176,4,0,55,0,94,1,169
defb 32,25,30,44,25,22,245,13,0,0,79,70,70,83,69,212,1,191,34,87,105,70,105,32,77,111,100,117,108,101,32,99,111,110,110,101,99,116,101,100,33
defb 34,32,32,32,32,32,32,32,0,17,0,104,1,131,32,28,3,187,1,152,32,32,32,32,32,0,31,0,176,4,197,32,83,69,78,68,32,65,84,32,67
defb 79,77,77,65,78,68,83,32,82,79,85,84,73,78,69,0,24,0,196,4,158,32,13,0,0,235,239,15,32,236,32,255,14,40,3,0,0,225,41,0,29
defb 0,206,4,185,32,28,208,251,44,255,1,40,172,40,3,0,0,193,44,13,0,0,203,44,15,41,41,0,11,0,216,4,176,32,13,0,0,203,0,24,0
defb 226,4,185,32,28,208,251,44,28,13,0,1,185,32,28,208,251,44,28,10,0,0,12,0,236,4,3,0,0,193,239,34,34,0,6,0,246,4,201,0,24
defb 0,0,5,197,32,83,69,78,68,32,84,69,88,84,32,82,79,85,84,73,78,69,0,25,0,60,5,158,32,13,0,0,235,239,15,32,236,32,255,14,40
defb 3,0,0,225,41,32,0,38,0,70,5,185,32,28,208,251,44,255,1,40,172,40,3,0,0,193,44,13,0,0,203,44,15,41,41,32,32,32,32,32,32
defb 32,32,32,0,14,0,80,5,176,32,13,0,0,203,32,32,32,0,36,0,85,5,161,32,13,0,0,99,114,108,230,238,14,32,235,32,185,32,28,208,251
defb 44,25,13,1,185,32,28,208,251,44,25,10,0,36,0,90,5,191,32,35,15,44,255,3,40,25,10,41,244,255,3,40,25,13,41,1,3,0,0,225,239
defb 34,34,32,32,32,32,32,0,6,0,100,5,201,0,22,0,208,7,197,32,87,73,70,73,32,67,79,78,78,69,67,84,73,79,78,0,22,0,210,7,3
defb 0,0,193,239,34,65,84,69,48,34,1,159,32,30,176,4,0,12,0,213,7,185,32,28,209,251,44,15,0,10,0,218,7,159,32,30,184,11,0,10,0
defb 223,7,131,32,28,3,187,0,32,0,224,7,161,32,13,0,0,83,84,65,84,85,211,239,14,32,235,32,13,0,0,83,84,65,84,85,211,239,15,0,40
defb 0,228,7,178,32,13,0,0,115,116,97,116,117,243,32,160,32,30,2,8,44,30,152,8,44,30,238,7,44,30,152,8,44,30,2,8,32,32,0,6,0
defb 238,7,201,0,52,0,2,8,169,32,25,27,44,25,19,245,13,0,0,111,102,102,115,101,244,1,163,34,65,46,80,46,32,115,115,105,100,58,34,44,3
defb 0,0,115,115,105,228,32,32,32,32,32,32,32,32,0,52,0,12,8,169,32,25,28,44,25,20,245,13,0,0,111,102,102,115,101,244,1,163,34,112,97
defb 115,115,119,111,114,100,58,34,44,3,0,0,112,97,115,243,32,32,32,32,32,32,32,32,32,0,73,0,22,8,3,0,0,225,239,34,65,84,43,67,87
defb 74,65,80,95,68,69,70,61,34,244,255,3,40,25,34,41,244,3,0,0,83,83,73,196,244,255,3,40,25,34,41,244,34,44,34,244,255,3,40,25,34
defb 41,244,3,0,0,80,65,83,211,244,255,3,40,25,34,41,0,15,0,32,8,159,32,30,176,4,32,32,32,32,32,0,53,0,42,8,169,32,25,30,44
defb 25,21,245,13,0,0,111,102,102,115,101,244,1,191,34,67,111,110,110,101,99,116,105,110,103,46,46,46,34,59,32,32,32,32,32,32,32,32,32,32,32
defb 32,32,0,10,0,52,8,159,32,30,184,11,0,45,0,62,8,161,32,13,0,0,115,116,97,116,117,243,239,16,32,235,32,191,34,79,75,34,1,138,32
defb 35,17,1,160,32,30,228,7,32,32,32,32,32,32,32,32,0,73,0,72,8,169,32,25,15,44,25,22,245,13,0,0,111,102,102,115,101,244,1,191,34
defb 69,114,114,111,114,58,82,101,116,114,121,40,49,41,32,111,114,32,73,110,115,101,114,116,32,110,101,119,32,65,99,99,101,115,115,32,80,111,105,110,116
defb 40,50,41,63,34,32,32,0,36,0,82,8,161,32,255,10,40,25,64,41,239,14,32,235,32,138,32,35,16,1,160,32,30,32,8,32,32,32,32,32,32
defb 32,32,0,46,0,92,8,161,32,255,10,40,25,65,41,239,14,32,235,32,138,32,35,16,1,138,32,35,17,1,131,32,28,3,187,1,160,32,30,2,8
defb 32,32,32,32,32,32,32,0,10,0,102,8,160,32,30,82,8,0,60,0,152,8,138,32,35,16,1,131,32,28,3,187,1,169,32,25,27,44,25,19,245
defb 13,0,0,111,102,102,115,101,244,1,163,34,72,111,115,116,32,105,112,58,34,44,3,0,0,104,111,115,244,32,32,32,32,32,32,32,0,52,0,162,8
defb 169,32,25,30,44,25,20,245,13,0,0,111,102,102,115,101,244,1,163,34,112,111,114,116,58,34,44,3,0,0,112,111,114,244,32,32,32,32,32,32,32
defb 32,32,32,32,32,32,0,53,0,172,8,3,0,0,72,79,83,212,239,255,3,40,25,34,41,244,3,0,0,72,79,83,212,244,255,3,40,25,34,41,244
defb 34,44,34,244,3,0,0,80,79,82,212,32,32,32,32,32,32,32,0,56,0,182,8,3,0,0,225,239,34,65,84,43,67,73,80,83,84,65,82,84,61
defb 34,244,255,3,40,25,34,41,244,34,84,67,80,34,244,255,3,40,25,34,41,244,34,44,34,244,3,0,0,72,79,83,212,0,25,0,192,8,3,0,0
defb 99,111,110,110,101,99,244,239,3,0,0,225,32,32,32,32,32,0,10,0,197,8,159,32,30,176,4,0,56,0,202,8,169,32,25,30,44,25,21,245,13
defb 0,0,111,102,102,115,101,244,1,191,34,67,111,110,110,101,99,116,105,110,103,46,46,46,34,59,1,159,32,30,184,11,32,32,32,32,32,32,32,32,32
defb 32,0,22,0,212,8,161,32,13,0,0,83,84,65,84,85,211,239,17,32,235,32,201,0,70,0,222,8,169,32,25,15,44,25,22,245,13,0,0,111,102
defb 102,115,101,244,1,191,34,69,114,114,111,114,58,82,101,116,114,121,40,49,41,32,111,114,32,73,110,115,101,114,116,32,110,101,119,32,72,111,115,116,32
defb 83,101,114,118,101,114,40,50,41,63,34,0,31,0,232,8,161,32,255,10,40,25,64,41,239,14,32,235,32,138,32,35,16,1,160,32,30,182,8,32,32
defb 32,0,38,0,242,8,161,32,255,10,40,25,65,41,239,14,32,235,32,138,32,35,16,1,138,32,35,17,1,160,32,30,152,8,32,32,32,32,32,0,10
defb 0,252,8,160,32,30,232,8,0,13,0,184,11,197,32,115,116,97,116,117,115,0,12,0,189,11,185,32,28,209,251,44,15,0,38,0,194,11,3,0,0
defb 225,239,34,65,84,43,67,73,80,83,84,65,84,85,83,34,1,159,32,30,176,4,32,32,32,32,32,32,32,32,0,11,0,204,11,13,0,0,201,239,15
defb 0,40,0,214,11,214,32,40,13,0,0,201,241,22,41,32,250,32,40,255,11,40,28,209,251,41,239,25,255,41,32,32,32,32,32,32,32,32,32,32,0
defb 38,0,224,11,13,0,0,193,239,255,11,40,28,208,251,41,1,13,0,0,201,239,13,0,0,201,244,15,32,32,32,32,32,32,32,32,32,0,6,0,234
defb 11,213,0,25,0,244,11,13,0,0,83,84,65,84,85,211,239,255,11,40,28,208,251,41,245,25,48,0,42,0,249,11,161,32,40,13,0,0,83,84,65
defb 84,85,211,241,16,41,32,252,32,40,13,0,0,115,116,97,116,117,243,238,19,41,32,235,32,30,189,11,0,6,0,254,11,201,0,18,0,160,15,13,0
defb 0,225,239,15,1,13,0,0,233,239,14,0,27,0,170,15,214,32,40,13,0,0,225,239,15,41,32,250,32,40,13,0,0,233,241,25,15,41,0,29,0
defb 180,15,13,0,0,225,239,255,11,40,28,209,251,41,1,13,0,0,233,239,13,0,0,233,244,15,0,6,0,190,15,213,0,6,0,200,15,201,0,46,0
defb 136,19,197,32,97,117,116,111,109,97,116,105,99,32,115,112,101,101,100,32,100,101,116,101,99,116,105,111,110,32,111,102,32,119,105,102,105,32,32,32,32
defb 32,32,0,21,0,146,19,185,32,28,209,251,44,15,32,32,32,32,32,32,32,32,32,0,19,0,156,19,3,0,0,225,239,34,65,84,34,32,32,32,32
defb 32,0,16,0,166,19,159,32,30,176,4,1,159,32,30,160,15,0,19,0,176,19,161,32,13,0,0,193,239,15,32,235,32,30,196,19,0,51,0,186,19
defb 13,0,0,225,239,255,11,40,28,208,251,41,1,161,32,13,0,0,225,239,25,65,32,252,32,13,0,0,225,239,25,13,32,252,32,13,0,0,225,239,25
defb 79,32,235,32,201,0,30,0,196,19,13,0,0,83,69,82,83,80,69,69,196,239,13,0,0,83,69,82,83,80,69,69,196,245,15,0,77,0,201,19,161
defb 32,13,0,0,83,69,82,83,80,69,69,196,239,23,32,235,32,185,32,28,209,251,44,13,0,0,67,85,82,83,80,69,69,196,1,191,34,78,79,32,87
defb 105,70,105,32,109,111,100,117,108,101,32,100,101,116,101,99,116,101,100,33,34,1,152,32,32,32,32,32,32,32,0,28,0,206,19,185,32,28,209,251,44
defb 13,0,0,115,101,114,115,112,101,101,228,1,160,32,30,146,19,0,0,0

This is actaully a method of passing Basic files through assembly code, and i'm using it in many other RSX commands!
The bytes transferred to &170 is the actual basic listing, and it's nothing more that the saved BAS file, without the first 128 bytes of header!  ;)
After that, you only need to set some variables in memory (the "patch_mems" section) , and you are ready!
And finally, the best part: the few bytes in the "run code" section, allows you to automatically run the inserted basic program, without giving "RUN" command!  ;)
It's only a few instructions:
Code: [Select]
   ld   c,0
   ld   hl,&ea92
   call    &001b

This,as small as it may seems, was rather tricky and hard to accomplish, as it required to intercept the "Run" command in basic rom at specific address (far call RST 3 to &ea92 of rom 0=Basic (http://cpctech.cpcwiki.de/docs/basic.asm))!
And because i couldn't find a dissasmble code of CPC 464 BASIC 1.0 rom, this automation is only available for CPC 6128  :)

btw, here is all you need to know about creating your own rsx commands: http://cpctech.cpc-live.com/docs/manual/s158se09.pdf (http://cpctech.cpc-live.com/docs/manual/s158se09.pdf)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 19:49, 08 June 21
Has a 3d-printable case been made for the USIfAC 2 yet? My current solution is less than ideal, and I'd prefer it in a case to prevent damaging my table/usifac2.
R


Somewhere in this thread someone has posted a 3d case. However it doesn't fit every Usifac II as I recognized. They differ slightly and I guess also the Reset-Button (or Pause?) has changed. And it doesn't close on its own, so I used some double-sided strip to keep the lid in place. Better than nothing though and it looks much better than the pure board.



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:55, 08 June 21
Hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541) , I am having a look at your code to run basic from asm and I have some questions
defb 14,0,33,149,234,205,27,0
corresponds to
Code: [Select]
0000 0E 00          LD C,00
0002 21 95 EA       LD HL,EA95
0005 CD 1B 00       CALL 001B    ; KL_FAR_PCHL
and you said it was LD HL, EA92 (I guess it is just a mistake when writing by heart)

the bytes correspond to a far call RST 3 to &ea92 of rom 0=Basic:
Code: [Select]
   ld   c,0
   ld   hl,&ea92
   call    &001b

Second question is what cp &6e  is for? You are checking  the low part of the sum of &170 + basic_code_size  to &6e, ??
If you check firmware guide you will see that @ &AE66 (and also &AE68, &AE6A, &AE6C) are the addresses used by basic to store the start address of  free space (or start of variables & arrays area). This address can be calculated by adding &170 offset to the size of the basic program. Now, for Amstrad CPC464 this address is in slightly  different place (&ae83), so, i'm using the low byte of this address (&83 or &66) to store it in USIfAC's ram, and fetch it whenever is needed (using a simple inp &fbdc), BUT also to DISTINGUISH cpc464 from cpc6128.
Now, if you add 8 to &66 you will have &6e, and that would be the value of l register at the end of loop, IF we are running on a cpc 6128 (e.g. basic 1.1)! So in 2 words, the cp &6e is for distinguish cpc 464 form 6128 (or better basic 1.0 from 1.1).

Third question is what ae29 does? it is just a variable that holds 0? and what is the purpose of copying and calling defb 14,0,33,149,234,205,27,0  on 7900, could not be called just from a label before defb line?
again reading from firmware guide, you will see that &ae29 is for storing file type byte, where for Basic program, must be 0. Now, in order to run basic program i needed to execute the "RUN" code @ &ea78 of basic 1.1 rom. What i found out though, is that i needed to skip the first section (which is relevant to run from a BAS file) as i needed to run a basic code already in ram, that's why i start the execution of routine from &ea92. Executing the run command is actually a far call RST 3 to &ea92 of rom 0=Basic. This can't be done from usifac's rom directly (as the RST3 changes upper rom to basic rom), so it must be first placed in ram to execute it, thus the copying @ &7900.


- And the forth question is, what are the main differences between these two ways of running basic?In this code they detect basic version and also copy  4x times &170+basic_code_size but instead of using RST 3 and go to &ea95 (inside RUN routine)
they go directly to the beginning of RUN routine at &ea78  (cpc6128)
The cpc6128 "way" is direct running of basic program through the proccess i described. To do so, i needed the disasemble basic rom  to find out at what address i need to jump to ,for executing a run command properly. And so, because i couldn't fine a disassemble  of basic 1.0 rom,in case of cpc464, this must be ommited, and instead, you will need to give the "run" command manually at the prompt.


I have found a disassembly of CPC464 in case you need it https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf (https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf)
Thanks, i'll take a look and see if i can make it work for CPC464 too. :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 21:11, 08 June 21
Thanks for all the details, I will need some time to digest it all

Anyway, I have assembled this code again
defb 14,0,33,149,234,205,27,0

and it gives ea 95 again
0E 00
21 95 EA   ld hl, ea95   
 CD 1B 00

So if ea92 is the correct one, shouldn't be this defb?
defb 14,0,33,146,234,205,27,0

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 21:59, 08 June 21
Yes, the correct is &ea95  ;D
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 12:47, 09 June 21
Thanks, i'll take a look and see if i can make it work for CPC464 too. :)
I extracted the run function for BASIC 1.0 from the book (https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf (https://acpc.me/ACME/LITTERATURE_LIVRES/%5BGER%5DGERMAN/MARKT-UND-TECHNIK/ROM-Listing_CPC464-664-6128(Jorn_W_ANNECK_Till_MOSSAKOWSKI).pdf)) and translated comments into English (Danke schöne Google Tanslator) and mixed it with this code https://www.cpcwiki.eu/forum/programming/asm-source-code/msg158311/#msg158311 (https://www.cpcwiki.eu/forum/programming/asm-source-code/msg158311/#msg158311)

I attach a working code  8) for 464,664 and 6128

The changes are:
- Address of start of BASIC variables ld l, &83 for 464  ld l, &66  for 6128 and 664
- RUN entry point EA95 is for 6128, EA7D for 664, and E9DB for 464
- file type byte AE29 (6128 and 664),  AE42 (464)

Code: [Select]
kl_rom_select equ &B90F
data_size equ 35                                ; size of BASIC file
addr    equ &170                                ; BASIC files normally start at 170, let's write in this area
org    &1200                                   ; and store our program in &1200

main:
                                                ; we will use 16-bit registers (hl, de, ... to deal with memory addresses that take 2 bytes &AABB)
    ld    hl, basic_code                  ; hl = address where basic_code is starts, i.e. org + something but the assembler does it for us
    ld     de, addr                        ; de = &170
    ld    bc, data_size                   ; bc = data size
    ldir                                    ; ldir copies a block from hl address to de address of length bc (i.e. memcpy)
                                             ; do not forget to go back from call

; Address of start of variables (&AE66-67 in cpc6128-664, &AE83-84 in cpc464)
    ;basic_version:
    ld c, 0
    call kl_rom_select         ;select upper rom given by C -> upper rom 0 -> BASIC
    ld a,(&c002)         ;basic 1.0 byte 2 is 0; basic 1.1 664 is 1; basic 1,1 byte 2 is 2; 
    ld (basic_version), a
    cp 0
    jr z,cpc464
    ld    l, &66  ; basic 1.1 at AE66
    ld a, &29
    ld (file_type), a

    ld (basic_version), a
    cp 1
    jr z,cpc664
   
    ld hl, run_entry
    ld (hl) , &95     ;ea95 for 6128
    inc hl
    ld (hl) , &ea
    jr patch_mems
cpc664:
    ld hl, run_entry
    ld (hl) , &7d     ;ea7d for 664   
    inc hl
    ld (hl) , &ea
    jr patch_mems

cpc464:
    ld    l, &83  ; basic 1.0 at AE83
    ld a, &42
    ld (file_type), a
   
    ld hl, run_entry
    ld (hl) , &db
    inc hl
    ld (hl) , &e9


patch_mems:
    ld    h,&ae  ;  hl =AExx
    ld    de, data_size+&170  ;end of data
    ld    B,4  ; 4 bytes
   
patch_loop:           
                                    ;write data_size+170  to AExx
    ld    (hl),e   
    inc    hl
    ld    (hl),d
    inc    hl
    dec    b
    jr    nz,patch_loop
    ld    a,l   
    jr    run_command
    ret

run_command:
    ;ld    hl,&ae29        ; file type 0   
    ;ld    hl,&ae42        ; file type 0   cpc464
    ld    h, &ae
    ld    a, (file_type)
    ld    l, a
    ld     a,0
    ld    (hl),a
    ld    hl, run_code     
    ld     de, &7900
    ld    bc, 9  ;  run code size,
    ldir
    jp    &7900 ; copy run code in memory and call it

run_code:
    ld c, 0
    ;ld hl, &ea95   ;6128
    ;ld hl, &e9db    ;464
    ld hl, (run_entry)
    call &001b
    ret


basic_code: ;35 bytes long
defb  &0c,&00,&0a,&00,&c5,&20,&48,&65,&6c,&6c,&6f,&00,&15,&00,&14,&00
defb  &bf,&20,&22,&48,&65,&6c,&6c,&6f,&20,&57,&6f,&72,&6c,&64,&21,&22
defb  &00,&00,&00
basic_code_end:

basic_version: defb 0
file_type: defb 0
run_entry: defw 0
Code of RUN function for 464

Code: [Select]
E9BD CD 51 DD           CALL DD51       End of statement?
E9C0 EB                 EX DE, HL
E9C1 2A 81 AE           LD HL, (AE81)   program start after DE
E9C4 EB                 EX DE, HL
E9C5 38 1C              JR C, E9E3      then from program start
E9C7 FE 1E              CP 1E           Token for line number?
E9C9 28 15              JR Z, E9E0      then from program line
E9CB FE 1D              CP 1D           Token for line address?
E9CD 28 11              JR 2, E9E0      then from the program line
E9CF CD 0D EA           CALL EA0D       1. Read and evaluate block
E9D2 21 30 EA           LD HL, EA30     Addr. Load binary file
E9D5 D2 13 BD           JP NC, BD13     Binadrdat. ? d. MC BOOT PROGRAM
E9D8 CD A8 EB           CALL EBA8       otherwise load program
E9DB 2A 81 AE           LD HL, (AE81)   Pointer to program start
E9DE 18 11              JR E9F1         start program
E9EO CD 67 E7           CALL E767       Get line address
E9E3 D5                 PUSH DE         Save pointer to entry point
E9E4 CD AD D2           CALL D2AD       initialize cassette
E9E7 CD 8C C1           CALL C18C       delete variables
E9EA CD 7A C1           CALL C17A       Initialize basic pointer
E9ED CD 5E C1           CALL C15E       Printout select. and I / O init.
E9F0 E1                 POP HL          new program pointer
E9F1 23                 INC HL          Pass over zero at the end of the line
E9F2 F1                 POP AF          delete call address
E9F3 C3 93 DD           JP DD93         for interpreter loop
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:12, 09 June 21
That's great! I have too, check the code (https://www.cpcwiki.eu/forum/programming/asm-source-code/msg158311/#msg158311) and manage to create a new "run command" code, that now works for CPC464 and CPC6128 (and most probable CPC664, although i don't have one to test it  :D ):
Code: [Select]
kl_rom_select equ &B90F
org &7900
write"DIRECT_ROM.BIN" 
ld c,0
call kl_rom_select
ld a,(&c002)
cp 0
jp z,cpc_464
cp 1
jp z,cpc_664
jp &ea78+&1d        ;; run BASIC CPC6128
cpc_664:
jp &ea7d+&1d        ;; run BASIC CPC664
cpc_464:
jp &e9bd+&1d        ;; run BASIC CPC464

The above code is transferred to ram and executed from there using this code:

ld hl, run_code
ld de, &7900
ld bc, 27
ldir
jp &7900
Run_code:
defb 14,0,205,15,185,58,2,192,254,0,202,24,121,254,1,202,21,121,195,149,234,195,154,234,195,218,233


As i explained before,the offset i'm using is for skipping the first section (which is relevant to run from a BAS file) of Basic's "Run" routine, which i assume is the same for all 3 models, so i used the same offset.

New firmware update (_4b) with the following improvements:

- RSX commands: |SET,|COM,|WIFI,|TER,|GALA,|PACMAN,|KGOR are now executed directly on CPC464, without needing to give "RUN" anymore!

- SNA routine now checks if Amstrad has 64k only, and loads only the 1st 64k ram dump even if snapshot file is for 128k. The reason i did this is because i noticed that the snapshot archive has a lot of game files that are 128k but actually only the 1st 64k iis used, so now you will be able to load most of the SNA files on CPC464 too!

- Minor optimization of  board's ROM code this time:replace "cp 0" with "or A" , reduce the size of hex file by dumping initial zeros of arrays & variables used in routines transferred to RAM.

- Fix a small bug in |format routine- now shows correctly  formatted track numbers.

- Fix a bug in |2PC routine when use the "invert file selection" function.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: issalig on 22:48, 09 June 21
Maybe it is time for a fork with USIFAC support
https://github.com/yawor/m4board-enclosure
Somewhere in this thread someone has posted a 3d case. However it doesn't fit every Usifac II as I recognized. They differ slightly and I guess also the Reset-Button (or Pause?) has changed. And it doesn't close on its own, so I used some double-sided strip to keep the lid in place. Better than nothing though and it looks much better than the pure board.

Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 04:18, 10 June 21
New firmware update (_4b) with the following improvements:
Hi John

Well done
Ps I can now delete the Macintosh extra files that are added to a USB stick (Known as TURDS)
Thanks for that.
A small request Is it possible to sort the Cat EG:- a-z etc
Keep up the GOOD Work

Keep Safe
Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 11:18, 10 June 21
A small request Is it possible to sort the Cat EG:- a-z etc
I'm afraid usb host module doesn't allow that. Files/dirs will be shown in order of how they were initially written in usb flash drive, usually this is alphabetically anyway. But any new file saved will be added at the end of list.
In anycase, i thnk that using the filter argument of the |CAT (to filter the list of files taken), is what can really makes catalogue management ..."piece of cake"!  :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 15:43, 10 June 21
I've noticed when doing a CAT on a folder that a large number of said folders do not identify themselves with the <DIR> marker - And that any folder with a long name, and a period (.) in them, will incorrectly split their names - f.ex: "Dizzy. Amstrad Action Special Edition" will display as "DIZZY~1.AMS" which causes an error if trying to navigate to it with cd
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 15:52, 10 June 21
I'm afraid usb host module doesn't allow that. Files/dirs will be shown in order of how they were initially written in usb flash drive, usually this is alphabetically anyway. But any new file saved will be added at the end of list.
In anycase, i thnk that using the filter argument of the |CAT (to filter the list of files taken), is what can really makes catalogue management ..."piece of cake"!  :)


the filter is nice but inconvenient to use on a 464 though - that said, a proper file manager (please don't just bake it into the next fw) would be a gods-send
I feel like it'd be a "killer utility" for the usifac2 and massively improve an already fantastic device.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:41, 10 June 21
the filter is nice but inconvenient to use on a 464 though - that said, a proper file manager (please don't just bake it into the next fw) would be a gods-send
I feel like it'd be a "killer utility" for the usifac2 and massively improve an already fantastic device.
It would be most unlikely for such a utility as a file manager to be incorporated into fw, because there is almost no space in microcontroller program memory left :)
But if i may say, judging from my (rather time consuming...) personal experience, the Basic loader utlity already masisvely imrpoved the user experience with cpc464, as it practically eliminates the need of issuing rsx commands! You just have a bunch of BAS files to select from, and run directly!
And although filtering is a bit tiresome on a CPC464, still, is MUCH easier and faster to load a game, than doing it "manually", using rsx commands (and the "sadistic" way of issuing arguments on a cpc 464  :laugh: )!
 In fact, i believe that ,for collections of up to a few 100's of games, you don't need filtering anyway, as with a simple cat, you get pages of 25 games (BAS files) in less than a second, so, practically you can "Scan" your entire collection in a few seconds!  ;)

 In a more general perspective,i would say that a little bit of CLI typing in usage, always adds to the "nostlagia feeling" of using an  80's home micro Amstrad CPC in 2021. It's like a kind of a small "ritual"  :)
Αnd the same goes the "other way":
Just imagine in a few years from now...
"man, this file manager looks too boring and tedious anymore, why don't add vocal recognition for loading games?  Or even better, wouldn't be great if i could just think of a game, and amstrad instantly load it?"  (yes, yes, my "tech-freak" driven boredom and laziness shows no limit...) :P
Τoo much easines and conveniences, and you will certainly loose the... "feeling"!  ;D 
Unless you are too young and this really doesn't matter for you... :)

In the end, if someone wants to just load and play games, as fast and easy as possible, well... that's what Amstrad emulators are for!  :)



Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Devlin on 19:35, 10 June 21
Quote from: ikonsgr
It would be most unlikely for such a utility as a file manager to be incorporated into fw, because there is almost no space in microcontroller program memory left :)
That, is entirely fair, and if honest, a bit of a relief.


Quote
In the end, if someone wants to just load and play games, as fast and easy as possible, well... that's what Amstrad emulators are for!  :)
I did not buy a usifac ii, so I could play in an emulator.. I like my real hardware :)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 01:52, 11 June 21
I've noticed when doing a CAT on a folder that a large number of said folders do not identify themselves with the <DIR> marker - And that any folder with a long name, and a period (.) in them, will incorrectly split their names - f.ex: "Dizzy. Amstrad Action Special Edition" will display as "DIZZY~1.AMS" which causes an error if trying to navigate to it with cd
Unfortunately this is a constraint (all names are converted in 8.3 dos type, so better not have too "fancy" long file names :) ) & a bug (sometimes not identifying a directory name with <DIR>,this mostly happens when you have many sub dirs ) of the CH376 usb host module... ::)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: eto on 16:26, 11 June 21
all names are converted in 8.3 dos type

Btw: Is it possible to get the long file names? Even if it cannot be used for the RSX commands, for a menu application, they could be used to display a more meaningful name. 
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 18:28, 11 June 21
I'm afraid not. The 8.3 names is not something i make for "compatibility" reasons (as amstrad cpc also uses 8.3 filenames) but it's what the usb module actually responds to.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: roudoudou on 18:46, 11 June 21
hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)
is there softwares for Linux or documentation to create those softwares?
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 19:24, 11 June 21
Hello


Is there any way to create the DSK of current disk file into USB ?


Would you give us a program in BASIC or ASM or BIN?


Thank you.
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:15, 11 June 21
hi @ikonsgr (https://www.cpcwiki.eu/forum/index.php?action=profile;u=541)
is there softwares for Linux or documentation to create those softwares?
I think you should ask issalig as he has already develop some utilities on linux: https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/msg201894/#msg201894
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 20:37, 11 June 21
Hello
Is there any way to create the DSK of current disk file into USB ?
Would you give us a program in BASIC or ASM or BIN?
Thank you.

 For now, there is no such ability to create a dsk image from a floppy disk. But you can copy directly files from a floppy disk to a usb flash drive using |2PC.
 Such a utility would certainly need quite a lot of work to develop, as it would require to recreate the whole structure of an image file  (https://www.cpcwiki.eu/index.php/Format:DSK_disk_image_file_format), and for now i'm not thinking to get involved with that (i'm working on another project...  ;D )
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Fran123 on 09:52, 12 June 21
I thought it would be easier, reading a sector and writing it to the file
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: Audronic on 10:32, 12 June 21
(i'm working on another project...  ;D )
Hmmmmnnn I wonder what that is ?

Keep up the good work

Keep Safe
Ray
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: ikonsgr on 12:30, 12 June 21
@Audronic (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1169) ,it's a 512k ram expansion, but instead of the usual CPLD approach, i use (again  ;D ) a PIC mcu!  :)

@Devlin (https://www.cpcwiki.eu/forum/index.php?action=profile;u=389)  , i had some thoughts about the "most wanted" file manager, and i think it would be rather easy to convert the existed assembly code for |CAT RSX command to output the list of names into memory instead of the screen. Then, using BASIC i could take the data from there and create a table of strings for each name for further proccess. Unfortunately the Basic routine for this it's rather slow (it would take ~4-5 seconds to get each page), but i'm thinking of using Turbo basic compiler to speed things up  ;)
Title: Re: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!
Post by: TotO on 12:38, 12 June 21
The USIfAC II is a great expansion. May be the FDC emulation can be improved by 3rd party?