Multiple memory mappers in MSX system

Page 1/2
| 2

By Eugeny_Brychkov

Paragon (1232)

Eugeny_Brychkov's picture

03-05-2010, 21:43

Is it supported? For example, several memory boards with 512K RAM in slots 3.1 and 3.2?
To my knowledge mapper works through ports 0FCh-0FFh, but can not figure out how to control multiple mappers through these ports (if ever possible).

Login or register to post comments

By MsxKun

Paragon (1115)

MsxKun's picture

03-05-2010, 23:11

It is. I think MSX-DOS2 can manage it with no problem.
Without DOS2, using the ports, I think the ports work with the mapper you have switched on the visible slot... if you wanna manage other one, switch its slot, and then use ports as usual.
The difficult part was page 3, where system area is, and all the subslot thingy, maybe. I forgot a lot about memory mappers since I'm used to ROM Tongue But it was possible.

By RetroTechie

Paragon (1563)

RetroTechie's picture

03-05-2010, 23:35

To my knowledge mapper works through ports 0FCh-0FFh, but can not figure out how to control multiple mappers through these ports (if ever possible).
Writing to ports FC~FFh selects mapper block for all mappers in the system simultanious, each mapper keeps its own copy of these registers. Reading from ports FC~FFh returns the value kept by the largest mapper in the system (as in: with the most significant bits), as far as the mappers that are present, support reading back from those regisers (not all mappers do, and programmers should never read these registers, really). You select which mapper by switching the slots they're in. It's more a software management / detection / hardware support issue.

Usually a single 1024K mapper would be more useful than 2x 512K mappers, and >4 MB? I have yet to see a useful application for that... Hannibal

By Eugeny_Brychkov

Paragon (1232)

Eugeny_Brychkov's picture

04-05-2010, 01:40

Reading from ports FC~FFh returns the value kept by the largest mapper in the system (as in: with the most significant bits)
Is there any schematic example?
You select which mapper by switching the slots they're in. It's more a software management / detection / hardware support issue
Again, interesting how it can be realized in hardware.
Usually a single 1024K mapper would be more useful than 2x 512K mappers, and >4 MB? I have yet to see a useful application for that... Hannibal
It was just an example... I guess megaram/megarom/scc memory mappers use other means to switch pages than fc-ff?

By Jipe

Paragon (1604)

Jipe's picture

04-05-2010, 12:35

choise the mapper bank with &HFFFF
if you have a philips you know poke -1,170 , a sony poke -1,255 and a panasonic poke -1,0
with combination port A8 and adress &HFFFF you can use all mappers banks

By Eugeny_Brychkov

Paragon (1232)

Eugeny_Brychkov's picture

04-05-2010, 13:16

choise the mapper bank with &HFFFF
if you have a philips you know poke -1,170 , a sony poke -1,255 and a panasonic poke -1,0
with combination port A8 and adress &HFFFF you can use all mappers banks

So it seems to be enough to use expanded slot selection signal, right?

By flyguille

Prophet (3031)

flyguille's picture

04-05-2010, 13:42

No, mappers of FC-FF is normaly write only, the software well writed will works always, include BIOS/BASIC.

If you reads the FC-FF ports, you will gets the native mapper values, because all external mappers is supposed to be write only.

indeed if two mappers sends values on a read, the values will crash in the bus, mixing it, and you will read inconsistent data.

So any software developed for multiple mappers will use write-only for external mappers.

----------------------------------------------------------

How knows the soft if it is a mapped memory and not just plain RAM? , just testing RAM values on each switching.

By flyguille

Prophet (3031)

flyguille's picture

04-05-2010, 13:45

how it can be realised in hardware, it is just Two chips 74ls670 TTL logic.

PD: the sub-slot selector (aka FFFFh) has nothing to do with mappers, it is just part of the MSX engine that is the sub-slot selector, it has nothing to do with the mapper/ram module in cartridge, so, you only want to watch the SLTSEL signal of the msx cartridge's bus.

By Eugeny_Brychkov

Paragon (1232)

Eugeny_Brychkov's picture

04-05-2010, 13:59

How knows the soft if it is a mapped memory and not just plain RAM? , just testing RAM values on each switching.
I do not understand, sorry.

PD: the sub-slot selector (aka FFFFh) has nothing to do with mappers, it is just part of the MSX engine that is the sub-slot selector, it has nothing to do with the mapper/ram module in cartridge, so, you only want to watch the SLTSEL signal of the msx cartridge's bus.
Thus writing to FC-FF will change values of all the mappers. In case of two mappers used by two programs (for example, one is in "foreground" and another in interrupt background), interrupt code, after changing FC-FF values, should return them back and only then return execution to the foreground code. That's not possible without reading the port, however can use current mirror FC-FF values stored in some memory.

By RetroTechie

Paragon (1563)

RetroTechie's picture

04-05-2010, 15:18

The memory mapper mechanism is just a 'layer' of logic on top of normal MSX slot select mechanism. And in normal speak: "memory mapper" = the RAM kind, "mapper" = any type of mapper (RAM, ROM mapper, SCC etc), depending on context.

How knows the soft if it is a mapped memory and not just plain RAM? , just testing RAM values on each switching.
I do not understand, sorry.

For all possible blocks: write block# to FC/FD/FE or FFh port, write block # in the RAM block you get, repeat. Then select all blocks again, and read back the values in RAM. A memory mapper will show different values in the memory location you wrote in (as they're different blocks you wrote to), normal RAM will just return the last value you wrote.

You have to understand memory mappers thoroughly to write a good routine for doing this (to determine memory mapper size reliably, including full 4M, non-power of 2 sizes, mappers with N blocks but 1/2N filled etc), but there's plenty examples around.

In case of two mappers used by two programs (for example, one is in "foreground" and another in interrupt background), interrupt code, after changing FC-FF values, should return them back and only then return execution to the foreground code. That's not possible without reading the port, however can use current mirror FC-FF values stored in some memory.
That's exactly what MemMan and DOS2 mapper routines are for... especially DOS2 routines are very fast, so there's no reason not to use them if available (other than laziness Tongue) (or load MemMan before your program & use that).

By DD

Expert (88)

DD's picture

04-05-2010, 16:15

Indeed an OUT to &HFE changes the page on &H8000 to &HBFFF of all mappers.

If you have two mappers, one of 512k and the other of 2048k, the 512k mapper only has 32 pages (5 bits) and the 2048k mapper has 128 pages (7 bits) for selecting the page. When reading this I/O address, both mapper will answer but it's no problem since they have the same value on the bits they use. As long the designer of the mapper does not write ones to the unused bits! Unfortunately, if you give OUT &HFE,32, the 512k mapper will show memory page 0 at address &H8000 and the 2048k mapper in a different slot will show the 32th page. When reading back &HFE, you should see 32+128 as both mappers don't use bit 7.

Page 1/2
| 2