Switching RAM in page 0 on MSX2

Page 3/3
1 | 2 |

By ro

Scribe (4707)

ro's picture

23-06-2022, 12:36

good work, gdx Smile

By gdx

Enlighted (5578)

gdx's picture

23-06-2022, 12:47

The principe is simple but easy to make a mistake.
I just replaced ld a,e by ld a,b.
I hope it is correct now.

By Metalion

Paragon (1529)

Metalion's picture

23-06-2022, 13:38

gdx, I'm confused ...
The code you posted just select RAM in P0, or does it search for it also ?

I must say I'm amazed at the length and complexity of the code needed to simply switch RAM in a page.
You would have thought that this simple task was easier to do in a standardized system such as the MSX.
But then again, I never really understood how slot management was working ...

By aoineko

Champion (475)

aoineko's picture

23-06-2022, 14:13

If you do not overwrite the RAM space allocated to the BIOS, the sub-slot information is directly accessible to the SLTTBL addresses. So there is no need to change the slot on page 3 to read this information.
Yes, this is a trick I don't use yet in MSXgl. It's part of the optimizations I will add because even if I want the library to be BIOS independent, when starting a program, it doesn't make much sense not to use the information already present in RAM. Smile

By gdx

Enlighted (5578)

gdx's picture

23-06-2022, 14:58

The RAM search routine is on the Wiki page I linked above. To make a program in ROM that accesses the RAM on all the pages, it is necessary to know the slots of the RAM to be able to access them.

The routine works bit by bit so the program becomes long. It's the essence of machine language. It's fast but the programs are long. In addition, it is amplified by the method used on MSX to select the slots. As I always say, the slots were the advantage and at the same time the defect of the MSXs.

By gdx

Enlighted (5578)

gdx's picture

23-06-2022, 15:07

aoineko wrote:

If you do not overwrite the RAM space allocated to the BIOS, the sub-slot information is directly accessible to the SLTTBL addresses. So there is no need to change the slot on page 3 to read this information.
Yes, this is a trick I don't use yet in MSXgl.

Yes, it is sometimes advantageous to use that and ASCII recommends it but you still have to change slots on page 3 to access the secondary slots.

By thegeps

Paragon (1031)

thegeps's picture

25-06-2022, 19:53

I did some experiment recently to have ram in page0 on my Turrican project, so I have the code ready. I won't use it (because I want Turrican to be compatible with all MSXes and 16KB machines don't have ram in page0) but it works, so if you want I can send it

Page 3/3
1 | 2 |