Advertisement
Twili

Turok source leak (fragment)

Sep 12th, 2017
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 11.51 KB | None | 0 0
  1. // tengine.c
  2.  
  3. #include "cppu64.h"
  4. #include "os_internal.h"
  5.  
  6. #ifndef MAKE_CART
  7. #include <PR/ramrom.h>  // needed for argument passing into the app
  8. #endif
  9.  
  10. #include "tengine.h"
  11. #include "dlists.h"
  12. #include "scaling.h"
  13. #include "particle.h"
  14. #include "mattable.h"
  15. #include "tcontrol.h"
  16. #include "tmove.h"
  17. #include "audio.h"
  18. #include "sfx.h"
  19. #include "textload.h"
  20. #include "regtype.h"
  21. #include "pickup.h"
  22. #include "attract.h"
  23. #include "map.h"
  24. #include "collinfo.h"
  25. #include "onscrn.h"
  26.  
  27. #include "introcam.h"
  28. #include "galrecam.h"
  29. #include "cammodes.h"
  30. #include "bossflgs.h"
  31. #include "persist.h"
  32.  
  33. extern  int     WeaponOrder[] ;
  34. extern  int     RequestorMode ;
  35.  
  36. extern BOOL persistant_data_loaded ;
  37.  
  38. extern char    text_errorcontroller[] ;
  39. extern char    text_pakdamaged[] ;
  40.  
  41. //--------------------------------------------------------------------------------------------------
  42. // Text
  43. //--------------------------------------------------------------------------------------------------
  44. #ifdef ENGLISH
  45. // ---------------------- English text ---------------------------
  46. static char     text_killerfish[] = {"killer fish"};
  47. static char     text_beetle[] = {"giant beetle"};
  48. static char     text_dragonfly[] = {"giant dragonfly"};
  49. static char     text_campaignerssoldier[] = {"campaigners soldier"};
  50. static char     text_campaignersseargent[] = {"campaigners sergeant"};
  51. static char     text_poacher[] = {"poacher"};
  52. static char     text_dimetrodon[] = {"dimetrodon"};
  53. static char     text_raptor[] = {"raptor"};
  54. static char     text_cyborgraptor[] = {"raptor mech"};
  55. static char     text_leaper[] = {"leaper"};
  56. static char     text_hulk[] = {"purlin"};
  57. static char     text_alieninfantry[] = {"alien infantry"};
  58. static char     text_moschops[] = {"moschops"};
  59. static char     text_ancientwarrior[] = {"ancient warrior"};
  60. static char     text_highpriest[] = {"high priest"};
  61. static char     text_cyborg[] = {"cyborg"};
  62. static char     text_demon[] = {"demon"};
  63. static char     text_demonlord[] = {"demon lord"};
  64. static char     text_pteranodon[] = {"pteranodon"};
  65. static char     text_sludgebeast[] = {"sludge beast"};
  66. static char     text_killerplant[] = {"killer plant"};
  67. static char     text_robot[] = {"attack robot"};
  68. static char     text_triceratops[] = {"triceratops"};
  69. static char     text_subterranean[] = {"subterranean"};
  70.  
  71. static char     text_quittraining[] = {"quit training"} ;
  72. static char     text_areyousure[] = {"are you sure"} ;
  73. #endif
  74.  
  75.  
  76. #ifdef GERMAN
  77. // ---------------------- German text ---------------------------
  78. static char     text_killerfish[] = {"killerfisch"};
  79. static char     text_beetle[] = {"riesenk<fer"};        //a.
  80. static char     text_dragonfly[] = {"riesenlibelle"};
  81. static char     text_campaignerssoldier[] = {"campaigner soldat"};
  82. static char     text_campaignersseargent[] = {"campaigner hauptmann"};
  83. static char     text_poacher[] = {"wilddied"};
  84. static char     text_dimetrodon[] = {"dimetrodon"};
  85. static char     text_raptor[] = {"raptor"};
  86. static char     text_cyborgraptor[] = {"mech raptor"};
  87. static char     text_leaper[] = {"springer"};
  88. static char     text_hulk[] = {"riese"};
  89. static char     text_alieninfantry[] = {"ausserirdische infanterie"};
  90. static char     text_moschops[] = {"moschops"};
  91. static char     text_ancientwarrior[] = {"krieger"};
  92. static char     text_highpriest[] = {"hoher priester"};
  93. static char     text_cyborg[] = {"cyborg"};
  94. static char     text_demon[] = {"d<mon"};               //a.
  95. static char     text_demonlord[] = {"d<mon anf/hrer"};  //a.u.
  96. static char     text_pteranodon[] = {"pteranodon"};
  97. static char     text_sludgebeast[] = {"schlammungeheuer"};
  98. static char     text_killerplant[] = {"killerpflanze"};
  99. static char     text_robot[] = {"kampfroboter"};
  100. static char     text_triceratops[] = {"trizeratops"};
  101. static char     text_subterranean[] = {"unterirdischer"};
  102.  
  103. static char     text_quittraining[] = {"training beenden"} ;
  104. static char     text_areyousure[] = {"bist du sicher"} ;
  105. #endif
  106.  
  107.  
  108. #ifdef KANJI
  109. // ---------------------- Japanese text ---------------------------
  110. static char     text_killerfish[] = {0x35, 0x21, 0x15, 0x00, -1};
  111. static char     text_beetle[] = {0x25, 0x41, 0x10, -1};
  112. static char     text_dragonfly[] = {0x2e, 0x0c, 0x19, 0x21, 0x01, -1};
  113. static char     text_campaignerssoldier[] = {0x0e, 0x23, 0x2c, 0x3d, 0x41, -1};
  114. static char     text_campaignersseargent[] = {0x29, 0x27, 0x0e, 0x02, -1};
  115. static char     text_poacher[] = {0x30, 0x41, 0x30, 0x22, 0x00, 0x27, -1};
  116. static char     text_dimetrodon[] = {0x0c, 0x34, 0x01, 0x05, 0x41, -1};
  117. static char     text_raptor[] = {0x21, 0x36, 0x0f, 0x41, -1};
  118. static char     text_cyborgraptor[] = {0x30, 0x01, 0x04, 0x21, 0x36, 0x0f, 0x41, -1};
  119. static char     text_leaper[] = {0x22, 0x2b, 0x41, 0x2f, -1};
  120. static char     text_hulk[] = {0x31, 0x41, 0x0c, 0x13, -1};
  121. static char     text_alieninfantry[] = {0x06, 0x21, 0x41, 0x00, 0x27, 0x13, -1};
  122. static char     text_moschops[] = {0x1b, 0x40, 0x07, 0x0c, -1};
  123. static char     text_ancientwarrior[] = {0x0c, 0x08, 0x23, 0x0f, 0x41, -1};
  124. static char     text_highpriest[] = {0x1a, 0x41, 0x22, 0x41, 0x25, 0x41, 0x2f, -1};
  125. static char     text_cyborg[] = {0x33, 0x41, 0x29, -1};
  126. static char     text_demon[] = {0x2e, 0x41, 0x1f, 0x27, -1};
  127. static char     text_demonlord[] = {0x2e, 0x41, 0x1f, 0x27, 0x25, 0x41, 0x2f, -1};
  128. static char     text_pteranodon[] = {0x2e, 0x0c, 0x02, 0x3a, 0x27, 0x29, -1};
  129. static char     text_sludgebeast[] = {0x06, 0x21, 0x41, 0x0b, 0x2b, 0x41, 0x2d, -1};
  130. static char     text_killerplant[] = {0x2e, 0x0c, 0x36, 0x21, 0x27, 0x13, -1};
  131. static char     text_robot[] = {0x25, 0x33, 0x01, 0x2f, -1};
  132. static char     text_triceratops[] = {0x30, 0x01, 0x04, 0x2b, 0x02, 0x23, 0x0c, -1};
  133. static char     text_subterranean[] = {0x26, 0x41, 0x1d, -1};
  134.  
  135. static char     text_quittraining[] = {0x13, 0x24, 0x41, 0x15, 0x27, 0x29, 0x74, 0x6c, 0x6a, 0x5d, -1} ;
  136. static char     text_areyousure[] = {0x6D, 0x72, 0x57, 0x4D, 0x7A, 0x57, 0x80, 0x4E, 0x51, -1} ;
  137. #endif
  138.  
  139. // thread overview
  140. /////////////////////////////////////////////////////////////////////////////
  141. //              rmon thread. Used for debugging.
  142. //                      Its main purpose is to send printf's back to host machine.
  143. //              scheduler thread. The highest priority thread of the game. Its
  144. //                      function is to see that audio and graphics tasks get built
  145. //                      and executed in a timely fashion.
  146. //              audio thread. The second highest thread. Creates the audio task
  147. //                      lists to be executed by the audio microcode to synthesize
  148. //                      the audio. Audio should run at a higher priority than
  149. //                      graphics, since if a frame of audio gets dropped, it will
  150. //                      cause a serious click, but a frame of graphics can always
  151. //                      redraw the last frame.
  152. //              game thread. Loops waiting for messages from scheduler.
  153. //                      Upon receiving retrace messages, will branch to the graphics
  154. //                      routine and the controller read routine.
  155. //              idle thread. Starts out as the init thread, but becomes the idle
  156. //                      thread.
  157. //              fault thread.  prints debug information on the screen after
  158. //                      a CPU exception.  If the rmon thread is started after the
  159. //                      fault thread, it will steal the exception interrupt thereby
  160. //                      preventing the fault thread from doing anything.
  161. /////////////////////////////////////////////////////////////////////////////
  162.  
  163. //#define DISPLAY_TIMING
  164.  
  165.  
  166. #ifdef MAKE_CART
  167. #ifdef DISPLAY_TIMING
  168. #undef DISPLAY_TIMING
  169. #endif
  170. #endif
  171.  
  172.  
  173.  
  174. // analog menu control defines
  175. #define MENU_START_SPEED        249.0
  176. #define MAX_MENU_SPEED          250.0
  177.  
  178. #define MENU_HORIZONTAL_THRESHHOLD      30
  179. #define MENU_VERTICAL_THRESHHOLD        30
  180.  
  181. // TEMP
  182. void                    CCartCache__MemoryDump(CCartCache *pThis);
  183. void                    printFaultData(OSThread *);
  184.  
  185.  
  186. // CEngineApp implementation
  187. /////////////////////////////////////////////////////////////////////////////
  188.  
  189. void                    CEngineApp__InitializeGameVars(CEngineApp *pThis) ;
  190. void                    CEngineApp__SetupShadowVtxs();
  191. void                    CEngineApp__InitGame(CEngineApp *pThis);
  192. void                    CEngineApp__InitGraphics(CEngineApp *pThis);
  193. CFrameData* CEngineApp__CreateGraphicsTask(CEngineApp *pThis);
  194. void                    CEngineApp__SendGraphicsTask(CEngineApp *pThis, CFrameData *pFData);
  195. void                    CEngineApp__InitDisplayLists(CEngineApp *pThis);
  196. void                    CEngineApp__ClearBuffers(CEngineApp *pThis);
  197. void                    CEngineApp__SetupSegments(CEngineApp *pThis);
  198. #define         CEngineApp__SetDebugMode(pThis, Debug) (pThis)->m_DebugMode = Debug
  199. void                    CEngineApp__SetupDraw(CEngineApp *pThis) ;
  200. void                    CEngineApp__DrawGAMEPAK(CEngineApp *pThis);
  201. void                    CEngineApp__DrawLEGALSCREEN(CEngineApp *pThis);
  202. void                    CEngineApp__DrawTITLE(CEngineApp *pThis);
  203. void                    CEngineApp__DrawGALLERY(CEngineApp *pThis);
  204. void                    CEngineApp__DrawGAME(CEngineApp *pThis);
  205. void                    CEngineApp__DrawCREDITS(CEngineApp *pThis);
  206. void                    CEngineApp__DrawFlash(CEngineApp *pThis);
  207. void                    CEngineApp__DrawColorFlash(CEngineApp *pThis);
  208. void                    CEngineApp__UpdateFade(CEngineApp *pThis);
  209. void                    CEngineApp__ResetGallery(CEngineApp *pThis);
  210. void                    CEngineApp__UpdateGallery(CEngineApp *pThis);
  211. void                    CEngineApp__DrawFade(CEngineApp *pThis);
  212. void                    CEngineApp__DrawWarp(CEngineApp *pThis);
  213. void                    CEngineApp__DrawSunGlare(CEngineApp *pThis);
  214. void                    CEngineApp__DrawDeath(CEngineApp *pThis);
  215. void                    CEngineApp__PlayerLostLife(CEngineApp *pThis);
  216. void                    CEngineApp__BuildDispList(CEngineApp *pThis);
  217. void                    CEngineApp__ScreenShot(CEngineApp *pThis);
  218. void                    CEngineApp__SetCameraToTurok(CEngineApp *pThis);
  219. void                    CEngineApp__DoPause(CEngineApp *pThis);
  220. #define         ToggleEvenOdd() even_odd ^= 1
  221. void                    CEngineApp__AdvanceFrameData(CEngineApp *pThis);
  222. #define         CEngineApp__GetFrameData(pThis) ((pThis)->m_pCurrentFrameData)
  223. void                    CEngineApp__GetFogColor(CEngineApp *pThis, BYTE *pR, BYTE *pG, BYTE *pB);
  224. void                    CEngineApp__UpdateSpiritMode(CEngineApp *pThis) ;
  225. void                    CEngineApp__UpdateCameraAttributes(CEngineApp *pThis);
  226. void                    CEngineApp__UpdatePause(CEngineApp *pThis);
  227. void                    CEngineApp__UpdateFrameData(CEngineApp *pThis, GFXMsg *pMsg);
  228. void                    CEngineApp__DoWarp(CEngineApp *pThis,
  229.                                                                                  int WarpID,
  230.                                                                                  float Seconds,
  231.                                                                                  int SoundEffect,
  232.                                                                                  BOOL WarpIn,
  233.                                                                                  BYTE Red, BYTE Green, BYTE Blue,
  234.                                                                                  BOOL StoreWarpReturn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement