Skip to content

Commit

Permalink
Fix GPU VM error on membus write if RAM size <128k (#2105)
Browse files Browse the repository at this point in the history
Also fixes negative addresses not being treated as ports
  • Loading branch information
Emily authored Dec 4, 2020
1 parent 8ae2f1a commit 13d6bdb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/entities/gmod_wire_gpu/cl_gpuvm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ function ENT:OverrideVM()
end
end

self.VM.ExternalWrite = function(VM, Address, Value)
if (Address >= 65536) and (Address <= 131071) then
return true
elseif Address < 0 then
VM:WritePort(-Address - 1, Value)
return true
end

VM:Interrupt(7, Address)
return false
end

-- Add internal registers
self.VM.InternalRegister[128] = "EntryPoint0"
self.VM.InternalRegister[129] = "EntryPoint1"
Expand Down

0 comments on commit 13d6bdb

Please sign in to comment.