sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

buffers.c (1885B)


      1 #include <ultra64.h>
      2 
      3 #include "buffers.h"
      4 
      5 ALIGNED8 u8 gDecompressionHeap[0xD000];
      6 
      7 #if defined(VERSION_EU)
      8 ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x3800];
      9 #elif defined(VERSION_SH)
     10 ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x4800];
     11 #elif defined(VERSION_CN)
     12 ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200) - 0x4C00];
     13 #else
     14 ALIGNED16 u8 gAudioHeap[DOUBLE_SIZE_ON_64_BIT(0x31200)];
     15 #endif
     16 
     17 #ifdef VERSION_CN
     18 
     19 // iQue BSS reordering
     20 
     21 // 0x200 bytes
     22 ALIGNED8 struct SaveBuffer gSaveBuffer;
     23 // 0x190a0 bytes
     24 struct GfxPool gGfxPools[2];
     25 ALIGNED8 u8 gThread4Stack[STACKSIZE];
     26 #if ENABLE_RUMBLE
     27 ALIGNED8 u8 gThread6Stack[STACKSIZE];
     28 #endif
     29 ALIGNED8 u8 gThread5Stack[STACKSIZE];
     30 // 0x400 bytes
     31 ALIGNED8 u8 gGfxSPTaskStack[SP_DRAM_STACK_SIZE8];
     32 // 0xc00 bytes for f3dex, 0x900 otherwise
     33 ALIGNED8 u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
     34 ALIGNED8 u8 gThread3Stack[STACKSIZE + 0x400];
     35 ALIGNED8 u8 gIdleThreadStack[IDLE_STACKSIZE];
     36 
     37 #else
     38 
     39 ALIGNED8 u8 gIdleThreadStack[IDLE_STACKSIZE];
     40 ALIGNED8 u8 gThread3Stack[STACKSIZE];
     41 ALIGNED8 u8 gThread4Stack[STACKSIZE];
     42 ALIGNED8 u8 gThread5Stack[STACKSIZE];
     43 #if ENABLE_RUMBLE
     44 ALIGNED8 u8 gThread6Stack[STACKSIZE];
     45 #endif
     46 // 0x400 bytes
     47 ALIGNED8 u8 gGfxSPTaskStack[SP_DRAM_STACK_SIZE8];
     48 // 0xc00 bytes for f3dex, 0x900 otherwise
     49 ALIGNED8 u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
     50 // 0x200 bytes
     51 ALIGNED8 struct SaveBuffer gSaveBuffer;
     52 // 0x190a0 bytes
     53 struct GfxPool gGfxPools[2];
     54 
     55 #endif
     56 
     57 // Yield buffer for audio, 0x400 bytes. Stubbed out post-JP since the audio
     58 // task never yields.
     59 #ifdef VERSION_JP
     60 ALIGNED8 u8 gAudioSPTaskYieldBuffer[OS_YIELD_AUDIO_SIZE];
     61 #endif
     62 
     63 // Probably Thread 2 stack space. Unreferenced, and stubbed out with f3dex to
     64 // avoid an overflowing .buffers segment.
     65 #if !defined(F3DEX_GBI_SHARED) && !defined(VERSION_EU)
     66 ALIGNED8 u8 gUnusedThread2Stack[UNUSED_STACKSIZE];
     67 #endif