Skip to content

Commit ae6f35c

Browse files
committed
[AlphaDream] Small cleanup
1 parent 043a49b commit ae6f35c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

VG Music Studio/Core/GBA/AlphaDream/Track.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@ public int GetPitch()
2727
public Track(byte i, Mixer mixer)
2828
{
2929
Index = i;
30-
// TODO: PSG Channels 3 and 4 are also usable
31-
Type = i >= 8 ? i % 2 == 0 ? "Square 1" : "Square 2" : "PCM8";
32-
Channel = i >= 8 ? (Channel)new SquareChannel(mixer) : new PCMChannel(mixer);
30+
if (i >= 8)
31+
{
32+
Type = Utils.PSGTypes[i & 3];
33+
Channel = new SquareChannel(mixer); // TODO: PSG Channels 3 and 4
34+
}
35+
else
36+
{
37+
Type = "PCM8";
38+
Channel = new PCMChannel(mixer);
39+
}
3340
}
3441
// 0x819B040
3542
public void Init()

VG Music Studio/Core/GBA/Utils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ internal static class Utils
77

88
public const int CartridgeOffset = 0x08000000;
99
public const int CartridgeCapacity = 0x02000000;
10+
11+
public static readonly string[] PSGTypes = new string[4] { "Square 1", "Square 2", "PCM4", "Noise" };
1012
}
1113
}

0 commit comments

Comments
 (0)