Detecting most common memory mappers

Page 1/2
| 2

By BadWolf359

Resident (33)

BadWolf359's picture

26-12-2022, 15:36

Hay guys,

What is the best way to write software for detecting the most common memory mappers? Not only if they exist but also their size. I've read the MSX Wiki - Memory mapper page but the information is a bit limited. Also: What are the most commonly used (and supported) memory mappers?

I was thinking of rewriting (later restoring) each first byte (incrementing) of a 16kb block in Slot3-2 while changing #99 and seeing if a prior used number shows up. I then could do the same for Slot1 & Slot2.
- Does that cover all bases?
- Or could this cause problems?
- Are there types of Memory Mappers that are easier detected so I can skip this procedure for them?
- Any other slots I should check? Like for Slot expanders etc.

I'm not planning to use MSX-DOS2 or any other software for this. I would like to find a (simple) way to do this in Assembler myself.

Would really like to see your creative solutions!

P.s.: Merry X-MAS!! ⛄ 🎄 🎅

Login or register to post comments

By ro

Scribe (4963)

ro's picture

26-12-2022, 19:57

By BadWolf359

Resident (33)

BadWolf359's picture

26-12-2022, 22:26

WOOPS! Actually I meant port #FC, #FD, #FE and #FF instead of "#99" in my post.

@ro: Thanx, this was about the idea I had myself, but this only uses the internal memory mapper.

By ro

Scribe (4963)

ro's picture

27-12-2022, 09:28

Hai, no it does not. This is a core function for counting maps in existing ram slot. You can use it for every type of ram slot.,internal, prim or sec slots. This code does not change slots.

I posted it for inspiration on how to count memory, and to confirm your idea. Read that topic why there's also a ram test built in. Smile

By Briqunullus

Hero (665)

Briqunullus's picture

27-12-2022, 09:50

Memory mappers are a great source of software incompatibilities. You can't read back mapper ports, so iterating is the only solution. And even then you'll need to consider mappers that aren't completely filled. Like that Panasonic machine ro is referring to. Or the Philips NMS8220. Those will give ram on some pages and gibberish on others.

By gdx

Enlighted (6213)

gdx's picture

27-12-2022, 10:30

Briqunullus wrote:

Memory mappers are a great source of software incompatibilities.

Less than slots. The bigger confusion was believing the false rumors that the I/O ports were readable.
The other mistake was to believe that the MSX2 system selects the memory mapper when it does not take it into account at all. It only initializes the order of the segments. These two beliefs were very widespread in the past.

By Briqunullus

Hero (665)

Briqunullus's picture

27-12-2022, 11:40

Yeah I should have said "great source of confusion" there. There are quite a few caveats along the way. And it can get tricky when there are multiple mappers in the system. But program well and you'll be fine.

By BadWolf359

Resident (33)

BadWolf359's picture

27-12-2022, 16:01

ro wrote:

Hai, no it does not. This is a core function for counting maps in existing ram slot. You can use it for every type of ram slot.,internal, prim or sec slots. This code does not change slots.

I posted it for inspiration on how to count memory, and to confirm your idea. Read that topic why there's also a ram test built in. Smile

Aha, I misunderstood the purpose then. Yeah, this should work for other mappers as well. Thanx!
But the next question should be: Which slots should I check for memory mappers besides 1, 2 and 32? Are there (common) mappers on other slots? And what if a slot expander is used?

By Briqunullus

Hero (665)

Briqunullus's picture

27-12-2022, 18:42

The internal mapper can be in any slot, not only in 3-2. For instance:

External mappers may or may not be in a slot expander. So in the end, you'll need to iterate all slots and all subslots.

By aoineko

Paladin (1002)

aoineko's picture

27-12-2022, 18:58

It would be surprising if there wasn't already assembly code to check for the presence of a RAM mapper in all slots/subslots, without using DOS.

By the way, are all the existing mappers visible on the 4 pages of the memory space?

By geijoenr

Champion (364)

geijoenr's picture

27-12-2022, 23:17

There is, I have done that. Is not complicated.

Just need to try all slots and subslots in a loop, writing and byte to check if is RAM then cycle over pages to find out the size.

Page 1/2
| 2