//P5S cel shading PS 4 (Persona menu).
// ---- Created with 3Dmigoto v1.3.16 on Sat Mar 19 16:28:59 2022

cbuffer _Globals : register(b0)
{
  float vATest : packoffset(c0);
  int nMMLocalTCI : packoffset(c1);
  float4 vMMPrms[3] : packoffset(c2);
  float4 vMMBld : packoffset(c5) = {0,0,0,0};
}

SamplerState __smpsStage0_s : register(s0);
SamplerState __smpsMMArray2_s : register(s2);
Texture2D<float4> sStage0 : register(t0);
Texture2DArray<float4> sMMArray2 : register(t2);


// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float2 v2 : TEXCOORD1,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 iniparams6 = IniParams.Load(int2(6,0));
  if (iniparams6.x==1) {
    discard;
  }
  
  float4 x0[2];
  x0[0].xy = v2.xy;
  x0[1].xy = v1.wz;
  r0.x = nMMLocalTCI;
  r0.xy = x0[r0.x+0].xy;
  r1.xy = vMMPrms[0].xy + r0.xy;
  r1.xy = vMMPrms[0].zw * r1.xy;
  r1.z = 2;
  r0.w = sMMArray2.Sample(__smpsMMArray2_s, r1.xyz).y;
  r0.z = 2;
  r0.x = sMMArray2.Sample(__smpsMMArray2_s, r0.xyz).z;
  r0.x = cmp(vMMBld.x >= r0.x);
  r0.y = sStage0.Sample(__smpsStage0_s, v1.xy).w;
  r0.x = r0.x ? r0.w : r0.y;
  r0.y = -vATest + r0.x;
  o0.w = r0.x;
  r0.x = cmp(r0.y < 0);
  if (r0.x != 0) discard;
  o0.xyz = float3(0,0,0);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sat Mar 19 16:28:59 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float vATest;                      // Offset:    0 Size:     4
//   int nMMLocalTCI;                   // Offset:   16 Size:     4
//   float4 vMMPrms[3];                 // Offset:   32 Size:    48
//   float4 vMMBld;                     // Offset:   80 Size:    16
//      = 0x00000000 0x00000000 0x00000000 0x00000000
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsStage0                      sampler      NA          NA    0        1
// __smpsMMArray2                    sampler      NA          NA    2        1
// sStage0                           texture  float4          2d    0        1
// sMMArray2                         texture  float4     2darray    2        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[6], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2darray (float,float,float,float) t2
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
dcl_indexableTemp x0[2], 4
mov x0[0].xy, v2.xyxx
mov x0[1].xy, v1.wzww
mov r0.x, cb0[1].x
mov r0.xy, x0[r0.x + 0].xyxx
add r1.xy, r0.xyxx, cb0[2].xyxx
mul r1.xy, r1.xyxx, cb0[2].zwzz
mov r1.z, l(2.000000)
sample_indexable(texture2darray)(float,float,float,float) r0.w, r1.xyzx, t2.xzwy, s2
mov r0.z, l(2.000000)
sample_indexable(texture2darray)(float,float,float,float) r0.x, r0.xyzx, t2.zxyw, s2
ge r0.x, cb0[5].x, r0.x
sample_indexable(texture2d)(float,float,float,float) r0.y, v1.xyxx, t0.xwyz, s0
movc r0.x, r0.x, r0.w, r0.y
add r0.y, r0.x, -cb0[0].x
mov o0.w, r0.x
lt r0.x, r0.y, l(0.000000)
discard_nz r0.x
mov o0.xyz, l(0,0,0,0)
ret
// Approximately 19 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
