spaces to tabs in C64 files
This commit is contained in:
parent
5247e1d357
commit
3dd5478efd
|
@ -5,6 +5,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
public partial class C64 : IDriveLight
|
public partial class C64 : IDriveLight
|
||||||
{
|
{
|
||||||
public bool DriveLightEnabled { get { return _board != null && (_board.CartPort.DriveLightEnabled || _board.Serial.DriveLightEnabled); } }
|
public bool DriveLightEnabled { get { return _board != null && (_board.CartPort.DriveLightEnabled || _board.Serial.DriveLightEnabled); } }
|
||||||
public bool DriveLightOn { get { return _board != null && (_board.CartPort.DriveLightOn || _board.Serial.DriveLightOn);} }
|
public bool DriveLightOn { get { return _board != null && (_board.CartPort.DriveLightOn || _board.Serial.DriveLightOn); } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_memoryDomains = new MemoryDomainList(domains);
|
_memoryDomains = new MemoryDomainList(domains);
|
||||||
((BasicServiceProvider) ServiceProvider).Register(_memoryDomains);
|
((BasicServiceProvider)ServiceProvider).Register(_memoryDomains);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class C64MemoryDomainFactory
|
private static class C64MemoryDomainFactory
|
||||||
|
|
|
@ -89,8 +89,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
|
|
||||||
DeterministicEmulation = true;
|
DeterministicEmulation = true;
|
||||||
|
|
||||||
((BasicServiceProvider) ServiceProvider).Register<IVideoProvider>(_board.Vic);
|
((BasicServiceProvider)ServiceProvider).Register<IVideoProvider>(_board.Vic);
|
||||||
((BasicServiceProvider) ServiceProvider).Register<IDriveLight>(this);
|
((BasicServiceProvider)ServiceProvider).Register<IDriveLight>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -175,7 +175,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
|
|
||||||
private void DoCycle()
|
private void DoCycle()
|
||||||
{
|
{
|
||||||
if (_frameCycles == 0) {
|
if (_frameCycles == 0)
|
||||||
|
{
|
||||||
_board.InputRead = false;
|
_board.InputRead = false;
|
||||||
_board.PollInput();
|
_board.PollInput();
|
||||||
_board.Cpu.LagCycles = 0;
|
_board.Cpu.LagCycles = 0;
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Cartridge
|
||||||
pinExRom = true;
|
pinExRom = true;
|
||||||
|
|
||||||
// for safety, initialize all banks to dummy
|
// for safety, initialize all banks to dummy
|
||||||
for (var i = 0; i < 64*0x2000; i++)
|
for (var i = 0; i < 64 * 0x2000; i++)
|
||||||
{
|
{
|
||||||
_banksA[i] = 0xFF;
|
_banksA[i] = 0xFF;
|
||||||
_banksB[i] = 0xFF;
|
_banksB[i] = 0xFF;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
|
|
||||||
private byte CpuRead(ushort addr)
|
private byte CpuRead(ushort addr)
|
||||||
{
|
{
|
||||||
return unchecked((byte) Read(addr));
|
return unchecked((byte)Read(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CpuWrite(ushort addr, byte val)
|
private void CpuWrite(ushort addr, byte val)
|
||||||
|
@ -123,25 +123,29 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
[SaveState.DoNotSave]
|
[SaveState.DoNotSave]
|
||||||
public int A
|
public int A
|
||||||
{
|
{
|
||||||
get { return _cpu.A; } set { _cpu.A = unchecked((byte)value); }
|
get { return _cpu.A; }
|
||||||
|
set { _cpu.A = unchecked((byte)value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[SaveState.DoNotSave]
|
[SaveState.DoNotSave]
|
||||||
public int X
|
public int X
|
||||||
{
|
{
|
||||||
get { return _cpu.X; } set { _cpu.X = unchecked((byte)value); }
|
get { return _cpu.X; }
|
||||||
|
set { _cpu.X = unchecked((byte)value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[SaveState.DoNotSave]
|
[SaveState.DoNotSave]
|
||||||
public int Y
|
public int Y
|
||||||
{
|
{
|
||||||
get { return _cpu.Y; } set { _cpu.Y = unchecked((byte)value); }
|
get { return _cpu.Y; }
|
||||||
|
set { _cpu.Y = unchecked((byte)value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[SaveState.DoNotSave]
|
[SaveState.DoNotSave]
|
||||||
public int S
|
public int S
|
||||||
{
|
{
|
||||||
get { return _cpu.S; } set { _cpu.S = unchecked((byte)value); }
|
get { return _cpu.S; }
|
||||||
|
set { _cpu.S = unchecked((byte)value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[SaveState.DoNotSave]
|
[SaveState.DoNotSave]
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case C64.CiaType.Ntsc:
|
case C64.CiaType.Ntsc:
|
||||||
return new Cia(14318181, 14*60, readIec)
|
return new Cia(14318181, 14 * 60, readIec)
|
||||||
{
|
{
|
||||||
DelayedInterrupts = true
|
DelayedInterrupts = true
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
{
|
{
|
||||||
_sampleRate = sampleRate;
|
_sampleRate = sampleRate;
|
||||||
_cpuCyclesNum = cyclesNum;
|
_cpuCyclesNum = cyclesNum;
|
||||||
_sampleCyclesDen = cyclesDen*sampleRate;
|
_sampleCyclesDen = cyclesDen * sampleRate;
|
||||||
|
|
||||||
_envelopes = new Envelope[3];
|
_envelopes = new Envelope[3];
|
||||||
for (var i = 0; i < 3; i++)
|
for (var i = 0; i < 3; i++)
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
var newVblankStart = vblankStart;
|
var newVblankStart = vblankStart;
|
||||||
var newVblankEnd = vblankEnd;
|
var newVblankEnd = vblankEnd;
|
||||||
var hBorderSize = 16; // must be a multiple of 4
|
var hBorderSize = 16; // must be a multiple of 4
|
||||||
var vBorderSize = hBorderSize*_pixelRatioNum/_pixelRatioDen; // to keep top and bottom in proportion
|
var vBorderSize = hBorderSize * _pixelRatioNum / _pixelRatioDen; // to keep top and bottom in proportion
|
||||||
var maxWidth = _rasterXPipeline.Max();
|
var maxWidth = _rasterXPipeline.Max();
|
||||||
|
|
||||||
switch (borderType)
|
switch (borderType)
|
||||||
|
@ -145,7 +145,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
||||||
_bufHeight = TimingBuilder_ScreenHeight(newVblankStart, newVblankEnd, lines);
|
_bufHeight = TimingBuilder_ScreenHeight(newVblankStart, newVblankEnd, lines);
|
||||||
_buf = new int[_bufWidth * _bufHeight];
|
_buf = new int[_bufWidth * _bufHeight];
|
||||||
_bufLength = _buf.Length;
|
_bufLength = _buf.Length;
|
||||||
VirtualWidth = _bufWidth*_pixelRatioNum/_pixelRatioDen;
|
VirtualWidth = _bufWidth * _pixelRatioNum / _pixelRatioDen;
|
||||||
VirtualHeight = _bufHeight;
|
VirtualHeight = _bufHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
{
|
{
|
||||||
[SaveState.DoNotSave] public const int FluxBitsPerEntry = 32;
|
[SaveState.DoNotSave] public const int FluxBitsPerEntry = 32;
|
||||||
[SaveState.DoNotSave] public const int FluxBitsPerTrack = 16000000 / 5;
|
[SaveState.DoNotSave] public const int FluxBitsPerTrack = 16000000 / 5;
|
||||||
[SaveState.DoNotSave] public const int FluxEntriesPerTrack = FluxBitsPerTrack/FluxBitsPerEntry;
|
[SaveState.DoNotSave] public const int FluxEntriesPerTrack = FluxBitsPerTrack / FluxBitsPerEntry;
|
||||||
[SaveState.DoNotSave] private int[][] _tracks;
|
[SaveState.DoNotSave] private int[][] _tracks;
|
||||||
[SaveState.DoNotSave] private readonly int[] _originalMedia;
|
[SaveState.DoNotSave] private readonly int[] _originalMedia;
|
||||||
[SaveState.DoNotSave] public bool Valid;
|
[SaveState.DoNotSave] public bool Valid;
|
||||||
|
@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[][] DeserializeTracks(int[] data)
|
private int[][] DeserializeTracks(int[] data)
|
||||||
{
|
{
|
||||||
var trackCount = data.Length/FluxEntriesPerTrack;
|
var trackCount = data.Length / FluxEntriesPerTrack;
|
||||||
var result = new int[trackCount][];
|
var result = new int[trackCount][];
|
||||||
for (var i = 0; i < trackCount; i++)
|
for (var i = 0; i < trackCount; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
trackByteOffsets[i] = trackByteOffsets[i - 1] + (SectorsPerTrack[i - 1] * 256);
|
trackByteOffsets[i] = trackByteOffsets[i - 1] + (SectorsPerTrack[i - 1] * 256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var bytes = new byte[trackByteOffsets[tracks - 1] + (SectorsPerTrack[tracks - 1] *256)];
|
var bytes = new byte[trackByteOffsets[tracks - 1] + (SectorsPerTrack[tracks - 1] * 256)];
|
||||||
|
|
||||||
var currentTrack = 16;
|
var currentTrack = 16;
|
||||||
var currentSector = 0;
|
var currentSector = 0;
|
||||||
|
@ -175,7 +175,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
var sectorInterleave = 3;
|
var sectorInterleave = 3;
|
||||||
var directory = new List<LocatedEntry>();
|
var directory = new List<LocatedEntry>();
|
||||||
|
|
||||||
Func<int, int, int> GetOutputOffset = (t, s) => trackByteOffsets[t] + (s*256);
|
Func<int, int, int> GetOutputOffset = (t, s) => trackByteOffsets[t] + (s * 256);
|
||||||
|
|
||||||
foreach (var entry in Entries)
|
foreach (var entry in Entries)
|
||||||
{
|
{
|
||||||
|
@ -244,7 +244,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
break;
|
break;
|
||||||
|
|
||||||
bytes[outputOffset + 0] = (byte)(currentTrack + 1);
|
bytes[outputOffset + 0] = (byte)(currentTrack + 1);
|
||||||
bytes[outputOffset + 1] = (byte) currentSector;
|
bytes[outputOffset + 1] = (byte)currentSector;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diskFull)
|
if (diskFull)
|
||||||
|
@ -265,8 +265,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
{
|
{
|
||||||
directoryOffset = 0;
|
directoryOffset = 0;
|
||||||
currentSector += 3;
|
currentSector += 3;
|
||||||
bytes[directoryOutputOffset] = (byte) currentTrack;
|
bytes[directoryOutputOffset] = (byte)currentTrack;
|
||||||
bytes[directoryOutputOffset + 1] = (byte) currentSector;
|
bytes[directoryOutputOffset + 1] = (byte)currentSector;
|
||||||
directoryOutputOffset = GetOutputOffset(currentTrack, currentSector);
|
directoryOutputOffset = GetOutputOffset(currentTrack, currentSector);
|
||||||
bam[currentTrack].Allocate(currentSector);
|
bam[currentTrack].Allocate(currentSector);
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
var nameAttribute = member.GetCustomAttributes(true).FirstOrDefault(a => a is SaveWithName);
|
var nameAttribute = member.GetCustomAttributes(true).FirstOrDefault(a => a is SaveWithName);
|
||||||
if (nameAttribute != null)
|
if (nameAttribute != null)
|
||||||
{
|
{
|
||||||
name = ((SaveWithName) nameAttribute).Name;
|
name = ((SaveWithName)nameAttribute).Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
||||||
}
|
}
|
||||||
else if (t.IsArray)
|
else if (t.IsArray)
|
||||||
{
|
{
|
||||||
var currentValueArray = (Array) currentValue;
|
var currentValueArray = (Array)currentValue;
|
||||||
for (var i = 0; i < currentValueArray.Length; i++)
|
for (var i = 0; i < currentValueArray.Length; i++)
|
||||||
{
|
{
|
||||||
ser.BeginSection(string.Format("{0}_{1}", name, i));
|
ser.BeginSection(string.Format("{0}_{1}", name, i));
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial
|
||||||
Via1 = Chip6522.Create(ReadVia1PrA, ReadVia1PrB);
|
Via1 = Chip6522.Create(ReadVia1PrA, ReadVia1PrB);
|
||||||
|
|
||||||
_cpuClockNum = clockNum;
|
_cpuClockNum = clockNum;
|
||||||
_driveCpuClockNum = clockDen*16000000; // 16mhz
|
_driveCpuClockNum = clockDen * 16000000; // 16mhz
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ExecutePhase()
|
public override void ExecutePhase()
|
||||||
|
|
Loading…
Reference in New Issue