Skip to content

Commit

Permalink
MLOOKAT and DWRITEFMT fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
DerelictDrone committed Dec 11, 2023
1 parent 8f72574 commit 5500df8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lua/entities/gmod_wire_gpu/cl_gpuvm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,7 @@ VM.OpcodeTable[246] = function(self) --DWRITEFMT string.format(
self:Dyn_Emit("text = string.sub(text,2,65536)")

self:Dyn_Emit("if (inparam == false) then")
self:Dyn_Emit("if (chr == \"%\") then")
self:Dyn_Emit("if (chr == \"%%%%\") then")
self:Dyn_Emit("inparam = true")
self:Dyn_Emit("else")
self:Dyn_Emit("finaltext = finaltext .. chr")
Expand Down Expand Up @@ -2091,13 +2091,13 @@ VM.OpcodeTable[246] = function(self) --DWRITEFMT string.format(
self:Dyn_Emit("inparam = false")
self:Dyn_Emit("lengthmod = nil")
self:Dyn_Emit("elseif (chr == \"t\") then")
self:Dyn_Emit("while (string.len(finaltext) % (lengthmod or 6) != 0) do")
self:Dyn_Emit("while (math.mod(string.len(finaltext),(lengthmod or 6)) != 0) do")
self:Dyn_Emit("finaltext = finaltext..\" \"")
self:Dyn_Emit("end")
self:Dyn_Emit("inparam = false")
self:Dyn_Emit("lengthmod = nil")
self:Dyn_Emit("elseif (chr == \"%\") then")
self:Dyn_Emit("finaltext = finaltext .. \"%\"")
self:Dyn_Emit("elseif (chr == \"%%%%\") then")
self:Dyn_Emit("finaltext = finaltext .. \"%%%%\"")
self:Dyn_Emit("inparam = false")
self:Dyn_Emit("lengthmod = nil")
self:Dyn_Emit("end")
Expand Down
6 changes: 3 additions & 3 deletions lua/wire/zvm/zvm_opcodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1576,9 +1576,9 @@ end
ZVM.OpcodeTable[267] = function(self) --MLOOKAT
local seg1code = self.EmitOperandSegment[1] and "0" or "VM.DS"
local seg2code = self.EmitOperandSegment[2] and "0" or "VM.DS"

Check warning on line 1578 in lua/wire/zvm/zvm_opcodes.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: seg2code
self:Dyn_Emit("$L EYE = VM:ReadVector3f($2 + %s+0",seg2code)
self:Dyn_Emit("$L CENTER = VM:ReadVector3f($2 + %s+3",seg2code)
self:Dyn_Emit("$L UP = VM:ReadVector3f($2 + %s+6",seg2code)
self:Dyn_Emit("$L EYE = VM:ReadVector3f($2 + VM."..(self.EmitOperandSegment[2] or "DS").."+0)")

Check warning on line 1579 in lua/wire/zvm/zvm_opcodes.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 1579 in lua/wire/zvm/zvm_opcodes.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
self:Dyn_Emit("$L CENTER = VM:ReadVector3f($2 + VM."..(self.EmitOperandSegment[2] or "DS").."+3)")

Check warning on line 1580 in lua/wire/zvm/zvm_opcodes.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 1580 in lua/wire/zvm/zvm_opcodes.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
self:Dyn_Emit("$L UP = VM:ReadVector3f($2 + VM."..(self.EmitOperandSegment[2] or "DS").."+6)")
self:Dyn_EmitInterruptCheck()

self:Dyn_Emit("$L X = { 0, 0, 0 }")
Expand Down

0 comments on commit 5500df8

Please sign in to comment.