Wenn ich den Emulator mit einem ROM starte, spielt ein sehr lautes Interferenzgeräusch und der Emulator stürzt ab. Ich weiß nicht, ob es sich um ein Timing, ein Naudio- oder Spu -Emulationsfehler handelt. />
Wenn ich den Emulator mit einem ROM starte, spielt ein sehr lautes Interferenzgeräusch und der Emulator stürzt ab. Ich weiß nicht, ob es sich um ein Timing, ein Naudio- oder Spu -Emulationsfehler handelt. /> [code]public sealed class GameBoyEmulator : NexusConsoleGame { private readonly Processor _cpu; private readonly SoundProcessor _spu; private readonly MemoryManagement _mmu; private readonly PixelProcessor _ppu; private readonly Timer _timer; private readonly Joypad _joypad;
private double accumulatedTime; private int cpuCycles; private int cyclesThisUpdate;
public GameBoyEmulator(string rom) { _spu = new SoundProcessor(); _mmu = MemoryManagement.LoadGamePak(rom, _spu); _cpu = new Processor(_mmu); _ppu = new PixelProcessor(Graphic, _mmu); _timer = new Timer(_mmu); _joypad = new Joypad(_mmu); }
protected override void Load() { Settings.ColorPalette = new GameBoyColorPalette(); Settings.Font = new NexusFont("Consolas", new NexusSize(8)); Settings.Title = "NexusGB"; Settings.StopGameKey = NexusKey.Escape; }
private void HandleInterrupts() { var interruptEnable = _mmu.InterruptEnable; var interruptFlag = _mmu.InterruptFlag;
for (int i = 0; i < 5; i++) { if ((((interruptEnable & interruptFlag) >> i) & 0x01) == 1) { _cpu.ExecuteInterrupt(i); } }
_cpu.UpdateIme(); } } < /code> Dies ist die Soundprozesssinginit: < /p> public sealed class SoundProcessor { private readonly ImmutableArray _channels; private readonly WaveSoundChannel _wave;
public SoundProcessor() { _channels = [ new SquareSweepChannel(this), new SquareChannel(this), _wave = new WaveSoundChannel(this), new NoiseChannel(this) ];
public void Update(in int cycles) { if ((number52 & (1 = 0xFF27 and < 0xFF30: return 0x00; case >= 0xFF30 and < 0xFF40: return _wave.ReadRam((ushort)(address - 0xFF30)); }
public void WriteToSoundBuffer(in int channel, in Span totalBuffer, in int index, float sample) { sample *= Sound1Volume / 7f;
if ((number51 & (1 public abstract class BaseSoundChannel { private readonly byte[] _numbers; protected readonly int _channelNumber; protected readonly SoundProcessor _spu; protected readonly WindowsSoundOut _out;
private float volume;
public ref float ChannelVolume => ref volume;
protected BaseSoundChannel(SoundProcessor spu, in int channelNumber) { _numbers = new byte[5]; _channelNumber = channelNumber; _spu = spu; _out = new WindowsSoundOut();
ChannelVolume = 0.05f; }
public abstract void Update(in int cycles);
public virtual byte ReadNumber(in int index) => _numbers[index];
public virtual void WriteNumber(in int index, in byte value) => _numbers[index] = value; } < /code> Dies ist die tatsächliche Tonausgabe für ein Windows-Gerät: < /p> public sealed class WindowsSoundOut { private readonly DirectSoundOut soundOut; private readonly BufferedWaveProvider _provider; private readonly byte[] _addSampleData;
public int SampleRate => _provider.WaveFormat.SampleRate;
public WindowsSoundOut() { _provider = new BufferedWaveProvider(new WaveFormat(44100, 16, 2)); soundOut = new DirectSoundOut(100); soundOut.Init(_provider); soundOut.Play();
_addSampleData = new byte[_provider.BufferLength]; }
public void BufferSoundSamples(in Span sampleData, in int length) { var index = 0; foreach (var current in MemoryMarshal.Cast(sampleData)) { _addSampleData[index++] = current; }
_provider.AddSamples(_addSampleData, 0, length + sizeof(float)); //The `InvalidOperationException: "Buffer full"` from NAudio occurs here } } [/code] Der gesamte Quellcode kann hier gefunden werden>
Android Studios Emulator-Audio funktioniert nicht. Ich bin auf macos big sur. Bei Windows funktioniert es gut, wenn Sie Bootcamp verwenden, und ich habe versucht, NoxPlayer zu verwenden, und es...
Mein Pixel 2 Android -Emulator wird nicht von meiner App gesunden, nicht einmal von YouTube. Ich habe meinen Computer neu gestartet, kaltgeschaltet die App, aber nichts funktioniert. Ich kann ein...
Ich arbeite mit dem Android XR-Emulator für die Entwicklung von AR/VR-Anwendungen und möchte Handgesten testen.
Kennt jemand die Tastenkombination oder weiß, wie man Handgesten aktiviert? der...
Ich arbeite mit dem Android XR-Emulator für die Entwicklung von AR/VR-Anwendungen und möchte Handgesten testen.
Kennt jemand die Tastenkombination oder weiß, wie man Handgesten aktiviert? der...