Author Topic: USIfAC II:Convert a PC or USB stick to Amstrad HDD,access dsk's,and many more!  (Read 37238 times)

archcosmo and 1 Guest are viewing this topic.

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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?
« Last Edit: 21:16, 07 May 21 by ikonsgr »

Offline issalig

  • CPC464
  • **
  • Posts: 47
  • Country: es
  • Liked: 29
  • Likes Given: 47
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

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


Enjoy.


Option B just from bash (simple but effective):https://github.com/issalig/cpc/blob/main/sw/usifac_receive.sh
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
« Last Edit: 08:28, 28 May 21 by issalig »

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
Another "3rd party support" for USIfAC II, Great!  :)

Offline issalig

  • CPC464
  • **
  • Posts: 47
  • Country: es
  • Liked: 29
  • Likes Given: 47
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 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!

Offline kolleykibber

  • CPC664
  • ***
  • Posts: 50
  • Country: gb
  • Liked: 39
  • Likes Given: 31
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 and Ewen of Ewenterm for giving me some fun with this!
« Last Edit: 18:33, 21 May 21 by kolleykibber »

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
@kolleykibber, 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 )

Offline kolleykibber

  • CPC664
  • ***
  • Posts: 50
  • Country: gb
  • Liked: 39
  • Likes Given: 31
Thanks @ikonsgr. 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 :)


Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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!
« Last Edit: 10:18, 25 May 21 by ikonsgr »

Offline Fran123

  • CPC664
  • ***
  • Posts: 60
  • Country: es
  • Liked: 11
  • Likes Given: 0

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/ftLkZxq



++
Phil





Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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:

  [ You are not allowed to view attachments ]  

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 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.... ::)
« Last Edit: 10:32, 29 May 21 by ikonsgr »

Offline entelle42

  • Speccy
  • *
  • Posts: 2
  • Country: fr
  • Liked: 2
  • Likes Given: 25
@ikonsgr 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

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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 :)

Offline entelle42

  • Speccy
  • *
  • Posts: 2
  • Country: fr
  • Liked: 2
  • Likes Given: 25

@ikonsgr , 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.
« Last Edit: 13:43, 29 May 21 by entelle42 »

Offline Devlin

  • CPC664
  • ***
  • Posts: 139
  • Country: gb
    • Magicbane
  • Liked: 66
  • Likes Given: 22
Sent an email - These look super cool!


(here we go!!!)
« Last Edit: 12:15, 30 May 21 by Devlin »
Amstrad fan! | CPC464 + USIfAC II | Administrator of Amstrad Discord : https://discord.gg/ksWvApv

Offline darkhalf

  • CPC464
  • **
  • Posts: 16
  • Country: au
    • Nistune
  • Liked: 7
  • Likes Given: 0

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

CPC6128, 2xCPC464, C64, A500

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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.
« Last Edit: 11:19, 31 May 21 by ikonsgr »

Offline darkhalf

  • CPC464
  • **
  • Posts: 16
  • Country: au
    • Nistune
  • Liked: 7
  • Likes Given: 0
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

CPC6128, 2xCPC464, C64, A500

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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 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.
« Last Edit: 22:39, 03 June 21 by ikonsgr »

Offline eto

  • Supporter
  • 464 Plus
  • *
  • Posts: 430
  • Country: de
  • Liked: 272
  • Likes Given: 243

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 .


« Last Edit: 00:12, 04 June 21 by eto »

Offline Fran123

  • CPC664
  • ***
  • Posts: 60
  • Country: es
  • Liked: 11
  • Likes Given: 0
Hello,


How much current does USIFAC II need to work?


Thank you

Offline Devlin

  • CPC664
  • ***
  • Posts: 139
  • Country: gb
    • Magicbane
  • Liked: 66
  • Likes Given: 22

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
« Last Edit: 14:44, 07 June 21 by Devlin »
Amstrad fan! | CPC464 + USIfAC II | Administrator of Amstrad Discord : https://discord.gg/ksWvApv

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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

Offline Devlin

  • CPC664
  • ***
  • Posts: 139
  • Country: gb
    • Magicbane
  • Liked: 66
  • Likes Given: 22
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.
« Last Edit: 20:52, 07 June 21 by Devlin »
Amstrad fan! | CPC464 + USIfAC II | Administrator of Amstrad Discord : https://discord.gg/ksWvApv

Offline ikonsgr

  • 6128 Plus
  • ******
  • Posts: 559
  • Country: gr
    • ikonsgr 80's Home Micros WorkBench
  • Liked: 564
  • Likes Given: 108
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  and with a basic loader for easy access:)
« Last Edit: 23:00, 07 June 21 by ikonsgr »

Offline Devlin

  • CPC664
  • ***
  • Posts: 139
  • Country: gb
    • Magicbane
  • Liked: 66
  • Likes Given: 22
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 :)
Amstrad fan! | CPC464 + USIfAC II | Administrator of Amstrad Discord : https://discord.gg/ksWvApv