mirror of
https://github.com/n64decomp/mk64
synced 2026-07-10 05:26:49 -04:00
trig tables shiftable (#596)
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "buffers.h"
|
||||
|
||||
u16 gRandomSeed16;
|
||||
|
||||
u8 randomSeedPadding[216];
|
||||
|
||||
#ifdef VERSION_EU
|
||||
u8 frameBufferPadding[0x5750];
|
||||
#else
|
||||
u8 frameBufferPadding[0x5810];
|
||||
#endif
|
||||
|
||||
union_D_802BFB80 D_802BFB80;
|
||||
struct_D_802DFB80 D_802DFB80[2][2][8];
|
||||
#ifdef AVOID_UB
|
||||
struct_D_802F1F80 D_802F1F80[2][4][8];
|
||||
#else
|
||||
u16 D_802F1F80[2][4][0x100 * 8];
|
||||
#endif
|
||||
|
||||
u16 gZBuffer[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
|
||||
#ifdef AVOID_UB
|
||||
u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#else
|
||||
u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include "gfx_output_buffer.h"
|
||||
|
||||
u64 gGfxSPTaskOutputBuffer[GFX_OUTPUT_BUFFER_SIZE];
|
||||
|
||||
u32 gGfxSPTaskOutputBufferSize;
|
||||
@@ -1,14 +0,0 @@
|
||||
#ifndef GFX_OUTPUT_BUFFER_H
|
||||
#define GFX_OUTPUT_BUFFER_H
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
// 0x1f000 bytes, aligned to a 0x1000-byte boundary through sm64.ld. (This results
|
||||
// in a bunch of unused space: ~0x100 in JP, ~0x300 in US.)
|
||||
#define GFX_OUTPUT_BUFFER_SIZE 0x3f00
|
||||
|
||||
// 0x3F00
|
||||
extern u64 gGfxSPTaskOutputBuffer[GFX_OUTPUT_BUFFER_SIZE];
|
||||
extern u32 gGfxSPTaskOutputBufferSize;
|
||||
|
||||
#endif // GFX_OUTPUT_BUFFER_H
|
||||
@@ -1,11 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <macros.h>
|
||||
#include <segments.h>
|
||||
|
||||
#define MEMORY_POOL_SIZE 0xAB630
|
||||
|
||||
/**
|
||||
* Memory pool setup to prevent other code segments flowing into the memory pool
|
||||
* and for easier portability.
|
||||
*/
|
||||
u8 memoryPool[MEMORY_POOL_SIZE];
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
#ifndef TRIG_TABLES_H
|
||||
#define TRIG_TABLES_H
|
||||
|
||||
/*
|
||||
* The sine and cosine tables overlap, but "#define gCosineTable (gSineTable +
|
||||
* 0x400)" doesn't give expected codegen; gSineTable and gCosineTable need to
|
||||
* be different symbols for code to match. Most likely the tables were placed
|
||||
* adjacent to each other, and gSineTable cut short, such that reads overflow
|
||||
* into gCosineTable.
|
||||
*
|
||||
* These kinds of out of bounds reads are undefined behavior, and break on
|
||||
* e.g. GCC (which doesn't place the tables next to each other, and probably
|
||||
* exploits array sizes for range analysis-based optimizations as well).
|
||||
* Thus, for non-IDO compilers we use the standard-compliant version.
|
||||
*/
|
||||
extern f32 gSineTable[];
|
||||
#ifdef AVOID_UB
|
||||
#define gCosineTable (gSineTable + 0x400)
|
||||
#else
|
||||
extern f32 gCosineTable[];
|
||||
#endif
|
||||
|
||||
extern s16 gArctanTable[];
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user