Yamaha CX5M memory questions

By EgonOlsen71

Supporter (7)

EgonOlsen71's picture

23-02-2021, 10:37

Being a MSX newbee, I'm trying to understand MSX 1 memory configurations, especially the one of my CX5M. I already understood some of it (I think...) but there are some questions remaining, which I couldn't find an answer to.

What I have and know:

My CX5M has 32KB of on board RAM. If I'm using it as a barebone machine, then that's all there is. Simple!

I then purchased a 64 KB expansion cartridge/PCB from raphnet. That replaces the 32KB of internal memory with the 64KB on the cart, giving me a total of 64KB. That's obviously the case, because now I can run 64K games from tape/MSX2CAS. So far, so good.

Then I purchased one of these 512KB MemoryMapper/MegaROM carts. Because I don't have another mapper nor 128 KB, I can't use the MegaROM option of that cart. Ok, got that as well. But I can use the mapper, which will be configured by Nextor when I'm booting from my SDCard. That seems to work fine as well, a simple test program in BASIC shows that there is a mapper present and that it has a total of 512KB. I can run VGMPLAY as well, which requires more memory...so all is good here.

But from here on, it becomes a bit hazy...

I ran TESTMEM with the 512KB MM cart only. It reports 64KB of base memory and 512 via the mapper. I assume that the 64KB of base memory are actually mapper memory mapped onto the slots, because my MSX doesn't have 64KB on board. Why it doesn't subtract this from the available 512KB is beyond me, but maybe that's on purpose. So my first question is:

1.) Is it true, that the mapper extends my base memory to 64KB or is this just some faulty reading from TESTMEM?

Then, I tried to launch the "Auf Wiedersehen Monty" ROM via Sofarun, which failed with a message that my device has only 32 KB of RAM available which isn't sufficient to launch the game. This leads to my second question:

2.) When launching a ROM via Sofarun, what happens to the mapper RAM? Is still available or is it disabled? I assume the latter, because why would Monty fail otherwise if TESTMEM reports 64 KB of base memory when the mapper is active!?

Next step...because my MSX has one cartridge slot only, I made myself a simple adapter to plug my 64KB expansion into the rear expansion slot, which is basically a male cartridge port. That works fine, the machine sees and utilizes the 64 KB just as before if I'm not using the mapper cartridge.

When using both cartridges together, it doesn't seem to affect the TESTMEM readings, which I expected somehow...I guess... However, it does affect the Monty-ROM. If I'm starting this one now, it reports that my machine has 128+ KB of RAM. Which indicates that either Monty is reading nonsense here or that all of a sudden, now the mapper in active (in addition to or as a replacement of my 64KB expansion) and the ROM sees all the memory. So question 3 is:

3.) If I'm using the mapper in combination with the expansion, how much RAM am I supposed to have when launching a ROM via Sofarun. 64KB or 512KB via the mapper?

And my final question:

4.) Is it even possible to detect the amount of slot-based, MSX1 style base memory in a machine once a mapper is configured? And is it even possible to use this memory? Does a 64KB machine (native or via expansion) plus a 512 KB mapper actually result in a 576 KB configuration or are the 64KB "wasted" in that case?

Login or register to post comments

By Briqunullus

Champion (293)

Briqunullus's picture

23-02-2021, 13:31

Whoa, that's a lot of text. Maybe it's a good idea to take a look at the slot map, which can be found near the bottom of the Wiki page of the CX5M.

Each slot can address 64K. The machine's internal RAM is only 32K in slot 0, with the other 32K of this slot filled with ROM. The cartridge slot is slot 1, and the expansion bus is slot 2.

A memory mapper fills one slot and has 64K available in that slot. Then it can swap out pages of 16K to make use of the full 512K, yet still 64K will only be visible at any one time. So depending how you look at it, a memory mapper is 64K and 512K at the same time.

By EgonOlsen71

Supporter (7)

EgonOlsen71's picture

23-02-2021, 13:50

Ok, so given that the ram expansions resides in the expansion slot (via the adapter) and the mapper is in the cartridge slot, I now have 32 KB in slot 0 (which we can ignore...can we?), 64 KB in slot 2 (the memory expansion) and the mapper's 64 KB (out of 512 KB) in slot 1, because it resides in the cartridge slot. Correct?

But what happens, if I start a ROM via Sofarun? What's actually active then? If it would be the mapper in slot 1, I shouldn't get the 32 KB message from it, should I?. But if it's the expansion in slot 2, I should only get a message about 64 KB, not "more than 128". This whole slot concept is really confusing, especially because I found no diag program whatsoever that clearly tells me the configuration across all slots. TESTRAM tells me, that I have 64 KB in slot 1, subslot 3 (which is obviously the mapper's RAM) and that the mapper's 512 KB are also in 1,3...but that's about it. No word about what is in slot 0 or 2.
Is there some tool that does this properly?

By NYYRIKKI

Enlighted (5691)

NYYRIKKI's picture

23-02-2021, 15:16

If you have 32kB internal memory, 64kB external memory and 512kB memory mapper, in theory nothing prevents you from using all of the 608kB you have... How ever ready made software that could actually do it are practically not existing.

- DOS2/Nextor only supports memory mappers, so for it this 32kB and 64kB RAM are not usable RAM and only the 512kB memory mapper will be used.

- Cassette games (or games that were originally in cassette) usually use the 32kB that BASIC has found and usually they just expect that rest of the 64kB memory is in same slot... If it is not, tough luck. Some games how ever do the RAM search the hard way and detect each page separately... Those should work although the 32kB in slot 0 may still confuse the game so that it loses access to BIOS and crashes because of that. In some other cases they fail to load just because the RAM is in "wrong slot" ie. expanded slot instead of primary slot.

- Disk games usually use the RAM that disk ROM has found. This should give pretty problem free 64kB RAM setup. In case of MegaROM crack etc. mapper expecting software without DOS2 support usually expects that the "primary memory" (=the memory that disk ROM has found) is memory mapper... In your case it is unlikely the case unless you do something.

- Modern ROM-loaders are usually much more aware of the MSX memory mess and have complex mechanisms to prevent problems. Since the different configurations can be pretty much anything, I don't wonder if they fail here and there.

All after all although in theory more memory is better, in practice it is not the case as the world around us is really long way from perfect. These 32kB and 64kB together with 512kB memory mapper cause more trouble than good. Moving the 64kB RAM to collector's shelve and building a switch to disable internal RAM is most likely best you can do. After that your RAM is still on expanded slot, so this does not solve all of the possible memory problems in MSX universe, but it is already a lot less confusing for the programs around. General rule of thumb is that older programs behave worse than newer programs.

If you need more information, this page might be good place to start:
https://www.msx.org/wiki/MSX_compatibility_problems

Quote:

No word about what is in slot 0 or 2. Is there some tool that does this properly?

You may want to try these:
http://www.tiny-yarou.com/slotchecker.html
http://www.msxvillage.fr/upload/msxmem2_slot.zip

By EgonOlsen71

Supporter (7)

EgonOlsen71's picture

23-02-2021, 15:49

Thank you for your comprehensive explanation. The memory situation is really confusing for MSX newbies (or at least, it was for me). This makes it somewhat clearer. The ROM compatibility with my setup is somewhat ok. Some ROMs work, some don't, but the "important" ones usually do work. So far, I haven't seen a difference between using or not using the 64KB in slot 2 in combination with the mapper. Tape images loaded via MSX2CAS usually work with the mapper turned off and the 64 KB expansion plugged in. Tape images loaded via Sofarom usually don't work at all for me with some exceptions, so I've given up on loading them this way. Next, I'll try some dsk-images to see how that goes. After all, this MSX stuff has been an interesting journey so far... Smile

By Briqunullus

Champion (293)

Briqunullus's picture

23-02-2021, 17:49

Hell yeah, I can see how things throw you off. But I think you're getting the picture. DOS2/Nextor will load itself into higher memory mapper pages, so the lower 64K is fully available for all software that doesn't (want to) know about memory mappers in the first place.

Indeed, the 64K expansion in slot 2 will always be ignored if you have the mapper in slot 1.

And finally, it's the 32K in slot 0 that confuses some software. If they expect RAM to be in a single slot and if they start searching in slot 0 then they will come to false conclusions.

By Manuel

Ascended (17484)

Manuel's picture

23-02-2021, 18:48

@Nyrikki I believe MemMan will actually be able to use all that RAM. But I don't think it was made for MSX 1.

By Briqunullus

Champion (293)

Briqunullus's picture

23-02-2021, 19:54

MemMan can indeed use non memory mapped memory, but it can't provide the segments in page 3. So that rules out the upper 16K of both the 32K internal and the 64K expansion. Smile

By NYYRIKKI

Enlighted (5691)

NYYRIKKI's picture

23-02-2021, 21:20

Yes, this can be VERY confusing...

The thing is that Z80 can point 64kB of memory and they divided it in to 4 (16k) pages... Each of these page can point to a different slot. There are 4 of those... So far so good and pretty simple... How ever they very soon figured out that 4 slots are not enough, so they allowed each of the slots to be divided in to 4 sub-slots, so that you can in theory have maximum of 4*4 (=16) slots. Each page on each slot can have RAM, ROM, I/O device, it can be unused or be some combination of these... and then the memory mapper logic is added on top of this... If it is not just "dummy" RAM, but memory mapper RAM, it means that the visible RAM can be selected out of maximum of 256 blocks. So in Z80 address space there is page that is a window to slot that can be a window to subslot that can be a window to some RAM block. This memory mapper also made it possible to map same RAM block to any page as the block numbers are identical on all pages... This last is actually very handy, but if this combination does not confuse a newbie, I don't know what will.

The thing is that MSX standard left all doors open for HW developers and then people came and walked trough all of the doors. As you might imagine even finding RAM to all of the 4 pages in this kind of tree structure can be quite an adventure game for a programmer. Also if he wants to use the memory mapper functionality across the pages he needs to make sure the pages are mapped to same memory mapper slot... but at the same time no one has promised that all pages on any slot would contain RAM if you don't have memory mapper (Like in this CX5M where only pages 2 and 3 on slot 0 have RAM from factory), but it is also possible that there are multiple memory mappers connected to the system... For example one cartridge port can have 4 sub-slots that each have 256-page (4MB) memory mapper that means one cartridge can have 16MB of memory mapper RAM. You can now maybe better understand why these things cause so many troubles in practice.

Manuel wrote:

@Nyrikki I believe MemMan will actually be able to use all that RAM. But I don't think it was made for MSX 1.

Yes, I was maybe a bit careless to say "practically not existing". I know there is also some CP/M version that can use other slot memory as RAM disk... I believe I've also seen some disk copy program that uses at least somewhat clever RAM detection... but what I meant is that in typical daily use it is not realistic to expect that all memory can be used when it is in multiple parts between slots.

By Manuel

Ascended (17484)

Manuel's picture

24-02-2021, 00:34

You're totally right. And the best thing would be to remove all the normal RAM from the MSX and only use the memory mapper RAM, indeed. A bit nasty though.

By EgonOlsen71

Supporter (7)

EgonOlsen71's picture

24-02-2021, 08:02

Manuel wrote:

And the best thing would be to remove all the normal RAM from the MSX and only use the memory mapper RAM, indeed. A bit nasty though.

Maybe, but I'm not going to do that. I bought a MSX to experience the hardware, the platform and this particular model itself and if it's a part of that, that the memory configuration can be the source of some incompatibilities, then so be it. As long as I (roughly) understand what's going on and that it's not a hardware fault of the machine that some things won't work, I'm fine.