Merge branch 'master' into better-reverb
This commit is contained in:
commit
01dd1dd918
11 files changed
+67
-7
No files matched your search
@@ -1088,6 +1088,11 @@ s32 audio_shut_down_and_reset_step(void) {
|
||||
* Waits until a specified number of audio frames have been created
|
||||
*/
|
||||
void wait_for_audio_frames(s32 frames) {
|
||||
#ifdef VC_HACKS
|
||||
// VC emulator stubs this function because busy loops are not supported
|
||||
// Technically we can put infinite loop that _looks_ like -O0 for emu but this is cleaner
|
||||
return;
|
||||
#endif
|
||||
gAudioFrameCount = 0;
|
||||
// Sound thread will update gAudioFrameCount
|
||||
while (gAudioFrameCount < frames) {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "game/object_list_processor.h"
|
||||
#include "surface_load.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
s32 unused8038BE90;
|
||||
|
||||
/**
|
||||
@@ -389,6 +391,7 @@ static struct Surface *read_surface_data(s16 *vertexData, s16 **vertexIndices) {
|
||||
return surface;
|
||||
}
|
||||
|
||||
#ifndef ALL_SURFACES_HAVE_FORCE
|
||||
/**
|
||||
* Returns whether a surface has exertion/moves Mario
|
||||
* based on the surface type.
|
||||
@@ -412,6 +415,7 @@ static s32 surface_has_force(s16 surfaceType) {
|
||||
}
|
||||
return hasForce;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns whether a surface should have the
|
||||
@@ -444,7 +448,9 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
|
||||
s32 numSurfaces;
|
||||
struct Surface *surface;
|
||||
s8 room = 0;
|
||||
#ifndef ALL_SURFACES_HAVE_FORCE
|
||||
s16 hasForce = surface_has_force(surfaceType);
|
||||
#endif
|
||||
s16 flags = surf_has_no_cam_collision(surfaceType);
|
||||
|
||||
numSurfaces = *(*data);
|
||||
@@ -462,19 +468,27 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s
|
||||
surface->type = surfaceType;
|
||||
surface->flags = (s8) flags;
|
||||
|
||||
#ifdef ALL_SURFACES_HAVE_FORCE
|
||||
surface->force = *(*data + 3);
|
||||
#else
|
||||
if (hasForce) {
|
||||
surface->force = *(*data + 3);
|
||||
} else {
|
||||
surface->force = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
add_surface(surface, FALSE);
|
||||
}
|
||||
|
||||
#ifdef ALL_SURFACES_HAVE_FORCE
|
||||
*data += 4;
|
||||
#else
|
||||
*data += 3;
|
||||
if (hasForce) {
|
||||
*data += 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +563,9 @@ u32 get_area_terrain_size(s16 *data) {
|
||||
s32 numVertices;
|
||||
s32 numRegions;
|
||||
s32 numSurfaces;
|
||||
#ifndef ALL_SURFACES_HAVE_FORCE
|
||||
s16 hasForce;
|
||||
#endif
|
||||
|
||||
while (!end) {
|
||||
terrainLoadType = *data++;
|
||||
@@ -578,8 +594,12 @@ u32 get_area_terrain_size(s16 *data) {
|
||||
|
||||
default:
|
||||
numSurfaces = *data++;
|
||||
#ifdef ALL_SURFACES_HAVE_FORCE
|
||||
data += 4 * numSurfaces;
|
||||
#else
|
||||
hasForce = surface_has_force(terrainLoadType);
|
||||
data += (3 + hasForce) * numSurfaces;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -709,7 +729,9 @@ void load_object_surfaces(s16 **data, s16 *vertexData) {
|
||||
s32 surfaceType;
|
||||
s32 i;
|
||||
s32 numSurfaces;
|
||||
#ifndef ALL_SURFACES_HAVE_FORCE
|
||||
s16 hasForce;
|
||||
#endif
|
||||
s16 flags;
|
||||
s16 room;
|
||||
|
||||
@@ -719,7 +741,9 @@ void load_object_surfaces(s16 **data, s16 *vertexData) {
|
||||
numSurfaces = *(*data);
|
||||
(*data)++;
|
||||
|
||||
#ifndef ALL_SURFACES_HAVE_FORCE
|
||||
hasForce = surface_has_force(surfaceType);
|
||||
#endif
|
||||
|
||||
flags = surf_has_no_cam_collision(surfaceType);
|
||||
flags |= SURFACE_FLAG_DYNAMIC;
|
||||
@@ -739,22 +763,30 @@ void load_object_surfaces(s16 **data, s16 *vertexData) {
|
||||
surface->object = gCurrentObject;
|
||||
surface->type = surfaceType;
|
||||
|
||||
#ifdef ALL_SURFACES_HAVE_FORCE
|
||||
surface->force = *(*data + 3);
|
||||
#else
|
||||
if (hasForce) {
|
||||
surface->force = *(*data + 3);
|
||||
} else {
|
||||
surface->force = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
surface->flags |= flags;
|
||||
surface->room = (s8) room;
|
||||
add_surface(surface, TRUE);
|
||||
}
|
||||
|
||||
#ifdef ALL_SURFACES_HAVE_FORCE
|
||||
*data += 4;
|
||||
#else
|
||||
if (hasForce) {
|
||||
*data += 4;
|
||||
} else {
|
||||
*data += 3;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -382,9 +382,14 @@ void render_init(void) {
|
||||
exec_display_list(&gGfxPool->spTask);
|
||||
|
||||
// Skip incrementing the initial framebuffer index on emulators so that they display immediately as the Gfx task finishes
|
||||
if ((*(volatile u32 *)0xA4100010) != 0) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
// VC probably emulates osViSwapBuffer accurately so instant patch breaks VC compatibility
|
||||
#ifndef VC_HACKS
|
||||
if (gIsConsole) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
#endif
|
||||
sRenderingFrameBuffer++;
|
||||
#ifndef VC_HACKS
|
||||
}
|
||||
#endif
|
||||
gGlobalTimer++;
|
||||
}
|
||||
|
||||
@@ -420,14 +425,18 @@ void display_and_vsync(void) {
|
||||
profiler_log_thread5_time(THREAD5_END);
|
||||
osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
|
||||
// Skip swapping buffers on emulator so that they display immediately as the Gfx task finishes
|
||||
if ((*(volatile u32 *)0xA4100010) != 0) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
#ifndef VC_HACKS
|
||||
if (gIsConsole) { // Read RDP Clock Register, has a value of zero on emulators
|
||||
#endif
|
||||
if (++sRenderedFramebuffer == 3) {
|
||||
sRenderedFramebuffer = 0;
|
||||
}
|
||||
if (++sRenderingFrameBuffer == 3) {
|
||||
sRenderingFrameBuffer = 0;
|
||||
}
|
||||
#ifndef VC_HACKS
|
||||
}
|
||||
#endif
|
||||
gGlobalTimer++;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ u8 textCurrRatio43[] = { TEXT_HUD_CURRENT_RATIO_43 };
|
||||
u8 textCurrRatio169[] = { TEXT_HUD_CURRENT_RATIO_169 };
|
||||
u8 textPressL[] = { TEXT_HUD_PRESS_L };
|
||||
u8 textWideInfo[] = { TEXT_HUD_WIDE_INFO };
|
||||
u8 textWideInfo2[] = { TEXT_HUD_WIDE_INFO2 };
|
||||
#endif
|
||||
|
||||
extern u8 gLastCompletedCourseNum;
|
||||
@@ -1505,7 +1504,6 @@ void render_widescreen_setting(void) {
|
||||
print_generic_string(10, 20, textCurrRatio169);
|
||||
print_generic_string(10, 7, textPressL);
|
||||
print_generic_string(10, 220, textWideInfo);
|
||||
print_generic_string(10, 200, textWideInfo2);
|
||||
}
|
||||
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
|
||||
if (gPlayer1Controller->buttonPressed & L_TRIG){
|
||||
|
||||
Reference in new issue
Block a user