I noticed that the status register 0 of the TMS99xx doesn't return the right values by default.
My MSX2 and turbo R return always the same following values after reset and a screen mode change with "A$= BIN$(vdp(8))".
In screen0: 10011111
In screen1: 10011111
In screen2: 10011111
OpenMSX return also the same values whatever the VDP but...
The real National CF-2700 :
In screen0: 11001000
In screen1: 10011111
In screen2: 11010001
The real Toshiba HX-10DP returns:
In screen0: 11001000
In screen1: 11001111
In screen2: 11010001
In screen 2, It does appear that there is a sprite overflow situation on sprite n. 17
In screen 0 there is a sprite overflow on sprite 8. A mode without sprites?
In screen 1 of Toshiba there is a sprite overflow on sprite 15
Weird that screen 0 there is a sprite overflow status
Which VDP's are in these machines you tried that on, gdx?
Probably a TMS9918ANL for the National CF-2700 and I don't know for the Toshiba HX-10DP, Maybe a TMS9918A. There is a heatsink.
There is another bug which is not insignificant. The VDP type test on the wiki works fine on OpenMSX and other emulators but not on real MSX1. It works fine too on real MSX2 and Turbo R. On real MSX1 the returned value changes sometime randomly. (Tested many times on two real Japanese MSX1)
I fixed the routine but it would be nice if this different behavior was emulated.
We can only fix it if you explain what is actually going on.... that goes for all these things.
I assume you’re referring to this detection code?
Status register 1 does not exist on TMS9918. Thus, you read the 5th sprite bits of status register 0, it seems the routine relies on this. I think the 5th sprite bits give the internal sprite counter of the VDP until it is latched when a 5th sprite is found, or something like that (your findings seem to suggest this is only the case on TMS9918 and not V99x8). Therefore, if you use this value you may get various values. I think this is not implemented on openMSX, which could explain the difference.
p.s. Register 15 does not exist on TMS9918, so due to the mirroring you are writing the value 8 and then 0 to register 7, rather than restoring it to its original value. This can mess up the text and background colour (leave the screen blank).
@Grauw can you also say such sensible things about the status register 0 findings at the top of this page?
I think the 5th sprite bits give the internal sprite counter of the VDP until it is latched when a 5th sprite is found, or something like that (your findings seem to suggest this is only the case on TMS9918 and not V99x8). Therefore, if you use this value you may get various values. I think this is not implemented on openMSX, which could explain the difference.
If someone designs tests to find out how it works in enough detail, we'd be happy to implement it.
I don’t know (haven’t tested) the exact behaviour. It is more a suspicion than a known fact. I think I recall Tom Harte implemented something in his CLK emulator. Or maybe it was someone else and something similar related to s#3-s#6.
Knowing the exact behaviour can potentially be very useful, it might allow to detect the current position of the raster beam with some sprites placed across the screen vertically. But exact details on how this behaves on each VDP are needed.