From 1293d19e658a3e7ac605e5560c719cf35af11455 Mon Sep 17 00:00:00 2001 From: DerelictDrone Date: Wed, 28 Aug 2024 02:49:19 -0500 Subject: [PATCH] Use MEMRQ = 6 to signify interrupt handled write --- lua/wire/zvm/zvm_features.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/wire/zvm/zvm_features.lua b/lua/wire/zvm/zvm_features.lua index b23da43..b7934e1 100644 --- a/lua/wire/zvm/zvm_features.lua +++ b/lua/wire/zvm/zvm_features.lua @@ -312,9 +312,14 @@ function ZVM:WriteCell(Address,Value) -- 2 - read interrupt requested -- 3 - write interrupt requested -- 4 - read interrupt handled - -- 5 - write interrupt handled + -- 5 - write address / value changed, write request is allowed + -- 6 - write request handled by interrupt, skip performing the write ourselves -- Check if page is overriden if Page.Override == 1 then + if self.MEMRQ == 6 then -- Skip performing the write ourselves, the interrupt did it for us. + self.MEMRQ = 0 + return true + end if self.MEMRQ == 5 then -- write IRQ handled, new address/value available self.MEMRQ = 0 Address = self.MEMADDR