slot layout - cayce-msx/msxpp-quick-ref GitHub Wiki

MSX++ BIOS ROM layout

The 512KiB SD-BIOS can be tailored with a few choices:

  • MegaSDHC or Nextor DOS
  • MSX1, MSX2, MSX2+ or Turbo-R compatible, as well as C-BIOS or custom Main/Sub-ROM
    • note: Windows make-sdb.cmd only supports MSX2+ and Turbo-R
  • charset/font: Yen, Backslash or Western
  • X-Basic a.k.a. Basic Kun a.k.a. BASIC'n version plus/v2.0, or version turbo/v2.1:
    • Plus (1989) supports up to MSX2+. Is also embedded in Sanyo PHC-70FD and PHC-70FD2 models.
    • Turbo (1992) supports up to Turbo-R and was (interestingly) released only on floppy disk. This version is included by default.
  • optional ESP-8266 Wi-Fi driver
  • boot logo: regular MSX, MSX++, SX-1, etc. (n/a for Turbo-R) - contained in the Kanji ROM

This is how SD-BIOS blocks map to the MSX++:
(subslot mentioned far left; location in SD-BIOS file far right)

---^| MSX-BIOS Configuration (OCM-PLD v3.4 or later) ^|------------------------
3-2 (4000h)  128kB  MEGASDHC.ROM* + NULL64KB.ROM / NEXTOR  .ROM   blocks 01-08  accessed via mapper
0-0 (0000h)   32kB  MSX2P   .ROM* / MSXTR   .ROM                  blocks 09-10
3-3 (4000h)   16kB  XBASIC2 .ROM  / XBASIC21.ROM*                 block  11
0-2 (4000h)   16kB  MSX2PMUS.ROM* / MSXTRMUS.ROM                  block  12
3-1 (0000h)   16kB  MSX2PEXT.ROM* / MSXTREXT.ROM                  block  13
3-1 (4000h)   32kB  MSXKANJI.ROM*                                 blocks 14-15
0-3 (4000h)   16kB  FREE16KB.ROM* / MSXTROPT.ROM / ESP8266 .ROM   block  16
I/O D8-D9    128kB  JIS1    .ROM*                                 blocks 17-24
I/O DA-DB    128kB  JIS2    .ROM*                        (512kB)  blocks 25-32

A * marks ROMs included in EP-BIOS.

MSX slot layout

The resulting MSX slot/subslot layout is the following:

pg 0-0  0-1  0-2 0-3    1   2   3-0 3-1  3-2 3-3
  |----|----|---|----| |-| |-| |---|----|---|---|
3 |    |RAM*|   |    | | | | | |RAM|    |   |   |
2 |    |RAM*|   |    | | | | | |RAM|Kan |Dsk|   |
1 |BASC|RAM*|FM |WiFi| | | | | |RAM|Kan |Dsk|Kun|
0 |BIOS|RAM*|   |    | | | | | |RAM| 2+ |   |   |
  |----|----|---|----| |-| |-| |---|----|---|---|
mapper |4MiB                   |2/4MiB  |A8 |   |   
       |256p.                  |128/256p|16p|   |   

EP-BIOS is the same, except the ESP8266 Wi-Fi ROM; that's not present.

Since OCM-PLD 3.9.1, it is possible to enable a 4MiB "Extra-Mapper" which will appear in slot 0-1.

Interestingly, the ESE-RAM in slot 3-2 (for MegaSD / Nextor), which behaves exactly like an ASCII 8K ROM mapper, is not the necessary 16 pages (128KiB) but 64 pages (512KiB) wide, giving not just read but also write (!) access to the whole EP/SDBIOS. Writing to ESE-RAM is possible by setting bit 7 of the page number, before writing it to the proper ASCII-8 bank address.

C-BIOS

Slot 0 can be set to unexpanded ('Primary mode') using SETSMART -F9 since OCM-PLD v3.5. This will be effective after reboot. Or press right-ALT during boot (since OCM-PLD v3.9.2). It makes the Wi-Fi ROM inaccessible; Kanji is replaced by FM-PAC, i.e., MSX-MUSIC, in slot 3-1. Can be useful to run some old games.

With this feature, it's possible to run C-BIOS.

C-BIOS layout:

pg   0      1   2   3-0  3-1  3-2 3-3
  |------| |-| |-| |----|----|---|---|
3 |      | | | | | |RAM |    |   |   |
2 |(logo)| | | | | |RAM |free|Dsk|   |
1 |BASIC | | | | | |RAM | FM |Dsk|Kun|
0 |BIOS  | | | | | |RAM | 2+ |   |   |
  |------| |-| |-| |----|----|---|---|
mapper             |2MiB|    |A8 |   |   
                   |128p|    |16p|   |   

Slot 0 page 2 says '(logo)' as C-BIOS expects it there, but this isn't mapped by OCM-PLD. C-BIOS will boot just fine, although without a logo.

MSX++ SDRAM layout

Source: the following files in OCM-PLD Pack v3.9.1 -

  • esemsx3/src/emsx_top.vhd: slightly different from the other docs; does not use the bank system described below, and does not have the Extra-Mapper
  • these are all exactly the same (when looking at the memory layout):
    • esemsx3/src/emsx_top.vhd.[msx2.381|zemmixneo.sx1mini|zemmixneo]
    • ocm_sm/src_addons/sm_emsx_top.vhd / .singlepsg
    • ocm_sm/src_addons/test_mixer/sm_emsx_top.vhd

Note: the below is totally different from http://msxbanzai.tni.nl/computers/ese3.html, which describes the original ESE MSX3 / OCM SDRAM layout. That mostly coincides with esemsx3/src/emsx_top.vhd.original, although it doesn't mention Kanji (JIS1) ROM.

An MSX++ is manufactured with 8, 16 or 32 MiB SDRAM. This memory (however large) is divided into four banks, A through D. So a bank is 2, 4 or 8 MiB in size. These banks are addressed using address range 00.0000 - (respectively) 1F.FFFF / 3F.FFFF / 7F.FFFF (hex). Together with the banks, the total memory address width is 25 bits (for 32MiB).

The lower 8MiB is almost fully used. When 16MiB is available, the upper half of banks A&B (20.0000-3F.FFFF), together 4MiB, can be used as extra memory mapper in slot 0-1. Anything above 16MiB is unused.

Bank usage:

  • A&B: regular & extra memory mapper - together max. 8MiB
  • C: ESE-SCC slot 1 & 2 - together max. 2MiB
    • In OCM-PLD 3.9.2 this is max. 4MiB (requires 16MiB SDRAM minimum)
  • D: 2MiB, used as follows:
    • 512KiB MSX++ BIOS - exact layout as described above
    • 509KiB RAM-disk - unused/unsupported!
    • 3KiB IPL-ROM - Initial Program Loader; boots up the MSX++
    • 1MiB VRAM - 16 pages of 64KiB whereas a regular MSX2/2+/TR has 2 pages of 64KiB

So out of 32MiB SDRAM, 20MiB (3.9.2: 18MiB) is unallocated. That leaves lots of space for future improvements!

The memory map is optimized by KdL for 8MiB SDRAM, to accomodate SM-X MINI and SMX-HB models with 8MiB. One block of 4MiB can optionally be used for slot 0-1 Extra-Mapper on MSX++ devices with 16 or 32MiB SDRAM.

This 8MiB optimization also shows with ESE-MegaSCC+/RAM, where slot 1 is "shared with 2nd half of ESE-MegaSCC+ Slot-2": This means that when using both slots for ESE-MegaSCC+/RAM at the same time, slot 2 must be in ESE-MegaRAM ASCII-8K 1024kB mode. Otherwise, data will be overwritten.

Starting with OCM-PLD 3.9.2 (unreleased at the moment of writing) this memory sharing is reduced. Also, another 2MiB is available for ESE-MegaRAM.

Note that ESET.COM RAMDISK is unsupported, although it is mentioned in the "External memory access" list; there is 509KiB allocated for it. Like the original ESE-MegaSCSI, ESE-RAM is used to store the DiskROM and ESET.COM parameters. (Although the original ESE-MegaSCSI used persistent memory, which remains after powering down. OCM-PLD's ESE-RAM is lost after switching off or cold reboot.) It is referenced in code using, e.g., iSltErm & ErmAdr - see OCM-PLD source files *msx_top.vhd*. The memory block reserved for this completely overlaps the EP/SD-BIOS. megasd.vhd supports 1MiB (20 bits) of ESE-RAM. But *msx_top.vhd* blocks the top half by mapping only 19 bits, leaving 512KiB - the exact size of the EP/SD-BIOS. The following line of code executes the blocking:

"0"      & ErmAdr(18 downto  0)     when( iSltErm  = '1' )else    -- [ D ]000000-07FFFF ( 512 kB) Internal Slot3-2

Without that "0" (and instead using ErmAdr(19 downto 0)), pages 64-127 of the ESE-RAM at slot3-2 would provide access to the RAMDISK and 3KiB IPL-ROM (together 512KiB).

However: access to MMC/SD and EPCS is arranged via these pages. ESE-MegaSCSI implements SCSI access in another way, and didn't have this limitation.

EP/SDBIOS layout

In the same order as the "External memory access" comments in *msx_top.vhd* files.

Slot Contents                Bank   Address range   Size
                             <<D range starts at slot3-2>>
0-0  MainROM                 [ D ] 02.0000-02.7FFF (  32 kB)
3-3  XBASIC                  [ D ] 02.8000-02.BFFF (  16 kB)
0-2  FM-BIOS                 [ D ] 02.C000-02.FFFF (  16 kB)
                             <<cont'd at slot3-1>>
0-3  WiFi(OPT)               [ D ] 03.C000-03.FFFF (  16 kB)
                             <<cont'd at Kanji>>
1    (EXTERNAL-SLOT)         <<no SDRAM>>
     / ESE-SCC1              [ C ] 10.0000-1F.FFFF (1024 kB) <= shared with the 2nd half of ESE-SCC2
     / Linear(1)             [ C ] 10.0000-10.FFFF (  64 kB) <= shared with ESE-SCC1
2    (EXTERNAL-SLOT)         <<no SDRAM>>
     / ESE-SCC2              [ C ] 00.0000-1F.FFFF (2048 kB)
     / Linear(2)             [ C ] 00.0000-00.FFFF (  64 kB) <= shared with ESE-SCC2
3-0  Mapper                  [A+B] 00.0000-1F.FFFF (4096 kB) <= or [ A ] 2MiB (first half) when FullRAM==0
3-1  ExtROM + KanjiROM       [ D ] 03.0000-03.BFFF (  48 kB)
3-2  MegaSDHC / NEXTOR       [ D ] 00.0000-01.FFFF ( 128 kB)
     / ESE-RAM               [ D ] 00.0000-07.FFFF ( 512 kB)
     / RAMDISK(inaccessible) [ D ] 08.0000-0F.F3FF (FREE: 509 kB)
     / IPL-ROM(hex)          [ D ] 0F.F400-0F.FFFF (the last 3 kB can be used to extended IPL-ROM in some firmware)
3-3  IPL-ROM(preloader)                            (blockRAM: < 3 kB, see IPLROM*.ASM) <= swapped with XBASIC at boot time - see 2nd row
---  VRAM                    [ D ] 10.0000-1F.FFFF (1024 kB)
I/O  Kanji-data              [ D ] 04.0000-07.FFFF ( 256 kB)  (JIS1+JIS2)
0-1  Extra-Mapper            [A+B] 20.0000-3F.FFFF (4096 kB) <= SDRAM 16MiB or higher
⚠️ **GitHub.com Fallback** ⚠️