BizHawk/BizHawk.Emulation.Cores/Computers/Commodore64/Media/PRG.cs

29 lines
524 B
C#
Raw Normal View History

using BizHawk.Emulation.Cores.Computers.Commodore64.MOS;
2016-02-22 23:50:11 +00:00
namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
{
2016-02-22 23:50:11 +00:00
public static class Prg
{
2016-02-22 23:50:11 +00:00
public static void Load(Chip90611401 pla, byte[] prgFile)
{
2016-02-22 23:50:11 +00:00
var length = prgFile.Length;
2017-04-24 13:35:05 +00:00
if (length <= 2)
{
return;
}
2016-02-22 23:50:11 +00:00
2017-04-24 13:35:05 +00:00
var addr = prgFile[0] | (prgFile[1] << 8);
var offset = 2;
unchecked
{
while (offset < length)
{
pla.Write(addr, prgFile[offset]);
offset++;
addr++;
}
}
}
}
}