public ROM(ushort address, ushort size, C64Interfaces.IFile file) : base(address, (uint)size) { _memory = new byte[size]; file.Read(_memory, 0, size); }
public GCRImage(C64Interfaces.IFile diskImage) { ushort id = 0; byte[] sector = new byte[RAW_SECT_LEN]; int offset = 0; _tracks = new byte[TRACK_COUNT][]; for (byte i = 0; i < TRACK_COUNT; i++) { byte track = (byte)(i >> 1); _tracks[i] = new byte[SPT[track] * GCR_SECTOR_LEN]; if ((i & 1) == 0) { if ((ulong)offset < diskImage.Size) { ushort start = 0; for (byte j = 0; j < SPT[track]; j++) { diskImage.Read(sector, offset, RAW_SECT_LEN); ConvertSectorToGCR(sector, _tracks[i], ref start, j, (byte)(track + 1), id); offset += RAW_SECT_LEN; } } } else { ushort start = 0; for (byte j = 0; j < SPT[track]; j++) ConvertSectorToGCR(sector, _tracks[i], ref start, j, (byte)(track + 1), id); } } }