mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 14:45:41 +12:00
[PICA] Implement CALLC
This commit is contained in:
parent
53d25ba075
commit
4b85ac8cc5
2 changed files with 9 additions and 0 deletions
|
@ -25,6 +25,7 @@ namespace ShaderOpcodes {
|
|||
NOP = 0x21,
|
||||
END = 0x22,
|
||||
CALL = 0x24,
|
||||
CALLC = 0x25,
|
||||
CALLU = 0x26,
|
||||
IFU = 0x27,
|
||||
IFC = 0x28,
|
||||
|
@ -87,6 +88,7 @@ class PICAShader {
|
|||
// Shader opcodes
|
||||
void add(u32 instruction);
|
||||
void call(u32 instruction);
|
||||
void callc(u32 instruction);
|
||||
void callu(u32 instruction);
|
||||
void cmp(u32 instruction);
|
||||
void dp3(u32 instruction);
|
||||
|
|
|
@ -14,6 +14,7 @@ void PICAShader::run() {
|
|||
switch (opcode) {
|
||||
case ShaderOpcodes::ADD: add(instruction); break;
|
||||
case ShaderOpcodes::CALL: call(instruction); break;
|
||||
case ShaderOpcodes::CALLC: callc(instruction); break;
|
||||
case ShaderOpcodes::CALLU: callu(instruction); break;
|
||||
case ShaderOpcodes::CMP1: case ShaderOpcodes::CMP2:
|
||||
cmp(instruction);
|
||||
|
@ -451,6 +452,12 @@ void PICAShader::call(u32 instruction) {
|
|||
pc = dest;
|
||||
}
|
||||
|
||||
void PICAShader::callc(u32 instruction) {
|
||||
if (isCondTrue(instruction)) {
|
||||
call(instruction); // Pls inline
|
||||
}
|
||||
}
|
||||
|
||||
void PICAShader::callu(u32 instruction) {
|
||||
const u32 bit = (instruction >> 22) & 0xf; // Bit of the bool uniform to check
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue