gasman / jsspeccy2

Ground-up rewrite of the Javascript Spectrum emulator
http://jsspeccy.zxdemo.org/
GNU General Public License v3.0
165 stars 43 forks source link

Z80 emulation errors #13

Closed mistificator closed 4 years ago

mistificator commented 4 years ago

I've tested JSSpeccy with Raxoft's Z80Test, and found some emulation errors. The processor instructions listed below did not pass the test (as it was printed by full test, z80full.tap):

SCF
CCF 
BIT N, (HL)
BIT N, [R, (HL)]
INI
IND
INIR
INDR

z80 fail If we can trust this test, and consider it a reference, then at least these results mean that JSSpeccy's Z80 emulation is not fully compliant with undocumented features of original CPU. It is necessary to carefully inspect the results of this diagnosis. Perhaps these errors are the main reason of such undesired behavoir as rebooting or hanging in some games. Or perhaps these errors mean nothing.

FUSE emulator does not have troubles with this test, and Spectaculator has the same errors as JSSpeccy.

mistificator commented 4 years ago

I discovered it's all about accuracy of setting of 3 and 5 bit of F register. I didn't know that crazy thing before.