Skip to content

Commit

Permalink
Fixes for csharp
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlindfors committed May 24, 2024
1 parent ffef299 commit 7e24546
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 52 deletions.
29 changes: 29 additions & 0 deletions csharp/src/Emulator.XNA/AudioPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Coderox AB. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

/// <summary>
/// Represents an audio player for the emulator.
/// </summary>
internal class AudioPlayer : IAudio
{
/// <summary>
/// Gets a value indicating whether the audio player is currently playing.
/// </summary>
public bool IsPlaying => false;

/// <summary>
/// Starts playing the audio.
/// </summary>
public void Start()
{
throw new System.NotImplementedException();
}

/// <summary>
/// Stops playing the audio.
/// </summary>
public void Stop()
{
throw new System.NotImplementedException();
}
}
4 changes: 2 additions & 2 deletions csharp/src/Emulator.XNA/Emulator.XNA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Chip8;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Xml.Schema;
using Input = Microsoft.Xna.Framework.Input;

/// <summary>
Expand Down Expand Up @@ -59,7 +58,8 @@ protected override void Initialize()

var random = new RandomNumberGenerator();
var registers = new Registers();
this.cpu = new CPU(this.memory, registers, random, this.keyboard, screen);
var audio = new AudioPlayer();
this.cpu = new CPU(this.memory, registers, random, this.keyboard, screen, audio);

this.GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap;

Expand Down
Loading

0 comments on commit 7e24546

Please sign in to comment.