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

ページ 1/5
| 2 | 3 | 4 | 5

By Accumulator

Champion (351)

Accumulator さんの画像

07-04-2023, 17:14

Almost all posts writable only have value FFH
Ports writable only have most of time value of 8BH
Ports readable and writable have a value most of time <> FFH

OpenMSX very very very easy to detect by ports and values.. child play!
Almost all ports in #90 - #AF region return #FF not correct...

Blocks mirrored are in addresses space between #A0 and AF all have 4 ports, total 8 ports (S1985)
RTC looks mirrired. but is not, (have tried all variations),
if RTC was mirrored it should have started at #B0, but uses only the upper 4 (#b4 - #b7 mirrored) ports (writing to the upper ports from the upper ports (#b6 and #b7) does not do anything.

Same for BackupRAM and Bitmap #40H
When opened and setting up BR and Bitmap
Looks like: #40H 01 8B FE 8B 8B 8B 8B FE
the FE can vary depending on the values written to correct registers

Screenshot of REAL MSX Ports (Sony HB-F700D)

ログイン/登録して投稿

By Accumulator

Champion (351)

Accumulator さんの画像

07-04-2023, 18:19

Screenshot from OpenMSX (Sony HB-F700D)

See the differences???

If this way of emulating and showing value of ports... Easy to Detect!!! Agree???

By Accumulator

Champion (351)

Accumulator さんの画像

07-04-2023, 18:23

Not Sorry, but it is just funny that it is not really hard to detect OpenMSX at all..
How many ways have I found already.... And I think I can find plenty more....
It started when I was trying to find all configurations of the VDP... and as additional obsession... find ways to detect...

By aoineko

Paragon (1135)

aoineko さんの画像

07-04-2023, 21:41

If you are so passionate about detection, wouldn't you like to create a detection code for PAC and Game Master cartridges? ^^

Anyway, I think it's a shame that we can't find an agreement to detect the execution environment of a MSX program properly. This would be very useful for debugging tools (ideally hardware directly connected to MSX but also emulator's debuggers). Through a free I/O port for example.

By Accumulator

Champion (351)

Accumulator さんの画像

07-04-2023, 23:26

PAC = FM-PAC? PANA with SRAM?

By aoineko

Paragon (1135)

aoineko さんの画像

08-04-2023, 00:18

PAC is FM-PAC without MSX-Music :)

By gdx

Enlighted (6429)

gdx さんの画像

08-04-2023, 01:37

In fact, an MSX doesn't have 256 readable / writeable ports but 256 output ports and 256 input ports. The two are independent. If they are grouped together, it is for convenience. When an input port is unused, it returns an undetermined value (generally FFh) which can vary from one MSX to another. And all the more so as there may be mirrors. So it doesn't matter to find different values on emulator or another MSX. Only mirrors are better to emulate.

By Manuel

Ascended (19677)

Manuel さんの画像

08-04-2023, 01:37

The mirroring is a matter of changing the XML description of the machine.

By Grauw

Ascended (10820)

Grauw さんの画像

08-04-2023, 01:58

gdx wrote:

In fact, an MSX doesn't have 256 readable / writeable ports but 256 output ports and 256 input ports. The two are independent. If they are grouped together, it is for convenience. When an input port is unused, it returns an undetermined value (generally FFh) which can vary from one MSX to another. And all the more so as there may be mirrors. So it doesn't matter to find different values on emulator or another MSX. Only mirrors are better to emulate.

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

Quote The Undocumented Z80 Documented:

引用:

4.4 16 Bit I/O ports

Officially the Z80 has an 8 bit I/O port address space. When using the I/O ports, the 16 address lines are used. And in fact, the high 8 bit do actually have some value, so you can use 65536 ports after all. IN r,(C), OUT (C),r, and the Block I/O instructions actually place the entire BC register on the address bus. Similarly IN A,(n) and OUT (n),A put A × 256 + n on the address bus.

The INI/INIR/IND/INDR instructions use BC after decrementing B, and the OUTI/OTIR/OUTD/OTDR instructions before.

It is not actually undocumented since the Z80 manual makes mention of this, and several non-MSX machines use this property for their I/O, e.g. the Sam Coupé’s sound chip and I believe the Amstrad CPC as well. Even on MSX ASCII recommends to use this to extend the expanded I/O address space (ports 40H-4FH), although I know of no device which uses this in practice.

By Accumulator

Champion (351)

Accumulator さんの画像

08-04-2023, 01:57

Why can an undetermined value differ by machine?
Pictures above shows real and emulated.... different not?

By Grauw

Ascended (10820)

Grauw さんの画像

08-04-2023, 02:05

Accumulator wrote:

Why can an undetermined value differ by machine?

Because the value read from an unconnected I/O port depends on whether the data bus has pull-ups (which results in 0FFH being read) (not the case on many machines, especially MSX1), and if there are no pull-ups, what was previously on the data bus plus inherent NMOS pull-up properties of all the devices connected to the data bus, and how strong those pull-ups are and how much time has passed. This all depends on the hardware circuit of specific machine models, and the chips used.

The Sony HB-F700D has pull-ups, which is why all unconnected I/O ports return 0FFH.

ページ 1/5
| 2 | 3 | 4 | 5