MiSTer-devel / ZX-Spectrum_MISTer

43 stars 32 forks source link

Port FE is not working properly #21

Closed mambrino closed 3 years ago

mambrino commented 3 years ago

When bit 4 (EAR output) of port FE is set to 0 or 1 and that port is read back, it should return the same status in bit 6 (EAR input) if computer is an issue 3, always 0 or 1 until bit 3 is enabled (MIC output and indirectly EAR output) and any subsequent reading of the port would return the same written value, this would be the case of an issue 2, or it would always remain fixed at 0 or 1 regardless of the status written to bit 3, which is the wrong case and the one that occurs in some emulators and this core (it always returns 1).

This is not the appropriate behaviour for this port, because it doesn't fit any of the two issues and causes problems with some games, such as abu simbel or blinkys scary school.

More details can be found here: https://worldofspectrum.org/faq/reference/48kreference.htm (Port 0xfe section)

sorgelig commented 3 years ago

so bit 6 = bit 4 when reading back on issue 3?

mambrino commented 3 years ago

yes

sorgelig commented 3 years ago

try this version: ZX-Spectrum.zip

gyurco commented 3 years ago

It's true when the real EAR input is low. If bit 4 out = 0, then bit 6 input will follow the EAR input. If bit 4 out = 1, then the EAR input cannot pull down the ULA bit 6 input. Unconnected EAR input should be 0. On Issue 3, the MIC output doesn't really affect the ULA EAR input (bit 6), on Issue 2 it does.

mambrino commented 3 years ago

try this version: ZX-Spectrum.zip

now works as expected for an issue 3 thanks ;)

mambrino commented 3 years ago

would be possible to add issue 2 compatibility too with a menu option for switch between both issues? Games like Abu Simbel needs issue 2 keyboard for working properly

sorgelig commented 3 years ago

may be issue 2 is enough then?

mambrino commented 3 years ago

I've been testing and with issue 2 everything should work, but I don't know if there is any specific game that requires issue 3. As far as I know only these two games are issue 2 restricted: Abu Simbel Profanation and Rasputin 48k, but 128k models are not issue 2, so they could give problems. Maybe an issue 2/3 selector would be the best solution.

sorgelig commented 3 years ago

ok

mambrino commented 3 years ago

I've tested your last release, but seems to be a problem related to issue selector. When issue 3 mode is selected tape loading works perfectly, but when you select issue 2 there's no loading at all.

sorgelig commented 3 years ago

what you mean by "loading"?

mambrino commented 3 years ago

second menu option: load tape file (tap,csw,tzx), and after input load "", virtual tape start playing but if you have issue 2 selected, seems that the spectrum doesn't receive anything from tape and stay with gray border wating for data.

sorgelig commented 3 years ago

i see. may be i should ignore mic out level then

sorgelig commented 3 years ago

try this: ZX-Spectrum.zip

mambrino commented 3 years ago

Now virtual tape works (regardless of the selected issue), but there is another problem, the disciple d+ interface can no longer write to disk. If you try to save a program from basic or dump ram to disk from snapshot menu, the core crashes. Disk loading seems to work fine.

sorgelig commented 3 years ago

did you update Main?

sorgelig commented 3 years ago

can you provide me +d simple disk with may be some test basic file and instruction how to display catalog, read and write file? I've forgot everything about +3 disk already.

mambrino commented 3 years ago

yes. i'm testing with latest main version. Previous testing core (posted here 3 days ago) can write perfectly. test.zip

for display catalog: CAT 1 for loading: LOAD D1 "TEST" for writing: SAVE D1 "TEST"

EDIT: Test in +2 mode, there's no support for disciple in +3

mambrino commented 3 years ago

+3 native disk access has the same problem (reads but hangs when writing), maybe it has been affected with sd access changes from last core.

sorgelig commented 3 years ago

this should fix the write issue: MiSTer.zip

mambrino commented 3 years ago

now it works! thanks again ;)