Patching MSX Bios for Memory Mapper Support

Page 1/2
| 2

By jdgabbard

Resident (44)

jdgabbard's picture

08-08-2022, 21:57

To give a little background to my question, I am working on building a MSX1 compatible machine from scratch. The method of construction is wire wrap. In short, it is at this time a minimal machine designed as an exercise to help me understand the architecture at a more base level. Current memory organization is 64k ROM in Slot0, and 64k RAM in Slot3. However, I do have plans to extend this computer to incorporate Slot1 and Sub-Slots 20 21 22 and 23. With plans to place a FDD and ROM in SLOT 20, and a Memory Mapper in Slot 21, with Slots 22 and 23 being available for use, along with the unexpanded slot1. I am currently about 60% = 70% done wiring the base computer. Though I am lacking a few parts for completion. Namely two 74LS157s for the Gamepad ports. I hope to begin testing it's operation within the next week or so.

With the background out of the way, here is my question. I see Mappers on a MSX1 as somewhat useless. The user must initialize them before they are usable. And without something such as an SD-Mapper, which already has a mapper available, they are of limited use. However, the MSX2 Bios does initialize Mappers. Though it also contains routines for peripherals that do not exist in the MSX1 architecture, such as the RTC, 9938/58, etc. So my question would be, is there a tool for patching a MSX2 bios for use on MSX1 machines - to remove the unwanted bits? Alternatively, is there a Sub-Rom that could reside at 8000h/C000h in Slot0 which is compatible with the MSX1 BIOS, and could initialize any Mappers connected to the system?

I realize this is a strange question. And I suppose it is asking if there is a way to hybridize the MSX bios to support something that is generally only supported by the MSX2 bios. I given what I know, I feel someone must have asked this questions before. Or possibly even found a solution. No point in recreating the wheel...

Login or register to post comments

By Grauw

Ascended (10617)

Grauw's picture

08-08-2022, 22:10

jdgabbard wrote:

With the background out of the way, here is my question. I see Mappers on a MSX1 as somewhat useless. The user must initialize them before they are usable.

Note that there are memory mappers available which initialise to have banks 0-3 selected in pages 0-3 (as opposed to bank 0 in all four pages). With that, no BIOS patch is required and they work out of the box on MSX1 computers. These mappers will be advertised as having MSX1 support, and it includes afaik the mapper in the MegaFlashROM SCC+ SD, the Carnivore2, and the Musical Memory Mapper.

jdgabbard wrote:

And without something such as an SD-Mapper, which already has a mapper available, they are of limited use. However, the MSX2 Bios does initialize Mappers. Though it also contains routines for peripherals that do not exist in the MSX1 architecture, such as the RTC, 9938/58, etc. So my question would be, is there a tool for patching a MSX2 bios for use on MSX1 machines - to remove the unwanted bits? Alternatively, is there a Sub-Rom that could reside at 8000h/C000h in Slot0 which is compatible with the MSX1 BIOS, and could initialize any Mappers connected to the system?

Check out the BIOS used in the Yamaha CX5MII, which is an MSX1 computer with a memory mapper. I don’t recall whether the mapper initialisation is patched into the BIOS or whether it was done in the additional “sub” ROM. I think the latter only added the 80 columns support and the mapper initialisation was patched into the BIOS, but not sure.

By gdx

Enlighted (5686)

gdx's picture

09-08-2022, 02:08

What BIOS do you intend to use? Bios Support for 80 columns may cause problems.

jdgabbard wrote:

I do have plans to extend this computer to incorporate Slot1 and Sub-Slots 20 21 22 and 23.

I guess you mean slots 3-0, 3-1, 3-2 and 3-3, right? Because the slots 1 and 2 are generally cartridge slots and it's better to remove the 64kB then put the memory mapper in the slot 3-x except if its size is 4MB and you want make one cartridge slot only.

By sdsnatcher73

Prophet (3516)

sdsnatcher73's picture

09-08-2022, 06:59

I think you will create the mapper yourself, right? Then to summarize:

  1. if your mapper initializes the pages 0-3 to contain bank 0-3 it will work. This is done with some logic chips I think.
  2. It is best to use expanded slot 3 to hold memory, FDD etc.
  3. Having both a mapper and 64kB unmapped RAM makes no sense, so when implementing the mapper let that replace the unmapped RAM.

By NYYRIKKI

Enlighted (5940)

NYYRIKKI's picture

09-08-2022, 07:58

Nice project, jdgabbard!

I believe only the first versions of MSX1 ROMs suffer from the lack of mapper initialization routines. I'm under impression those were added already before MSX2 ROMs came out. In project like this compiling own ROMs might be viable option as well (See msxsysscr project by Arjen Zeilemaker) This has the added benefit that you can select the wanted fixes and stuff like keyboard layout, currency symbol etc.

gdx wrote:

I guess you mean slots 3-0, 3-1, 3-2 and 3-3, right? Because the slots 1 and 2 are generally cartridge slots and it's better to remove the 64kB then put the memory mapper in the slot 3-x except if its size is 4MB and you want make one cartridge slot only.

Exactly my first thoughts... but maybe I'm thinking too much of MSX2. If we think of MSX1 software this setup of jdgabbard might actually work better... Next obvious question might be why not built MSX2 or MSX2+? Practically the setup needs only new VDP and VRAM to hit that target. (Rest of the stuff like RTC or F4-port can be considered optional although you need to carefully select suitable ROM if this stuff is missing)

By jdgabbard

Resident (44)

jdgabbard's picture

10-08-2022, 02:25

@Grauw I will check out the Machines you suggested. This is to be a rather simple mapper, so I do not anticipate building it to auto-initialize to sequential banks. Though, I designed a mapper that does that in VHDL, I plan on using a pair of 4x4 registers to implement the mapper on this expansion card.

@gdx I had planned on using just a standard MSX1 Japanese bios, though was considering patching for an American Keyboard layout such as the Omega (since I have a spare keyboard on hand). As for the Slots, no, I meant it exactly as I wrote it before. The base system will be built with 64k ROM in SLOT 0 and 64K RAM in SLOT 3. This is to keep the main board simple. Also, because I do not have room on the board for an FFFF register and logic for decoding sub-slots. See pictures below. The expansion board will be built with an unexpanded SLOT 1 for use with any cards that need a full unexpanded-slot. And SLOT 2 will be expanded to allow 2-0 for an FDD, and 2-1 for a 512k Mapper. This isn't being built so much for usability (I have 3x MSX machines I can use: HB-F1XD, Omega, and Casio MX-10). It is more of a design experiment to better understand the system architecture and design.

@sdsnatcher73 Yes, I am designing the mapper myself. I have plenty of room to off-load the SLTSL3 signal onto the expansion board. So this may be something that is practical. However, as mentioned above, the point of this experiment isn't to make something that is practical. It's to make something that is usable and touches on multiple facets of the MSX architecture from a design perspective. The longer version of this is that I have recently designed a system that is similar to the MSX in many areas, and I am investigating design principles that I may later use to write a complete MSX core in VHDL. But before I go down the path, I want to see what works and what doesn't. And I view this as a good way of studying the architecture. This is actually the second project headed down this road for me. Look in the hardware section for the RD-10 board where I designed a partial MSX engine from scratch as a replacement expansion unit for the MX-10.

@NYYRIKKI Thank you. I've probably got more time in wrapping wire than I do laying it out in schematic form. But I'll see how well it works and base my judgement on that before coming to my own conclusion. I'm probably my own worst critic.... If you're familiar with which BIOS versions included this that would be a nice piece of information. I am familiar with Arjen's work. And I actually sent him some suggests to modify his source for the TDC-600, to include english pathcing. I have not studied his code for the BIOS however. Mostly because I absolutely hate the way most MSX source code is generated.... I'm a PASMO guy, and whatever assembler/disassembler is used with a lot of source code just drives me up the wall. As for the MSX1 or 'why not ...MSX2', I suppose this goes back to the previous answer.... I'm not so much worried about features as I am looking to study the architecture.

Here are some pictures of the board I am currently working on:

If anyone is interested in knowing a little about the other project I mentioned, I am currently referring to it as the G80-99K. It is comprised of a Z80 at 6mhz (switchable via software to 3.58mhz), 8Mb memory Mapper with 512k ROM and 512k RAM on the main board, dual video controller (9118 and an AVR based 80-column mode), RS232, USB Serial, Sega compatible gamepad port, FAT32 file system using an SD interface (I've also used USB host on a previous version), a SAA1099 PSG and a daughter card with a SN76489. It can also natively run some SG-1000 games straight from the DOS I wrote for the computer. Though this is currently limited to ROMs of about 32k in size (due to my software routines). Picture and Video below.

https://youtu.be/ONv41MlMX-k

By gdx

Enlighted (5686)

gdx's picture

10-08-2022, 10:05

I made a patch to initialize the memory mapper segments.

Download:
https://1fichier.com/?1j18gfwt66ttanaerpug

It can be applied on most MSX1 BIOS but not all. So be careful.

By jdgabbard

Resident (44)

jdgabbard's picture

10-08-2022, 19:17

gdx wrote:

I made a patch to initialize the memory mapper segments.

Download:
https://1fichier.com/?1j18gfwt66ttanaerpug

It can be applied on most MSX1 BIOS but not all. So be careful.

I'll try taking a look at it. For some reason I'm having problem downloading the patch. And it's making me wait an hour to try again. You mention it cannot be used on all machines. Anything in particular to watch out for when selecting a machine's bios?

By gdx

Enlighted (5686)

gdx's picture

10-08-2022, 22:16

Try with this link:
https://www11.zippyshare.com/v/cANqrSYw/file.html
Read the attached text file for detail.

By jdgabbard

Resident (44)

jdgabbard's picture

11-08-2022, 04:30

I was able to download it from that link, thank you. I'll take a look at it when I get time to test out the machine.

By gdx

Enlighted (5686)

gdx's picture

11-08-2022, 09:49

I just saw that I forgot to replace 7FF0h by 7FEEh in the text file. At first I added a routine at 7FF0h, then I shifted it -2 bytes because a few Bios seem to put data on the last two bytes.

Page 1/2
| 2