From f4757074d64230c0f21bc1669237c12111fade63 Mon Sep 17 00:00:00 2001 From: Adrian Conlon <98398945+AdrianConlon@users.noreply.github.com> Date: Sat, 15 Jun 2024 11:06:57 +0100 Subject: [PATCH] Hold unfixed page and make both fixed and unfixed page publically available. --- M6502/M6502.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/M6502/M6502.cs b/M6502/M6502.cs index 5019bc0..29cff62 100644 --- a/M6502/M6502.cs +++ b/M6502/M6502.cs @@ -759,11 +759,24 @@ namespace EightBit #region Address page fixup + private byte unfixedPage; private byte fixedPage; + public byte UnfixedPage + { + get => this.unfixedPage; + private set => this.unfixedPage = value; + } + + public byte FixedPage + { + get => this.fixedPage; + private set => this.fixedPage = value; + } + private void MaybeFixup() { - if (this.Bus.Address.High != this.fixedPage) + if (this.Bus.Address.High != this.FixedPage) { this.Fixup(); } @@ -772,7 +785,8 @@ namespace EightBit private void Fixup() { this.MemoryRead(); - this.Bus.Address.High = this.fixedPage; + this.UnfixedPage = this.Bus.Address.High; + this.Bus.Address.High = this.FixedPage; } private void MaybeFixupR() @@ -799,7 +813,7 @@ namespace EightBit private void NoteFixedAddress(ushort address) { this.intermediate.Word = address; - this.fixedPage = this.intermediate.High; + this.FixedPage = this.intermediate.High; this.Bus.Address.Low = this.intermediate.Low; }