started adding gpu support

This commit is contained in:
unknown
2026-09-09 15:26:36 -05:00
parent 0decb483fe
commit 45650cdc0f
21 changed files with 36 additions and 11 deletions
+6
View File
@@ -32,6 +32,12 @@ namespace Core
SFG, // Sets a flag to true SFG, // Sets a flag to true
RFG, // Sets a flag to false RFG, // Sets a flag to false
// drawing
CPXBF, // create buffer
PBSET, // set pixel in buffer
PBCLEAR, // clear pb
DCLR, // set draw clr
GIE, // Gets if X is equal to Y GIE, // Gets if X is equal to Y
PRA, // Prints accumulator PRA, // Prints accumulator
+22 -8
View File
@@ -18,9 +18,10 @@ namespace Core
public int pointer = 0; public int pointer = 0;
// Declare them here without `new int[WindowSize]` // Declare them here without `new int[WindowSize]`
public int[] PixBufferR; public int[,] PixBufferR;
public int[] PixBufferG; public int[,] PixBufferG;
public int[] PixBufferB; public int[,] PixBufferB;
public int[] ColorBuffer = new int[3];
public int f_IsEqu; public int f_IsEqu;
public int f_IsZer; public int f_IsZer;
@@ -28,11 +29,6 @@ namespace Core
public Operations(int pixBufSize) public Operations(int pixBufSize)
{ {
WindowSize = pixBufSize; WindowSize = pixBufSize;
// Initialize them here so they use the correct WindowSize
PixBufferR = new int[WindowSize];
PixBufferG = new int[WindowSize];
PixBufferB = new int[WindowSize];
} }
@@ -50,6 +46,8 @@ namespace Core
return StackY; return StackY;
case "f_IsEqual": case "f_IsEqual":
return f_IsEqu; return f_IsEqu;
case "f_IsZero":
return f_IsZer;
} }
Variables.TryGetValue(shite, out int a); Variables.TryGetValue(shite, out int a);
return a; return a;
@@ -147,6 +145,16 @@ namespace Core
Accumulator = StackX / StackY; Accumulator = StackX / StackY;
return; return;
// drawing
case ComponentType.CPXBF:
ExecuteCommand(ComponentType.SVAR, new[] { args[1], WindowSize.ToString() });
PixBufferR = new int[WindowSize, WindowSize];
PixBufferG = new int[WindowSize, WindowSize];
PixBufferB = new int[WindowSize, WindowSize];
return;
case ComponentType.DCLR:
ColorBuffer = new int[] { args[1] };
// Debug commands // Debug commands
@@ -225,6 +233,12 @@ namespace Core
case "MUL": ExecuteCommand(ComponentType.MUL, tokens); break; case "MUL": ExecuteCommand(ComponentType.MUL, tokens); break;
case "DIV": ExecuteCommand(ComponentType.DIV, tokens); break; case "DIV": ExecuteCommand(ComponentType.DIV, tokens); break;
// drawing
case "CPXBF": break; // create pixel buffer
case "PBSET": break; // set a pixel in the buffer
case "PBCLEAR": break; // clear buffer
case "DCLR": break; // set draw color
// Debug // Debug
case "PRA": ExecuteCommand(ComponentType.PRA, tokens); break; case "PRA": ExecuteCommand(ComponentType.PRA, tokens); break;
case "PRX": ExecuteCommand(ComponentType.PRX, tokens); break; case "PRX": ExecuteCommand(ComponentType.PRX, tokens); break;
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
7e4ab6ec30c119e58bb28285aaa45d2b6248630033dfbcb03f8acc446e1d573c 56ba5591e1a83fa83135db75c787bf936e80bbba9a4cdf6068a6857b3a145201
@@ -13,3 +13,6 @@ C:\Users\Madeline McWhorter\MathApp\Core\obj\Debug\Core.pdb
C:\Users\Madeline McWhorter\MathApp\Core\bin\Debug\Core.dll.config C:\Users\Madeline McWhorter\MathApp\Core\bin\Debug\Core.dll.config
C:\Users\Madeline McWhorter\MathApp\Core\bin\Debug\SDL2-CS.dll C:\Users\Madeline McWhorter\MathApp\Core\bin\Debug\SDL2-CS.dll
C:\Users\Madeline McWhorter\MathApp\Core\obj\Debug\Core.csproj.Up2Date C:\Users\Madeline McWhorter\MathApp\Core\obj\Debug\Core.csproj.Up2Date
C:\Users\Administrator\MathApp\Core\bin\Debug\Core.dll.config
C:\Users\Administrator\MathApp\Core\bin\Debug\SDL2-CS.dll
C:\Users\Administrator\MathApp\Core\obj\Debug\Core.csproj.Up2Date
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -30,7 +30,7 @@ namespace MathApp
contents = ""; contents = "";
} }
} }
Operations ops = new Operations(409600); Operations ops = new Operations(640);
Console.WriteLine("[ASM] System started!"); Console.WriteLine("[ASM] System started!");
ops.EquParserLoop(contents); ops.EquParserLoop(contents);
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
6e19822cf9df8a3348f7b52adfa331baa8ea4458cbec56a5f3fa3f63bc1a6672 3acf27fa7da4c0bed16312c6cbec7519a66f2b6319fa1561ba08b5cbef155736
@@ -20,3 +20,5 @@ C:\Users\Madeline McWhorter\MathApp\MathLib\obj\x86\Debug\MathLib.exe
C:\Users\Madeline McWhorter\MathApp\MathLib\obj\x86\Debug\MathLib.pdb C:\Users\Madeline McWhorter\MathApp\MathLib\obj\x86\Debug\MathLib.pdb
C:\Users\Madeline McWhorter\MathApp\MathLib\bin\Debug\SDL2-CS.dll C:\Users\Madeline McWhorter\MathApp\MathLib\bin\Debug\SDL2-CS.dll
C:\Users\Madeline McWhorter\MathApp\MathLib\bin\Debug\Core.dll.config C:\Users\Madeline McWhorter\MathApp\MathLib\bin\Debug\Core.dll.config
C:\Users\Administrator\MathApp\MathLib\bin\Debug\SDL2-CS.dll
C:\Users\Administrator\MathApp\MathLib\bin\Debug\Core.dll.config
Binary file not shown.
Binary file not shown.