Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSFE] Illegal opcode 0xF2@0xEFFE #386

Closed
nelsonhef opened this issue Mar 16, 2024 · 4 comments
Closed

[NSFE] Illegal opcode 0xF2@0xEFFE #386

nelsonhef opened this issue Mar 16, 2024 · 4 comments

Comments

@nelsonhef
Copy link

nelsonhef commented Mar 16, 2024

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

@nelsonhef nelsonhef changed the title [NSFE] Unknown opcode 0xF2@0xEFFE [NSFE] Illegal opcode 0xF2@0xEFFE Mar 16, 2024
punesemu added a commit that referenced this issue Mar 18, 2024
…nd $FFFB even though it shouldn't since they are reserved for the NSF Player ("The vector table at $FFFA-FFFF should not be filled with code or data by the NSF. These can be overridden by hardware NSF players."). I have added the management of this eventuality (#386).
@punesemu
Copy link
Owner

Hi @nelsonhef , try with the last WIP.

@nelsonhef
Copy link
Author

nelsonhef commented Mar 18, 2024

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.

@punesemu
Copy link
Owner

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.

@nelsonhef
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants