diff --git a/rpcs3/Emu/RSX/gcm_enums.cpp b/rpcs3/Emu/RSX/gcm_enums.cpp index e5a224af48..a5f6175ffc 100644 --- a/rpcs3/Emu/RSX/gcm_enums.cpp +++ b/rpcs3/Emu/RSX/gcm_enums.cpp @@ -695,18 +695,6 @@ rsx::stencil_op rsx::to_stencil_op(u16 in) fmt::throw_exception("Unknown stencil op 0x%x" HERE, in); } -enum -{ - CELL_GCM_FUNC_ADD = 0x8006, - CELL_GCM_MIN = 0x8007, - CELL_GCM_MAX = 0x8008, - CELL_GCM_FUNC_SUBTRACT = 0x800A, - CELL_GCM_FUNC_REVERSE_SUBTRACT = 0x800B, - CELL_GCM_FUNC_REVERSE_SUBTRACT_SIGNED = 0x0000F005, - CELL_GCM_FUNC_ADD_SIGNED = 0x0000F006, - CELL_GCM_FUNC_REVERSE_ADD_SIGNED = 0x0000F007, -}; - rsx::blend_equation rsx::to_blend_equation(u16 in) { switch (in) diff --git a/rpcs3/Emu/RSX/gcm_enums.h b/rpcs3/Emu/RSX/gcm_enums.h index 93c77c44b6..38ece3f98b 100644 --- a/rpcs3/Emu/RSX/gcm_enums.h +++ b/rpcs3/Emu/RSX/gcm_enums.h @@ -516,6 +516,19 @@ enum CELL_GCM_SURFACE_SWIZZLE = 2, }; +// GCM blend equation +enum +{ + CELL_GCM_FUNC_ADD = 0x8006, + CELL_GCM_MIN = 0x8007, + CELL_GCM_MAX = 0x8008, + CELL_GCM_FUNC_SUBTRACT = 0x800A, + CELL_GCM_FUNC_REVERSE_SUBTRACT = 0x800B, + CELL_GCM_FUNC_REVERSE_SUBTRACT_SIGNED = 0x0000F005, + CELL_GCM_FUNC_ADD_SIGNED = 0x0000F006, + CELL_GCM_FUNC_REVERSE_ADD_SIGNED = 0x0000F007, +}; + enum { CELL_GCM_TEXTURE_UNSIGNED_REMAP_NORMAL = 0, diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index a89f7df389..e217a2472c 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -747,6 +747,32 @@ namespace rsx } } + void set_blend_equation(thread* rsx, u32 reg, u32 arg) + { + for (u32 i = 0; i < 32u; i += 16) + { + switch ((arg >> i) & 0xffff) + { + case CELL_GCM_FUNC_ADD: + case CELL_GCM_MIN: + case CELL_GCM_MAX: + case CELL_GCM_FUNC_SUBTRACT: + case CELL_GCM_FUNC_REVERSE_SUBTRACT: + case CELL_GCM_FUNC_REVERSE_SUBTRACT_SIGNED: + case CELL_GCM_FUNC_ADD_SIGNED: + case CELL_GCM_FUNC_REVERSE_ADD_SIGNED: + break; + + default: + { + // Ignore invalid values as a whole + method_registers.decode(reg, method_registers.register_previous_value); + return; + } + } + } + } + template struct set_texture_dirty_bit { @@ -2997,6 +3023,7 @@ namespace rsx bind_range(); bind_range(); bind(); + bind(); //NV308A bind_range();