Author Topic: [M4Board + XMem] Can M4 ROM be installed on the XMem? [Resolved: Answer is NO!]  (Read 841 times)

0 Members and 1 Guest are viewing this topic.

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
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!
« Last Edit: 13:52, 09 February 21 by m_dr_m »

Offline SOS

  • Supporter
  • 464 Plus
  • *
  • Posts: 385
  • Country: de
  • Identity lost
    • index.php?action=treasury
  • Liked: 252
  • Likes Given: 276
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #1 on: 08:01, 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

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.028
  • Country: fr
    • urban exploration
  • Liked: 1397
  • Likes Given: 831
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #2 on: 09:25, 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
use RASM, the best assembler ever made :p

I will survive

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.907
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 3003
  • Likes Given: 1802
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #3 on: 09: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?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #4 on: 13: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 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, ...).

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #5 on: 13:51, 09 February 21 »
wwwhhhaaaaaaaaaaaaaattt? 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.

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.244
  • Country: dk
    • spinpoint.org
  • Liked: 1452
  • Likes Given: 1151
Re: [M4Board + XMem] Can M4 ROM be installed on the XMem?
« Reply #6 on: 14:04, 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.

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
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.


Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
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.

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.

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.244
  • Country: dk
    • spinpoint.org
  • Liked: 1452
  • Likes Given: 1151
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/

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
Line 1262 you can see how I display the RMR / MMR / ROMsel on the screen by reading the SNA config.
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!!).

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.

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
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).

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.510
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1200
  • Likes Given: 2822
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.

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

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.244
  • Country: dk
    • spinpoint.org
  • Liked: 1452
  • Likes Given: 1151
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.

Offline genesis8

  • CPC6128
  • ****
  • Posts: 241
  • Country: fr
    • Genesis8 Amstrad Page
  • Liked: 87
  • Likes Given: 56
____________
Amstrad news site at Genesis8 Amstrad Page

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.244
  • Country: dk
    • spinpoint.org
  • Liked: 1452
  • Likes Given: 1151
Where can firmware 3.16 be downloaded ?
Not sure where I downloaded it, but attached it to this post.

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.154
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 1073
  • Likes Given: 779
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcomed !

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.154
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 1073
  • Likes Given: 779
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcomed !

Offline m_dr_m

  • CPC6128
  • ****
  • Posts: 193
  • Country: se
  • http://orgams.wikidot.com/
    • OrgaMS!
  • Liked: 118
  • Likes Given: 132
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 !).

Offline zhulien

  • 6128 Plus
  • ******
  • Posts: 639
  • Country: au
  • aka Vorax
    • 8bitology
  • Liked: 265
  • Likes Given: 248
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.