//DMC3 black bars.
// ---- Created with 3Dmigoto v1.3.7 on Fri Mar 30 20:29:29 2018

cbuffer PS_CONSTANT_BUFFER : register(b0)
{
  int alpha_test : packoffset(c0);
  int alpha_test_func : packoffset(c0.y);
  float alpha_ref : packoffset(c0.z);
}



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


void main(
  float4 v0 : SV_POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR1,
  float4 v3 : COLOR0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 iniparams = IniParams.Load(0);
  if (iniparams.z==1 && (v0.z<1.00000001 && v0.z>0.999999) && v3.x==0 && v3.y==0 && v3.z==0)
  {
	discard;
  }
  
  r0.xyz = v3.xyz;
  r1.x = 2 * v3.w;
  r0.w = cmp(0 != alpha_test);
  if (r0.w != 0) {
    r0.w = alpha_test_func;
    r1.x = r1.x;
    r1.y = alpha_ref;
    r1.z = cmp((int)r0.w == 1);
    if (r1.z != 0) {
      r1.z = -1;
    } else {
      r1.w = cmp((int)r0.w == 2);
      if (r1.w != 0) {
        r1.w = cmp(r1.x < r1.y);
        if (r1.w != 0) {
          r1.z = 1;
        } else {
          r1.z = -1;
        }
      } else {
        r1.w = cmp((int)r0.w == 3);
        if (r1.w != 0) {
          r1.w = cmp(r1.y == r1.x);
          if (r1.w != 0) {
            r1.z = 1;
          } else {
            r1.z = -1;
          }
        } else {
          r1.w = cmp((int)r0.w == 4);
          if (r1.w != 0) {
            r1.w = cmp(r1.y >= r1.x);
            if (r1.w != 0) {
              r1.z = 1;
            } else {
              r1.z = -1;
            }
          } else {
            r1.w = cmp((int)r0.w == 5);
            if (r1.w != 0) {
              r1.w = cmp(r1.y < r1.x);
              if (r1.w != 0) {
                r1.z = 1;
              } else {
                r1.z = -1;
              }
            } else {
              r1.w = cmp((int)r0.w == 6);
              if (r1.w != 0) {
                r1.w = cmp(r1.y != r1.x);
                if (r1.w != 0) {
                  r1.z = 1;
                } else {
                  r1.z = -1;
                }
              } else {
                r0.w = cmp((int)r0.w == 7);
                if (r0.w != 0) {
                  r0.w = cmp(r1.x >= r1.y);
                  if (r0.w != 0) {
                    r1.z = 1;
                  } else {
                    r1.z = -1;
                  }
                } else {
                  r1.z = 1;
                }
              }
            }
          }
        }
      }
    }
    r1.z = r1.z;
    r0.w = (int)r1.z;
    r0.w = cmp(r0.w < 0);
    //r0.w = r0.w ? -1.#QNAN0 : 0;
    if (r0.w != 0) discard;
  }
  o0.xyz = r0.xyz;
  o0.w = r1.x;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.7 on Fri Mar 30 20:29:29 2018
//
//
// Buffer Definitions:
//
// cbuffer PS_CONSTANT_BUFFER
// {
//
//   int alpha_test;                    // Offset:    0 Size:     4
//   int alpha_test_func;               // Offset:    4 Size:     4
//   float alpha_ref;                   // Offset:    8 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float
// COLOR                    1   xyzw        2     NONE   float
// COLOR                    0   xyzw        3     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed | skipOptimization
dcl_constantbuffer cb0[1], immediateIndexed
dcl_input_ps linear v3.xyzw
dcl_output o0.xyzw
dcl_temps 2
//
// Initial variable locations:
//   v0.x <- pi.pos.x; v0.y <- pi.pos.y; v0.z <- pi.pos.z; v0.w <- pi.pos.w;
//   v1.x <- pi.texcoord.x; v1.y <- pi.texcoord.y;
//   v2.x <- pi.fog.x; v2.y <- pi.fog.y; v2.z <- pi.fog.z; v2.w <- pi.fog.w;
//   v3.x <- pi.rgba.x; v3.y <- pi.rgba.y; v3.z <- pi.rgba.z; v3.w <- pi.rgba.w;
//   o0.x <- <main return value>.x; o0.y <- <main return value>.y; o0.z <- <main return value>.z; o0.w <- <main return value>.w
//
#line 22 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\ps\COL.hlsl"
mov r0.xyz, v3.xyzx  // r0.x <- color.x; r0.y <- color.y; r0.z <- color.z
mul r1.x, v3.w, l(2.000000)  // r1.x <- color.w
ine r0.w, l(0, 0, 0, 0), cb0[0].x
if_nz r0.w
  nop
  mov r0.w, cb0[0].y
  mov r1.x, r1.x
  mov r1.y, cb0[0].z

#line 37 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\Shared.fxh"
  ieq r1.z, r0.w, l(1)
  if_nz r1.z
    mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
  else
    ieq r1.w, r0.w, l(2)
    if_nz r1.w
      lt r1.w, r1.x, r1.y
      if_nz r1.w
        mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
      else

#line 50
        mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
      endif
    else
      ieq r1.w, r0.w, l(3)
      if_nz r1.w
        eq r1.w, r1.y, r1.x
        if_nz r1.w
          mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
        else

#line 62
          mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
        endif
      else
        ieq r1.w, r0.w, l(4)
        if_nz r1.w
          ge r1.w, r1.y, r1.x
          if_nz r1.w
            mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
          else

#line 74
            mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
          endif
        else
          ieq r1.w, r0.w, l(5)
          if_nz r1.w
            lt r1.w, r1.y, r1.x
            if_nz r1.w
              mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
            else

#line 86
              mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
            endif
          else
            ieq r1.w, r0.w, l(6)
            if_nz r1.w
              ne r1.w, r1.y, r1.x
              if_nz r1.w
                mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
              else

#line 98
                mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
              endif
            else
              ieq r0.w, r0.w, l(7)
              if_nz r0.w
                ge r0.w, r1.x, r1.y
                if_nz r0.w
                  mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
                else

#line 110
                  mov r1.z, l(-1)  // r1.z <- <AlphaTestFunc return value>
                endif
              else

#line 115
                mov r1.z, l(1)  // r1.z <- <AlphaTestFunc return value>
              endif
            endif
          endif
        endif
      endif
    endif
  endif

#line 27 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\ps\COL.hlsl"
  mov r1.z, r1.z  // r1.z <- clipVal
  itof r0.w, r1.z
  lt r0.w, r0.w, l(0.000000)
  and r0.w, r0.w, l(-1)
  discard_nz r0.w
endif
mov o0.xyz, r0.xyzx
mov o0.w, r1.x
ret
// Approximately 83 instruction slots used

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