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.
If you go that far, then there are actually 65536 input and output ports, since I/O is really 16-bit .
I don't go that far because the Z80 does not have an instruction that goes beyond 8 bits.
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.
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.
@aineko
check the wiki , tools and detecting:
MSX wiki
If you go that far, then there are actually 65536 input and output ports, since I/O is really 16-bit .
I don't go that far because the Z80 does not have an instruction that goes beyond 8 bits.
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:
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.
@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...
Afaik S3527 was a part made available before MSX2 came around.
I think the entire 98H-9FH block is reserved for the VDP, the unused ports are mirrored.
Not always mirrored.
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.
@Grauw, What is the machine code for OUT (BC),R? Is there IN R,(BC) or equivalent?