parse.c
author icculus
Sat, 09 Feb 2008 19:00:59 -0500
branchtrunk
changeset 6 89bff6a08fca
parent 4 e0b2c5b7210c
child 7 18bf77bb8c07
permissions -rw-r--r--
[svn] Pad out instructions so indexes match.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
     1
#include <stdio.h>
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
     2
#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
     3
#include <stdint.h>
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     4
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     5
#define END_OF_STREAM (-2)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     6
//#define FAIL(x) (-1)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     7
static int FAIL(const char *reason)
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     8
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
     9
    printf("%s FAIL.\n", reason);
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    10
    return -1;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    11
} // FAIL
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    12
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
    13
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    14
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
    15
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
    16
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
    17
4
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    18
#if ((defined __GNUC__) && (defined __POWERPC__))
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    19
    static inline uint32 SWAP32(uint32 x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    20
    {
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    21
        __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (x) : "r" (&x));
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    22
        return x;
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    23
    } // SWAP32
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    24
#elif defined(__POWERPC__)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    25
    static inline uint32 SWAP32(uint32 x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    26
    {
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    27
        return ( (((x) >> 24) & 0x000000FF) | (((x) >>  8) & 0x0000FF00) |
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    28
                 (((x) <<  8) & 0x00FF0000) | (((x) << 24) & 0xFF000000) );
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    29
    } // SWAP32
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    30
#else
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    31
#   define SWAP32(x) (x)
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    32
#endif
e0b2c5b7210c [svn] Implemented byteswapping.
icculus
parents: 2
diff changeset
    33
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    34
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
    35
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    36
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
    37
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    38
    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
    39
} // parse_NOP
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    40
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    41
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
    42
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    43
    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
    44
} // parse_MOV
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    45
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    46
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
    47
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    48
    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
    49
} // parse_ADD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    50
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    51
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
    52
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    53
    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
    54
} // parse_SUB
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
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
    57
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    58
    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
    59
} // parse_MAD
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
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
    62
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    63
    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
    64
} // parse_MUL
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
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
    67
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    68
    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
    69
} // parse_RCP
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
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
    72
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    73
    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
    74
} // parse_RSQ
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
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
    77
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    78
    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
    79
} // parse_DP3
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
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
    82
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    83
    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
    84
} // parse_DP4
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
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
    87
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    88
    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
    89
} // parse_MIN
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
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
    92
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    93
    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
    94
} // parse_MAX
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
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
    97
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
    98
    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
    99
} // parse_SLT
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
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
   102
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   103
    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
   104
} // parse_SGE
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
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
   107
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   108
    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
   109
} // parse_EXP
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
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
   112
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   113
    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
   114
} // parse_LOG
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
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
   117
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   118
    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
   119
} // parse_LIT
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
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
   122
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   123
    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
   124
} // parse_DST
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
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
   127
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   128
    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
   129
} // parse_LRP
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
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
   132
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   133
    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
   134
} // parse_FRC
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
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
   137
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   138
    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
   139
} // parse_M4X4
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
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
   142
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   143
    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
   144
} // parse_M4X3
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
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
   147
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   148
    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
   149
} // parse_M3X4
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
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
   152
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   153
    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
   154
} // parse_M3X3
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
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
   157
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   158
    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
   159
} // parse_M3X2
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
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
   162
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   163
    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
   164
} // parse_CALL
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   165
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   166
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
   167
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   168
    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
   169
} // parse_CALLNZ
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
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
   172
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   173
    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
   174
} // parse_LOOP
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
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
   177
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   178
    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
   179
} // parse_RET
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
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
   182
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   183
    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
   184
} // parse_ENDLOOP
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
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
   187
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   188
    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
   189
} // parse_LABEL
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
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
   192
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   193
    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
   194
} // parse_DCL
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
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
   197
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   198
    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
   199
} // parse_POW
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
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
   202
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   203
    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
   204
} // parse_CRS
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
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
   207
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   208
    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
   209
} // parse_SGN
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
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
   212
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   213
    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
   214
} // parse_ABS
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
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
   217
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   218
    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
   219
} // parse_NRM
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
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
   222
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   223
    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
   224
} // parse_SINCOS
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
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
   227
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   228
    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
   229
} // parse_REP
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
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
   232
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   233
    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
   234
} // parse_ENDREP
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
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
   237
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   238
    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
   239
} // parse_IF
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
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
   242
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   243
    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
   244
} // parse_IFC
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
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
   247
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   248
    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
   249
} // parse_ELSE
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
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
   252
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   253
    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
   254
} // parse_ENDIF
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
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
   257
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   258
    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
   259
} // parse_BREAK
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
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
   262
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   263
    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
   264
} // parse_BREAKC
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
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
   267
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   268
    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
   269
} // parse_MOVA
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
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
   272
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   273
    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
   274
} // parse_DEFB
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
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
   277
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   278
    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
   279
} // parse_DEFI
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
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
   282
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   283
    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
   284
} // parse_TEXCOORD
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
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
   287
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   288
    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
   289
} // parse_TEXKILL
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
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
   292
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   293
    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
   294
} // parse_TEX
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
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
   297
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   298
    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
   299
} // parse_TEXBEM
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
static int parse_TEXBEML(const uint32 *argtokens)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   302
{
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   303
    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
   304
} // parse_TEXBEML
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
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
   307
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   308
    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
   309
} // parse_TEXREG2AR
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
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
   312
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   313
    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
   314
} // parse_TEXREG2GB
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
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
   317
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   318
    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
   319
} // parse_TEXM3X2PAD
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   320
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   321
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
   322
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   323
    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
   324
} // parse_TEXM3X2TEX
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
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
   327
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   328
    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
   329
} // parse_TEXM3X3PAD
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
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
   332
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   333
    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
   334
} // parse_TEXM3X3TEX
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
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
   337
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   338
    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
   339
} // parse_RESERVED0
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
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
   342
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   343
    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
   344
} // parse_TEXM3X3SPEC
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
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
   347
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   348
    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
   349
} // parse_TEXM3X3VSPEC
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
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
   352
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   353
    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
   354
} // parse_EXPP
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
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
   357
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   358
    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
   359
} // parse_LOGP
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
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
   362
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   363
    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
   364
} // parse_CND
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
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
   367
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   368
    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
   369
} // parse_DEF
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
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
   372
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   373
    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
   374
} // parse_TEXREG2RGB
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
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
   377
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   378
    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
   379
} // parse_TEXDP3TEX
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
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
   382
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   383
    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
   384
} // parse_TEXM3X2DEPTH
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
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
   387
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   388
    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
   389
} // parse_TEXDP3
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
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
   392
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   393
    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
   394
} // parse_TEXM3X3
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
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
   397
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   398
    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
   399
} // parse_TEXDEPTH
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
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
   402
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   403
    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
   404
} // parse_CMP
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
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
   407
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   408
    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
   409
} // parse_BEM
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
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
   412
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   413
    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
   414
} // parse_DP2ADD
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
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
   417
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   418
    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
   419
} // parse_DSX
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
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
   422
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   423
    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
   424
} // parse_DSY
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
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
   427
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   428
    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
   429
} // parse_TEXLDD
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
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
   432
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   433
    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
   434
} // parse_SETP
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
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
   437
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   438
    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
   439
} // parse_TEXLDL
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
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
   442
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   443
    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
   444
} // parse_BREAKP
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
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
   447
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   448
    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
   449
} // parse_BREAKP
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
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   452
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
typedef struct
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
    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
   457
    int arg_tokens;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   458
    //uint32 shader_requirements;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   459
    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
   460
} Instruction;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   461
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   462
// 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
   463
//  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
   464
static Instruction instructions[] = {
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   465
    #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
   466
    INSTRUCTION(NOP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   467
    INSTRUCTION(MOV, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   468
    INSTRUCTION(ADD, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   469
    INSTRUCTION(SUB, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   470
    INSTRUCTION(MAD, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   471
    INSTRUCTION(MUL, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   472
    INSTRUCTION(RCP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   473
    INSTRUCTION(RSQ, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   474
    INSTRUCTION(DP3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   475
    INSTRUCTION(DP4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   476
    INSTRUCTION(MIN, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   477
    INSTRUCTION(MAX, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   478
    INSTRUCTION(SLT, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   479
    INSTRUCTION(SGE, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   480
    INSTRUCTION(EXP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   481
    INSTRUCTION(LOG, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   482
    INSTRUCTION(LIT, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   483
    INSTRUCTION(DST, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   484
    INSTRUCTION(LRP, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   485
    INSTRUCTION(FRC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   486
    INSTRUCTION(M4X4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   487
    INSTRUCTION(M4X3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   488
    INSTRUCTION(M3X4, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   489
    INSTRUCTION(M3X3, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   490
    INSTRUCTION(M3X2, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   491
    INSTRUCTION(CALL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   492
    INSTRUCTION(CALLNZ, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   493
    INSTRUCTION(LOOP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   494
    INSTRUCTION(RET, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   495
    INSTRUCTION(ENDLOOP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   496
    INSTRUCTION(LABEL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   497
    INSTRUCTION(DCL, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   498
    INSTRUCTION(POW, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   499
    INSTRUCTION(CRS, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   500
    INSTRUCTION(SGN, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   501
    INSTRUCTION(ABS, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   502
    INSTRUCTION(NRM, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   503
    INSTRUCTION(SINCOS, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   504
    INSTRUCTION(REP, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   505
    INSTRUCTION(ENDREP, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   506
    INSTRUCTION(IF, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   507
    INSTRUCTION(IFC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   508
    INSTRUCTION(ELSE, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   509
    INSTRUCTION(ENDIF, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   510
    INSTRUCTION(BREAK, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   511
    INSTRUCTION(BREAKC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   512
    INSTRUCTION(MOVA, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   513
    INSTRUCTION(DEFB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   514
    INSTRUCTION(DEFI, 5),
6
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   515
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   516
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   517
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   518
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   519
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   520
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   521
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   522
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   523
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   524
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   525
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   526
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   527
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   528
    INSTRUCTION(RESERVED, 0),
89bff6a08fca [svn] Pad out instructions so indexes match.
icculus
parents: 4
diff changeset
   529
    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
   530
    INSTRUCTION(TEXCOORD, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   531
    INSTRUCTION(TEXKILL, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   532
    INSTRUCTION(TEX, -1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   533
    INSTRUCTION(TEXBEM, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   534
    INSTRUCTION(TEXBEML, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   535
    INSTRUCTION(TEXREG2AR, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   536
    INSTRUCTION(TEXREG2GB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   537
    INSTRUCTION(TEXM3X2PAD, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   538
    INSTRUCTION(TEXM3X2TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   539
    INSTRUCTION(TEXM3X3PAD, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   540
    INSTRUCTION(TEXM3X3TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   541
    INSTRUCTION(RESERVED, 0),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   542
    INSTRUCTION(TEXM3X3SPEC, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   543
    INSTRUCTION(TEXM3X3VSPEC, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   544
    INSTRUCTION(EXPP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   545
    INSTRUCTION(LOGP, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   546
    INSTRUCTION(CND, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   547
    INSTRUCTION(DEF, 5),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   548
    INSTRUCTION(TEXREG2RGB, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   549
    INSTRUCTION(TEXDP3TEX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   550
    INSTRUCTION(TEXM3X2DEPTH, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   551
    INSTRUCTION(TEXDP3, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   552
    INSTRUCTION(TEXM3X3, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   553
    INSTRUCTION(TEXDEPTH, 1),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   554
    INSTRUCTION(CMP, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   555
    INSTRUCTION(BEM, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   556
    INSTRUCTION(DP2ADD, 4),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   557
    INSTRUCTION(DSX, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   558
    INSTRUCTION(DSY, 2),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   559
    INSTRUCTION(TEXLDD, 5),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   560
    INSTRUCTION(SETP, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   561
    INSTRUCTION(TEXLDL, 3),
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   562
    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
   563
    #undef INSTRUCTION
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   564
};
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   565
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   566
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   567
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
   568
{
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   569
    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
   570
    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
   571
    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
   572
    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
   573
    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
   574
    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
   575
    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
   576
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   577
    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
   578
        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
   579
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   580
    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
   581
        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
   582
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   583
    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
   584
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   585
    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
   586
    {
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   587
        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
   588
            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
   589
        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
   590
            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
   591
    } // if
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   592
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   593
return insttoks + 1;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   594
//    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
   595
} // parse_instruction_token
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   596
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   597
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   598
static int parse_version_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   599
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   600
    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
   601
        return FAIL("Expected version token, got none at all.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   602
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   603
    const uint32 token = SWAP32(*tokens);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   604
    const uint32 shadertype = ((token >> 16) & 0xFFFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   605
    const uint32 major = ((token >> 8) & 0xFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   606
    const uint32 minor = (token & 0xFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   607
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   608
    if (shadertype == 0xFFFF)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   609
        printf("Pixel shader\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   610
    else if (shadertype == 0xFFFE)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   611
        printf("Vertex shader\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   612
    else
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   613
        return FAIL("geometry shader? Unsupported at the moment.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   614
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   615
    printf("Version %u.%u\n", (uint) major, (uint) minor);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   616
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   617
    return 1;  // ate one token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   618
} // parse_version_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   619
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   620
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   621
static int parse_comment_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   622
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   623
    const uint32 token = SWAP32(*tokens);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   624
    if ((token & 0xFFFF) != 0xFFFE)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   625
        return 0;  // not a comment token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   626
    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
   627
        return FAIL("comment token high bit must be zero.");  // so says msdn.
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   628
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   629
    const uint32 commenttoks = ((token >> 16) & 0xFFFF);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   630
    const uint32 commentlen = commenttoks * sizeof (uint32);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   631
    printf("Comment (%u tokens, %u bytes): ",
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   632
            (uint) commenttoks, (uint) commentlen);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   633
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   634
    uint32 i = 0;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   635
    const char *comment = (const char *) (tokens+1);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   636
    while (i < commentlen)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   637
        fputc(comment[i++], stdout);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   638
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   639
    printf("\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   640
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   641
    return commenttoks + 1;  // comment data plus the initial token.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   642
} // parse_comment_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   643
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   644
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   645
static int parse_end_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   646
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   647
    if (SWAP32(*tokens) != 0x0000FFFF)      // end token is always 0x0000FFFF.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   648
        return 0;  // not us, eat no tokens.
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   649
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   650
    printf("END\n");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   651
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   652
    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
   653
        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
   654
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   655
    return END_OF_STREAM;
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   656
} // parse_end_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   657
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   658
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   659
static int parse_phase_token(const uint32 *tokens, const uint32 tokencount)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   660
{
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   661
    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
   662
        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
   663
    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
   664
} // parse_phase_token
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   665
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   666
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   667
static int parse_token(const uint32 *tokens, const uint32 tokencount)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   668
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   669
    int rc = 0;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   670
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   671
    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
   672
        return FAIL("unexpected end of shader.");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   673
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   674
    if ((rc = parse_comment_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   675
        return rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   676
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   677
    if ((rc = parse_end_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   678
        return rc;
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
    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
   681
        return rc;
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   682
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   683
    if ((rc = parse_instruction_token(tokens, tokencount)) != 0)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   684
        return rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   685
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   686
    return FAIL("unknown token");
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   687
} // parse_token
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   688
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   689
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   690
int D3D2GLSL_parse(const uint8 *tokenbuf, const uint32 bufsize)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   691
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   692
    const uint32 *tokens = (const uint32 *) tokenbuf;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   693
    uint32 tokencount = bufsize / sizeof (uint32);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   694
    int rc = parse_version_token(tokens, tokencount);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   695
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   696
    // 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
   697
    while (rc > 0)
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   698
    {
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   699
        tokens += rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   700
        tokencount -= rc;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   701
        rc = parse_token(tokens, tokencount);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   702
    } // while
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   703
2
c37210f5e87b [svn] Bunch More Work. Parse out instruction tokens, fail in a bunch of new stubs.
icculus
parents: 1
diff changeset
   704
    return (rc == END_OF_STREAM);
1
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   705
} // D3D2GLSL_parse
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   706
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   707
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   708
int main(int argc, char **argv)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   709
{
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   710
    if (argv[1] != NULL)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   711
    {
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   712
        FILE *io = fopen(argv[1], "rb");
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   713
        if (io != NULL)
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   714
        {
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   715
            uint8 *buf = (uint8 *) malloc(1000000);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   716
            int rc = fread(buf, 1, 1000000, io);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   717
            fclose(io);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   718
            D3D2GLSL_parse(buf, rc);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   719
            free(buf);
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   720
        } // if
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   721
    } // if
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   722
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   723
    return 0;
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   724
} // main
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   725
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   726
// end of parse.c ...
99ac16070d07 [svn] Initial add.
icculus
parents:
diff changeset
   727