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.

breiztiger


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 ?

GUNHED

Quote from: breiztiger on 16:05, 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 (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

breiztiger

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

KaosOverride

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

Duke

#2254
Quote from: Swisstoni on 11:30, 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.

Quote from: breiztiger on 16:05, 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 ?

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 :)

KaosOverride



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...[emoji3]



Enviado desde mi SM-G950F mediante Tapatalk

KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Duke

Quote from: KaosOverride on 17:18, 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:

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 :)

breiztiger

Thanks Duke


I'll test this asap

trocoloco

Quote from: Swisstoni on 11:30, 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?


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

Duke

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


Stwert

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

Stwert

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.

cpcoldie

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



Duke

#2263
@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.

ComSoft6128

#2264
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

cpcoldie

#2265
@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!

Duke

Quote from: cpcoldie on 17:11, 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.


Duke


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:

        ; 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   



Quote from: cpcoldie on 17:11, 09 December 18
But is there a short controlled way to synchronize the romslots.bin with the flash?

cpcoldie

Quote from: Duke on 08:41, 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

Duke

#2269
M4 Firmware v2.0.5 beta 5 now available.
Download here: http://www.spinpoint.org/cpc/M4FIRM_v205b5.zip
Unpack to root of microSD card and powercycle CPC. *1

Fixes:
SNA loader pen 0 bug (Thanks @krusty)
SNA screen mode bug (Thanks @abalore)

Addition:
Preliminary SNA v3 support (compressed snapshots). It's tad slower than non compressed one - will make it faster if anyone gives a .... :)

If you don't care about the above, wait updating. I hope to fix/add some more over the xmas holidays.


*1, new alternative download method for betas, use your CPC directly like this:

|httpget,"spinpoint.org/BETA.BAS"
RUN"BETA.BAS

XeNoMoRPH

Quote from: Duke on 11:56, 23 December 18
M4 Firmware v2.0.5 beta 5 now available.
Download here: http://www.spinpoint.org/cpc/M4FIRM_v205b5.zip
Unpack to root of microSD card and powercycle CPC. *1

Fixes:
SNA loader pen 0 bug (Thanks @krusty)
SNA screen mode bug (Thanks @abalore)

Addition:
Preliminary SNA v3 support (compressed snapshots). It's tad slower than non compressed one - will make it faster if anyone gives a .... :)

If you don't care about the above, wait updating. I hope to fix/add some more over the xmas holidays.


*1, new alternative download method for betas, use your CPC directly like this:

|httpget,"spinpoint.org/BETA.BAS"
RUN"BETA.BAS

Black Screen for me after update ... I have returned to the previous version Beta 3
your amstrad news source in spanish language : https://auamstrad.es

Duke

Quote from: XeNoMoRPH on 07:43, 24 December 18
Black Screen for me after update ... I have returned to the previous version Beta 3
Thanks for testing.
Be aware that while the ESP firmware is updating, the screen will be black for 1-2 mins, so if you do not wait this time the update will not succeed.
When the upgrade begins of ESP, the red/green led will flash,  then be ON steady, once the led turns off, upgrade is finished. So one should not powercycle while the red/green led is ON.

XeNoMoRPH

1. Bakckup M4 folder from microSD      2. deleted M4 folder from microSD           3. updating  Firmware .. mission successfully            4. Restore M4 folder backup to microSD to get configuration
:P
your amstrad news source in spanish language : https://auamstrad.es

Duke

Quote from: XeNoMoRPH on 09:41, 24 December 18
1. Bakckup M4 folder from microSD      2. deleted M4 folder from microSD           3. updating  Firmware .. mission successfully            4. Restore M4 folder backup to microSD to get configuration
:P

Good. Next version will feature a generated report.txt of the upgrade process.
I noticed one mistake I had, if the CRC of the ESP upgrade failed, it would still erase the ESP flash, although not program it.
So that is probably what happened.

Duke

#2274
M4 Firmware v2.0.5 beta 6 now available.
Download here: http://www.spinpoint.org/cpc/M4FIRM_v205b6.zip
Unpack to root of microSD card and powercycle CPC. *1


       
  • Fix do not erase ESP flash, if CRC error in ESPFIRM.BIN

       
  • Added RSX command |ROMSOFF (requested by  @breiztiger), to disable all running roms.
Parameters can be added: |ROMSOFF, except rom slot, 0=do not reset, 1=reset.
This is useful if you ie. want to run a game from M4 that does not like other roms enabled (himem), if M4 is slot 6 you can disable all others like this:
|ROMSOFF,6,1
To disable all roms of M4, just type |ROMSOFF
All roms will be re-enabled as they were when pressing M4 reset or power cycling the CPC.

       
  • Added upgrade report, that is generated in root of microSD, called report.txt
This will help diagnose if anything went wrong when upgrading.
Please paste contents here (or pm me) if anything went wrong.
For v2.0.5 beta 6, it should look like this if succesful:

M4 Firmware version 2.0.5B6
ESP firmware v2.0.5B6 found.
ESP flash: 0x00C84016
ESP CRC match: 0xBA3A0F08
Programming...
ESP programming success


*1 Or use alternative download method for betas, directly via your CPC like this:

|httpget,"spinpoint.org/BETA.BAS"
RUN"BETA.BAS

If you have already downloaded "BETA.BAS" you can in the future just type RUN"BETA"  to retrieve latest beta firmware.


@SOS
Quote
Feature-Request for M4ROM:
Function "fio_jvec()"  ("fio jump vector" / #CD30):
Exit the function with "jp #be7f" (like #CD49 in CPC6128-AMSDOS). :)
I wanted to add this, but not good for CPC464 ;)

Powered by SMFPacks Menu Editor Mod