From a3df106f9287d49f08bd63ca92ee6f3689204a88 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 6 Feb 2023 20:32:24 -0500 Subject: [PATCH] Reset write phase only upon traditional register accesses. --- Components/9918/Implementation/9918.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Components/9918/Implementation/9918.cpp b/Components/9918/Implementation/9918.cpp index d659becda..b6acd78be 100644 --- a/Components/9918/Implementation/9918.cpp +++ b/Components/9918/Implementation/9918.cpp @@ -1068,10 +1068,13 @@ uint8_t Base::read_register_indirect() { template uint8_t TMS9918::read(int address) { - // TODO: is this still a global effect of reads, even in the world of the Yamahas? - this->write_phase_ = false; + const int target = this->masked_address(address); - switch(this->masked_address(address)) { + if(target < 2) { + this->write_phase_ = false; + } + + switch(target) { default: return 0xff; case 0: return this->read_vram(); case 1: return this->read_register();