Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLOOKAT and DWRITEFMT fixed #36

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -4,7 +4,7 @@
local VM = {}

surface.CreateFont( "WireGPU_ErrorFont",{
font="Coolvetica",

Check warning on line 7 in lua/entities/gmod_wire_gpu/cl_gpuvm.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
size = 26,
weight = 200,
antialias = true,
Expand All @@ -12,7 +12,7 @@
})

function ENT:OverrideVM()
-- Store VM calls that will be overriden

Check warning on line 15 in lua/entities/gmod_wire_gpu/cl_gpuvm.lua

View workflow job for this annotation

GitHub Actions / lint

"Syntax inconsistency"

Inconsistent use of tabs and spaces for indentation
self.VM.BaseReset = self.VM.Reset

-- Add additional VM functionality
Expand All @@ -39,7 +39,7 @@
self.VM.ErrorText[17] = "Frame instruction limit"
self.VM.ErrorText[23] = "Error reading string data"

self.VM.Interrupt = function(self,interruptNo,interruptParameter,isExternal,cascadeInterrupt)

Check warning on line 42 in lua/entities/gmod_wire_gpu/cl_gpuvm.lua

View workflow job for this annotation

GitHub Actions / lint

"Shadowing"

Variable 'self' shadows existing binding, defined at line 14, column 10
if self.ASYNC == 1 then
if self.EntryPoint5 > 0 then
self.IP = self.EntryPoint5
Expand All @@ -63,7 +63,7 @@
surface.DrawRect(0,0,self.ScreenWidth,self.ScreenHeight)

draw.DrawText("Error in the instruction stream","WireGPU_ErrorFont",48,16,Color(255,255,255,255))
draw.DrawText((self.ErrorText[interruptNo] or "Unknown error").." (#"..interruptNo..")","WireGPU_ErrorFont",16,16+32*2,Color(255,255,255,255))

Check warning on line 66 in lua/entities/gmod_wire_gpu/cl_gpuvm.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
draw.DrawText("Parameter: "..(interruptParameter or 0),"WireGPU_ErrorFont",16,16+32*3,Color(255,255,255,255))
draw.DrawText("Address: "..self.XEIP,"WireGPU_ErrorFont",16,16+32*4,Color(255,255,255,255))

Expand Down Expand Up @@ -2039,7 +2039,7 @@
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 @@
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 @@ -458,8 +458,8 @@
--------------------------------------------------------------------------------
ZVM.OpcodeTable[70] = function(self) --EXTINT
self:Dyn_EmitState()
self:Emit("VM.IP = %d",(self.PrecompileIP or 0))

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

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Emit("VM.XEIP = %d",(self.PrecompileTrueXEIP or 0))

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

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Dyn_Emit("VM:ExternalInterrupt(math.floor($1))")
self:Dyn_EmitBreak()
self.PrecompileBreak = true
Expand Down Expand Up @@ -687,7 +687,7 @@
self:Dyn_Emit("end")
end
ZVM.OpcodeTable[98] = function(self) --TIMER
self:Dyn_EmitOperand("(VM.TIMER+%d*VM.TimerDT)",(self.PrecompileInstruction or 0))

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

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
end
ZVM.OpcodeTable[99] = function(self) --LIDTR
self:Dyn_Emit("VM.IDTR = $1")
Expand Down Expand Up @@ -1046,7 +1046,7 @@
ZVM.OpcodeTable[126] = function(self) --LEA
local emitText = self.OperandEffectiveAddress[self.EmitOperandRM[2]] or "0"
emitText = string.gsub(emitText,"$BYTE",self.EmitOperandByte[2] or "0")
emitText = string.format(string.gsub(emitText,"$SEG","VM[%q]",(self.EmitOperandSegment[2] or "DS")))

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

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
self:Dyn_EmitOperand(emitText)
end
ZVM.OpcodeTable[127] = function(self) --BLOCK
Expand Down Expand Up @@ -1188,7 +1188,7 @@
self:Dyn_Emit("V = VM:Pop()") -- IRET EIP
self:Dyn_EmitInterruptCheck()

for i=0,31 do

Check warning on line 1191 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
self:Dyn_Emit("V = VM:Pop()") self:Dyn_EmitInterruptCheck() self:Dyn_Emit("VM.R%d = V")
end

Expand Down Expand Up @@ -1576,9 +1576,9 @@
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"
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 + %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_EmitInterruptCheck()

self:Dyn_Emit("$L X = { 0, 0, 0 }")
Expand Down Expand Up @@ -1641,7 +1641,7 @@
self:Dyn_EmitInterruptCheck()
end
ZVM.OpcodeTable[269] = function(self) --VLEN
local seg1code = self.EmitOperandSegment[1] and "0" or "VM.DS"

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

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: seg1code
local seg2code = self.EmitOperandSegment[2] and "0" or "VM.DS"
self:Dyn_Emit("if VM.VMODE == 2 then")
self:Dyn_Emit("$L V = VM:ReadVector2f($2 + %s)",seg2code)
Expand Down
Loading