sm64

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

framebuffers.h (718B)


      1 #ifndef FRAMEBUFFERS_H
      2 #define FRAMEBUFFERS_H
      3 
      4 #include <PR/ultratypes.h>
      5 
      6 #include "config.h"
      7 
      8 // level_script.c assumes that the frame buffers are adjacent, while game.c's
      9 // -g codegen implies that they are separate variables. This is impossible to
     10 // reconcile without undefined behavior. Avoid that when possible.
     11 #ifdef AVOID_UB
     12 extern u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
     13 #define gFramebuffer0 gFramebuffers[0]
     14 #define gFramebuffer1 gFramebuffers[1]
     15 #define gFramebuffer2 gFramebuffers[2]
     16 #else
     17 extern u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
     18 extern u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
     19 extern u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
     20 #endif
     21 
     22 #endif // FRAMEBUFFERS_H