CPCWiki forum

General Category => Applications (CPC and CPC-related) => Topic started by: m_dr_m on 02:29, 09 February 21

Title: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: m_dr_m on 02:29, 09 February 21
I wonder if the M4-ROM, installed by default on ROM 6 on the M4, can be installed on the XMem.


Goal: get the full ROM range 0-63, and be able to access to transfer files from M4's SD to XMass (CubeMDos).



Here what I tried:
- M4: Start at 32
- M4: M4ROM at 64 ("Enabled", but I guess it doesn't change anything)
- The lowrom is the standard firmware.
- XMEM: M4ROM at 6.
Once this one ^^ burned, the CPC crashes at boot (change screen offset + freeze). Even if I unplug the M4.


I'm curious whether someone managed to setup a similar configuration.


Have a wonderful day!
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: SOS on 07:01, 09 February 21
Quote from: m_dr_m on 02:29, 09 February 21
I wonder if the M4-ROM, installed by default on ROM 6 on the M4, can be installed on the XMem.

...
- XMEM: M4ROM at 6.
Once this one ^^ burned, the CPC crashes at boot (change screen offset + freeze).
Simple "No"
The M4-ROM is on the M4-Card an writable ROM, it's more a RAM as a ROM.
The ARM writes the data of the result-phase in the M4-ROM, so the M4-ROM can only be installed on a M4-Card, never on an other ROM-Board
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: roudoudou on 08:25, 09 February 21
Quote from: SOS on 07:01, 09 February 21
Simple "No"
The M4-ROM is on the M4-Card an writable ROM, it's more a RAM as a ROM.
The ARM writes the data of the result-phase in the M4-ROM, so the M4-ROM can only be installed on a M4-Card, never on an other ROM-Board
wwwhhhaaaaaaaaaaaaaattt? the ROM is not a ROM?  :o
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: TotO on 08:41, 09 February 21
I have set the X-MEM and M4 on a 464 with M4ROM at ROM7 and other ROM from 32 to 63.
But, I'm pretty sure to have used the M4ROM as ROM6 on an X-MEM in the same way with a CPC6128 when the M4 was released.
Does the M4ROM was no more a ROM but a "dirty hack" of the memory since?
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: m_dr_m on 12:44, 09 February 21
Thanks 🆘!


Too bad there isn't a check + nice error message (also, the screen crash is weird, I would have expected an infinite loop at worse). 
Since @Duke (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1624) has released the source (great move), maybe I should add that myself!


I guess the only option then is to use the modified low ROM which detect the M4ROM at a place > 31.
By the way, I plan to make a customisable version of this lower firmware. Check the upcoming thread!


Thanks TotO for the input! Yes I imagine the rewritable feature enabled some fancy stuff (status, persistence, ...).
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: m_dr_m on 12:51, 09 February 21
Quote from: roudoudou on 08:25, 09 February 21wwwhhhaaaaaaaaaaaaaattt? the ROM is not a ROM?

Each time the M4 is reset, the 512k ROM dump (/m4/romslots.bin on the SD) is loaded into ARM's flash, if I understand correctly.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
Post by: Duke on 13:04, 09 February 21
Quote from: m_dr_m on 12:51, 09 February 21
Each time the M4 is reset, the 512k ROM dump (/m4/romslots.bin on the SD) is loaded into ARM's flash, if I understand correctly.
The romslots.bin is only used when a new rom is added/changed, rest of the time the ARM flashrom keeps the rom.
It's used when reflashing, because the sector erase on the ARM flashrom is in 128KB size, and I do not have 128KB (available) RAM to store its contents in when erasing and rewriting a sector. So its kind of shadow file.

SOS is correct about the M4 rom, it is loaded into the ARM's RAM, so it can change dynamically, there's even a command to write to the ROM contents. Same goes for the "HACK menu" rom, its also stored in RAM.

As for combing all rom slots of XMEM and M4 is to either use slot 7 for the M4 rom (as XMEM does not map it, but some CPC's dont like it) or yes, hacking the modified lowerrom to use a higher slot.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: m_dr_m on 13:12, 09 February 21
Totally makes sense, thanks!


About the hack feature: is there some documentation to hack the hack? I'd like to either:
- Read the current MMR / RRM for soft breakpoints.
- Be able to replace the hack menu by Orgams's monitor / step by step debugging trace mode.


Well, same possibility than with Multiface II.

Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: m_dr_m on 13:17, 09 February 21
Quote from: Duke on 13:04, 09 February 21SOS is correct about the M4 rom, it is loaded into the ARM's RAM, so it can change dynamically, there's even a command to write to the ROM contents. Same goes for the "HACK menu" rom, its also stored in RAM.

Now that I think of it, couldn't the M4ROM loads itself (at regular ROM init time) into the ARM RAM?
In that way it could come from any rom board (as long as the M4Board is present!!).

It's not a request, I just like to understand the technical limitations.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: Duke on 14:05, 09 February 21
Quote from: m_dr_m on 13:12, 09 February 21
About the hack feature: is there some documentation to hack the hack? I'd like to either:
- Read the current MMR / RRM for soft breakpoints.
- Be able to replace the hack menu by Orgams's monitor / step by step debugging trace mode.
Only the source code and the thread I started here with a brief explanation of its workings.
https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/m4-board-hack-menu-source-code/ (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/m4-board-hack-menu-source-code/)

As for RMR/MMR it is stored in the "SNA config" at offset 0x100 of the hack rom (this is a dynamic area that reflects hardware registeres at the time of invoking the hackmenu)
In the source code:
https://github.com/M4Duke/m4hackmenu/blob/master/nmirom.s (https://github.com/M4Duke/m4hackmenu/blob/master/nmirom.s)
Line 1262 you can see how I display the RMR / MMR / ROMsel on the screen by reading the SNA config.
Quote from: m_dr_m on 13:17, 09 February 21Now that I think of it, couldn't the M4ROM loads itself (at regular ROM init time) into the ARM RAM? In that way it could come from any rom board (as long as the M4Board is present!!).

Sure, that would be possible. Already it checks for "M4ROM.BIN" in root of microSD card, this will be loaded instead of the embedded rom if present (so this is what you use to easily make your own modifications).
Using the C_ROMWRITE command you could load a replacement from anywhere and overwrite it at runtime if wanted. Still it has to fit in the CPC rom map without colissions with XMEM, so not sure it helps much.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: m_dr_m on 14:12, 10 February 21
Thanks a lot! That will be fun to hack.


Oh, last question (until the next): is there similar restriction/gotcha about the Lower ROM?
I've tried to put FW315FR.ROM (of XMEM fame) as Low ROM in slot 31, the CPC wouldn't boot at all (no signal on my screen, so I guess it doesn't even reach CRTC init).
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: GUNHED on 15:27, 10 February 21
At my 6128plus setup I do use the M4 card with the 4 MB RAM expansion. Works fine.


And for the CPC6128 I use the X-MEM + Y-MEM (no this is not mathematics...). Works fine too.

Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: Duke on 18:32, 10 February 21
Quote from: m_dr_m on 14:12, 10 February 21
Oh, last question (until the next): is there similar restriction/gotcha about the Lower ROM?
I've tried to put FW315FR.ROM (of XMEM fame) as Low ROM in slot 31, the CPC wouldn't boot at all (no signal on my screen, so I guess it doesn't even reach CRTC init).
There is no restriction on the lower ROM.
I think FW315 may have dependency on the X-MEM being there(ramdisk?). FW316 works fine IIRC.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: genesis8 on 19:11, 10 February 21
Where can firmware 3.16 be downloaded ?

3.12 is at https://www.cpcwiki.eu/index.php/Firmware_3.1 (https://www.cpcwiki.eu/index.php/Firmware_3.1) and 3.15 at https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/firmware-3-1-megaflash/msg91505/#msg91505 (https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/firmware-3-1-megaflash/msg91505/#msg91505)
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: Duke on 19:59, 10 February 21
Quote from: genesis8 on 19:11, 10 February 21
Where can firmware 3.16 be downloaded ?
Not sure where I downloaded it, but attached it to this post.
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: Ast on 20:00, 10 February 21
3.16 : https://cpcrulez.fr/hardware-memoire-interface_ROM-x-mem.htm (https://cpcrulez.fr/hardware-memoire-interface_ROM-x-mem.htm)
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: Ast on 20:01, 10 February 21
Same time @Duke (https://www.cpcwiki.eu/forum/index.php?action=profile;u=1624)
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: m_dr_m on 20:38, 10 February 21
Thank you very much!


I retried with 3.16, works like a charm.
I guess I did a bad manipulation last time (despite double checking the uploaded ROM and the absence of conflict).
Or maybe it was some bad interaction with my other cards (for now the M4 is isolated !).
Title: Re: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]
Post by: zhulien on 14:56, 12 February 21
With most of the other threads about DMA and the CPC they generally say DMA on CPC is impossible, i would definitely consider the M4 as having DMA - just not in the typical sense - and because it writes directly to the rom space (which is RAM from the M4's point of view and of course still memory from the CPC's point of view).  I think quite a bit of other hardware could benefit from the same or similar arrangements.  I believe some form of video streaming should be possible with the M4 because of the DMA.
Powered by SMFPacks Menu Editor Mod