mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-01-22 16:16:17 +00:00
Work in progress to correct fixup effect storage
This commit is contained in:
@@ -223,8 +223,28 @@ namespace EightBit
|
||||
|
||||
private void StoreFixupEffect(byte data)
|
||||
{
|
||||
var fixedAddress = (byte)(this.Bus.Address.High + 1);
|
||||
this.MemoryWrite((byte)(data & fixedAddress));
|
||||
////var fixedAddress = (byte)(this.Bus.Address.High + 1);
|
||||
//var fixedAddress = this.FixedPage + 1;
|
||||
//var updated = (byte)(data & fixedAddress);
|
||||
//if (this.Fixed)
|
||||
//{
|
||||
// this.Bus.Address.High = updated;
|
||||
//}
|
||||
|
||||
//this.MemoryWrite(updated);
|
||||
|
||||
byte updated;
|
||||
if (this.Fixed)
|
||||
{
|
||||
updated = (byte)(data & this.FixedPage);
|
||||
this.Bus.Address.High = updated;
|
||||
}
|
||||
else
|
||||
{
|
||||
updated = (byte)(data & this.UnfixedPage);
|
||||
this.Bus.Address.High = updated;
|
||||
}
|
||||
this.MemoryWrite(updated);
|
||||
}
|
||||
|
||||
private void SHA() => this.StoreFixupEffect((byte)(this.A & this.X));
|
||||
|
||||
@@ -646,12 +646,22 @@ namespace EightBit
|
||||
|
||||
private byte fixedPage;
|
||||
|
||||
private byte unfixedPage;
|
||||
|
||||
public byte FixedPage
|
||||
{
|
||||
get => this.fixedPage;
|
||||
protected set => this.fixedPage = value;
|
||||
}
|
||||
|
||||
public byte UnfixedPage
|
||||
{
|
||||
get => this.unfixedPage;
|
||||
protected set => this.unfixedPage = value;
|
||||
}
|
||||
|
||||
public bool Fixed => this.FixedPage != this.UnfixedPage;
|
||||
|
||||
protected void MaybeFixup()
|
||||
{
|
||||
if (this.Bus.Address.High != this.FixedPage)
|
||||
@@ -685,6 +695,7 @@ namespace EightBit
|
||||
|
||||
protected void NoteFixedAddress(ushort address)
|
||||
{
|
||||
this.UnfixedPage = this.Bus.Address.High;
|
||||
this.Intermediate.Word = address;
|
||||
this.FixedPage = this.Intermediate.High;
|
||||
this.Bus.Address.Low = this.Intermediate.Low;
|
||||
|
||||
Reference in New Issue
Block a user