parse.c
author icculus
Sun, 10 Feb 2008 18:34:12 -0500
branchtrunk
changeset 7 18bf77bb8c07
parent 6 89bff6a08fca
permissions -rw-r--r--
[svn] Cleanups, split things out.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     1
/**
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     2
 * d3d2glsl; generate GLSL programs from bytecode of compiled Direct3D shaders.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     3
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     4
 * Please see the file LICENSE.txt in the source's root directory.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     5
 *
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     6
 *  This file written by Ryan C. Gordon.
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     7
 */
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     8
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
     9
// Shader bytecode format is described at MSDN:
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    10
//  http://msdn2.microsoft.com/en-us/library/ms800307.aspx
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    11
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
    12
#include <stdio.h>
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
    13
#include <stdlib.h>
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    14
#include <stdint.h>
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    15
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    16
typedef unsigned int uint;  // this is a printf() helper. don't use for code.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    17
typedef uint8_t uint8;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    18
typedef uint32_t uint32;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    19
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    20
// Byteswap magic...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    21
4
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    22
#if ((defined __GNUC__) && (defined __POWERPC__))
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    23
    static inline uint32 SWAP32(uint32 x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    24
    {
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    25
        __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (x) : "r" (&x));
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    26
        return x;
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    27
    } // SWAP32
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    28
#elif defined(__POWERPC__)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    29
    static inline uint32 SWAP32(uint32 x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    30
    {
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    31
        return ( (((x) >> 24) & 0x000000FF) | (((x) >>  8) & 0x0000FF00) |
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    32
                 (((x) <<  8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) );
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    33
    } // SWAP32
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    34
#else
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    35
#   define SWAP32(x) (x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    36
#endif
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    37
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    38
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    39
// Special-case return values from the parsing pipeline...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    40
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    41
#define END_OF_STREAM (-2)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    42
//#define FAIL(x) (-1)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    43
static int FAIL(const char *reason)
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    44
{
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    45
    printf("%s FAIL.\n", reason);
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    46
    return -1;
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    47
} // FAIL
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    48
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    49
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    50
// one function for each opcode...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
    51
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    52
typedef int (*parse_instruction_function)(const uint32 *argtokens);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    53
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    54
static int parse_NOP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    55
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    56
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    57
} // parse_NOP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    58
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    59
static int parse_MOV(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    60
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    61
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    62
} // parse_MOV
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    63
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    64
static int parse_ADD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    65
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    66
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    67
} // parse_ADD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    68
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    69
static int parse_SUB(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    70
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    71
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    72
} // parse_SUB
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    73
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    74
static int parse_MAD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    75
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    76
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    77
} // parse_MAD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    78
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    79
static int parse_MUL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    80
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    81
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    82
} // parse_MUL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    83
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    84
static int parse_RCP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    85
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    86
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    87
} // parse_RCP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    88
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    89
static int parse_RSQ(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    90
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    91
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    92
} // parse_RSQ
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    93
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    94
static int parse_DP3(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    95
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    96
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    97
} // parse_DP3
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    98
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    99
static int parse_DP4(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   100
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   101
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   102
} // parse_DP4
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   103
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   104
static int parse_MIN(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   105
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   106
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   107
} // parse_MIN
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   108
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   109
static int parse_MAX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   110
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   111
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   112
} // parse_MAX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   113
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   114
static int parse_SLT(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   115
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   116
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   117
} // parse_SLT
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   118
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   119
static int parse_SGE(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   120
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   121
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   122
} // parse_SGE
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   123
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   124
static int parse_EXP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   125
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   126
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   127
} // parse_EXP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   128
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   129
static int parse_LOG(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   130
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   131
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   132
} // parse_LOG
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   133
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   134
static int parse_LIT(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   135
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   136
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   137
} // parse_LIT
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   138
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   139
static int parse_DST(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   140
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   141
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   142
} // parse_DST
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   143
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   144
static int parse_LRP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   145
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   146
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   147
} // parse_LRP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   148
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   149
static int parse_FRC(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   150
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   151
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   152
} // parse_FRC
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   153
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   154
static int parse_M4X4(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   155
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   156
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   157
} // parse_M4X4
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   158
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   159
static int parse_M4X3(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   160
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   161
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   162
} // parse_M4X3
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   163
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   164
static int parse_M3X4(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   165
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   166
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   167
} // parse_M3X4
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   168
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   169
static int parse_M3X3(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   170
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   171
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   172
} // parse_M3X3
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   173
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   174
static int parse_M3X2(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   175
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   176
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   177
} // parse_M3X2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   178
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   179
static int parse_CALL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   180
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   181
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   182
} // parse_CALL
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   183
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   184
static int parse_CALLNZ(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   185
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   186
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   187
} // parse_CALLNZ
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   188
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   189
static int parse_LOOP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   190
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   191
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   192
} // parse_LOOP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   193
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   194
static int parse_RET(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   195
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   196
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   197
} // parse_RET
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   198
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   199
static int parse_ENDLOOP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   200
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   201
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   202
} // parse_ENDLOOP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   203
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   204
static int parse_LABEL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   205
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   206
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   207
} // parse_LABEL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   208
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   209
static int parse_DCL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   210
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   211
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   212
} // parse_DCL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   213
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   214
static int parse_POW(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   215
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   216
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   217
} // parse_POW
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   218
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   219
static int parse_CRS(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   220
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   221
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   222
} // parse_CRS
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   223
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   224
static int parse_SGN(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   225
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   226
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   227
} // parse_SGN
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   228
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   229
static int parse_ABS(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   230
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   231
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   232
} // parse_ABS
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   233
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   234
static int parse_NRM(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   235
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   236
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   237
} // parse_NRM
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   238
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   239
static int parse_SINCOS(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   240
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   241
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   242
} // parse_SINCOS
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   243
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   244
static int parse_REP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   245
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   246
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   247
} // parse_REP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   248
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   249
static int parse_ENDREP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   250
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   251
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   252
} // parse_ENDREP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   253
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   254
static int parse_IF(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   255
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   256
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   257
} // parse_IF
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   258
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   259
static int parse_IFC(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   260
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   261
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   262
} // parse_IFC
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   263
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   264
static int parse_ELSE(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   265
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   266
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   267
} // parse_ELSE
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   268
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   269
static int parse_ENDIF(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   270
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   271
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   272
} // parse_ENDIF
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   273
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   274
static int parse_BREAK(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   275
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   276
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   277
} // parse_BREAK
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   278
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   279
static int parse_BREAKC(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   280
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   281
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   282
} // parse_BREAKC
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   283
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   284
static int parse_MOVA(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   285
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   286
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   287
} // parse_MOVA
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   288
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   289
static int parse_DEFB(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   290
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   291
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   292
} // parse_DEFB
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   293
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   294
static int parse_DEFI(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   295
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   296
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   297
} // parse_DEFI
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   298
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   299
static int parse_TEXCOORD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   300
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   301
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   302
} // parse_TEXCOORD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   303
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   304
static int parse_TEXKILL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   305
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   306
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   307
} // parse_TEXKILL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   308
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   309
static int parse_TEX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   310
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   311
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   312
} // parse_TEX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   313
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   314
static int parse_TEXBEM(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   315
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   316
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   317
} // parse_TEXBEM
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   318
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   319
static int parse_TEXBEML(const uint32 *argtokens)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   320
{
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   321
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   322
} // parse_TEXBEML
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   323
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   324
static int parse_TEXREG2AR(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   325
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   326
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   327
} // parse_TEXREG2AR
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   328
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   329
static int parse_TEXREG2GB(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   330
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   331
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   332
} // parse_TEXREG2GB
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   333
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   334
static int parse_TEXM3X2PAD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   335
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   336
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   337
} // parse_TEXM3X2PAD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   338
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   339
static int parse_TEXM3X2TEX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   340
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   341
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   342
} // parse_TEXM3X2TEX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   343
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   344
static int parse_TEXM3X3PAD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   345
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   346
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   347
} // parse_TEXM3X3PAD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   348
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   349
static int parse_TEXM3X3TEX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   350
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   351
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   352
} // parse_TEXM3X3TEX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   353
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   354
static int parse_RESERVED0(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   355
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   356
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   357
} // parse_RESERVED0
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   358
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   359
static int parse_TEXM3X3SPEC(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   360
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   361
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   362
} // parse_TEXM3X3SPEC
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   363
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   364
static int parse_TEXM3X3VSPEC(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   365
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   366
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   367
} // parse_TEXM3X3VSPEC
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   368
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   369
static int parse_EXPP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   370
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   371
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   372
} // parse_EXPP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   373
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   374
static int parse_LOGP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   375
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   376
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   377
} // parse_LOGP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   378
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   379
static int parse_CND(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   380
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   381
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   382
} // parse_CND
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   383
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   384
static int parse_DEF(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   385
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   386
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   387
} // parse_DEF
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   388
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   389
static int parse_TEXREG2RGB(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   390
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   391
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   392
} // parse_TEXREG2RGB
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   393
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   394
static int parse_TEXDP3TEX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   395
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   396
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   397
} // parse_TEXDP3TEX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   398
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   399
static int parse_TEXM3X2DEPTH(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   400
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   401
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   402
} // parse_TEXM3X2DEPTH
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   403
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   404
static int parse_TEXDP3(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   405
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   406
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   407
} // parse_TEXDP3
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   408
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   409
static int parse_TEXM3X3(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   410
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   411
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   412
} // parse_TEXM3X3
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   413
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   414
static int parse_TEXDEPTH(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   415
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   416
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   417
} // parse_TEXDEPTH
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   418
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   419
static int parse_CMP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   420
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   421
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   422
} // parse_CMP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   423
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   424
static int parse_BEM(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   425
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   426
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   427
} // parse_BEM
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   428
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   429
static int parse_DP2ADD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   430
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   431
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   432
} // parse_DP2ADD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   433
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   434
static int parse_DSX(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   435
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   436
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   437
} // parse_DSX
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   438
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   439
static int parse_DSY(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   440
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   441
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   442
} // parse_DSY
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   443
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   444
static int parse_TEXLDD(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   445
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   446
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   447
} // parse_TEXLDD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   448
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   449
static int parse_SETP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   450
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   451
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   452
} // parse_SETP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   453
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   454
static int parse_TEXLDL(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   455
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   456
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   457
} // parse_TEXLDL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   458
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   459
static int parse_BREAKP(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   460
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   461
    return FAIL("unimplemented.");  // !!! FIXME
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   462
} // parse_BREAKP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   463
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   464
static int parse_RESERVED(const uint32 *argtokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   465
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   466
    return FAIL("Tried to use RESERVED opcode.");
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   467
} // parse_BREAKP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   468
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   469
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   470
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
   471
// Lookup table for instruction opcodes...
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   472
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   473
typedef struct
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   474
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   475
    const char *opcode_string;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   476
    int arg_tokens;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   477
    //uint32 shader_requirements;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   478
    parse_instruction_function parser;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   479
} Instruction;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   480
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   481
// These have to be in the right order! This array is indexed by the value
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   482
//  of the instruction token.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   483
static Instruction instructions[] = {
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   484
    #define INSTRUCTION(op, args) { #op, args, parse_##op }
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   485
    INSTRUCTION(NOP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   486
    INSTRUCTION(MOV, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   487
    INSTRUCTION(ADD, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   488
    INSTRUCTION(SUB, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   489
    INSTRUCTION(MAD, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   490
    INSTRUCTION(MUL, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   491
    INSTRUCTION(RCP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   492
    INSTRUCTION(RSQ, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   493
    INSTRUCTION(DP3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   494
    INSTRUCTION(DP4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   495
    INSTRUCTION(MIN, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   496
    INSTRUCTION(MAX, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   497
    INSTRUCTION(SLT, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   498
    INSTRUCTION(SGE, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   499
    INSTRUCTION(EXP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   500
    INSTRUCTION(LOG, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   501
    INSTRUCTION(LIT, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   502
    INSTRUCTION(DST, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   503
    INSTRUCTION(LRP, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   504
    INSTRUCTION(FRC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   505
    INSTRUCTION(M4X4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   506
    INSTRUCTION(M4X3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   507
    INSTRUCTION(M3X4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   508
    INSTRUCTION(M3X3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   509
    INSTRUCTION(M3X2, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   510
    INSTRUCTION(CALL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   511
    INSTRUCTION(CALLNZ, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   512
    INSTRUCTION(LOOP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   513
    INSTRUCTION(RET, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   514
    INSTRUCTION(ENDLOOP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   515
    INSTRUCTION(LABEL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   516
    INSTRUCTION(DCL, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   517
    INSTRUCTION(POW, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   518
    INSTRUCTION(CRS, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   519
    INSTRUCTION(SGN, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   520
    INSTRUCTION(ABS, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   521
    INSTRUCTION(NRM, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   522
    INSTRUCTION(SINCOS, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   523
    INSTRUCTION(REP, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   524
    INSTRUCTION(ENDREP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   525
    INSTRUCTION(IF, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   526
    INSTRUCTION(IFC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   527
    INSTRUCTION(ELSE, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   528
    INSTRUCTION(ENDIF, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   529
    INSTRUCTION(BREAK, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   530
    INSTRUCTION(BREAKC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   531
    INSTRUCTION(MOVA, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   532
    INSTRUCTION(DEFB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   533
    INSTRUCTION(DEFI, 5),
6
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   534
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   535
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   536
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   537
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   538
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   539
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   540
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   541
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   542
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   543
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   544
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   545
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   546
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   547
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   548
    INSTRUCTION(RESERVED, 0),
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   549
    INSTRUCTION(TEXCOORD, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   550
    INSTRUCTION(TEXKILL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   551
    INSTRUCTION(TEX, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   552
    INSTRUCTION(TEXBEM, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   553
    INSTRUCTION(TEXBEML, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   554
    INSTRUCTION(TEXREG2AR, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   555
    INSTRUCTION(TEXREG2GB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   556
    INSTRUCTION(TEXM3X2PAD, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   557
    INSTRUCTION(TEXM3X2TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   558
    INSTRUCTION(TEXM3X3PAD, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   559
    INSTRUCTION(TEXM3X3TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   560
    INSTRUCTION(RESERVED, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   561
    INSTRUCTION(TEXM3X3SPEC, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   562
    INSTRUCTION(TEXM3X3VSPEC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   563
    INSTRUCTION(EXPP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   564
    INSTRUCTION(LOGP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   565
    INSTRUCTION(CND, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   566
    INSTRUCTION(DEF, 5),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   567
    INSTRUCTION(TEXREG2RGB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   568
    INSTRUCTION(TEXDP3TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   569
    INSTRUCTION(TEXM3X2DEPTH, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   570
    INSTRUCTION(TEXDP3, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   571
    INSTRUCTION(TEXM3X3, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   572
    INSTRUCTION(TEXDEPTH, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   573
    INSTRUCTION(CMP, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   574
    INSTRUCTION(BEM, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   575
    INSTRUCTION(DP2ADD, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   576
    INSTRUCTION(DSX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   577
    INSTRUCTION(DSY, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   578
    INSTRUCTION(TEXLDD, 5),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   579
    INSTRUCTION(SETP, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   580
    INSTRUCTION(TEXLDL, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   581
    INSTRUCTION(BREAKP, 1),  // src
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   582
    #undef INSTRUCTION
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   583
};
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   584
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   585
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
   586
// parse various token types...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
   587
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   588
static int parse_instruction_token(const uint32 *tokens, const uint32 tokencount)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   589
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   590
    const uint32 token = SWAP32(*tokens);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   591
    const uint32 opcode = (token & 0xFFFF);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   592
    const uint32 controls = ((token >> 16) & 0xFF);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   593
    const uint32 insttoks = ((token >> 24) & 0x0F);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   594
    const int coissue = (token & 0x40000000) ? 1 : 0;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   595
    const int predicated = (token & 0x10000000) ? 1 : 0;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   596
    const Instruction *instruction = &instructions[opcode];
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   597
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   598
    if ( opcode >= (sizeof (instructions) / sizeof (instructions[0])) )
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   599
        return 0;  // not an instruction token, or just not handled here.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   600
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   601
    if ((token & 0x80000000) != 0)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   602
        return FAIL("instruction token high bit must be zero.");  // so says msdn.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   603
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   604
    printf("%s\n", instruction->opcode_string);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   605
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   606
    if (instruction->arg_tokens >= 0)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   607
    {
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   608
        if (instruction->arg_tokens != insttoks)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   609
            return FAIL("unexpected number of tokens for instruction.");
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   610
        else if (tokencount <= instruction->arg_tokens)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   611
            return FAIL("not enough tokens left in shader for instruction.");
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   612
    } // if
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   613
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   614
return insttoks + 1;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   615
//    return instruction->parser(tokens + 1);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   616
} // parse_instruction_token
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   617
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   618
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   619
static int parse_version_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   620
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   621
    if (tokencount == 0)
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   622
        return FAIL("Expected version token, got none at all.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   623
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   624
    const uint32 token = SWAP32(*tokens);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   625
    const uint32 shadertype = ((token >> 16) & 0xFFFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   626
    const uint32 major = ((token >> 8) & 0xFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   627
    const uint32 minor = (token & 0xFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   628
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   629
    if (shadertype == 0xFFFF)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   630
        printf("Pixel shader\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   631
    else if (shadertype == 0xFFFE)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   632
        printf("Vertex shader\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   633
    else
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   634
        return FAIL("geometry shader? Unsupported at the moment.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   635
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   636
    printf("Version %u.%u\n", (uint) major, (uint) minor);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   637
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   638
    return 1;  // ate one token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   639
} // parse_version_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   640
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   641
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   642
static int parse_comment_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   643
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   644
    const uint32 token = SWAP32(*tokens);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   645
    if ((token & 0xFFFF) != 0xFFFE)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   646
        return 0;  // not a comment token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   647
    else if ((token & 0x80000000) != 0)
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   648
        return FAIL("comment token high bit must be zero.");  // so says msdn.
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   649
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   650
    const uint32 commenttoks = ((token >> 16) & 0xFFFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   651
    const uint32 commentlen = commenttoks * sizeof (uint32);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   652
    printf("Comment (%u tokens, %u bytes): ",
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   653
            (uint) commenttoks, (uint) commentlen);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   654
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   655
    uint32 i = 0;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   656
    const char *comment = (const char *) (tokens+1);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   657
    while (i < commentlen)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   658
        fputc(comment[i++], stdout);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   659
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   660
    printf("\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   661
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   662
    return commenttoks + 1;  // comment data plus the initial token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   663
} // parse_comment_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   664
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   665
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   666
static int parse_end_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   667
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   668
    if (SWAP32(*tokens) != 0x0000FFFF)      // end token is always 0x0000FFFF.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   669
        return 0;  // not us, eat no tokens.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   670
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   671
    printf("END\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   672
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   673
    if (tokencount != 1)  // we _must_ be last. If not: FAIL.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   674
        FAIL("end token before end of stream");
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   675
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   676
    return END_OF_STREAM;
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   677
} // parse_end_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   678
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   679
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   680
static int parse_phase_token(const uint32 *tokens, const uint32 tokencount)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   681
{
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   682
    if (SWAP32(*tokens) != 0x0000FFFD)    // phase token is always 0x0000FFFD.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   683
        return 0;  // not us, eat no tokens.
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   684
    return FAIL("not sure what this thing is yet.");
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   685
} // parse_phase_token
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   686
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   687
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   688
static int parse_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   689
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   690
    int rc = 0;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   691
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   692
    if (tokencount == 0)
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   693
        return FAIL("unexpected end of shader.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   694
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   695
    if ((rc = parse_comment_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   696
        return rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   697
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   698
    if ((rc = parse_end_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   699
        return rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   700
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   701
    if ((rc = parse_phase_token(tokens, tokencount)) != 0)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   702
        return rc;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   703
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   704
    if ((rc = parse_instruction_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   705
        return rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   706
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   707
    return FAIL("unknown token");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   708
} // parse_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   709
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   710
7
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
   711
// API entry point...
18bf77bb8c07 [svn] Cleanups, split things out.
icculus
parents: 6
diff changeset
   712
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   713
int D3D2GLSL_parse(const uint8 *tokenbuf, const uint32 bufsize)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   714
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   715
    const uint32 *tokens = (const uint32 *) tokenbuf;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   716
    uint32 tokencount = bufsize / sizeof (uint32);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   717
    int rc = parse_version_token(tokens, tokencount);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   718
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   719
    // parse out the rest of the tokens after the version token...
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   720
    while (rc > 0)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   721
    {
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   722
        tokens += rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   723
        tokencount -= rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   724
        rc = parse_token(tokens, tokencount);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   725
    } // while
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   726
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   727
    return (rc == END_OF_STREAM);
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   728
} // D3D2GLSL_parse
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   729
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   730
// end of parse.c ...
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   731