punesemu/puNES

[NSFE] Illegal opcode 0xF2@0xEFFE

nelsonhef opened this issue · 4 comments

Hi!

The following NSFe file (Kirby's Adventure CRC: b02b8838) doesn't output sound and returns a illegal opcode 0xF2 in the latest WIP (74252de) and below. Tried all relevant commits down to the 0.111 release and all gave the same error although at different PC. The 0.110 release plays fine.

WIP 74252de - cpu : alert PC = 0xEFFE, CODEOP = 0xF2
0.111 release - cpu: alert PC = 0xFA39, CODEOP = 0x52
0.110 release - works.

nosound.zip

Hi @nelsonhef , try with the last WIP.

Hi @punesemu, i tried the latest WIP (a51c9f4) and now the NSFE file produces sound output, but i had another Illegal opcode 0x02@0xA566 while playing Song 0 (Green Fields). I was able to find two ways to reproduce the issue:

  • If the "Playlist" is "On", let the first two tracks play. On track 3 (Song 0) the illegal opcode occurs at about 3 sec before the end of the track.
  • If the "Playlist" is "Off", turn on the "Repeat" and play the Song 0. After the first playback, the second one fails with the illegal opcode about 3 sec to the end of the track.

Thx @nelsonhef, can you test the last WIP?
P.S. This NSFe executes a JMP $ABS instruction at address 0xFFF9. This instruction occupies 3 bytes and therefore occupies the memory area that goes from 0xFFF9 and 0xFFFB but the addresses 0xFFFA and 0xFFFB should be occupied by the NMI vector and, according to the NSF specifications, are reserved for the player.

Fixed in b6dc62f. Thank you for the fix and the detailed explanation of the issue.