SH SERIES C Compiler (Ver. 5.0(Release10))       06-Jul-1998 19:43:56  PAGE    1

************ SOURCE LISTING ************

FILE NAME: .\sample.c

  Seq       File  Line   0----+----1----+----2----+----3----+----4----+----5----
    1   sample.c     1    /*
    2   sample.c     2    Test ReadBNC for Official Format (BASIC)
    3   sample.c     3    */
    4   sample.c     4    
    5   sample.c     5    #include <Shinobi.h>
 4760   sample.c     6    #include <nindows.h>
 5310   sample.c     7    #include <NinjaCnk.h>
 5700   sample.c     8    #include <NinjaCnk2.h>
 5905   sample.c     9    #include <nuBinary.h>
 5929   sample.c    10    
 5930   sample.c    11    
 5931   sample.c    12    NJS_OBJECT *BSK_OBJECT;
 5932   sample.c    13    NJS_MOTION *BSK_OBJECT_MOTION;
 5933   sample.c    14    NJS_TEXLIST     *tlist1;
 5934   sample.c    15    char *pFilename = "run_null3.nj";
 5935   sample.c    16    char *pMFilename = "rocket03d_run.njm";
 5936   sample.c    17    
 5937   sample.c    18    
 5938   sample.c    19    NJS_TEXMEMLIST  tex[100];
 5939   sample.c    20    NJS_TEXINFO     info;
 5940   sample.c    21    
 5941   sample.c    22    
 5942   sample.c    23    extern NJS_MATRIX       matrix[128];
 5943   sample.c    24    extern Uint8 vbuf[];
 5944   sample.c    25    /*extern NJS_VERTEX_BUF vbuf[4096];*/
 5945   sample.c    26    
 5946   sample.c    27    NJS_VIEW        view;
 5947   sample.c    28    NJS_LIGHT       light;
 5948   sample.c    29    
 5949   sample.c    30    Uint32 count = 0;
 5950   sample.c    31    
 5951   sample.c    32    
 5952   sample.c    33    
 5953   sample.c    34    void Count(void)
 5954   sample.c    35    {
 5955   sample.c    36            count++;
 5956   sample.c    37    
 5957   sample.c    38    }
 5958   sample.c    39    
 5959   sample.c    40    
 5960   sample.c    41    
 5961   sample.c    42    void njUserInit(void)
 5962   sample.c    43    {
 5963   sample.c    44        Uint8 *work_buff;
 5964   sample.c    45        Uint32 fpos = 0, rtype, fsize;
 5965   sample.c    46    
 5966   sample.c    47            /*sbInitSystem( NJD_RESOLUTION_VGA, NJD_FRAMEB
                         +UFFER_MODE_RGB555, 1 );*/
 5967   sample.c    48  E     sbInitSystem( 5, 1, 1 );
 5968   sample.c    49            njInitVertexBuffer( 800000, 0, 300000, 0 );
 5969   sample.c    50            njInitMatrix( matrix, 128 , 1);
 5970   sample.c    51            njInit3D( vbuf, 4096 );
 5971   sample.c    52    
 5972   sample.c    53    
 5973   sample.c    54            njInitView( &view );
 5974   sample.c    55            njTranslateViewRelative(&view, 0.f, 0.f, 100.f
                         +);
 5975   sample.c    56            njSetView( &view );
 5976   sample.c    57    
 5977   sample.c    58    
 5978   sample.c    59  E         njCreateLight( &light, 0x01 |0x02 |0x10  );
 5979   sample.c    60            njSetLightIntensity( &light, 1.5f, 1.0f, 0.7f 
                         +);
 5980   sample.c    61  E         njSetLightAngle( &light, ((Angle)(((3.141592 /
                         + 30.f) * 65536.0) / (2 * 3.141592))), ((Angle)(((3.141
                         +592 / 4.f) * 65536.0) / (2 * 3.141592))) );
 5981   sample.c    62            /*njSetLightDirection( &light, 0, 0.707f, -0.7
                         +07f );*/
 5982   sample.c    63            njSetLightDirection( &light, 0, 0.f, -1.f );
 5983   sample.c    64    
 5984   sample.c    65        /*-- OBJECT-------------------------*/
 5985   sample.c    66        fpos = 0;
 5986   sample.c    67        work_buff = nuOpenBinary(pFilename);
 5987   sample.c    68        tlist1 = (NJS_TEXLIST *)nuReadBinaryChunk(work_buf
                         +f, &fpos, &rtype);
 5988   sample.c    69            BSK_OBJECT = (NJS_OBJECT *)nuReadBinaryChunk(w
                         +ork_buff, &fpos, &rtype);
 5989   sample.c    70        nuCloseBinary(work_buff);
 5990   sample.c    71        /*---------------------------------*/
 5991   sample.c    72    
 5992   sample.c    73        /*-- OBJECT MOTION-----------------*/
 5993   sample.c    74        fpos = 0;
 5994   sample.c    75        work_buff = nuOpenBinary(pMFilename);
 5995   sample.c    76            BSK_OBJECT_MOTION = (NJS_MOTION *)nuReadBinary
                         +Chunk(work_buff, &fpos, &rtype);
 5996   sample.c    77        nuCloseBinary(work_buff);
 5997   sample.c    78        /*---------------------------------*/
 5998   sample.c    79    
 5999   sample.c    80        njInitTextureBuffer(vbuf,4096*96);
 6000   sample.c    81            njInitTexture( tex, 100 );
 6001   sample.c    82            njLoadTexture( tlist1 );
 6002   sample.c    83            njSetTexture( tlist1 );
 6003   sample.c    84    
 6004   sample.c    85            njSetBackColor(0x00000000,0x00000000,0x000000F
                         +F);
 6005   sample.c    86    
 6006   sample.c    87            njSetVSyncFunction(Count);
 6007   sample.c    88  E         nwInitSystem(10,0 );
 6008   sample.c    89    }
 6009   sample.c    90    
 6010   sample.c    91    
 6011   sample.c    92    
 6012   sample.c    93    Sint32 njUserMain(void)
 6013   sample.c    94    {
 6014   sample.c    95        static float frame = 0.f;
 6015   sample.c    96    
 6016   sample.c    97        njDrawMotion(BSK_OBJECT, BSK_OBJECT_MOTION, frame)
                         +;
 6017   sample.c    98    
 6018   sample.c    99  E     njPrintD(((3)<<16|(5)),count,8);
 6019   sample.c   100  E     njPrintF(((3)<<16|(8)),frame,8);
 6020   sample.c   101    
 6021   sample.c   102        frame++;
 6022   sample.c   103        if(frame > 17.f)
 6023   sample.c   104            frame = 0.f;
 6024   sample.c   105    
 6025   sample.c   106            return nwExecute();
 6026   sample.c   107    }
 6027   sample.c   108    
 6028   sample.c   109    void njUserExit(void)
 6029   sample.c   110    {
 6030   sample.c   111            nwExitSystem();
 6031   sample.c   112            njExitTexture();
 6032   sample.c   113            sbExitSystem();
 6033   sample.c   114    }
 6034   sample.c   115    
 6035   sample.c   116    intcInit(){}
SH SERIES C Compiler (Ver. 5.0(Release10))       06-Jul-1998 19:43:56  PAGE    1


******** STATISTICS INFORMATION ********


********** ERROR INFORMATION ***********

NUMBER OF ERRORS:           0
NUMBER OF WARNINGS:         2




******* SOURCE LINE INFORMATION ********

COMPILED SOURCE LINE:      116



******* SECTION SIZE INFORMATION *******

PROGRAM  SECTION (P):                               00000274 Byte(s)
PROGRAM  SECTION (P$8):                             00000000 Byte(s)
CONSTANT SECTION (C):                               00000022 Byte(s)
CONSTANT SECTION (C$8):                             00000000 Byte(s)
DATA     SECTION (D):                               00000010 Byte(s)
DATA     SECTION (D$8):                             00000000 Byte(s)
BSS      SECTION (B):                               00001B08 Byte(s)
BSS      SECTION (B$8):                             00000000 Byte(s)

 TOTAL PROGRAM SIZE: 00001DAE Byte(s)



********** LABEL INFORMATION ***********

NUMBER OF EXTERNAL REFERENCE SYMBOLS:           30
NUMBER OF EXTERNAL DEFINITION SYMBOLS:          15
NUMBER OF INTERNAL/EXTERNAL SYMBOLS:            45
*** COMMAND PARAMETER ***


  .\sample.c -ob=output\sample.obj -define=__SHC__,__SET4__ -debug -sub=shc.sub 


