Author Topic: Amstrad CPC WiFi  (Read 254186 times)

0 Members and 2 Guests are viewing this topic.

Offline breiztiger

  • CPC464
  • **
  • Posts: 18
  • Liked: 22
Re: Amstrad CPC WiFi
« Reply #2250 on: 17:05, 07 November 18 »

ok i think so


do you think we can have a commandline like |m4off to disable all rom from m4 and run stock cpc without disconnect the hardware ?

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 721
  • Country: de
  • Reincarnation of TFM
  • Liked: 344
Re: Amstrad CPC WiFi
« Reply #2251 on: 17:40, 07 November 18 »
do you think we can have a commandline like |m4off to disable all rom from m4 and run stock cpc without disconnect the hardware ?


Use: |M4ROMOFF

http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2018.08.23)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Ver.: 2018.08.15)

Offline breiztiger

  • CPC464
  • **
  • Posts: 18
  • Liked: 22
Re: Amstrad CPC WiFi
« Reply #2252 on: 17:48, 07 November 18 »
Sorry but if you read my request you see that m4romoff disconnect only m4 rom but no other roms

Modified lowerrom for example is alway present

Offline KaosOverride

  • 464 Plus
  • *****
  • Posts: 303
  • Country: es
  • Liked: 190
Re: Amstrad CPC WiFi
« Reply #2253 on: 18:08, 07 November 18 »
You can switch off, extract the MicroSD, switch on and use |m4romoff

Enviado desde mi SM-G950F mediante Tapatalk

KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2254 on: 18:14, 07 November 18 »
Im a new Amstrad owner and ive recently purchased one of these boards I'm really impressed with it, one question though is there a loader available with long file name support?
Do you mean a file selector of some sort ?
If you just want to display long filenames and use them basic there is |ls command.

do you think we can have a commandline like |m4off to disable all rom from m4 and run stock cpc without disconnect the hardware ?

Sure, it will be easy to add.
For now you can do as @KaosOverride said.
Or write a little basic program that renames m4/romconfig.bin & m4/romslots.bin. Then have another program that copies them back (|copyf...) to their correct filenames.

Ie.
10 |ren,"m4/romconfig.old", "m4/romconfig.bin"
20 |ren,"m4/romslots.old", "m4/romslots.bin"
30 |m4romoff

save"romsoff.bas"

10 |copyf,"m4/romconfig.old", "m4/romconfig.bin"
20 |copyf,"m4/romslots.old", "m4/romslots.bin"
30 ?"powercycle cpc"
save"romson.bas"

Not tested either, but should work :)
« Last Edit: 18:17, 07 November 18 by Duke »

Offline KaosOverride

  • 464 Plus
  • *****
  • Posts: 303
  • Country: es
  • Liked: 190
Re: Amstrad CPC WiFi
« Reply #2255 on: 18:18, 07 November 18 »


Quote from: Duke
Or write a little basic program that renames m4/romconfig.bin & m4/romslots.bin. Then have another like program that copies them back (|copyf...) to their correct filenames.

I was thinking about this when using different hardware combinations like 464 and 6128 so one romset can be rom7 for M4 and other for rom6 + amsdos...



Enviado desde mi SM-G950F mediante Tapatalk

KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2256 on: 18:45, 07 November 18 »
I was thinking about this when using different hardware combinations like 464 and 6128 so one romset can be rom7 for M4 and other for rom6 + amsdos...

This is possible but requires a bit more work, because the romslots.bin is only a shadow file of the contents in flashrom.
So to use different rom configs (ie. from other people too), a little program to change the flags of the romconfig.bin file is needed.
In C (on PC) it would look like this:
Code: [Select]
typedef struct
{
    int    totalRoms;
    int    m4RomNum;
    int    m4RomEnable;
    int    romRangeStart;
    int    lowerEnable;
    int    lowerSlot;
    unsigned int reserved[2];
} _romConfigHeader;

typedef struct
{
    char updateflag;            // 0=disabled, 1 = enabled, 2 = new, 3 = remove
    char    name[32];
} _romConfig;

int main(int argc, char** argv)
{    FILE *fd;
    int i;
    unsigned char *buf;   
           
      fd = fopen("romconfig.bin", "rb");
      buf = (unsigned char *)malloc(1088); //32 + 32*33
    fread(buf, 1088, 1, fd);
    fclose(fd);

    _romConfigHeader *rh = (_romConfigHeader *)&buf[0];
    _romConfig *rc = (_romConfig *)&buf[sizeof(_romConfigHeader)];
   
    for (i=0; i < rh->totalRoms; i++)
        rc[i].updateflag = 2;        // 0=disabled, 1 = enabled, 2 = new, 3 = remove
           
      fd = fopen("romconfig.new", "wb");
      fwrite(buf, 1088, 1, fd);
      fclose(fd);
    free(buf);
   
    return 0;
}
Then all the rom slots will be put into flashrom.
It could be written in basic too with some poking, I guess, if someone fancies it :)

Offline breiztiger

  • CPC464
  • **
  • Posts: 18
  • Liked: 22
Re: Amstrad CPC WiFi
« Reply #2257 on: 19:55, 07 November 18 »
Thanks Duke


I’ll test this asap

Offline trocoloco

  • CPC664
  • ***
  • Posts: 106
  • Country: es
  • Liked: 36
Re: Amstrad CPC WiFi
« Reply #2258 on: 18:23, 08 November 18 »
Im a new Amstrad owner and ive recently purchased one of these boards I'm really impressed with it, one question though is there a loader available with long file name support?


I think that what you are looking for is in this link, it is in spanish though but very easy to use.
http://amstrad.esy.es

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2259 on: 11:07, 11 November 18 »
Forgot to mention.

Over time some people asked me if it was possible to change their M4 board with EDGE connector to IDC, after acquiring a MotherX4 or similar, so some months ago I made a simple adapter for it.

Price is:
Assembled, 4 euro
Self assembled, 3 euro (pcb + right angle IDC connector)

I know it's not cheap, so attached the gerbers here, feel free to make it yourself, sell it on ebay etc.
Notice when you solder on the IDC connector, the "IDC" label has to point downwards (see RED arrow on pic).


Offline Stwert

  • CPC464
  • **
  • Posts: 4
  • Country: scotland
  • Liked: 9
Re: Amstrad CPC WiFi
« Reply #2260 on: 12:32, 19 November 18 »
Hi,


I don't post much, actually I think this is my first. So, hello everyone. I'm around here often re-learning everything I've forgotten over the years  :doh:


Anyway, having recently received Duke's (really) superb M4 board, I wanted to get it into an enclosure to protect it, but being the fussy type, couldn't find one I wanted.


So here's my take on an M4 Enclosure, I'm sure there's probably tons I've missed but what the hey.
This was designed around the latest Rev 2.5 board, so how that relates to older boards I don't know.


No screws needed, clips together nicely with all of the necessary holes where they should be and a couple of buttons.
The lid obviously goes with the "chimney's" facing into the case, they're just to help keep the buttons where they should be.


Suggestions welcome, other than shove it up your  :o  I know that one  :laugh:
I'll likely keep tweaking it when I have time, the buttons are a teeny bit wobbly still.


Excuse the photo's, my office is a mess because I'm refitting it, so my photo box is...... somewhere.


And yeah, the top of my enclosure is a mess, I removed it while still hot because I have no patience and I need to go to the shop for more Monster  ;D


Cheers.
« Last Edit: 16:35, 19 November 18 by Stwert »

Offline Stwert

  • CPC464
  • **
  • Posts: 4
  • Country: scotland
  • Liked: 9
Re: Amstrad CPC WiFi
« Reply #2261 on: 13:36, 19 November 18 »
Sorry for the double post, I’m on my mobile and the damn thing won’t let me scroll to edit.


Anyway, it occurs to me that some people might like to put a brim/skirt around the buttons for stability, but not everything else. It was fine when I printed, but y’know depends on so many factors.


Anyway, if anyone would like to do that just let me know and I’ll put up individual stl’s.


Cheers.

Offline cpcoldie

  • CPC464
  • **
  • Posts: 3
  • Country: at
  • Liked: 1
Re: Amstrad CPC WiFi
« Reply #2262 on: 23:54, 08 December 18 »
Hi fellows!
I'm a new and proud owner of a brand new M4 Board.Many thanks to Duke for this very cool piece of hardware.
But I have some issues and sometimes very funny behaviors.I played with the M4 with a handfull sd cards to test some roms.One really funny behavior:
I tried out  some combinations and ended up with [screenshot1].
This works mostly.
Then I tried out some different combinations with another sd with the DES Roms.
Ok, not really well but the DES starts without M4 support.
Then I inserted the former sd. There is no DES rom on it.
And... The cpc starts with.... DES! :o :D
Hmmm...
And it dosen't matter in which way  I reboot the cpc (M4 reset, cpc reset, switch off/on ...)
But the web gui shows the correct rom list of sreenshot1.
Reinserting the sd with the DES roms and deleting the roms with the webgui stops this behavior.

Does the M4 cache the roms?


« Last Edit: 23:59, 08 December 18 by cpcoldie »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2263 on: 08:06, 09 December 18 »
@cpcoldie

romslots.bin on the microSD is only a shadow file of the contents inside the MCU chip, so swapping romconfig.bin and romslots.bin from other configurations will only give weird results.

The romconfig.bin file tells which roms are activate (and their names in the webui).
The romslots.bin is as said a shadow file, it is only used, when roms are updated. Reason for this is that the flash sectors in the MCU chip are 128KB large, meaning a full sector erase has to be done, whenever a small 16KB rom is replaced, here is where the "shadow" contents are used.
« Last Edit: 08:10, 09 December 18 by Duke »

Offline ComSoft6128

  • ..................................
  • Supporter
  • 6128 Plus
  • *
  • Posts: 759
  • Country: scotland
  • CPC THEN CPC NOW
    • index.php?action=treasury
  • Liked: 819
Re: Amstrad CPC WiFi
« Reply #2264 on: 09:42, 09 December 18 »
I can't comment on using DES with the M4 as I haven't used that combination yet.
What I can tell you is that DES waits until all other Roms have initialised and then displays the DES interface. So if you have DES stored in an unusual location this is probably why you are getting this result. Also, you might find the DES user manual and the programmers guide helpful, these are available here:


http://www.cpcwiki.eu/index.php/Desktop_Environment_System

Cheers,

Peter
« Last Edit: 10:04, 09 December 18 by ComSoft6128 »

Offline cpcoldie

  • CPC464
  • **
  • Posts: 3
  • Country: at
  • Liked: 1
Re: Amstrad CPC WiFi
« Reply #2265 on: 18:11, 09 December 18 »
@Duke
Thanks for this explaination, it is clearifying some behaviors.
But is there a short controlled way to synchronize the romslots.bin with the flash?
   Now to something different.
I have tried out to compile some bcpl code with the rom based compiler.
Working with the real disc works flawlessly but with the sd there are some header problems.
Also with Maxam and Protext saving some text to the sd.
Will investigate further this issues.

@ComSoft6128
Thanks, I read the user manual but what is "an unusual location"?

Greetings!
« Last Edit: 18:44, 09 December 18 by cpcoldie »

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2266 on: 22:12, 09 December 18 »
But is there a short controlled way to synchronize the romslots.bin with the flash?
I posted a few messages back how this is done, but of course it's not a short method, since you would have to compile a program on a PC and run it from there.
If I have the feel tomorrow I will knock it together a cpc version, which you can just run to import roms from a different config.

Quote
Now to something different.

I have tried out to compile some bcpl code with the rom based compiler.

Working with the real disc works flawlessly but with the sd there are some header problems.

Also with Maxam and Protext saving some text to the sd.

Will investigate further this issues.
Please provide feedback on this issue, early on I used protext/maxam quite a lot for testing various routines I wrote and headers were flawless.


Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 965
  • Country: dk
    • spinpoint.org
  • Liked: 921
Re: Amstrad CPC WiFi
« Reply #2267 on: 09:41, 11 December 18 »

Here is a native CPC program to use other people's (or sd cards) M4 rom configuration:

Unpack the m4reconf.bin to the /M4 directory of the microSD.
Copy whatever romslots.bin and romconfig.bin you want to use to the /M4 directory aswell.
Run"m4reconf.bin"
Power cycle CPC and done.

Here is the source code:
Code: [Select]
        ; M4 rom re-config
        ; To assemble use RASM assembler
        ; Duke - 2018
       
        org    0x4000
        nolist

km_wait_key        equ 0xBB18
txt_output        equ 0xBB5A
txt_set_column    equ 0xBB6F
scr_reset        equ    0xBC0E
scr_set_ink        equ    0xBC32
scr_set_border    equ    0xBC38
cas_in_open        equ 0xBC77
cas_in_close    equ 0xBC7A
cas_in_char        equ 0xBC80
cas_out_open    equ 0xBC8C
cas_out_close    equ 0xBC8F
cas_out_char    equ 0xBC95
kl_init_back    equ 0xBCCE

        ; re-init M4rom
   
        ld de,0x40
        ld hl,0xB0FF
        call 0xBCCB
       
        ; setup screen
       
        ld a,2           
        call scr_reset        ; set mode 2
        xor a
        ld b,a
        call scr_set_border
        xor a
        ld b,a
        ld c,b
        call scr_set_ink
        ld a,1
        ld b,26
        ld c,b
        call scr_set_ink

        ld    a,20
        call txt_set_column
        ld    hl,txt_title
        call wrt
       
        ; read romconfig.bin
       
        ld    hl,filename
        ld    de,buf
        ld    b,13        ; "romconfig.bin"
        call cas_in_open
        jp    nc,file_err
        ld    hl, buf2
        ld    bc,1088        ; file len
fread_loop:
        call cas_in_char
        ld    (hl),a
        inc    hl
        dec    bc
        xor    a
        cp    c
        jr    nz, fread_loop
        cp    b
        jr    nz, fread_loop
       
        call cas_in_close
       
        ; display 'active' roms and set the flag so they are re-flashed on power cycle
       
        ld    ix,buf2
        ld    b,(ix)        ; number of roms (either 16 or 32)
        ld    de,32
        add    ix,de        ; skip header
        inc    de
rom_loop:
        ld    a,(ix)
        cp    1
        jr    nz, rom_not_used
        push de
        push ix
        pop    hl
        push bc
        inc hl            ; point to rom name
        ld de,text_buf
        ld bc,32
        ldir
        pop bc
        pop de
        ld hl,text_buf
        call wrt
        ld hl,txt_reen
        call wrt
        ld (ix),2        ; set rom to NEW
rom_not_used:
        add    ix,de        ; +33
        djnz rom_loop
       
        ; save the modified romconfig.bin
       
        ld hl,filename
        ld de,buf
        ld b,13        ; "romconfig.bin"
        call cas_out_open
        ld hl,buf2
        ld bc,1088        ; file len
fwrite_loop:
        ld    a,(hl)
        call cas_out_char
        inc hl
        dec bc
        xor a
        cp c
        jr nz, fwrite_loop
        cp b
        jr nz, fwrite_loop
       
        call cas_out_close
done:
        ; display done
       
        ld hl,txt_done
        call wrt
        jp    km_wait_key
file_err:
        ld    hl,txt_file_err
        call wrt
        jp    km_wait_key
wrt:
        ld    a,(hl)
        or    a
        ret    z
        call txt_output
        inc    hl
        jr    wrt
       
filename:
        db "romconfig.bin"
txt_title:
        db "M4 rom reconfig - Duke 2018",10,13,10,13,0
txt_file_err:
        db "Error M4 romconfig.bin not found!",10,13,0
txt_reen:
        db " re-enabled.",10,13,0
txt_done:
        db 10,13,10,13,"Done! Power-cycle CPC",0

text_buf:
        ds 33,0
       
buf:    ds 2048,0
buf2:    ds 1088,0   


But is there a short controlled way to synchronize the romslots.bin with the flash?

Offline cpcoldie

  • CPC464
  • **
  • Posts: 3
  • Country: at
  • Liked: 1
Re: Amstrad CPC WiFi
« Reply #2268 on: 18:54, 11 December 18 »
Here is a native CPC program to use other people's (or sd cards) M4 rom configuration:
Hi Duke,

Thank you very much!
Unfortunately at the moment I am very busy at work but will try this ASAP.

Cheers