summaryrefslogtreecommitdiff
path: root/rvcontroller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rvcontroller.lua')
-rw-r--r--rvcontroller.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/rvcontroller.lua b/rvcontroller.lua
index 9d9a337..7d6a211 100644
--- a/rvcontroller.lua
+++ b/rvcontroller.lua
@@ -414,6 +414,8 @@ local function readcsr(address)
bits[11] = mem.mpp%2 == 1
bits[12] = mem.mpp >= 2
return implodebits(bits,32)
+ elseif address == 0x305 then --mtvec
+ return mem.mtvecwritten and mem.trapbase+mem.trapmode or 0
elseif address == 0x310 then --mstatush
local bits = {}
bits[5] = mem.mbe