| カテゴリ | 重要度 | ステータス | 解決状況 | 登録日時 | 最終更新 |
|---|---|---|---|---|---|
システムコア | 低 | 解決済み | 修正済み | 2013-11-18 06:45 | 2013-11-18 18:51 |
| テスター | jwdonal | 担当者 | AWJ | ソース | |
| バージョン | 0.151 | 発生バージョン | 修正バージョン | 0.152 | |
| 修正コミット | プルリク | ||||
| フラグ | |||||
| セット | SNES | ||||
| セット詳細 | |||||
| 概 要 | BRK命令実行中、PSレジスタをスタックにプッシュしているとき、SPC-700がBフラグを設定してしまう。 | ||||
| 詳 細 | When the PS register is pushed to the stack during execution of the BRK instruction the B flag is getting set. This should not happen. The B flag is only set _after_ the PS register is pushed to the stack (mess is doing this part correctly). Setting the B flag before writing the PS to the stack happens on both 6502/65816 (i.e. NES/SNES processors) so I'm guessing this is an incorrect carry-over from one of those processors. The bug is located in \src\emu\cpu\spc700\spc700.c line 703. The "GET_REG_P_BRK" should be replaced with just "GET_REG_P". Just to re-iterate, the B flag _should_ be set _after_ the PS register is pushed to the stack (mess is already doing this properly). But the B flag should _not_ be set _before_ pushing to the stack. I marked this bug as minor since I don't think there are many games that even look at the B flag at all. But I could be wrong...maybe there are lots of games that use it...? | ||||
| 再現手順 | Load any ROM which causes the BRK instruction to be executed on the SPC-700. I just wrote a small test ROM myself. The source for the test rom follows (compile with tasm and convert to sfc with spc2rom): .title "brk_bug" .fill 0200h-*,000h start: brk jmp start brk_vec: reti .fill $FF84-*,$00 .fill $FFC0-*,$FF ; 60 bytes of $FF for SPC2ROM .fill 010000h-*,000h ; Start of TCALL vector space .org $FFDE .dw brk_vec .end | ||||
| 追加情報 | I tested the instruction running on a real SNES using a logic analyzer and watched each cycle of the instruction as it executed. I can provide you the logic analyzer trace if you like, but I don't think that's necessary. You could test the same thing without a logic analyzer by executing the BRK instruction on a real SPC700 and then popping the last byte off the stack within the BRK service routine - you will see that the B flag was not set before it was written to the stack. | ||||
| 添付ファイル | |||||