Twili

Turok source leak (more bits)

Sep 13th, 2017
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.63 KB | None | 0 0
  1. void                    CEngineApp__UpdateTITLE(CEngineApp *pThis);
  2. void                    CEngineApp__UpdateGAME(CEngineApp *pThis);
  3. void                    CEngineApp__UpdateCREDITS(CEngineApp *pThis);
  4. void                    CEngineApp__PrepareFrame(CEngineApp *pThis, int nMinimumF
  5.  
  6. // Symbol genererated by "makerom" to indicate the end of the code segment
  7. // in virtual (and physical) memory
  8. /////////////////////////////////////////////////////////////////////////////
  9.  
  10. extern char _codeSegmentEnd[];
  11.  
  12. // Symbols generated by "makerom" to tell us where the static segment is
  13. // in ROM.
  14. /////////////////////////////////////////////////////////////////////////////
  15.  
  16. extern char _staticSegmentRomStart[], _staticSegmentRomEnd[];
  17.  
  18. // Entry points for new threads
  19. /////////////////////////////////////////////////////////////////////////////
  20.  
  21. // boot thread entry point
  22. void boot();
  23. // idle thread entry point
  24. void idle(void *pArg);
  25. // main thread entry point
  26. void mainproc(void *pArg);
  27. // fault thread entry point
  28.  
  29.  
  30.  
  31.  
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34.  
  35.  
  36.  
  37.  
  38.  
  39. float                   particle_speed_aceler = 1.0;
  40. float                   sky_speed_scaler = 1.0;
  41.  
  42. float                   old_enemy_speed_scaler = 1.0;
  43. float                   old_particle_speed_scaler = 1.0;
  44. float                   old_sky_speed_scaler = 1.0;
  45.  
  46.  
  47. float                   rsp_total_time = 0.0;
  48. float                   rsp_audio_time = 0.0;
  49. float                   rsp_graphics_time = 0.0;
  50. float                   rdp_time = 0.0;
  51. float                   cpu_time = 0.0;
  52.  
  53. float                   weapon_z_rotation = 0.0;
  54.  
  55. //ROMAddress    *rp_current_textureset;
  56. //DWORD                 current_texture;
  57.  
  58. //DWORD                 idle_count;
  59.  
  60. BOOL                    player_is_moving = TRUE;
  61. BOOL                    cache_is_valid = FALSE;
  62.  
  63. CViewVolume     view_volume;
  64. CBoundsRect     view_bounds_rect,
  65.                                 anim_bounds_rect;
  66.  
  67.  
  68.  
  69.  
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72.  
  73.  
  74.  
  75.  
  76.  
  77.         // _Disable_ unimplemented:operation exception for floating point
  78.         // The trunc.w.s instruction causes this exception when the input
  79.         // value is larger than the maximum fixed point value.  This is
  80.         // can happen in the game, so I'm disabling the exception.
  81.         //fpstat &= ^(FPCSR_CE | FPCSR_FS | FPCSR_EV | FPCSR_F1 | FPCSR_RM_PN);
  82.         //fpstat &= -FPCSR_CE;
  83.         //fpstat = 0;
  84.  
  85.         __osSetFpcCsr(fpstat);
  86.  
  87.         //last = (OSThread*) NULL;
  88.  
  89.         while (TRUE)
  90.         {
  91.                 osRecvMesg(&faultMsgQ, (OSMesg*) &msg, OS_MESG_BLOCK);
  92.  
  93. #ifdef SHIP_IT
  94.         // create the persistant data block
  95.         if (            cache_is_valid
  96.                         && (GetApp()->m_Mode == MODE_GAME)
  97.                         && CEngineApp__GetPlayer(GetApp()) )
  98.         {
  99.                 pPlayer = CEngineApp__GetPlayer(GetApp());
  100.  
  101.                 if (frame_number
  102.  
  103.  
  104.  
  105.  
  106.  
  107. /////////////////////////////////////////////////////////////////////////////
  108.  
  109.  
  110.  
  111.  
  112.  
  113.                         pThis->m_FirstRun = TRUE;
  114.  
  115.                 *pTest++ = *pSig++;
  116.         }
  117.  
  118.         if (pThis->m_FirstRun)
  119.                 COptions__SetDefaults(&pThis->m_Options);
  120.  
  121.         pThis->m_bReset = FALSE;
  122.  
  123.         pThis->m_FadeStatus = FADE_NULL ;
  124.         pThis->m_FadeFast = FALSE;
  125.  
  126.  
  127.         CEngineApp__SetDebugMode(pThis, FALSE);
  128.  
  129.         pThis->m_pDLP                   = NULL;
  130.         pThis->m_SloMo                  = FALSE;
  131.         pThis->m_bPause         = FALSE;
  132.         pThis->m_hMusic         = -1;
  133.         pThis->m_MusicVolume = 0.0;
  134.         pThis->m_SFXVolume   = 0.0;
  135.  
  136.         CMtxF__RotateX(mfRot, -ANGLE_PI/2) ;
  137.         CMtxF__Scale(mfFlipZ, 1, 1, -1);
  138.         CMtxF__PostMult(mf_3dstudio_to_u64, mfRot, mfFlipZ);
  139.  
  140.  
  141.  
  142.  
  143.  
  144. /////////////////////////////////////////////////////////////////////////////
  145.  
  146.  
  147.  
  148.  
  149.  
  150.         //int i;
  151.  
  152.         // Initialize video
  153.         /////////////////////////////////////////////////////////////////////////////
  154.  
  155.         osViBlack(TRUE);        // set display to black
  156.  
  157.         // start PI Mgr for access to cartridge
  158.         /////////////////////////////////////////////////////////////////////////////
  159.  
  160.         osCreatePiManager((OSPri)OS_PRIORITY_PIMGR, &PiMessageQ, PiMessages,
  161.  
  162.  
  163.  
  164.  
  165.  
  166. /////////////////////////////////////////////////////////////////////////////
  167.  
  168.  
  169.  
  170.  
  171.  
  172.         // queue.  The background processing thread would call osYieldThread()
  173.         // between critical sections.
  174.  
  175.         while (TRUE);
  176. }
  177.  
  178. void CEngineApp__SetupSegments(CEngineApp *pThis)
  179. {
  180.         gSPSegment(pThis->m_pDLP++, 0, 0x0);
  181. }
  182.  
  183. void CEngineApp__GetFogColor(CEngineApp *pThis, BYTE *pR, BYTE *pG, BYTE *pB)
  184. {
  185.         // mask off bottom 3 bits so background and fog will be the same color
  186.         *pR = pThis->m_FogColor[0] & 0xf8;
  187.         *pG = pThis->m_FogColor[1] & 0xf8;
  188.         *pB = pThis->m_FogColor[2] & 0xf8;
  189. }
  190.  
  191. void CEngineApp__ClearBuffers(CEngineApp *pThis)
  192. {
  193.         BYTE            r, g, b;
  194.         CCamera *pCamera = &pThis->m_Camera ;
  195.  
  196.         // must clear buffers in G_RM_OPA_SURF render mode
  197.         CGeometry__SetRenderMode(&pThis->m_pDLP, G_RM_NOOP__G_RM_NOOP2);
  198.  
  199.  
  200.  
  201.  
  202.  
  203. /////////////////////////////////////////////////////////////////////////////
  204.  
  205.  
  206.  
  207.  
  208.  
  209. void CEngineApp__BuildDispList(CEngineApp *pThis)
  210. {
  211.         CCamera *pCamera = &pThis->m_Camera ;
  212.  
  213.         // clears current render and combine modes
  214.         CGeometry__ResetDrawModes() ;
  215.  
  216.  
  217.         CEngineApp__InitDisplayLists(pThis);
  218.         CEngineApp__ClearBuffers(pThis);
  219.  
  220.         switch (pThis->m_Mode)
  221.         {
  222.                 case MODE_LEGALSCREEN:
  223.                         CEngineApp__DrawLEGALSCREEN(pThis);
  224.                         break ;
  225.                 case MODE_GAMEPAK:
  226.                         CEngineApp__DrawGAMEPAK(pThis);
  227.                         break ;
  228.                 case MODE_TITLE:
  229.                         CEngineApp__DrawTITLE(pThis);
  230.                         break ;
  231.                 case MODE_INTRO:
  232.                 case MODE_GAME:
  233.                 case MODE_GAMEOVER:
  234.                         CEngineApp__DrawGAME(pThis);
  235.                         break ;
  236.                 case MODE_CREDITS:
  237.                         CEngineApp__DrawCREDITS(pThis);
  238.                         break ;
  239.                 case MODE_GALLERY:
  240.                         CEngineApp__DrawGAME(pThis);
  241.                         CEngineApp__DrawGALLERY(pThis);
  242.                         break ;
  243.  
  244.  
  245.  
  246.  
  247.  
  248. /////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment