OUT &H41,154 on Panasonic FS-A1WX

Página 2/2
1 |

Por Meits

Scribe (5863)

Imagen del Meits

06-02-2020, 20:04

251 here (a wx with 256k)

Por Grauw

Ascended (9071)

Imagen del Grauw

06-02-2020, 20:16

Ok, then I can’t explain the value used in the magazine Smile. If it was 155 then maybe they read the default value and then reset bit 0. But that doesn’t seem to be the case, unless the unused bits are floating and are indeterminate.

Por gdx

Prophet (3501)

Imagen del gdx

07-02-2020, 01:16

Grauw wrote:

The IF PEEK is unnecessary, but the rest is correct due to the way expanded (switched) I/O ports work.

Useful because some MSX1s can give a false positive value with INP(64).
And the 5.37MHz mode is appeared on Panasonic MSX2+ only.

Grauw wrote:

The IF PEEK(&H2D) is superfluous and potentially even prevents an MSX2 with turbo circuit mod that's listening to this port from working.

"OUT 64,8:IF INP(64)=247 THEN" prevents also it, so "IF PEEK(&H2D)" doesn't change anything.

Por Grauw

Ascended (9071)

Imagen del Grauw

07-02-2020, 13:14

gdx wrote:
Grauw wrote:

The IF PEEK is unnecessary, but the rest is correct due to the way expanded (switched) I/O ports work.

Useful because some MSX1s can give a false positive value with INP(64).
And the 5.37MHz mode is appeared on Panasonic MSX2+ only.

There is no harm outputting a value to this I/O address on such MSX1s.

gdx wrote:
Grauw wrote:

The IF PEEK(&H2D) is superfluous and potentially even prevents an MSX2 with turbo circuit mod that's listening to this port from working.

"OUT 64,8:IF INP(64)=247 THEN" prevents also it, so "IF PEEK(&H2D)" doesn't change anything.

Why couldn’t a turbo circuit implement an expanded I/O port?

The IF PEEK is really a superfluous check IMO, only makes the code longer without practical benefit.

By the way, what about not changing unrelated bits?

OUT &H40,8:IF INP(&H40)=247 THEN OUT &H41,INP(&H41) AND 254  ' Enable 5.37 MHz
OUT &H40,8:IF INP(&H40)=247 THEN OUT &H41,INP(&H41) OR 1     ' Disable 5.37 MHz

Lastly, looking at the openMSX implementation bit 2 = 0 seems to indicate whether turbo is available. Relevant for the Sanyo PHC-70FD I reckon, which does have the register but does not support turbo.

Por gdx

Prophet (3501)

Imagen del gdx

07-02-2020, 13:34

Grauw wrote:

There is no harm outputting a value to this I/O address on such MSX1s.

I/O ports not managed by some MSXs can give a random value.

Grauw wrote:

Why couldn’t a turbo circuit implement an expanded I/O port?

OUT &H40,8:? INP(&H40) returns the maker ID. So if someone makes a similar turbo circuit normally he will have to use another ID.

PEEK(&H2D) is not a always useful in program but for an exemple it is useful.

Por Grauw

Ascended (9071)

Imagen del Grauw

07-02-2020, 13:59

gdx wrote:
Grauw wrote:

There is no harm outputting a value to this I/O address on such MSX1s.

I/O ports not managed by some MSXs can give a random value.

So worst case the program thinks “the port is present”, outputs the value, and nothing bad happens.

gdx wrote:
Grauw wrote:

Why couldn’t a turbo circuit implement an expanded I/O port?

OUT &H40,8:? INP(&H40) returns the maker ID. So if someone makes a similar turbo circuit normally he will have to use another ID.

If the function is the same, it is okay to reuse the port. Otherwise all software that uses it would need to be adapted, that’s not realistic. The 1chipMSX does this for example, see its documentation.

Página 2/2
1 |