Skip to content

Static usage preventing multiple NSFPlayer instances #1

@meckzqz

Description

@meckzqz

Hello! You may not remember me, but we used to chat many years ago while I was using your C# Mega Man Engine project (my project was called Mega Man Time Tangent). Great idea for making a standalone version of this NSF player, and from my profiling in Unity the performance is excellent!

Currently, due to critical components of emulation depending on static classes/fields (Nes.Cpu, Apu.Mixer, etc.), attempting to have multiple NSFPlayer instances playing simultaneously (say, for synthesizing sound effects and music) results in undefined behaviour and crashes. On my end, I've hacked in some dependency injection where necessary (for example, Board now has a local reference to an Nes), and while simultaneous playback now works, the solution doesn't seem ideal.

I'd be curious to hear your thoughts on a proper solution to this limitation of the library, and would be happy to implement the fix myself and create a pull request.

Thanks for the library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions