Commodore64: Experimental video chip things.
This commit is contained in:
parent
459368dd5b
commit
7c532fbd01
|
@ -98,6 +98,10 @@
|
|||
<Compile Include="Computers\Commodore64\Cartridge\Mapper0020.cs" />
|
||||
<Compile Include="Computers\Commodore64\Disk\VIC1541.cs" />
|
||||
<Compile Include="Computers\Commodore64\Disk\VIC1541.PLA.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\MOS6569.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Vic.Interface.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Vic.Internal.cs" />
|
||||
<Compile Include="Computers\Commodore64\Experimental\Vic.Rom.cs" />
|
||||
<Compile Include="Computers\Commodore64\Media\PRG.cs" />
|
||||
<Compile Include="Computers\Commodore64\Cartridge\Cart.cs" />
|
||||
<Compile Include="Computers\Commodore64\MOS\CartridgePort.cs" />
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
||||
{
|
||||
public class MOS6569 : VIC
|
||||
{
|
||||
public MOS6569()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
||||
{
|
||||
public abstract partial class VIC
|
||||
{
|
||||
public Func<int> InputAddress;
|
||||
public Func<bool> InputChipSelect;
|
||||
public Func<int> InputData;
|
||||
|
||||
class Sprite
|
||||
{
|
||||
public int Color;
|
||||
public bool DataCollision;
|
||||
public bool Enabled;
|
||||
public bool ExpandX;
|
||||
public bool ExpandY;
|
||||
public bool Multicolor;
|
||||
public bool Priority;
|
||||
public bool SpriteCollision;
|
||||
public int X;
|
||||
public int Y;
|
||||
}
|
||||
|
||||
int[] backgroundColor;
|
||||
bool bitmapMode;
|
||||
int borderColor;
|
||||
int characterBitmap;
|
||||
bool columnSelect;
|
||||
bool dataCollisionInterrupt;
|
||||
bool displayEnable;
|
||||
bool extraColorMode;
|
||||
byte interruptEnableRegister;
|
||||
bool lightPenInterrupt;
|
||||
int lightPenX;
|
||||
int lightPenY;
|
||||
bool multiColorMode;
|
||||
bool rasterInterrupt;
|
||||
int rasterX;
|
||||
int rasterY;
|
||||
bool reset;
|
||||
bool rowSelect;
|
||||
bool spriteCollisionInterrupt;
|
||||
int[] spriteMultiColor;
|
||||
Sprite[] sprites;
|
||||
int videoMemory;
|
||||
int xScroll;
|
||||
int yScroll;
|
||||
|
||||
public VIC()
|
||||
{
|
||||
backgroundColor = new int[4];
|
||||
spriteMultiColor = new int[2];
|
||||
sprites = new Sprite[8];
|
||||
for (int i = 0; i < 8; i++)
|
||||
sprites[i] = new Sprite();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Desired 14-bit address from the VIC.
|
||||
/// </summary>
|
||||
public int OutputAddress()
|
||||
{
|
||||
return ADDR;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AEC pin output.
|
||||
/// </summary>
|
||||
public bool OutputAEC()
|
||||
{
|
||||
return AEC;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// BA pin output.
|
||||
/// </summary>
|
||||
public bool OutputBA()
|
||||
{
|
||||
return BA;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CAS pin output.
|
||||
/// </summary>
|
||||
public bool OutputCAS()
|
||||
{
|
||||
return CAS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 12-bit data output from the VIC.
|
||||
/// </summary>
|
||||
public int OutputData()
|
||||
{
|
||||
return DATA;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IRQ pin output.
|
||||
/// </summary>
|
||||
public bool OutputInterrupt()
|
||||
{
|
||||
return IRQ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PHI0 pin output.
|
||||
/// </summary>
|
||||
public bool OutputPHI0()
|
||||
{
|
||||
return PHI0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RAS pin output.
|
||||
/// </summary>
|
||||
public bool OutputRAS()
|
||||
{
|
||||
return RAS;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
||||
{
|
||||
public partial class VIC
|
||||
{
|
||||
int ADDR;
|
||||
bool AEC;
|
||||
bool BA;
|
||||
bool CAS;
|
||||
int DATA;
|
||||
bool IRQ;
|
||||
bool PHI0;
|
||||
bool RAS;
|
||||
|
||||
bool badLineCondition;
|
||||
bool badLineEnable;
|
||||
bool idleState;
|
||||
int pixelTimer;
|
||||
int rowCounter;
|
||||
int videoCounter;
|
||||
int videoCounterBase;
|
||||
int videoMatrixLineIndex;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (pixelTimer == 0)
|
||||
{
|
||||
PHI0 = !PHI0;
|
||||
pixelTimer = 8;
|
||||
|
||||
badLineEnable |= (rasterY == 0x30 && displayEnable);
|
||||
if (!PHI0)
|
||||
{
|
||||
badLineCondition = (
|
||||
badLineEnable &&
|
||||
rasterY >= 0x030 &&
|
||||
rasterY <= 0x0F7 &&
|
||||
(rasterY & 0x007) == yScroll
|
||||
);
|
||||
if (!idleState && badLineCondition)
|
||||
idleState = true;
|
||||
}
|
||||
}
|
||||
pixelTimer--;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Computers.Commodore64.Experimental
|
||||
{
|
||||
public partial class Vic
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue