I/O ports are quite messy... (Detect OpenMSX)

Page 2/5
1 | | 3 | 4 | 5

By Accumulator

Champion (328)

Accumulator's picture

08-04-2023, 02:05

But what I find also strange is specifications of the S-3527 mentions only VDP ports 98H & 99H
Some machines like NMS-8280 and 8250 have V9938 and S-3527..
So you cannot depend on the specifications of the MSX-ENGINE.

By gdx

Enlighted (6207)

gdx's picture

08-04-2023, 02:13

Grauw wrote:

If you go that far, then there are actually 65536 input and output ports, since I/O is really 16-bit Smile.

I don't go that far because the Z80 does not have an instruction that goes beyond 8 bits. Wink

Accumulator wrote:

But what I find also strange is specifications of the S-3527 mentions only VDP ports 98H & 99H

It's not strange because mirrors should not be taken into account. They are there only for economy.

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 02:18

I think the entire 98H-9FH block is reserved for the VDP, the unused ports are mirrored. So that the chip select signals provided by the S3527 can be used even if there is a newer VDP which uses additional I/O ports.

So for a machine with a S3527 and V99x8 (e.g. Philips NMS 8250), 98H-9BH will be mirrored once to 9CH-9FH. Whereas a machine with S3527 and TMS9918 (e.g. Philips VG-8020/19 or Yamaha SX-100), 98H-99H will be mirrored three more times to 9AH-9FH.

By Accumulator

Champion (328)

Accumulator's picture

08-04-2023, 02:20

@aineko
check the wiki , tools and detecting:
MSX wiki

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 02:28

gdx wrote:
Grauw wrote:

If you go that far, then there are actually 65536 input and output ports, since I/O is really 16-bit Smile.

I don't go that far because the Z80 does not have an instruction that goes beyond 8 bits. Wink

But it does? out (c),r is actually out (bc),r. Just the mnemonic is misleading, but as I said, there are several Z80 based systems which do make use of this (documented) 16-bit I/O address space, and even on MSX it is a documented possibility by ASCII.

Quote MSX Datapack:

Quote:

Also, since the Z80CPU has a 16-bit address in the I/O space, it is recommended to decode the upper 8 bits and access in 16 bits for IDs that can be expanded further in the future. In particular, devices connected by manufacturer IDs can be accessed in 16 bits to increase the address space for each ID by 256 times, making it possible to withstand future expansion.

By Accumulator

Champion (328)

Accumulator's picture

08-04-2023, 02:31

@gdx, it is not a mirror...
for V9938 you also need the 9A and 9B port....
nothing to do with mirroring..

@grauw,
Are you sure the VDP ports for eg VG8020 are only 98 and 99 and mirrored to 9A -9F?
My understanding says 98 and 99 might be mirrored to 9B and 9C only...
Blocks of 8 bytes...

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 02:27

Afaik S3527 was a part made available before MSX2 came around.

By gdx

Enlighted (6207)

gdx's picture

08-04-2023, 02:27

Grauw wrote:

I think the entire 98H-9FH block is reserved for the VDP, the unused ports are mirrored.

Not always mirrored.

By Grauw

Ascended (10767)

Grauw's picture

08-04-2023, 02:38

Not by definition, but in the case of machines using the S3527. Since it does not consider address bits 0-2, it leaves decoding of A0-A2 up to the VDP that is wired up. If the S3527 had decoded A1-A2, only 98H and 99H would be accessible and the chip would be unusable for MSX2 machines with V9938.

Which is why I say, ASCII probably specified the entire 98H-9FH range as reserved for the VDP, even a possible V9978 could use 9CH-9FH if it needed to and still use the S3527.

So for a generic MSX-SYSTEM / ENGINE chip this makes sense, to not decode those bits and allow to mirror. For machines with their own decoding logic, they might as well check specifically just for the I/O ports used by their specific VDP, since it is better not to mirror unnecessarily.

By gdx

Enlighted (6207)

gdx's picture

08-04-2023, 02:39

@Grauw, What is the machine code for OUT (BC),R? Is there IN R,(BC) or equivalent?

Page 2/5
1 | | 3 | 4 | 5