[ オリジナルレポート ]

BugID: #02701

カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
システムコア最小解決済み修正済み2008-12-03 01:142019-04-14 04:33
 
テスターhap担当者hapソース
バージョン0.128u4発生バージョン修正バージョン0.133u3
フラグ
セット z80.c
セット詳細
 
概 要SCF CCF XとYフラグ。
詳 細This affects all versions of MAME and MESS, I doubt any game relies on this, even ZEXALL doesn't catch it. SCF and CCF X and Y flags are wrong in MAME. Following information has been tested by me and confirmed by several guys in #openmsx freenode and #msxdev rizon IRC.

NEC: flags & A & 0x28
SGS/SHARP/ZiLOG: (flags | A) & 0x28
T9769C (Toshiba IC used in turboR): (flags & 0x28) | (A & 8)

What MAME does, is plain (A&0x28). The most common situation would be the 2nd one, so I suggest to implement that, until MAME emulates the trivial differences between chip brands, if ever.

change
OP(op,37) { z80->F = (z80->F & (SF|ZF|PF)) | CF | (z80->A & (YF|XF)); } /* SCF */
OP(op,3f) { z80->F = ((z80->F&(SF|ZF|PF|CF))|((z80->F&CF)<<4)|(z80->A&(YF|XF)))^CF; } /* CCF */

to:
OP(op,37) { z80->F = (z80->F & (SF|ZF|PF|XF|YF)) | CF | (z80->A & (YF|XF)); } /* SCF */
OP(op,3f) { z80->F = ((z80->F&(SF|ZF|PF|CF|XF|YF))|((z80->F&CF)<<4)|(z80->A&(YF|XF)))^CF; } /* CCF */
再現手順 
追加情報 
 
添付ファイルdiff fileu5_z80_39.diff (2008-12-10 04:05)