How do memory mappers exactly work?

Par Chris584

Supporter (12)

Portrait de Chris584

20-01-2011, 01:30

Hi,

A few weeks ago, I posted a topic asking how to convert binary files so as NOT to use Basic loaders. Cax's help was really great and I have already converted other megaroms not included yet on his page, like Aleste, which can now be loaded as a sequence of BLOAD commands.

However, I can only load it when the emulator configuration is set to MSX2+ or MSXTurbo, but not if MSX2. I suppose that memory mappers are playing a crucial role, but I don't exactly understand what's going on.

The BASIC Loader works as it is shown below, and of course it works fine on MSX2:

120 OUT&HFE,1:BLOAD"ALESTE.01"
130 OUT&HFE,2:BLOAD"ALESTE.02"
140 OUT&HFE,3:BLOAD"ALESTE.03"
150 OUT&HFE,4:BLOAD"ALESTE.04"
160 OUT&HFE,5:BLOAD"ALESTE.05"
170 OUT&HFE,6:BLOAD"ALESTE.06"
180 OUT&HFE,7:BLOAD"ALESTE.07"
190 OUT&HFE,8:BLOAD"ALESTE.08"
200 OUT&HFE,9:BLOAD"ALESTE.09"
210 OUT&HFE,10:BLOAD"ALESTE.0A"
220 OUT&HFE,11:BLOAD"ALESTE.0B"
230 OUT&HFE,12:BLOAD"ALESTE.0C"
240 OUT&HFE,14:BLOAD"ALESTE.0E"
250 OUT&HFE,15:BLOAD"ALESTE.0F"

When I use the BASIC loader, why can the game be also loaded on MSX2 configurations (128Kb RAM) ? On the other hand, if I use binary files featuring the same instructions (converted to machine code), I mean instructions like those "OUT&HFE,X", the game can ONLY be loaded con MSX2+ or Turbo systems, but not on MSX2. Actually, the modified version of the game is perfectly loaded on MSX2 until reaching BLOAD"ALESTE.08", and then the CPU restarts at that point.

Am I missing something to set for the binary files to also get a workable version of the game on MSX2?

Thanks,

CJ

!login ou Inscrivez-vous pour poster

Par Metalion

Paragon (1622)

Portrait de Metalion

20-01-2011, 09:05

Well, if I'm not mistaken 8 x 16Kb = 128Kb !
So you just run out of available RAM in the mapper ...

MSX2+ and TurboR setups have probably more RAM.

Par cax

Prophet (3740)

Portrait de cax

20-01-2011, 09:35

Indeed, Aleste is not a game that can fully fit in 128K machine. The game itself is 256K Smile
There exist versions of Aleste cracks that DO run on MSX2 with 128K RAM, but the game does not fully fit in the memory
and as a result constantly access disk between levels.

Fitting a 128K ROM to run in 128K RAM/128K VRAM is usually not an easy task, and involves some major hackery and tricks,
sometimes it's not possible, sometimes it results in ill effects like slowdowns or cutting some features from the original game.
There are MegaROMs that were cracked to run fully in 128K without sound, with option to have a sound if more RAM is available.
Quarth, as Aleste, loads the non-fitting data from the disk if only 128K is available.

Please pay attention to the fact the games on my page are all for MSX2 machines with 128K RAM/128K VRAM max !
Of course I could convert more MegaROMs, but my goal was exactly these 128K diskless machines -
to make loading MegaROMs on them possible with help of cas: port and turbo-loader.

MSX2 with 256K RAM in 99.9% have a floppy built-in and won't need special versions that can be loaded via cassette port.

Par Chris584

Supporter (12)

Portrait de Chris584

20-01-2011, 09:52

Thanks to both of you,

Metalion, you're right and that's exactly what I thought, but why don't I run out of RAM when the BASIC Loader is used in MSX2? That's what I don't understand.

However, if I use my own loader in machine code, which does exactly the same as the BASIC one, the game is not loaded on a MSX2 configuration...

CJ

Par Metalion

Paragon (1622)

Portrait de Metalion

20-01-2011, 10:24

It might be something else, then.
Furthermore, if you use the standard MSX2 setup in BlueMSX, it features 512Kb of RAM so it should be OK.

Could you post your code ?

Par Chris584

Supporter (12)

Portrait de Chris584

20-01-2011, 12:55

Hi Metalion,

Got it, I thought that MSX2 setup in BlueMSX features 128Kb instead of 512Kb. as the memory RAM available is not shown in the Classic view. So that's why the BASIC loader really works on MSX2. However, because I tried my BLOADABLE files with a special BOOT Loader that specifically works on a different MSX2 Computer that only features 128Kb., they can work properly.

I have now tried them without the BOOT LOADER on a standard MSX2 Configuration (512 Kb.) and they work fine. So, there was nothing special with the BASIC Loader. It has always been working with 512Kb.

Thanks for your time,

CJ