News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Duke

Amstrad CPC WiFi

Started by Duke, 07:36, 07 May 16

Previous topic - Next topic

0 Members and 7 Guests are viewing this topic.

luismcv

Quote from: Duke on 20:09, 03 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.

Quote from: Duke on 20:09, 03 February 17
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.

Quote from: Duke on 20:09, 03 February 17
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.

Quote from: Duke on 20:09, 03 February 17
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.


Quote from: Duke on 20:09, 03 February 17
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!

luismcv

Quote from: SOS on 21:05, 03 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.

Johnny Olsen

Quote from: Joseman on 22:15, 02 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 ?

Duke

#1278
Quote from: luismcv on 14:46, 04 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 :)

Duke

#1279
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).

wilco2009

 :) :) :)


The new FCP command sounds great!


Thanks again.

HAL6128

#1281

...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 :)
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Duke

Quote from: HAL 6128 on 18: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 :)
Thanks for testing, can you mail me the .dsk so I can check, the ones I tried could boot from floppy afterwards.

HAL6128


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 Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Duke

Quote from: HAL 6128 on 19: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.
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).

HAL6128

#1285

Quote from: Duke on 20:03, 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:
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

luismcv

Quote from: Duke on 04:56, 05 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?


Quote from: Duke on 04:56, 05 February 17
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!

Duke

#1287
Quote from: luismcv on 23:43, 05 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').

SOS

Have i missed something?
What makes the new |wifi-RSX?

XeNoMoRPH

Hi Duke !!! .. I just sent MP for buy one M4 board for me , thx :)
your amstrad news source in spanish language : https://auamstrad.es

Duke

Quote from: SOS on 06:33, 06 February 17
Have i missed something?
What makes the new |wifi-RSX?
|wifi,0 powers off wifi.
|wifi,1 powers it on again.

Mrisopure

Hello, hello, I'm interested in an M4 board, Duke, I'll send you an MP to place the order.

HAL6128


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 Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

HAL6128


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 Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Duke

Quote from: HAL 6128 on 23:04, 06 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 :)

HAL6128

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 Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

wilco2009


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

Duke

Quote from: wilco2009 on 21: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.
Try |ren,"NET.BAS","NETSET.BAS"            It's "newfilename" , "oldfilename"

wilco2009

Thanks,  :picard:


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

Joseman

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

Powered by SMFPacks Menu Editor Mod