home *** CD-ROM | disk | FTP | other *** search
/ Emulator Universe CD / emulatoruniversecd1998.iso / MSX / OS / MSXDOS2.ZIP / MAPPER2.TXT < prev    next >
Encoding:
Text File  |  1996-08-23  |  2.9 KB  |  82 lines

  1. How to use mapper...
  2.  
  3. when the memorymapper system was first made you could read the mapper ports
  4. (&hFC-&hFF) again. But later the standard was changed, now you can't be
  5. certain about the data you read from the mapper registers. Its actually on a
  6. problem on the MSX Turbo R because the "S1990 'MSX engine'" only returns 5
  7. bits so if you have a mapper larger than 512KByte then there are not enough
  8. bits.
  9.  
  10. In MSX DOS 2 you are definately not allowed to read the mapperregisters, you
  11. have to use "EXTENDED BIOS" which DOS2 installs. (&HFFCA, its installed if
  12. bit 0 of &hFB20 (HOKVLD) are set.)
  13.  
  14. You have 2 extended bios functions:
  15.  
  16. Get mapper vaiable table
  17.  
  18. Parameter:   A = 0
  19.              D = 4 (Device number of mapper support)
  20.              E = 1
  21. Result:      A = Slot address of primary mapper
  22.              DE= reserved
  23.              HL= Start address of mapper variable table
  24.  
  25. ---------------------------------------------------------
  26. Get mapper support routine address
  27.  
  28. Parameter:   A = 0
  29.              D = 4
  30.              E = 2
  31. Result:      A = Total number of memory mapper segments
  32.              B = slot number of primary mapper
  33.              C = number of free segments of primary mapper
  34.              DE= reserved
  35.              HL= start addresss of jump table
  36. ---------------------------------------------------------
  37.  
  38. The Jump table looks like this:
  39.  
  40. +00H  ALL_SEG   Allocate a 16k segment
  41. +03H  FRE_SEG   Free a 16k segment.
  42. +06H  RD_SEG    Read byte from address A:HL to A
  43. +09H  WR_SEG    Write byte from E to address A:HL
  44. +0CH  CAL_SEG   Inter-segment call. Address in IYh:IX
  45. +0FH  CALLS     Inter-segment call. Address in line after
  46.                 the call instruction
  47. +12H  PUT_PH    Put segment into page (HL)
  48. +15H  GET_PH    Get current segment for page (HL)
  49. +18H  PUT_P0    Put segment into page 0
  50. +1BH  Get_P0    Get current segment for page 0
  51. +1EH  PUT_P1    Put segment into page 1
  52. +21H  GET_P1    Get current segment for page 1
  53. +24H  PUT_P2    Put segment into page 2
  54. +27H  GET_P2    Get current segment for page 2
  55. +2AH  PUT_P3    not supported since page-3 must never be changed
  56.                 Acts like a "NOP" if called.
  57. +2DH  GET_P3    Get current segment for page 3.
  58.  
  59.  
  60. The Mapper variable table looks like this: (for each mapper)
  61.  
  62. +0  Slot address of the mapper slot
  63. +1  Total number of 16k RAM segments. 1...255 (8...255 for the primary)
  64. +2  Number of free 16k RAM segments
  65. +3  Number of 16k RAM segments allocated to the system (at least 6 for the
  66.     primary)
  67. +4  Number of 16k RAM segments allocated to the user.
  68. +5..+7  Unused
  69. +8  Entries for other mapper slots. If there is none, +8 will be zero
  70.  
  71.  
  72.  
  73. I won't go more into detail here. I got these informations from
  74. "MSX DOS 2.20 Programme Reference Manual 1, Transient Program Interface
  75. Specifications" (the HSH version, which are a reprint of an ASCII book I
  76. think)
  77.  
  78.  
  79. Greetings,
  80. Henrik. <msx@login.dknet.dk>
  81.  
  82.