Skip to content

Commit

Permalink
Update for display contract changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Feb 8, 2024
1 parent 2607994 commit 1e38ef5
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Source/Juego/IJuegoHardware.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Meadow.Foundation.Audio;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Leds;
using Meadow.Foundation.Sensors.Accelerometers;
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;

namespace WildernessLabs.Hardware.Juego
{
Expand All @@ -15,7 +15,7 @@ public interface IJuegoHardware
/// <summary>
/// Gets the graphics display interface
/// </summary>
public IGraphicsDisplay? Display { get; }
public IPixelDisplay? Display { get; }

/// <summary>
/// Gets the right/up button
Expand Down
4 changes: 2 additions & 2 deletions Source/Juego/JuegoHardwareV1.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Meadow;
using Meadow.Foundation.Audio;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Leds;
using Meadow.Foundation.Sensors.Accelerometers;
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Units;
using System;

Expand All @@ -21,7 +21,7 @@ public class JuegoHardwareV1 : IJuegoHardware
protected IF7FeatherMeadowDevice Device { get; }

/// <inheritdoc/>
public IGraphicsDisplay? Display { get; }
public IPixelDisplay? Display { get; }

/// <inheritdoc/>
protected ISpiBus? SpiBus { get; }
Expand Down
4 changes: 2 additions & 2 deletions Source/Juego/JuegoHardwareV2.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Meadow;
using Meadow.Foundation.Audio;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Foundation.Leds;
using Meadow.Foundation.Sensors.Accelerometers;
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Units;
using System;
using System.Threading;
Expand All @@ -27,7 +27,7 @@ public class JuegoHardwareV2 : IJuegoHardware
/// <inheritdoc/>
protected IDigitalOutputPort? Mcp_Reset { get; }
/// <inheritdoc/>
public IGraphicsDisplay? Display { get; }
public IPixelDisplay? Display { get; }
/// <inheritdoc/>
public IDigitalOutputPort? DisplayBacklightPort { get; }
/// <inheritdoc/>
Expand Down
4 changes: 2 additions & 2 deletions Source/Juego/JuegoHardwareV3.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Meadow;
using Meadow.Foundation.Audio;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Foundation.Leds;
using Meadow.Foundation.Sensors.Accelerometers;
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Units;
using System;
using System.Threading;
Expand All @@ -32,7 +32,7 @@ public class JuegoHardwareV3 : IJuegoHardware
/// <inheritdoc/>
protected IDigitalOutputPort? Mcp_Reset { get; }
/// <inheritdoc/>
public IGraphicsDisplay? Display { get; }
public IPixelDisplay? Display { get; }
/// <inheritdoc/>
public IDigitalOutputPort? DisplayBacklightPort { get; }
/// <inheritdoc/>
Expand Down
3 changes: 2 additions & 1 deletion Source/Juego_Demo/DisplayController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Meadow;
using Meadow.Foundation;
using Meadow.Foundation.Graphics;
using Meadow.Peripherals.Displays;
using Meadow.Units;

namespace Juego_Demo
Expand Down Expand Up @@ -133,7 +134,7 @@ public bool SelectButtonState
bool isUpdating = false;
bool needsUpdate = false;

public DisplayController(IGraphicsDisplay display)
public DisplayController(IPixelDisplay display)
{
graphics = new MicroGraphics(display)
{
Expand Down
14 changes: 10 additions & 4 deletions Source/Juego_Demo/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ public override Task Initialize()
startButton.PressEnded += (s, e) => displayController.StartButtonState = false;
}

audioLeft = new MicroAudio(juego.LeftSpeaker);
audioRight = new MicroAudio(juego.RightSpeaker);
if (juego.LeftSpeaker != null)
{
audioLeft = new MicroAudio(juego.LeftSpeaker);
audioRight = new MicroAudio(juego.RightSpeaker);
}

return Task.CompletedTask;
}
Expand All @@ -107,8 +110,11 @@ public async override Task Run()
juego.MotionSensor.StartUpdating(TimeSpan.FromMilliseconds(250));
}

await audioLeft.PlaySystemSound(SystemSoundEffect.PowerUp);
await audioRight.PlayGameSound(GameSoundEffect.LevelComplete);
if (juego.LeftSpeaker != null)
{
await audioLeft.PlaySystemSound(SystemSoundEffect.PowerUp);
await audioRight.PlayGameSound(GameSoundEffect.LevelComplete);
}

return;
}
Expand Down
15 changes: 7 additions & 8 deletions Source/Juego_Prototype/Games/FrogIt/FrogItGame.Art.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Juego;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.Buffers;
using Meadow.Foundation.Graphics.Buffers;
using Meadow.Peripherals.Displays;

namespace Juego.Games
{
Expand Down Expand Up @@ -36,7 +35,7 @@ void InitBuffers()
logDarkCenter = (new Buffer1bpp(8, 8, logDarkC)).RotateAndConvert<Buffer1bpp>(RotationType._90Degrees);
logDarkRight = (new Buffer1bpp(8, 8, logDarkR)).RotateAndConvert<Buffer1bpp>(RotationType._90Degrees);

byte[] crocL= { 0x3f, 0x88, 0xc2, 0xe0, 0xf0, 0xa0, 0x01, 0xff }; //log left
byte[] crocL = { 0x3f, 0x88, 0xc2, 0xe0, 0xf0, 0xa0, 0x01, 0xff }; //log left
byte[] crocC = { 0xff, 0x83, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x31 };
byte[] crocR = { 0xff, 0xff, 0xff, 0x0f, 0x07, 0x01, 0x70, 0xff };

Expand Down Expand Up @@ -67,18 +66,18 @@ void InitBuffers()
{ 0xe3, 0x3a, 0x5e, 0xfc, 0xfc, 0x5e, 0x3a, 0xe3 }, // {0x81, 0xE7, 0x3C, 0x7E, 0x7E, 0xDB, 0xBD, 0x99},

// Bigger logs
{0x3C, 0x7E, 0xD7, 0xB5, 0xAD, 0xBF, 0xFF, 0xED},
{0xAD, 0xAD, 0xFF, 0xB7, 0xF5, 0xBF, 0xB7, 0xAD},
{0x3C, 0x7E, 0xD7, 0xB5, 0xAD, 0xBF, 0xFF, 0xED},
{0xAD, 0xAD, 0xFF, 0xB7, 0xF5, 0xBF, 0xB7, 0xAD},
{0xED, 0xBD, 0xC3, 0xBD, 0xA5, 0xBD, 0x42, 0x3C},

// Trucks
{0x00, 0x7F, 0x41, 0x55, 0x55, 0x55, 0x55, 0x55},
{0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55},
{0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55},
{0x41, 0x7F, 0x22, 0x7F, 0x7F, 0x63, 0x22, 0x1C},

// Crocs
{0x41, 0x63, 0x46, 0x6E, 0x7C, 0x7E, 0x7A, 0x3E},
{0xBC, 0xFE, 0x7E, 0x3E, 0xBE, 0xBE, 0xFC, 0x7C},
{0xBC, 0xFE, 0x7E, 0x3E, 0xBE, 0xBE, 0xFC, 0x7C},
{0x78, 0x38, 0x38, 0x38, 0x70, 0x60, 0x60, 0x40},

// Cars
Expand Down
1 change: 1 addition & 0 deletions Source/Juego_Prototype/IOConfig/Config_1a_St7789.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Peripherals.Leds;

namespace Juego
Expand Down
1 change: 1 addition & 0 deletions Source/Juego_Prototype/IOConfig/Config_1c_Ssd1351.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Peripherals.Leds;

namespace Juego
Expand Down
1 change: 1 addition & 0 deletions Source/Juego_Prototype/IOConfig/Config_1c_St7735.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Peripherals.Leds;

namespace Juego
Expand Down
1 change: 1 addition & 0 deletions Source/Juego_Prototype/IOConfig/Config_1c_St7789.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Peripherals.Leds;

namespace Juego
Expand Down
1 change: 1 addition & 0 deletions Source/Juego_Prototype/IOConfig/Config_proto_Sh1106_Spi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Foundation.Sensors.Hid;
using Meadow.Hardware;
using Meadow.Peripherals.Displays;
using Meadow.Peripherals.Leds;

namespace Juego
Expand Down

0 comments on commit 1e38ef5

Please sign in to comment.