From c8471eb99386487f256cccc1364550ff45f93f5f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 3 Mar 2021 20:47:45 -0500 Subject: [PATCH] Adds various asserts, some comments. --- .../Implementation/65816Implementation.hpp | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index 0d98a17ea..f3128e550 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -484,31 +484,37 @@ template void Processor void Processor void Processor void Processoroperation == RTL)); registers_.pc = uint16_t(data_buffer_.value + 1); break; @@ -661,8 +671,11 @@ template void Processoroperation == JSL)); data_buffer_.value = registers_.pc; data_buffer_.size = 2; + // The per-cycle scheduling for JSL means that the program + // bank register has already been pushed to the stack by now. registers_.pc = uint16_t(instruction_buffer_.value); break; @@ -671,6 +684,7 @@ template void Processor> 8); set_flags(uint8_t(data_buffer_.value)); + assert(data_buffer_.size == 4 - registers_.emulation_flag); if(!registers_.emulation_flag) { registers_.program_bank = (data_buffer_.value & 0xff000000) >> 8; } @@ -728,11 +742,13 @@ template void Processor void Processor void Processor void Processor