Commodore64: Split up and moved source files. No user-observable changes in execution.
This commit is contained in:
parent
1584a114fe
commit
2e7935938a
|
@ -104,14 +104,19 @@
|
|||
<Compile Include="Computers\Commodore64\Experimental\C64PAL.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Interface.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Internal.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Registers.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cia.Settings.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.State.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Registers.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Settings.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.SoundProvider.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Userport.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Cache.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Registers.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Settings.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.State.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Timing.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.VideoProvider.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\MOS6581.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Presets.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\IMotherboard.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.Interface.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Cpu.Internal.cs" />
|
||||
|
@ -123,15 +128,10 @@
|
|||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Serial.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Interface.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Sid.Internal.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\MOS6569.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Ram.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Rom.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Interface.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Internals\Vic.Internal.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Ram2114.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Rom2332.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Rom2364.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Chips\Ram4864.cs" />
|
||||
<Compile Include="Computers\Commodore64\InputFileInfo.cs" />
|
||||
<Compile Include="Computers\Commodore64\Media\PRG.cs" />
|
||||
<Compile Include="Computers\Commodore64\Cartridge\Cart.cs" />
|
||||
|
|
|
@ -132,13 +132,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
|||
);
|
||||
}
|
||||
|
||||
bool ReadReset()
|
||||
{
|
||||
return (
|
||||
expansion.Reset
|
||||
);
|
||||
}
|
||||
|
||||
bool ReadSerialATN()
|
||||
{
|
||||
return (cia2.PortA & 0x08) != 0;
|
||||
|
|
|
@ -33,13 +33,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
|||
|
||||
public void ExecuteFrame()
|
||||
{
|
||||
vic.Clock();
|
||||
vic.Clock();
|
||||
vic.Clock();
|
||||
vic.Clock();
|
||||
vic.Precache();
|
||||
cpu.Clock();
|
||||
cpu.Precache();
|
||||
}
|
||||
|
||||
public byte PeekBasicRom(int addr)
|
||||
|
|
|
@ -11,26 +11,26 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
|||
{
|
||||
static private C64Timing timing;
|
||||
|
||||
public C64PAL() : base(timing)
|
||||
public C64PAL(byte[] basic, byte[] kernal, byte[] character) : base(timing)
|
||||
{
|
||||
this.basicRom = new Rom2364();
|
||||
this.basicRom = Presets.Rom2364(basic);
|
||||
this.cassette = new Cassette();
|
||||
this.characterRom = new Rom2332();
|
||||
this.cia1 = new Cia();
|
||||
this.cia2 = new Cia();
|
||||
this.colorRam = new Ram2114();
|
||||
this.characterRom = Presets.Rom2332(character);
|
||||
this.cia1 = Presets.Cia6526(true);
|
||||
this.cia2 = Presets.Cia6526(true);
|
||||
this.colorRam = Presets.Ram2114();
|
||||
this.cpu = new Cpu();
|
||||
this.expansion = new Expansion();
|
||||
this.joystickA = new Joystick();
|
||||
this.joystickB = new Joystick();
|
||||
this.kernalRom = new Rom2364();
|
||||
this.kernalRom = Presets.Rom2364(kernal);
|
||||
this.keyboard = new Keyboard();
|
||||
this.memory = new Ram4864();
|
||||
this.memory = Presets.Ram4864();
|
||||
this.pla = new Pla();
|
||||
this.serial = new Serial();
|
||||
this.sid = new MOS6581();
|
||||
this.sid = Presets.Sid6581();
|
||||
this.user = new Userport();
|
||||
this.vic = new MOS6569();
|
||||
this.vic = Presets.Vic6569();
|
||||
InitializeConnections();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
virtual public bool Data { get { return true; } }
|
||||
public bool OutputData() { return Data; }
|
||||
public bool OutputSense() { return Sense; }
|
||||
virtual public int Peek(int addr) { return 0xFF; }
|
||||
virtual public void Poke(int addr, int val) { }
|
||||
virtual public void Precache() { }
|
||||
virtual public bool Sense { get { return true; } }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
virtual public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Cia
|
||||
sealed public partial class Cia
|
||||
{
|
||||
public Func<bool> InputCNT;
|
||||
public Func<bool> InputFlag;
|
||||
|
@ -24,9 +24,10 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
public bool PC { get { return true; } }
|
||||
public int PortA { get { return 0xFF; } }
|
||||
public int PortB { get { return 0xFF; } }
|
||||
public bool PortA0 { get { return true; } }
|
||||
public bool SP { get { return true; } }
|
||||
|
||||
public void Clock() { }
|
||||
public void Precache() { }
|
||||
public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,25 +5,15 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Cia
|
||||
sealed public partial class Cia
|
||||
{
|
||||
public int Peek(int addr)
|
||||
public Cia(CiaSettings settings)
|
||||
{
|
||||
return 0xFF;
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Poke(int addr, int val)
|
||||
public void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
public int Read(int addr)
|
||||
{
|
||||
return Peek(addr);
|
||||
}
|
||||
|
||||
public void Write(int addr, int val)
|
||||
{
|
||||
Poke(addr, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
sealed public partial class Cia
|
||||
{
|
||||
public int Peek(int addr)
|
||||
{
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
public void Poke(int addr, int val)
|
||||
{
|
||||
}
|
||||
|
||||
public int Read(int addr)
|
||||
{
|
||||
return Peek(addr);
|
||||
}
|
||||
|
||||
public void Write(int addr, int val)
|
||||
{
|
||||
Poke(addr, val);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,10 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public class Ram2114 : Internals.Ram
|
||||
public class CiaSettings
|
||||
{
|
||||
public Ram2114() : base(0x800, 0x7FF, 0xF) { }
|
||||
}
|
||||
}
|
|
@ -24,16 +24,15 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
public bool OutputPort5() { return Port5; }
|
||||
public bool OutputPort6() { return Port6; }
|
||||
public bool OutputPort7() { return Port7; }
|
||||
public int Port { get { return cachedPort; } }
|
||||
public bool Port0 { get { return (cachedPort & 0x01) != 0; } }
|
||||
public bool Port1 { get { return (cachedPort & 0x02) != 0; } }
|
||||
public bool Port2 { get { return (cachedPort & 0x04) != 0; } }
|
||||
public bool Port3 { get { return (cachedPort & 0x08) != 0; } }
|
||||
public bool Port4 { get { return (cachedPort & 0x10) != 0; } }
|
||||
public bool Port5 { get { return (cachedPort & 0x20) != 0; } }
|
||||
public bool Port6 { get { return (cachedPort & 0x40) != 0; } }
|
||||
public bool Port7 { get { return (cachedPort & 0x80) != 0; } }
|
||||
public void Precache() { }
|
||||
public void SyncState(Serializer ser) { }
|
||||
public int Port { get { return (portLatch | (~portDirection)) & 0xFF; } }
|
||||
public bool Port0 { get { return (Port & 0x01) != 0; } }
|
||||
public bool Port1 { get { return (Port & 0x02) != 0; } }
|
||||
public bool Port2 { get { return (Port & 0x04) != 0; } }
|
||||
public bool Port3 { get { return (Port & 0x08) != 0; } }
|
||||
public bool Port4 { get { return (Port & 0x10) != 0; } }
|
||||
public bool Port5 { get { return (Port & 0x20) != 0; } }
|
||||
public bool Port6 { get { return (Port & 0x40) != 0; } }
|
||||
public bool Port7 { get { return (Port & 0x80) != 0; } }
|
||||
public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
int cachedAddress;
|
||||
int cachedData;
|
||||
bool cachedNMI;
|
||||
int cachedPort;
|
||||
int delayCycles;
|
||||
bool nmiBuffer;
|
||||
int portDirection;
|
||||
|
|
|
@ -7,36 +7,14 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
{
|
||||
public class Expansion
|
||||
{
|
||||
public Func<int> InputAddress;
|
||||
public Func<bool> InputBA;
|
||||
public Func<int> InputData;
|
||||
public Func<bool> InputDotClock;
|
||||
public Func<bool> InputHiExpansion;
|
||||
public Func<bool> InputHiRom;
|
||||
public Func<bool> InputIRQ;
|
||||
public Func<bool> InputLoExpansion;
|
||||
public Func<bool> InputLoRom;
|
||||
public Func<bool> InputNMI;
|
||||
public Func<bool> InputRead;
|
||||
public Func<bool> InputReset;
|
||||
|
||||
virtual public int Address { get { return 0xFFFF; } }
|
||||
virtual public int Data { get { return 0xFF; } }
|
||||
virtual public bool ExRom { get { return true; } }
|
||||
virtual public bool Game { get { return true; } }
|
||||
virtual public bool IRQ { get { return true; } }
|
||||
virtual public bool NMI { get { return true; } }
|
||||
public int OutputAddress() { return Address; }
|
||||
public int OutputData() { return Data; }
|
||||
public bool OutputExRom() { return ExRom; }
|
||||
public bool OutputGame() { return Game; }
|
||||
public bool OutputIRQ() { return IRQ; }
|
||||
public bool OutputNMI() { return NMI; }
|
||||
public bool OutputRead() { return Read; }
|
||||
public bool OutputReset() { return Reset; }
|
||||
virtual public void Precache() { }
|
||||
virtual public bool Read { get { return true; } }
|
||||
virtual public bool Reset { get { return true; } }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
virtual public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,10 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
{
|
||||
public class Joystick
|
||||
{
|
||||
virtual public int Data { get { return 0x1F; } }
|
||||
virtual public int Data { get { return 0xFF; } }
|
||||
public int OutputData() { return Data; }
|
||||
public int OutputPotX() { return PotX; }
|
||||
public int OutputPotY() { return PotY; }
|
||||
virtual public int PotX { get { return 0xFF; } }
|
||||
virtual public int PotY { get { return 0xFF; } }
|
||||
virtual public void Precache() { }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
public int OutputPot() { return Pot; }
|
||||
virtual public int Pot { get { return 0xFF; } }
|
||||
virtual public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,8 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
public int OutputColumn() { return Column; }
|
||||
public bool OutputRestore() { return Restore; }
|
||||
public int OutputRow() { return Row; }
|
||||
virtual public void Precache() { }
|
||||
virtual public bool Restore { get { return true; } }
|
||||
virtual public int Row { get { return 0xFF; } }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
virtual public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,29 +79,6 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
ExpansionHi
|
||||
}
|
||||
|
||||
bool p0;
|
||||
bool p1;
|
||||
bool p2;
|
||||
bool p3;
|
||||
bool p4;
|
||||
bool p5;
|
||||
bool p6;
|
||||
bool p7;
|
||||
bool p9;
|
||||
bool p11;
|
||||
bool p13;
|
||||
bool p15;
|
||||
bool p17;
|
||||
bool p19;
|
||||
bool p20;
|
||||
bool p21;
|
||||
bool p22;
|
||||
bool p23;
|
||||
bool p24;
|
||||
bool p25;
|
||||
bool p26;
|
||||
bool p27;
|
||||
bool p28;
|
||||
bool loram;
|
||||
bool hiram;
|
||||
bool game;
|
||||
|
@ -222,6 +199,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
loram = InputLoRam();
|
||||
hiram = InputHiRam();
|
||||
game = InputGame();
|
||||
exrom = InputExRom();
|
||||
|
||||
a15 = (addr & 0x08000) != 0;
|
||||
a14 = (addr & 0x04000) != 0;
|
||||
|
@ -258,39 +236,31 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
}
|
||||
}
|
||||
|
||||
// cartridge high, banked either at A000-BFFF or E000-FFFF depending
|
||||
exrom = InputExRom();
|
||||
if (a13 && !game && ((hiram && !a14 && read && !exrom) || (a14 && exrom)))
|
||||
return PLABank.CartridgeHi;
|
||||
if (read)
|
||||
{
|
||||
// cartridge high, banked either at A000-BFFF or E000-FFFF depending
|
||||
if (a13 && !game && ((hiram && !a14 && !exrom) || (a14 && exrom)))
|
||||
return PLABank.CartridgeHi;
|
||||
|
||||
// cartridge low, banked at 8000-9FFF
|
||||
if (!a14 && !a13 && ((loram && hiram && read && !exrom) || (exrom && !game)))
|
||||
return PLABank.CartridgeLo;
|
||||
// cartridge low, banked at 8000-9FFF
|
||||
if (!a14 && !a13 && ((loram && hiram && !exrom) || (exrom && !game)))
|
||||
return PLABank.CartridgeLo;
|
||||
|
||||
// kernal rom, banked at E000-FFFF
|
||||
if (hiram && a14 && a13 && read && (game || (!exrom && !game)))
|
||||
return PLABank.KernalROM;
|
||||
// kernal rom, banked at E000-FFFF
|
||||
if (hiram && a14 && a13 && (game || (!exrom && !game)))
|
||||
return PLABank.KernalROM;
|
||||
|
||||
// basic rom, banked at A000-BFFF
|
||||
if (loram && hiram && !a14 && a13 && read && game)
|
||||
return PLABank.BasicROM;
|
||||
// basic rom, banked at A000-BFFF
|
||||
if (loram && hiram && !a14 && a13 && game)
|
||||
return PLABank.BasicROM;
|
||||
}
|
||||
}
|
||||
|
||||
// ultimax mode ram exclusion
|
||||
if (exrom && !game)
|
||||
{
|
||||
p24 = !a15 && !a14 && a12;
|
||||
p25 = !a15 && !a14 && a13;
|
||||
p26 = !a15 && a14;
|
||||
p27 = a15 && !a14 && a13;
|
||||
p28 = a15 && a14 && !a13 && !a12;
|
||||
if (!(p24 || p25 || p26 || p27 || p28))
|
||||
return PLABank.RAM;
|
||||
}
|
||||
else
|
||||
return PLABank.RAM;
|
||||
if (exrom && !game && ((a15 && ((!a14 && a13) || (a14 && !a13 && !a12))) || (!a15 && (a14 || (!a14 && (a12 || a13))))))
|
||||
return PLABank.None;
|
||||
|
||||
return PLABank.None;
|
||||
return PLABank.RAM;
|
||||
}
|
||||
|
||||
public int VicRead(int addr)
|
||||
|
|
|
@ -5,19 +5,39 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public class Ram : Rom
|
||||
sealed public class Ram
|
||||
{
|
||||
public Func<bool> InputRead;
|
||||
protected int addressMask;
|
||||
protected int dataMask;
|
||||
protected int[] memory;
|
||||
|
||||
public Ram(int size, int addressMask, int dataMask)
|
||||
: base(size, addressMask, dataMask)
|
||||
{
|
||||
this.addressMask = addressMask;
|
||||
this.dataMask = dataMask;
|
||||
this.memory = new int[size];
|
||||
}
|
||||
|
||||
virtual public void Execute()
|
||||
public int Peek(int addr)
|
||||
{
|
||||
if (!InputRead())
|
||||
memory[InputAddress() & addressMask] = InputData() & dataMask;
|
||||
return memory[addr & addressMask];
|
||||
}
|
||||
|
||||
public void Poke(int addr, int val)
|
||||
{
|
||||
memory[addr & addressMask] = val;
|
||||
}
|
||||
|
||||
public int Read(int addr)
|
||||
{
|
||||
return memory[addr & addressMask];
|
||||
}
|
||||
|
||||
public void Write(int addr, int val)
|
||||
{
|
||||
memory[addr & addressMask] = val & dataMask;
|
||||
}
|
||||
|
||||
public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,30 +7,27 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
{
|
||||
public class Rom
|
||||
{
|
||||
public Func<int> InputAddress;
|
||||
public Func<int> InputData;
|
||||
|
||||
protected int addressMask;
|
||||
protected int dataMask;
|
||||
protected int[] memory;
|
||||
|
||||
public Rom(int size, int addressMask, int dataMask)
|
||||
public Rom(int size, int addressMask, byte[] data)
|
||||
{
|
||||
this.addressMask = addressMask;
|
||||
this.dataMask = dataMask;
|
||||
this.memory = new int[size];
|
||||
for (int i = 0; i < size; i++)
|
||||
memory[i] = data[i];
|
||||
}
|
||||
|
||||
virtual public int Data
|
||||
public int Peek(int addr)
|
||||
{
|
||||
get
|
||||
{
|
||||
return memory[InputAddress() & addressMask] & dataMask;
|
||||
}
|
||||
return memory[addr & addressMask];
|
||||
}
|
||||
|
||||
public int OutputData() { return Data; }
|
||||
virtual public void Precache() { }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
public int Read(int addr)
|
||||
{
|
||||
return memory[addr & addressMask];
|
||||
}
|
||||
|
||||
public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
public bool OutputClock() { return Clock; }
|
||||
public bool OutputData() { return Data; }
|
||||
public bool OutputSRQ() { return SRQ; }
|
||||
virtual public void Precache() { }
|
||||
virtual public bool SRQ { get { return true; } }
|
||||
virtual public void SyncState(Serializer ser) { }
|
||||
virtual public void SyncState(Serializer ser) { Sync.SyncObject(ser, this); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,15 +5,8 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public abstract partial class Sid
|
||||
sealed public partial class Sid
|
||||
{
|
||||
public Func<int> InputAddress;
|
||||
public Func<int> InputData;
|
||||
public Func<bool> InputRead;
|
||||
|
||||
virtual public int Data { get { return 0xFF; } }
|
||||
public int OutputData() { return Data; }
|
||||
public void Precache() { }
|
||||
public void SyncState(Serializer ser) { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,19 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Sid
|
||||
sealed public partial class Sid
|
||||
{
|
||||
public Sid(SidSettings settings)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Clock()
|
||||
{
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
sealed public partial class Sid
|
||||
{
|
||||
public int Peek(int addr)
|
||||
{
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
public void Poke(int addr, int val)
|
||||
{
|
||||
}
|
||||
|
||||
public int Read(int addr)
|
||||
{
|
||||
return Peek(addr);
|
||||
}
|
||||
|
||||
public void Write(int addr, int val)
|
||||
{
|
||||
Poke(addr, val);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,10 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public class Rom2332 : Internals.Rom
|
||||
public class SidSettings
|
||||
{
|
||||
public Rom2332() : base(0x1000, 0xFFF, 0xFF) { }
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Sid
|
||||
sealed public partial class Sid
|
||||
{
|
||||
public ISoundProvider GetSoundProvider()
|
||||
{
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic
|
||||
{
|
||||
public void Precache()
|
||||
{
|
||||
cachedAEC = (pixelTimer >= 4);
|
||||
cachedBA = ba;
|
||||
cachedIRQ = irq;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic
|
||||
sealed public partial class Vic
|
||||
{
|
||||
public Action ClockPhi0;
|
||||
public Func<int, int> ReadColorRam;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic
|
||||
sealed public partial class Vic
|
||||
{
|
||||
bool cachedAEC;
|
||||
bool cachedBA;
|
||||
|
@ -63,13 +63,9 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
int videoCounterBase;
|
||||
int videoMatrixLineIndex;
|
||||
|
||||
public Vic()
|
||||
public Vic(VicSettings settings)
|
||||
{
|
||||
backgroundColor = new int[4];
|
||||
spriteMultiColor = new int[2];
|
||||
sprites = new Sprite[8];
|
||||
for (int i = 0; i < 8; i++)
|
||||
sprites[i] = new Sprite();
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Clock()
|
||||
|
@ -83,5 +79,14 @@ namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
|||
}
|
||||
pixelTimer--;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
backgroundColor = new int[4];
|
||||
spriteMultiColor = new int[2];
|
||||
sprites = new Sprite[8];
|
||||
for (int i = 0; i < 8; i++)
|
||||
sprites[i] = new Sprite();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
sealed public partial class Vic
|
||||
{
|
||||
public int Peek(int addr)
|
||||
{
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
public void Poke(int addr, int val)
|
||||
{
|
||||
}
|
||||
|
||||
public int Read(int addr)
|
||||
{
|
||||
return Peek(addr);
|
||||
}
|
||||
|
||||
public void Write(int addr, int val)
|
||||
{
|
||||
Poke(addr, val);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,10 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public class Rom2364 : Internals.Rom
|
||||
public class VicSettings
|
||||
{
|
||||
public Rom2364() : base(0x2000, 0x1FFF, 0xFF) { }
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic
|
||||
sealed public partial class Vic
|
||||
{
|
||||
public void SyncState(Serializer ser)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic
|
||||
sealed public partial class Vic
|
||||
{
|
||||
protected struct CycleTiming
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
|
||||
{
|
||||
public partial class Vic : IVideoProvider
|
||||
sealed public partial class Vic : IVideoProvider
|
||||
{
|
||||
protected int[] videoBuffer;
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
{
|
||||
public class MOS6569 : Internals.Vic
|
||||
{
|
||||
public MOS6569()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
using BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
{
|
||||
sealed public class MOS6581 : Sid
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
using BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
{
|
||||
static public class Presets
|
||||
{
|
||||
static public Cia Cia6526(bool todJumper) { return new Cia(Settings6526(todJumper)); }
|
||||
static public Cia Cia6526A(bool todJumper) { return new Cia(Settings6526A(todJumper)); }
|
||||
static public Cpu Cpu6510() { return new Cpu(); }
|
||||
static public Ram Ram2114() { return new Ram(0x1000, 0x0FFF, 0x0F); }
|
||||
static public Ram Ram4864() { return new Ram(0x10000, 0xFFFF, 0xFF); }
|
||||
static public Rom Rom2332(byte[] data) { return new Rom(0x1000, 0xFFF, data); }
|
||||
static public Rom Rom2364(byte[] data) { return new Rom(0x2000, 0x1FFF, data); }
|
||||
static public Sid Sid6581() { return new Sid(Settings6581()); }
|
||||
static public Sid Sid8580() { return new Sid(Settings8580()); }
|
||||
static public Vic Vic6567() { return new Vic(Settings6567()); }
|
||||
static public Vic Vic6569() { return new Vic(Settings6569()); }
|
||||
|
||||
static private CiaSettings Settings6526(bool todJumper)
|
||||
{
|
||||
CiaSettings result = new CiaSettings();
|
||||
return result;
|
||||
}
|
||||
|
||||
static private CiaSettings Settings6526A(bool todJumper)
|
||||
{
|
||||
CiaSettings result = new CiaSettings();
|
||||
return result;
|
||||
}
|
||||
|
||||
static private VicSettings Settings6567()
|
||||
{
|
||||
VicSettings result = new VicSettings();
|
||||
return result;
|
||||
}
|
||||
|
||||
static private VicSettings Settings6569()
|
||||
{
|
||||
VicSettings result = new VicSettings();
|
||||
return result;
|
||||
}
|
||||
|
||||
static private SidSettings Settings6581()
|
||||
{
|
||||
SidSettings result = new SidSettings();
|
||||
return result;
|
||||
}
|
||||
|
||||
static private SidSettings Settings8580()
|
||||
{
|
||||
SidSettings result = new SidSettings();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips
|
||||
{
|
||||
public class Ram4864 : Internals.Ram
|
||||
{
|
||||
public Ram4864() : base(0x10000, 0xFFFF, 0xFF) { }
|
||||
}
|
||||
}
|
|
@ -268,18 +268,16 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
|
|||
// ultimax mode ram exclusion
|
||||
if (exrom && !game)
|
||||
{
|
||||
p24 = !a15 && !a14 && a12;
|
||||
p25 = !a15 && !a14 && a13;
|
||||
p26 = !a15 && a14;
|
||||
p27 = a15 && !a14 && a13;
|
||||
p28 = a15 && a14 && !a13 && !a12;
|
||||
if (!(p24 || p25 || p26 || p27 || p28))
|
||||
return PLABank.RAM;
|
||||
p24 = !a15 && !a14 && a12; //00x1 1000-1FFF, 3000-3FFF
|
||||
p25 = !a15 && !a14 && a13; //001x 2000-3FFF
|
||||
p26 = !a15 && a14; //01xx 4000-7FFF
|
||||
p27 = a15 && !a14 && a13; //101x A000-BFFF
|
||||
p28 = a15 && a14 && !a13 && !a12; //1100 C000-CFFF
|
||||
if (p24 || p25 || p26 || p27 || p28)
|
||||
return PLABank.None;
|
||||
}
|
||||
else
|
||||
return PLABank.RAM;
|
||||
|
||||
return PLABank.None;
|
||||
return PLABank.RAM;
|
||||
}
|
||||
|
||||
public byte Peek(int addr)
|
||||
|
|
Loading…
Reference in New Issue