mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
WIP: uncapped framerate 6
This commit is contained in:
parent
6e47f226c9
commit
5e17edfd01
6 changed files with 36 additions and 38 deletions
|
@ -126,7 +126,6 @@ struct DisplayListNode
|
||||||
Mtx *transform;
|
Mtx *transform;
|
||||||
void *transformPrev;
|
void *transformPrev;
|
||||||
void *displayList;
|
void *displayList;
|
||||||
void *displayListPrev;
|
|
||||||
struct DisplayListNode *next;
|
struct DisplayListNode *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -227,12 +227,11 @@ void patch_mtx_interpolated(f32 delta) {
|
||||||
gCurGraphNodeRoot = sBackgroundNodeRoot;
|
gCurGraphNodeRoot = sBackgroundNodeRoot;
|
||||||
vec3f_copy(posCopy, gLakituState.pos);
|
vec3f_copy(posCopy, gLakituState.pos);
|
||||||
vec3f_copy(focusCopy, gLakituState.focus);
|
vec3f_copy(focusCopy, gLakituState.focus);
|
||||||
/*if (gGlobalTimer == sBackgroundNode->prevCameraTimestamp + 1 &&
|
if (gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) {
|
||||||
gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) {*/
|
|
||||||
delta_interpolate_vec3f(gLakituState.pos, sBackgroundNode->prevCameraPos, posCopy, delta);
|
delta_interpolate_vec3f(gLakituState.pos, sBackgroundNode->prevCameraPos, posCopy, delta);
|
||||||
delta_interpolate_vec3f(gLakituState.focus, sBackgroundNode->prevCameraFocus, focusCopy, delta);
|
delta_interpolate_vec3f(gLakituState.focus, sBackgroundNode->prevCameraFocus, focusCopy, delta);
|
||||||
//}
|
}
|
||||||
/*list = */sBackgroundNode->fnNode.func(GEO_CONTEXT_RENDER, &sBackgroundNode->fnNode.node, NULL);
|
sBackgroundNode->fnNode.func(GEO_CONTEXT_RENDER, &sBackgroundNode->fnNode.node, NULL);
|
||||||
|
|
||||||
vec3f_copy(gLakituState.pos, posCopy);
|
vec3f_copy(gLakituState.pos, posCopy);
|
||||||
vec3f_copy(gLakituState.focus, focusCopy);
|
vec3f_copy(gLakituState.focus, focusCopy);
|
||||||
|
@ -245,9 +244,6 @@ void patch_mtx_interpolated(f32 delta) {
|
||||||
gShadowInterpCurrent = interp;
|
gShadowInterpCurrent = interp;
|
||||||
Vec3f posInterp;
|
Vec3f posInterp;
|
||||||
delta_interpolate_vec3f(posInterp, interp->shadowPosPrev, interp->shadowPos, delta);
|
delta_interpolate_vec3f(posInterp, interp->shadowPosPrev, interp->shadowPos, delta);
|
||||||
if (i == 0) {
|
|
||||||
printf("XXX: %f <--> %f == %f\n", interp->shadowPosPrev[1], interp->shadowPos[1], posInterp[1]);
|
|
||||||
}
|
|
||||||
gCurGraphNodeObject = interp->obj;
|
gCurGraphNodeObject = interp->obj;
|
||||||
create_shadow_below_xyz(posInterp[0], posInterp[1], posInterp[2], interp->shadowScale, interp->node->shadowSolidity, interp->node->shadowType);
|
create_shadow_below_xyz(posInterp[0], posInterp[1], posInterp[2], interp->shadowScale, interp->node->shadowSolidity, interp->node->shadowType);
|
||||||
}
|
}
|
||||||
|
@ -315,7 +311,7 @@ static void geo_process_master_list_sub(struct GraphNodeMasterList *node) {
|
||||||
}
|
}
|
||||||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transformPrev),
|
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transformPrev),
|
||||||
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
|
G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
|
||||||
gSPDisplayList(gDisplayListHead++, currList->displayListPrev);
|
gSPDisplayList(gDisplayListHead++, currList->displayList);
|
||||||
currList = currList->next;
|
currList = currList->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,7 +327,7 @@ static void geo_process_master_list_sub(struct GraphNodeMasterList *node) {
|
||||||
* parameter. Look at the RenderModeContainer struct to see the corresponding
|
* parameter. Look at the RenderModeContainer struct to see the corresponding
|
||||||
* render modes of layers.
|
* render modes of layers.
|
||||||
*/
|
*/
|
||||||
static void geo_append_display_list2(void *displayList, void *displayListPrev, s16 layer) {
|
static void geo_append_display_list(void *displayList, s16 layer) {
|
||||||
|
|
||||||
#ifdef F3DEX_GBI_2
|
#ifdef F3DEX_GBI_2
|
||||||
gSPLookAt(gDisplayListHead++, &lookAt);
|
gSPLookAt(gDisplayListHead++, &lookAt);
|
||||||
|
@ -343,7 +339,6 @@ static void geo_append_display_list2(void *displayList, void *displayListPrev, s
|
||||||
listNode->transform = gMatStackFixed[gMatStackIndex];
|
listNode->transform = gMatStackFixed[gMatStackIndex];
|
||||||
listNode->transformPrev = gMatStackPrevFixed[gMatStackIndex];
|
listNode->transformPrev = gMatStackPrevFixed[gMatStackIndex];
|
||||||
listNode->displayList = displayList;
|
listNode->displayList = displayList;
|
||||||
listNode->displayListPrev = displayListPrev;
|
|
||||||
listNode->next = 0;
|
listNode->next = 0;
|
||||||
if (gCurGraphNodeMasterList->listHeads[layer] == 0) {
|
if (gCurGraphNodeMasterList->listHeads[layer] == 0) {
|
||||||
gCurGraphNodeMasterList->listHeads[layer] = listNode;
|
gCurGraphNodeMasterList->listHeads[layer] = listNode;
|
||||||
|
@ -354,10 +349,6 @@ static void geo_append_display_list2(void *displayList, void *displayListPrev, s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void geo_append_display_list(void *displayList, s16 layer) {
|
|
||||||
geo_append_display_list2(displayList, displayList, layer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the master list node.
|
* Process the master list node.
|
||||||
*/
|
*/
|
||||||
|
@ -724,20 +715,19 @@ static void geo_process_background(struct GraphNodeBackground *node) {
|
||||||
|
|
||||||
vec3f_copy(posCopy, gLakituState.pos);
|
vec3f_copy(posCopy, gLakituState.pos);
|
||||||
vec3f_copy(focusCopy, gLakituState.focus);
|
vec3f_copy(focusCopy, gLakituState.focus);
|
||||||
/*if (gGlobalTimer == node->prevCameraTimestamp + 1 &&
|
if (gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) {
|
||||||
gGlobalTimer != gLakituState.skipCameraInterpolationTimestamp) {*/
|
|
||||||
vec3f_copy(gLakituState.pos, node->prevCameraPos);
|
vec3f_copy(gLakituState.pos, node->prevCameraPos);
|
||||||
vec3f_copy(gLakituState.focus, node->prevCameraFocus);
|
vec3f_copy(gLakituState.focus, node->prevCameraFocus);
|
||||||
sBackgroundNode = node;
|
sBackgroundNode = node;
|
||||||
sBackgroundNodeRoot = gCurGraphNodeRoot;
|
sBackgroundNodeRoot = gCurGraphNodeRoot;
|
||||||
//}
|
}
|
||||||
list = node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, NULL);
|
list = node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, NULL);
|
||||||
vec3f_copy(gLakituState.pos, posCopy);
|
vec3f_copy(gLakituState.pos, posCopy);
|
||||||
vec3f_copy(gLakituState.focus, focusCopy);
|
vec3f_copy(gLakituState.focus, focusCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list != NULL) {
|
if (list != NULL) {
|
||||||
geo_append_display_list2((void *) VIRTUAL_TO_PHYSICAL(list), (void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8);
|
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8);
|
||||||
} else if (gCurGraphNodeMasterList != NULL) {
|
} else if (gCurGraphNodeMasterList != NULL) {
|
||||||
#ifndef F3DEX_GBI_2E
|
#ifndef F3DEX_GBI_2E
|
||||||
Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7);
|
Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7);
|
||||||
|
@ -1002,14 +992,11 @@ static void geo_process_shadow(struct GraphNodeShadow *node) {
|
||||||
if (!increment_mat_stack()) { return; }
|
if (!increment_mat_stack()) { return; }
|
||||||
|
|
||||||
if (gShadowAboveWaterOrLava == TRUE) {
|
if (gShadowAboveWaterOrLava == TRUE) {
|
||||||
geo_append_display_list2((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev),
|
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 4);
|
||||||
(void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 4);
|
|
||||||
} else if (gMarioOnIceOrCarpet == TRUE) {
|
} else if (gMarioOnIceOrCarpet == TRUE) {
|
||||||
geo_append_display_list2((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev),
|
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 5);
|
||||||
(void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 5);
|
|
||||||
} else {
|
} else {
|
||||||
geo_append_display_list2((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev),
|
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 6);
|
||||||
(void *) VIRTUAL_TO_PHYSICAL(shadowListPrev), 6);
|
|
||||||
}
|
}
|
||||||
gMatStackIndex--;
|
gMatStackIndex--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ static void debug_warp_level1() {
|
||||||
//set_mario_action(&gMarioStates[0], ACT_JUMBO_STAR_CUTSCENE, 0);
|
//set_mario_action(&gMarioStates[0], ACT_JUMBO_STAR_CUTSCENE, 0);
|
||||||
//return;
|
//return;
|
||||||
|
|
||||||
dynos_warp_to_level(LEVEL_CCM, 1, 1);
|
dynos_warp_to_level(LEVEL_BOB, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void debug_warp_level2() {
|
static void debug_warp_level2() {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include "pc/lua/smlua_hooks.h"
|
#include "pc/lua/smlua_hooks.h"
|
||||||
#include "djui_panel_playerlist.h"
|
#include "djui_panel_playerlist.h"
|
||||||
#include "djui_hud_utils.h"
|
#include "djui_hud_utils.h"
|
||||||
|
#include "engine/math_util.h"
|
||||||
|
#include "pc/utils/misc.h"
|
||||||
|
|
||||||
static Gfx* sSavedDisplayListHead = NULL;
|
static Gfx* sSavedDisplayListHead = NULL;
|
||||||
|
|
||||||
|
@ -15,6 +17,24 @@ static u32 sDjuiLuaErrorTimeout = 0;
|
||||||
bool gDjuiInMainMenu = true;
|
bool gDjuiInMainMenu = true;
|
||||||
bool gDjuiDisabled = false;
|
bool gDjuiDisabled = false;
|
||||||
|
|
||||||
|
bool sDjuiRendered60fps = false;
|
||||||
|
|
||||||
|
void patch_djui_before(void) {
|
||||||
|
sDjuiRendered60fps = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void patch_djui_interpolated(UNUSED f32 delta) {
|
||||||
|
// reset the head and re-render DJUI
|
||||||
|
if (delta >= 0.5f && !sDjuiRendered60fps) {
|
||||||
|
sDjuiRendered60fps = true;
|
||||||
|
if (sSavedDisplayListHead == NULL) { return; }
|
||||||
|
gDisplayListHead = sSavedDisplayListHead;
|
||||||
|
djui_render();
|
||||||
|
gDPFullSync(gDisplayListHead++);
|
||||||
|
gSPEndDisplayList(gDisplayListHead++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void djui_init(void) {
|
void djui_init(void) {
|
||||||
gDjuiRoot = djui_root_create();
|
gDjuiRoot = djui_root_create();
|
||||||
|
|
||||||
|
@ -58,15 +78,6 @@ void djui_lua_error(char* text) {
|
||||||
sDjuiLuaErrorTimeout = 30 * 5;
|
sDjuiLuaErrorTimeout = 30 * 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void djui_render_patch(void) {
|
|
||||||
// reset the head and re-render DJUI
|
|
||||||
if (sSavedDisplayListHead == NULL) { return; }
|
|
||||||
gDisplayListHead = sSavedDisplayListHead;
|
|
||||||
djui_render();
|
|
||||||
gDPFullSync(gDisplayListHead++);
|
|
||||||
gSPEndDisplayList(gDisplayListHead++);
|
|
||||||
}
|
|
||||||
|
|
||||||
void djui_render(void) {
|
void djui_render(void) {
|
||||||
if (gDjuiDisabled) { return; }
|
if (gDjuiDisabled) { return; }
|
||||||
sSavedDisplayListHead = gDisplayListHead;
|
sSavedDisplayListHead = gDisplayListHead;
|
||||||
|
|
|
@ -66,5 +66,4 @@ extern bool gDjuiDisabled;
|
||||||
void djui_init(void);
|
void djui_init(void);
|
||||||
void djui_connect_menu_open(void);
|
void djui_connect_menu_open(void);
|
||||||
void djui_lua_error(char* text);
|
void djui_lua_error(char* text);
|
||||||
void djui_render_patch(void);
|
|
||||||
void djui_render(void);
|
void djui_render(void);
|
||||||
|
|
|
@ -109,6 +109,7 @@ static void patch_interpolations_before(void) {
|
||||||
extern void patch_paintings_before(void);
|
extern void patch_paintings_before(void);
|
||||||
extern void patch_bubble_particles_before(void);
|
extern void patch_bubble_particles_before(void);
|
||||||
extern void patch_snow_particles_before(void);
|
extern void patch_snow_particles_before(void);
|
||||||
|
extern void patch_djui_before(void);
|
||||||
patch_mtx_before();
|
patch_mtx_before();
|
||||||
patch_screen_transition_before();
|
patch_screen_transition_before();
|
||||||
patch_title_screen_before();
|
patch_title_screen_before();
|
||||||
|
@ -117,6 +118,7 @@ static void patch_interpolations_before(void) {
|
||||||
patch_paintings_before();
|
patch_paintings_before();
|
||||||
patch_bubble_particles_before();
|
patch_bubble_particles_before();
|
||||||
patch_snow_particles_before();
|
patch_snow_particles_before();
|
||||||
|
patch_djui_before();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void patch_interpolations(f32 delta) {
|
static inline void patch_interpolations(f32 delta) {
|
||||||
|
@ -128,7 +130,7 @@ static inline void patch_interpolations(f32 delta) {
|
||||||
extern void patch_paintings_interpolated(f32 delta);
|
extern void patch_paintings_interpolated(f32 delta);
|
||||||
extern void patch_bubble_particles_interpolated(f32 delta);
|
extern void patch_bubble_particles_interpolated(f32 delta);
|
||||||
extern void patch_snow_particles_interpolated(f32 delta);
|
extern void patch_snow_particles_interpolated(f32 delta);
|
||||||
extern void djui_render_patch(void);
|
extern void patch_djui_interpolated(f32 delta);
|
||||||
patch_mtx_interpolated(delta);
|
patch_mtx_interpolated(delta);
|
||||||
patch_screen_transition_interpolated(delta);
|
patch_screen_transition_interpolated(delta);
|
||||||
patch_title_screen_interpolated(delta);
|
patch_title_screen_interpolated(delta);
|
||||||
|
@ -137,7 +139,7 @@ static inline void patch_interpolations(f32 delta) {
|
||||||
patch_paintings_interpolated(delta);
|
patch_paintings_interpolated(delta);
|
||||||
patch_bubble_particles_interpolated(delta);
|
patch_bubble_particles_interpolated(delta);
|
||||||
patch_snow_particles_interpolated(delta);
|
patch_snow_particles_interpolated(delta);
|
||||||
/*djui_render_patch();*/
|
patch_djui_interpolated(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void produce_uncapped_frames(void) {
|
void produce_uncapped_frames(void) {
|
||||||
|
|
Loading…
Reference in a new issue