Memory Mapper Segment availability/allocation under MSXDOS/Nextor

Page 1/3
| 2 | 3

By DamnedAngel

Expert (121)

DamnedAngel's picture

07-05-2019, 13:45

Hi all,

I am sorry if this has been asked, but I could not find any material on forums and documentation.

How do I check for memory mapper segment availability under MSXDOS/Nextor?

I want to use the memory mapper without destroying the OS environment, so my application can quit safely to OS. I have seen that applications like MI120 properly detects OS' total usage of Memory Mapper Segments (although MI120 does not show which segments are being used). How do they do that?

Is there a set of MSXDOS BIOS calls to control Memory Mapper's segments availability/allocation?

thanks in advance,

Login or register to post comments

By Grauw

Enlighted (7967)

Grauw's picture

07-05-2019, 13:59

All is described here: http://map.grauw.nl/resources/dos2_environment.php#c5

Note that the mapper support routines are a MSX-DOS2 function, although there is a TSR (MU.COM) which can also add mapper support to DOS1.

Also note that it is your responsibility to restore the slot and mapper page configuration to its initial state when your program terminates, also when it terminates abnormally. Unfortunately DOS doesn’t do this automatically, and if you don’t do it yourself the memory environment can get messed up causing bugs for programs that are run afterwards. The only thing that DOS does for you automatically on program termination is to free the user segments that you’ve allocated, though I think it’s good practice to also free these manually (for MU.COM support this is also mandatory).

By DamnedAngel

Expert (121)

DamnedAngel's picture

07-05-2019, 16:15

Wow,
nice material. That helps a lot!
Thanks!

By ToriHino

Champion (299)

ToriHino's picture

07-05-2019, 20:38

As an additional note, be aware that MSX-DOS2 can load directly to the primary mapper only. So when you want to transfer data from disk to a non-primary mapper slot using the DOS calls, always use a buffer in between.

By DamnedAngel

Expert (121)

DamnedAngel's picture

07-05-2019, 21:21

Oh, nice to know. Thanks!

By gdx

Prophet (2663)

gdx's picture

08-05-2019, 01:50

Grauw wrote:

Note that the mapper support routines are a MSX-DOS2 function

More precisely, Mapper support routines are a Disk-ROM v2.xx function. The function is present without booting under DOS2.

By DarkSchneider

Paladin (790)

DarkSchneider's picture

08-05-2019, 10:59

But are only officially supported under DOS2, as there are no BIOS additions concerning memory mapping.

By Grauw

Enlighted (7967)

Grauw's picture

08-05-2019, 11:20

@gdx I presume you mean when executing in the BIOS/BASIC environment? Or do you mean to say that even think when booting in "DOS1 mode", with a key pressed at start-up or booting from a DOS1-formatted disk, these mapper support routines are available? (That would be novel to me.)

@DarkSchneider You can call the Extended BIOS from the BIOS/BASIC environment just as well as from the DOS environment (just like the BDOS functions can be called from both environments)... Nowhere have I ever read that the extended BIOS mapper routines are only supposed to be used in the DOS2 runtime environment, and I don’t see why that would be so either…

By DarkSchneider

Paladin (790)

DarkSchneider's picture

08-05-2019, 11:56

Yes you can call the extended BIOS but I can't see any memory mapping instruction out of DOS2.
I use these references, maybe I am missing something or lack documentation:
https://www.konamiman.com/msx/msx2th/th-ap.txt
http://map.grauw.nl/resources/msxbios.php
http://map.grauw.nl/resources/subrom.php
https://konamiman.github.io/MSX2-Technical-Handbook/md/Appendix1.html
http://map.grauw.nl/resources/datapack/Vol3-7MSXExtendedBIOSSpecification.pdf
And only in the last one I can see "MSX­DOS2 (Memory mapper support)" included in Extended BIOS. So even if the Disk ROM could include it, I can find any documentation for accesing those features in the MSX standard way (not using direct ports).

By Grauw

Enlighted (7967)

Grauw's picture

08-05-2019, 12:05

DarkSchneider wrote:

I can’t find any documentation for accesing those features in the MSX standard way (not using direct ports).

You access it in exactly the same way in both environments, calling the "Get mapper support routine address" routine on the EXTBIO entry point. This entry point is standard and not dependent on the DOS runtime. The only coupling to MSX-DOS2 is that it is included as part of the DiskROM v2.0, otherwise it is a completely independent system.

By gdx

Prophet (2663)

gdx's picture

08-05-2019, 12:05

Grauw wrote:

@gdx I presume you mean when executing in the BIOS/BASIC environment? Or do you mean to say that even think when booting in "DOS1 mode", with a key pressed at start-up or booting from a DOS1-formatted disk, these mapper support routines are available? (That would be novel to me.)

Mapper function (Extended BIOS) is available in the BIOS/BASIC environment when booting with Disk-ROM v2.00 but not in "DOS1 mode". When we press [1] at boot the Disk-ROM v1.xx is set instead of the v2.xx.

Page 1/3
| 2 | 3
My MSX profile