Author Topic: Amstrad CPC WiFi  (Read 330724 times)

0 Members and 1 Guest are viewing this topic.

Offline luismcv

  • CPC464
  • **
  • Posts: 16
  • Country: gb
  • Liked: 5
  • Likes Given: 0
Re: Amstrad CPC WiFi
« Reply #1275 on: 15:46, 04 February 17 »
Originally it was one of my main plans (TFM kindly provided me with raw FDC disc I/O code for this purpose). When I started to look at it, I realized much more work would be needed on the Z80 side, especially with all the copyprotected discs, I kinda lost the motivation and since no-one was asking for it...
If you want to have a go, it would be great.
Well, I was thinking about something simpler, just using AMSDOS routines to write to the disc and for standard formats. Although now that I think about it, it might not be that useful as most of these discs' contents can probably just be copied at file level. Anyway, I'll try to find time to do some research about discs formats and copy protections (and if/how DSK files support them) even if it's just out of curiosity and see if I can encourage myself to try to write something.

I've talked about this before, I am not that good with javascript for the PC side, if anyone wants to help out, I'll gladly provide whatever functions needed (http requests), but parsing all the stuff in javascript and output it in html for a nice file tree, is not for me :)
I see. Javascript is not my thing either. But even a simple http call that accepts a path would be useful, at least for hot swapping disc images, and could be easily called with curl or similar from a command line. And if you also add another to list the files and directories, it would allow anyone that feels like it to implement something more elaborate in Javascript, scripting or even some native UI for their favorite OS.

I will not at this time release my core sources, I have a few more projects lined up relying on this,

Fair enough, was just wondering.

For what it is worth, this is what I am working on currently in hardware terms for the cpc:
M4 lite. Same as M4 board, but without WiFi/USB, just romboard and mass storage + 64/128 memory expansion. I am pretty far with this, but having a big issue with the extended RAM, reading is perfect, but for some reason I always get the ram WR going through to the base memory, at first I thouht I wasn't asserting RAMDIS quick enough, but that's not it. I put the scope on, the LA and not found the reason yet. In the process of going through the 464 schematics step by step. If I don't solve that, it'll be canned. Otherwise it was intended as play games/whatever for CPC464/664 at low cost.
Would this memory expansion emulation ported to the original M4? That would be great.


That being said every GPIO on the board is labelled, there's JTAG header and SWDIO, the datasheet is available and you can go right on programming it. And I'll be helpful if any info needed.
As for the extra connector, yes there is quite a few things, there's a serial port, it would be trivial to add a serial interface and use those pins from the CPC, there's a SPI interface aswell (though more tricky) and a bunch of GPIO's available.
Probably too much for me to start from scratch, but if I did:

    - Any risks of causing a catastrophic short between the M4 board and CPC and frying one or the other? Or are all the inputs and outputs current limited?

    - I think I read you put a protected boot loader on the STM that will always update the firmware from the SD card. So it should be almost impossible to end with a totally bricked board? And this same mechanism should be also enough to upload any experimental and alternative firmware, no need to use JTAG or anything else to program the flash?

Thank you very much!

Offline luismcv

  • CPC464
  • **
  • Posts: 16
  • Country: gb
  • Liked: 5
  • Likes Given: 0
Re: Amstrad CPC WiFi
« Reply #1276 on: 15:50, 04 February 17 »
YANCC for M4DOS will support that.
I will release it in a few days.

I didn't know about your project. Niiice. I used Norton Commander on MSDOS back then, and I still use Midnight Commander for some things on MacOS and Linux.

Offline Johnny Olsen

  • Supporter
  • CPC6128
  • *
  • Posts: 231
  • Country: dk
  • Liked: 152
  • Likes Given: 280
Re: Amstrad CPC WiFi
« Reply #1277 on: 02:49, 05 February 17 »
Hi

All the "disc missing" messages in games are because the game itself reinit the amsdos rom (and only this rom), then the M4 rom stop working and the cpc come back to drive A to read the game... for example all the "xor" cracks and some other cracks (velus, etc), do this thing. I've been changing all the call #BCCE (reinit rom 7) to call #BCCB (reinit all the roms) and the 90% of this games start to work!


Have you tried to patch the jump block and redirect the call &bcce to call &bccb rather than patch a lot of game ?

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1278 on: 05:56, 05 February 17 »
Would this memory expansion emulation ported to the original M4? That would be great.
Probably not, I don't have the resources for it with the other stuff going on, and my initial gpio config wasn't ideal, meaning more precious clock cycles to do it.
Quote
Probably too much for me to start from scratch, but if I did:

    - Any risks of causing a catastrophic short between the M4 board and CPC and frying one or the other? Or are all the inputs and outputs current limited?

    - I think I read you put a protected boot loader on the STM that will always update the firmware from the SD card. So it should be almost impossible to end with a totally bricked board? And this same mechanism should be also enough to upload any experimental and alternative firmware, no need to use JTAG or anything else to program the flash?

There should be very little chance of frying anything hardware wise, if some contention is created for very long periods, I dunno. I have crashed it all 1000's of times, all CPC's still alive :)
And yeah the write protected bootloader should make it brick safe and of course you don't need to use jtag or st-link, just place the M4FIRM.BIN file on the microSD.
Though you can get a ST-Link (clone) for a few bucks, it sure beats moving the microSD around when testing :)
« Last Edit: 05:58, 05 February 17 by Duke »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1279 on: 15:45, 05 February 17 »
And a small update.

M4 Firm V2.0.1 online (use |upgrade command or download from here: http://www.cpcwiki.eu/index.php/M4_Board#Firmware
- Fix (again) for |era and |ren (thanks @SOS).
- Added |FCP command to copy between microSD and floppies.

|FCP,"src","dest"

Examples to copy all files from a 3" floppy in drive A.
|mkdir,"myfloppy"     <- create a directory (not needed of course)
|cd,"myfloppy"
|fcp,"A:*", "C:"         <- copies all files from A to myfloppy directory. Only wildcard supported is one * for all files.
You can also just copy single files and even change the destname.
|fcp,"A:myfile.bin", "C:myfile.new"

To copy a DSK file contents to floppy A:
|cd,"somedisk.dsk"
|fcp,"*","A:"

Drive B can be used too (untested), tape is not properly supported yet, but single filecopy to/from may work. (Tape is referenced with letter T:).

See screenshots for examples aswell.

Oh and of course to use this, you must have M4 rom below AMSDOS (ie. rom6) and do not enable the modified lowerrom.

Also note that the copy function uses a bit of ram (&8000 to &9AB6).
« Last Edit: 16:07, 05 February 17 by Duke »

Offline wilco2009

  • CPC664
  • ***
  • Posts: 102
  • Country: es
  • Liked: 50
  • Likes Given: 46
Re: Amstrad CPC WiFi
« Reply #1280 on: 19:16, 05 February 17 »
 :) :) :)


The new FCP command sounds great!


Thanks again.

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1281 on: 19:42, 05 February 17 »

...by copying a binary file from a DSK to a real Disc I got a error message after starting the file "Line too long"? (Header transfer problem?)


The tool grows better and better :)
« Last Edit: 19:49, 05 February 17 by HAL 6128 »
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1282 on: 20:02, 05 February 17 »
...by copying a binary file from a DSK to a real Disc I got a error message after starting the file "Line too long"? (Header transfer problem?)


The tool grows better and better :)
Thanks for testing, can you mail me the .dsk so I can check, the ones I tried could boot from floppy afterwards.

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1283 on: 20:35, 05 February 17 »

It's from the "defence" game (disk.bin).
By the way, since version 2. the game don't start from SD anymore. Weird.
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1284 on: 21:03, 05 February 17 »
It's from the "defence" game (disk.bin).
By the way, since version 2. the game don't start from SD anymore. Weird.
Thanks, just tried and yes... Will investigate :/
You sure the "since version 2" is not a himem problem again? (Freeware defence.dsk v1.02 runs fine from the SD card here).

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1285 on: 21:39, 05 February 17 »

You sure the "since version 2" is not a himem problem again? (Freeware defence.dsk v1.02 runs fine from the SD card here).
hmpff... forgot, yes! :picard2: :picard: :doh:
« Last Edit: 21:43, 05 February 17 by HAL 6128 »
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline luismcv

  • CPC464
  • **
  • Posts: 16
  • Country: gb
  • Liked: 5
  • Likes Given: 0
Re: Amstrad CPC WiFi
« Reply #1286 on: 00:43, 06 February 17 »
Probably not, I don't have the resources for it with the other stuff going on, and my initial gpio config wasn't ideal, meaning more precious clock cycles to do it.

Not sure I understand, aren't all the GPIOs the same? Anyway, this reminds me to ask: what's the mapping between the M4 GPIOs and the CPC expansion port?


Though you can get a ST-Link (clone) for a few bucks, it sure beats moving the microSD around when testing :)

Good point :) I had a look on ebay a definitely worth it.

Thanks once again!

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1287 on: 00:57, 06 February 17 »
Not sure I understand, aren't all the GPIOs the same? Anyway, this reminds me to ask: what's the mapping between the M4 GPIOs and the CPC expansion port?
Pretty much, though there is a few differences. Each GPIO port is mapped into 16 bits (GPIOA, GPIOB, GPIOC, GPIOD, GPIOE etc) and can be read/written in one instruction (ldrh/strh). So the more GPIO ports you have to read/write the more cycles it takes, ie. read A15-A0, read D7-D0 (two ports already) + important control signals like mreq, rd, wr, iorq, romen etc. Then flip bus direction (hi wasted cycles), then drive appropriate signals. Though the Z80 is slowmo compared to the Cortex-M4 you only have a certain amount of nanoseconds to do the important bits (like setting romdis or ramdis, driving datalines). While you can do most instructions in 1 cycle (6.25 ns) on the Cortex, writing GPIOS, addressing memory, doing jumps can take much more(up to 5 cycles). So every instruction counts :)

EDIT: Forgot the 2nd part of your question, if you look at the expansion connector on M4Board you will see labels like PE0,PE1....PD0 etc, those are the GPIO ports of the Cortex (PORT 'X' pin 'Y').
 
« Last Edit: 01:04, 06 February 17 by Duke »

Offline SOS

  • Supporter
  • CPC6128
  • *
  • Posts: 299
  • Country: de
  • Identity lost
    • index.php?action=treasury
  • Liked: 201
  • Likes Given: 178
Re: Amstrad CPC WiFi
« Reply #1288 on: 07:33, 06 February 17 »
Have i missed something?
What makes the new |wifi-RSX?

Offline XeNoMoRPH

  • 6128 Plus
  • ******
  • Posts: 539
  • Country: es
  • " ... in space no one , can hear you scream ... "
  • Liked: 1076
  • Likes Given: 932
Re: Amstrad CPC WiFi
« Reply #1289 on: 09:40, 06 February 17 »
Hi Duke !!! .. I just sent MP for buy one M4 board for me , thx :)

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1290 on: 09:54, 06 February 17 »
Have i missed something?
What makes the new |wifi-RSX?
|wifi,0 powers off wifi.
|wifi,1 powers it on again.

Offline Mrisopure

  • CPC464
  • **
  • Posts: 4
  • Country: es
    • youtube
  • Liked: 0
  • Likes Given: 0
Re: Amstrad CPC WiFi
« Reply #1291 on: 22:53, 06 February 17 »
Hello, hello, I'm interested in an M4 board, Duke, I'll send you an MP to place the order.

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1292 on: 23:13, 06 February 17 »

Compability grows: With |DISC command and PDOS1.2 in ROM7 you can enter the |DRIVE command and the GUI of PDOS and you are able to work with it. I have a 3,5 inch disc on B. So I can use 720kByte (also in CP/M with RAMDOS.COM). The |CPM command also works if |DISC is applied before.
Applying the |FCP command you are able to copy files onto or from a real 720kByte (ROMDOS1) disc. I've tested it with another game (Vector) and it works fine.
Nice work!


(Would be great to have a CPM driver, but I assume then the SD card has to be partioned in order to use both possibilities :))
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1293 on: 00:04, 07 February 17 »

Just another thought and I didn't dare to try it.
After changing with |CD into a DATA formatted DSK image, I was able to read a sector (sector 0) into RAM from the DSK image.
Is it possible to copy that sector to a real disc after applying the |DISC command?
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1294 on: 00:30, 07 February 17 »
Just another thought and I didn't dare to try it.
After changing with |CD into a DATA formatted DSK image, I was able to read a sector (sector 0) into RAM from the DSK image.
Is it possible to copy that sector to a real disc after applying the |DISC command?
Yes it should be possible. Sector read/writing is supported to the DSK image, but yes it would a |DISC to change to real disc, so probably software to do it is lacking :)

Offline HAL 6128

  • 464 Plus
  • *****
  • Posts: 491
  • Country: de
    • index.php?action=treasury
  • Liked: 243
  • Likes Given: 1213
Re: Amstrad CPC WiFi
« Reply #1295 on: 00:35, 07 February 17 »
Just tried it and it works :) (and destroyed the directory of my real disc :picard: ).
It is possible to copy a disc image to a real disc. The only thing is, always to switch between |disc (writing) and |sd (reading).
...proudly supported Schnaps Demo and Pentomino, NQ-Music-Disc with GFX

Offline wilco2009

  • CPC664
  • ***
  • Posts: 102
  • Country: es
  • Liked: 50
  • Likes Given: 46
Re: Amstrad CPC WiFi
« Reply #1296 on: 22:02, 07 February 17 »

|REN command is not working or I am doing something bad. It allways return the same error "Error ocurred."


For instance, I have a file in root directory called "NETSET.BAS", I'am trying to rename it with |REN,"NETSET.BAS","NET.BAS" but it allways returns the same error.


It happends for every file that I have tried.

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.138
  • Country: dk
    • spinpoint.org
  • Liked: 1226
  • Likes Given: 918
Re: Amstrad CPC WiFi
« Reply #1297 on: 22:43, 07 February 17 »
|REN command is not working or I am doing something bad. It allways return the same error "Error ocurred."


For instance, I have a file in root directory called "NETSET.BAS", I'am trying to rename it with |REN,"NETSET.BAS","NET.BAS" but it allways returns the same error.


It happends for every file that I have tried.
Try |ren,"NET.BAS","NETSET.BAS"            It's "newfilename" , "oldfilename"

Offline wilco2009

  • CPC664
  • ***
  • Posts: 102
  • Country: es
  • Liked: 50
  • Likes Given: 46
Re: Amstrad CPC WiFi
« Reply #1298 on: 01:02, 08 February 17 »
Thanks,  :picard:


I have read the command description a lot of times and I didn't see it.

Offline Joseman

  • 6128 Plus
  • ******
  • Posts: 780
  • Country: es
  • Liked: 628
  • Likes Given: 429
Re: Amstrad CPC WiFi
« Reply #1299 on: 00:25, 09 February 17 »
Hi @Duke

in my (almost) day by day work with the wonderful (yes i said it again) M4, i found something strange...

This time is with the simulator game Gunship, i found a cracked version of it, the game can save the pilot achievements and then you can load the pilot other day and continue playing with it...

This crack version uses the firmware to load and save the pilot (i don't know if the original game uses the firmware to do this too, i doubt it), with the M4 you go and save the pilot (you can choose the name of the pilot), the game saves the pilot and the game hangs... ok, you can think that the pilot was not saved but, if you reset the game and load the pilot, the pilot is loaded correctly!! (you know that because  you can use random names for the pilot and when you load, the name that  you chose is there!).

Summarizing, the M4 hangs the game saving a file with firmware, but it loads correctly and the game plays correctly...

If none of the two worked i could think that the game was incompatible with the M4 (for all the things we know), but when the save doesn't work correctly but the load works... mmmm... i suspect on a posible bug on the save method?

i can upload the game and if you want take a look on it?

P.D.: the crack use call #BCCB from the start i didn't change it