1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-15 06:06:04 +00:00
oot/src/code/z_rcp.c

195 lines
6.5 KiB
C
Raw Normal View History

2020-03-17 04:31:30 +00:00
#include <ultra64.h>
#include <global.h>
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093370.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009352C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093708.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009373C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093774.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093794.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800937C0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800937E4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093808.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093848.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800938B4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093920.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009398C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800939F8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093A64.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093AD0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093B3C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093BA8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093C14.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093C80.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093D18.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093D84.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093DF0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093E5C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093EC8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093F34.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093F58.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093F7C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80093FD8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094044.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800940B0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009411C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094140.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800941AC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094218.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094284.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800942F0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009435C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800943C8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094434.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800944A0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800944C4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094520.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009457C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800945A0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009460C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094678.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800946E4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094708.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009472C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_8009476C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800947AC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094944.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094968.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800949A8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094A14.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094A80.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094AEC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094B58.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094BC4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094C50.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094CBC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094D28.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094D4C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094DB8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094E54.s")
2020-03-22 21:19:43 +00:00
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) {
2020-03-17 04:31:30 +00:00
return Draw_TexScroll(gfxCtx, x, y, 0, 0);
}
2020-03-22 21:19:43 +00:00
Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) {
2020-03-17 04:31:30 +00:00
Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx));
x %= 2048;
y %= 2048;
gDPTileSync(displayList);
2020-03-22 21:19:43 +00:00
gDPSetTileSize(displayList + 1, 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2)));
gSPEndDisplayList(displayList + 2);
2020-03-17 04:31:30 +00:00
return displayList;
}
2020-03-22 21:19:43 +00:00
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
u32 y2, s32 width2, s32 height2) {
2020-03-17 04:31:30 +00:00
Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx));
x1 %= 2048;
y1 %= 2048;
x2 %= 2048;
y2 %= 2048;
gDPTileSync(displayList);
2020-03-22 21:19:43 +00:00
gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
gDPTileSync(displayList + 2);
gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
gSPEndDisplayList(displayList + 4);
2020-03-17 04:31:30 +00:00
return displayList;
}
2020-03-22 21:19:43 +00:00
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) {
2020-03-17 04:31:30 +00:00
Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx));
x1 %= 2048;
y1 %= 2048;
x2 %= 2048;
y2 %= 2048;
gDPTileSync(displayList);
2020-03-22 21:19:43 +00:00
gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
gDPTileSync(displayList + 2);
gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
gDPSetEnvColor(displayList + 4, red, green, blue, alpha);
gSPEndDisplayList(displayList + 5);
2020-03-17 04:31:30 +00:00
return displayList;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_800951D0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095248.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095974.s")