mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Start wiring up some CD+G instructions
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RedBookPlayer.Models.Hardware.Karaoke;
|
||||
|
||||
namespace RedBookPlayer.Models.Hardware
|
||||
{
|
||||
@@ -106,30 +105,6 @@ namespace RedBookPlayer.Models.Hardware
|
||||
return lowerSixBits == 0x09;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read packet data according to the instruction, if possible
|
||||
/// </summary>
|
||||
/// <returns>Supported object created from data, null on error</returns>
|
||||
public object ReadData()
|
||||
{
|
||||
if(!IsCDGPacket())
|
||||
return null;
|
||||
|
||||
return (this.Instruction) switch
|
||||
{
|
||||
SubchannelInstruction.MemoryPreset => new MemPreset(this.Data),
|
||||
SubchannelInstruction.BorderPreset => new BorderPreset(this.Data),
|
||||
SubchannelInstruction.TileBlockNormal => new TileBlock(this.Data),
|
||||
SubchannelInstruction.ScrollPreset => new Scroll(this.Data),
|
||||
SubchannelInstruction.ScrollCopy => new Scroll(this.Data),
|
||||
SubchannelInstruction.DefineTransparentColor => null, // Undefined in documentation
|
||||
SubchannelInstruction.LoadColorTableLower => new LoadCLUT(this.Data),
|
||||
SubchannelInstruction.LoadColorTableUpper => new LoadCLUT(this.Data),
|
||||
SubchannelInstruction.TileBlockXOR => new TileBlock(this.Data),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user