Are the values of Z80 registers on ROM init meaningful?

페이지 2/2
1 |

By zeilemaker54

Champion (312)

zeilemaker54의 아바타

28-07-2021, 12:23

I would advice against using the Z80 register values, as those are not guaranteed by the standard.
If an alternative code is used for CALSLT in a alternative BIOS (C-BIOS) or even may be an other kind of slotswitch hardware, this will cause compatibility issues.
For example, the MSXDOS2 version of CALSLT use the Z80 registers differently.

By gdx

Enlighted (4721)

gdx의 아바타

29-07-2021, 10:32

C-BIOS is not a official BIOS but registers assignment is the same. Ditto for the GR8BIT. HL is the pointer to INIT, STATEMENT, DEVICE or TEXT. DE is the content of the pointed address, and C is the current ROM slot ID. In the past, I had seen the description of these registers in partial developer documentation (no info about the others). That's why I checked on emulator.

zeilemaker54 wrote:

For example, the MSXDOS2 version of CALSLT use the Z80 registers differently.

We are talking about the ROM slot search routines which is performed only during the MSX initialization to Main-ROM. MSX-DOS2 is therefore unrelated at all.

By Grauw

Ascended (10074)

Grauw의 아바타

29-07-2021, 10:43

ROM loaders can often boot games without restarting, and there is no guarantee how they do it…

By gdx

Enlighted (4721)

gdx의 아바타

29-07-2021, 10:51

I saw a few Roms that use C register to get the slot ID, and I also do it for 2 or 3 Roms for lack of space. So it would be nice if the loaders take that into account even if it's only optional.

By Grauw

Ascended (10074)

Grauw의 아바타

29-07-2021, 12:00

The slot ID is handy for sure, it saves implementing a GetSlotId routine for ROMs that only need to swap themselves into page 2. Unfortunate that it is not documented.

By zeilemaker54

Champion (312)

zeilemaker54의 아바타

29-07-2021, 19:28

gdx wrote:

C-BIOS is not a official BIOS but registers assignment is the same. Ditto for the GR8BIT. HL is the pointer to INIT, STATEMENT, DEVICE or TEXT. DE is the content of the pointed address, and C is the current ROM slot ID. In the past, I had seen the description of these registers in partial developer documentation (no info about the others). That's why I checked on emulator.

zeilemaker54 wrote:

For example, the MSXDOS2 version of CALSLT use the Z80 registers differently.

We are talking about the ROM slot search routines which is performed only during the MSX initialization to Main-ROM. MSX-DOS2 is therefore unrelated at all.

You are right, we are talking about the ROM search routine. But the same applies here of course. If I implement a custom BIOS which does implement for example a custom slot search (is fully acceptable in the true expandable way MSX is designed), the ROM search routine will be different and so will probably the register use. As the use of the ROM search routine registers is not documented, this will cause compatibility problems.
True MSX software follow the code best practice to avoid compatibility problems and run on any (future) MSX.
I do not see the problem to include a few bytes extra code to avoid any compatibility problems with future MSX versions.

페이지 2/2
1 |