MMM Musical Memory Mapper on a 64kb machine

Page 1/4
| 2 | 3 | 4

By norakomi

Paragon (1062)

norakomi's picture

08-04-2020, 11:02

Hi guys !!

The game Deva that we are developing requires 128kb ram.

I got a question from a guy who owns a Panasonic FS-A1WX.
This MSX only has 64kb ram.

He asked if Deva will run on his MSX with a MMM (Musical Memory Mapper).

Now I tried running the game on openmsx with his configuration,
unfortunately it didn't work.

Does anyone know how to properly access the required 128kb ?

Note: The game does NOT run in Dos, no floppy support.

Login or register to post comments

By zeilemaker54

Champion (268)

zeilemaker54's picture

08-04-2020, 13:10

Should be working. How are you using the 128kb ram ?
By using the memory mapper mechanism ? And if yes, are you reading the memory mapper registers ?

By Grauw

Ascended (8914)

Grauw's picture

08-04-2020, 14:07

Don’t read from the mapper registers FC-FF. It is non-standard and several machines have issues with this, amongst others the FS-A1WX. It is most likely that this is your issue. If you eliminate those reads, then it should work fine. Just mirror the current page selection in memory, or when using DOS2, use the mapper support routines (which mirror for you). It’s not specific to the MMM, all mappers will have this issue on those machines.

By norakomi

Paragon (1062)

norakomi's picture

09-04-2020, 08:50

Quote:

Just mirror the current page selection in memory

as far as i know (i didn't write this piece of code myself) I don't read from mapper registers FC-FF.
I only write to them, and make a copy in RAM whenever I do.
Example: With 128kb ram: so putting for instance bank 6 in page 2 is done like this:
ld a,6
ld (Value_Port_fd),A
out ($fd),a ;$ff = page 0 ($c000-$ffff) | $fe = page 1 ($8000-$bfff) | $fd = page 2 ($4000-$7fff) | $fc = page 3 ($0000-$3fff)
So this should be fine, but it doesn't work on the FS-A1WX with MMM configured.

By lintweaker

Master (227)

lintweaker's picture

09-04-2020, 09:17

Wrt pages, I think it is:
fch = page 0
fdh = page 1
feh = page 2
ffh = page 3

By Manel46

Hero (537)

Manel46's picture

09-04-2020, 10:03

use Moonblaster V.1.4, in my rom games, for msx music / msx audio.
I have several songs, and every time I need one, I copy it on page 3, above the variables. Considering its length, of course.
This replayer with the corresponding "IF" can use mapped ram (#fe). But not me.

By gdx

Prophet (3430)

gdx's picture

09-04-2020, 14:32

You can take inspiration from this BASIC program to detect the size of the main memory mapper.

5 'Display the main memory mapper size
10 S%=PEEK(&HF341) OR PEEK(&HF342) OR PEEK(&HF343) AND &H8F: IF S%<>PEEK(&HF344) AND &H8F THEN PRINT"Main-RAM is dispaced in several slots!": BEEP: END
20 IF PEEK(&HF677)=&HC1 THEN 50
30 CLS: PRINT CHR$(13)+"DMMM v0.5 by GDX": PRINT "wait...";
40 POKE &HF676,1: POKE &HF677,&HC1: POKE &HC100,0: RUN"DMMM.BAS"
50 PRINT CHR$(13)+"wait...";STRING$(23,32);
60 FOR N=255 TO 0 STEP -1
70 OUT 254,N: POKE &H8000,N
80 NEXT N: SZ=0
90 FOR N=0 TO 255
100 OUT 254,N
110 OT=T: T=PEEK(&H8000)
120 IF N=255 AND OT=254 THEN SZ=255
130 IF T=N THEN IF N<128 THEN SZ=N
140 NEXT N
150 OUT 254,1: POKE &HF676,1: POKE &HF677,&H80: POKE &H8000,0
160 IF SZ<4 THEN PRINT CHR$(13);"No mapper found!": BEEP: END
170 PRINT CHR$(13);"Main mapper size:"; SZ*16+16;"KB"
180 PRINT"Slot:"; S% AND 3;
190 IF S%>128 THEN PRINT"-";(S% AND 12)/4

This program assumes that all pages are those of the main mapper, and the indicated size will be smaller than real size if DOS2 is installed.

By Manel46

Hero (537)

Manel46's picture

09-04-2020, 15:20

I insist. In MBPLAY, we have the principle in conditionals:
withMapper: equ 1; 1 = include Mapper supported code
Put 0 there.
Then each song loads it into a buffer, after the variables in #cxxx.
In this way, when connecting the different banks, the song will always sound. The replayer on page 1, of course.
So with 16 Kbs of ram there is enough. As long as no more ram is used for whatever.
I am referring to the latest updated version of mooblaster v1.4:
http://msxbanzai.tni.nl/dev/software.html

By Grauw

Ascended (8914)

Grauw's picture

09-04-2020, 15:44

norakomi wrote:

Example: With 128kb ram: so putting for instance bank 6 in page 2 is done like this:
ld a,6
ld (Value_Port_fd),A
out ($fd),a ;$ff = page 0 ($c000-$ffff) | $fe = page 1 ($8000-$bfff) | $fd = page 2 ($4000-$7fff) | $fc = page 3 ($0000-$3fff)

What initial values are you using for the Value_Port_fc etc. mirrors? They should be the values:

Value_Port_fc: db 3
Value_Port_fd: db 2
Value_Port_fe: db 1
Value_Port_ff: db 0

By norakomi

Paragon (1062)

norakomi's picture

09-04-2020, 17:35

I isolated the problem, but I don't know how to fix it yet.

To start with:

Quote:

What initial values are you using for the Value_Port_fc etc. mirrors? They should be the values:

Value_Port_fc: db 3
Value_Port_fd: db 2
Value_Port_fe: db 1
Value_Port_ff: db 0

Yes, this is all set.

Now what DOES work is writing bank 0,1,2 or 3 to any port.
So this works:
ld a,2 (0,1,2 or 3 works)
ld (Value_Port_fd),A
out ($fd),a ;$ff = page 0 ($c000-$ffff) | $fe = page 1 ($8000-$bfff) | $fd = page 2 ($4000-$7fff) | $fc = page 3 ($0000-$3fff)

but this doesn't work:
ld a,7
ld (Value_Port_fd),A
out ($fd),a ;$ff = page 0 ($c000-$ffff) | $fe = page 1 ($8000-$bfff) | $fd = page 2 ($4000-$7fff) | $fc = page 3 ($0000-$3fff)

When I do this a copy of page 0 (Port_ff) goes into page 2......

How can I use value 4,5,6 and 7 ????

By Manel46

Hero (537)

Manel46's picture

09-04-2020, 17:52

I have configured Open MSX with the Panasonic FS-A1WX + Musical Memory Mapper, and the music of my rom "msx in a row!" Sounds perfectly. It works as explained before.
64 KBs of ram are needed because I use the P0 for the replayer with their tables. Not sure if this helps.

https://www.msx.org/news/software/en/msx-in-a-row-by-mapax-r...

Page 1/4
| 2 | 3 | 4