Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/buffers/framebuffers.h
7858 views
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
23
24