emcc memes

This commit is contained in:
Colton Rushton 2021-02-23 07:59:54 -04:00
parent 4170a56f95
commit 1fc7f7f7f4
62 changed files with 722 additions and 50 deletions

View File

@ -45,7 +45,7 @@ sound_mode = stereo
```
___
## Flags Section - [flags]
This section contains all main game flags (walkthought milestones).
This section contains all main game flags (walkthrough milestones).
> **Note**: The value can be only 0 (False) or 1 (True).
| Flag | Description |
@ -142,10 +142,10 @@ pss = 10
```
___
## Cap Section - [cap]
This section contains information about where Mario lost his cap and who take it.
This section contains information about where Mario lost his cap and who, or what, took it.
| Flag | Value | Description |
|---|---|---|
| type | ground, klepto, ukiki, mrblizzard | The one who or what took the cap from Mario. Default flag is **"ground"**
| type | ground, klepto, ukiki, mrblizzard | The one that took the cap from Mario. Default flag is **"ground"**
| level | ssl, sl, ttm, none | Specifies the course where the cap is located. Default flag is **"none"**.
| area | 1, 2 | Specifies the area in the course.
@ -155,4 +155,4 @@ Example:
type = ground
level = ssl
area = 1
```
```

View File

@ -2492,10 +2492,17 @@ ALIGNED8 const u8 texture_waterbox_lava[] = {
};
// Unreferenced light group
#ifndef TARGET_WEB
static const Lights1 segment2_lights_unused = gdSPDefLights1(
0x40, 0x40, 0x40,
0xff, 0xff, 0xff, 0x28, 0x28, 0x28
);
#else
UNUSED static const Lights1 segment2_lights_unused = gdSPDefLights1(
0x40, 0x40, 0x40,
0xff, 0xff, 0xff, 0x28, 0x28, 0x28
);
#endif
// 0x02014470 - 0x020144B0
static const Mtx matrix_identity = {

View File

@ -3144,7 +3144,11 @@ const BehaviorScript bhvUnusedFakeStar[] = {
};
// What is this?
#ifndef TARGET_WEB
static const BehaviorScript unused_1[] = {
#else
UNUSED static const BehaviorScript unused_1[] = {
#endif
BREAK(),
BREAK(),
BREAK(),

View File

@ -291,7 +291,7 @@ struct MarioState
/*0x0C*/ u32 action;
/*0x10*/ u32 prevAction;
/*0x14*/ u32 terrainSoundAddend;
#ifndef QOL_FIXES
#ifdef QOL_FIXES
/*0x18*/ u16 actionState;
#else
/*0x18*/ u32 actionState;

View File

@ -173,11 +173,19 @@ u8 gDefaultShortNoteDurationTable[16] = {
s8 gVibratoCurve[16] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 };
#endif
#ifndef TARGET_WEB
struct AdsrEnvelope gDefaultEnvelope[] = {
{ BE_TO_HOST16(4), BE_TO_HOST16(32000) }, // go from 0 to 32000 over the course of 16ms
{ BE_TO_HOST16(1000), BE_TO_HOST16(32000) }, // stay there for 4.16 seconds
{ BE_TO_HOST16(ADSR_HANG), 0 } // then continue staying there
};
#else
struct AdsrEnvelope gDefaultEnvelope[] = {
{ (s16)BE_TO_HOST16(4), (s16)BE_TO_HOST16(32000) }, // go from 0 to 32000 over the course of 16ms
{ (s16)BE_TO_HOST16(1000), (s16)BE_TO_HOST16(32000) }, // stay there for 4.16 seconds
{ (s16)BE_TO_HOST16(ADSR_HANG), 0 } // then continue staying there
};
#endif
#ifdef VERSION_EU
struct NoteSubEu gZeroNoteSub = { 0 };

View File

@ -621,7 +621,7 @@ const char unusedErrorStr2[] = "specchg error\n";
/**
* Fade out a sequence player
*/
#if defined(VERSION_EU)
#ifdef VERSION_EU
void audio_reset_session_eu(s32 presetId) {
OSMesg mesg;

View File

@ -302,7 +302,11 @@ void temporary_pools_init(struct PoolSplit *a) {
}
#ifndef VERSION_EU
#ifndef TARGET_WEB
static void unused_803163D4(void) {
#else
UNUSED static void unused_803163D4(void) {
#endif
}
#endif

View File

@ -65,9 +65,14 @@ void sound_init_main_pools(s32 sizeForAudioInitPool);
void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id);
void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 arg2);
#ifdef VERSION_EU
#ifdef TARGET_WEB
s32 audio_shut_down_and_reset_step(void);
void audio_reset_session(void);
#else
s32 audio_shut_down_and_reset_step(void);
void audio_reset_session(void);
#endif
#else
void audio_reset_session(struct AudioSessionSettings *preset);
#endif

View File

@ -27,7 +27,11 @@ void port_eu_init(void);
struct Note *gNotes;
#ifdef VERSION_EU
#ifndef TARGET_WEB
static u8 pad[4];
#else
UNUSED static u8 pad[4];
#endif
#endif
struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS];
@ -390,7 +394,11 @@ out2:
static
#endif
#ifndef TARGET_WEB
void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) {
#else
UNUSED void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED u8 *offsetBase) {
#endif
struct AudioBankSample *sample;
void *patched;
UNUSED u8 *mem; // unused on US
@ -485,11 +493,17 @@ void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32
drum = PATCH(patched, mem);
mem->drums[i] = drum;
if (drum->loaded == 0) {
#if !defined(VERSION_EU) || !defined(QOL_FIXES)
#ifndef VERSION_EU
#ifndef QOL_FIXES
//! copt replaces drum with 'patched' for these two lines
PATCH_SOUND(&(*(struct Drum *)patched).sound, mem, offset);
patched = (*(struct Drum *)patched).envelope;
drum->envelope = (void *)((uintptr_t) mem + (uintptr_t) patched);
#else
patch_sound(&drum->sound, (u8 *) mem, offset);
patched = drum->envelope;
drum->envelope = (void *)((uintptr_t) patched + (uintptr_t) mem);
#endif
#else
patch_sound(&drum->sound, (u8 *) mem, offset);
patched = drum->envelope;
@ -898,7 +912,11 @@ void audio_init() {
UNUSED s8 pad[32];
u8 buf[0x10];
#endif
#ifndef TARGET_WEB
s32 i, j, UNUSED k;
#else
s32 i, j, UNUSED k = 0;
#endif
UNUSED s32 lim1; // lim1 unused in EU
#ifdef VERSION_EU
u8 buf[0x10];

View File

@ -4,6 +4,7 @@
#include "data.h"
#include "seqplayer.h"
#include "synthesis.h"
#include "heap.h"
#ifdef VERSION_EU

View File

@ -273,7 +273,18 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) {
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
if (i == 1) {
// self-assignment has no affect when added here, could possibly simplify a macro definition
#ifndef TARGET_WEB
#ifndef QOL_FIXES
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-assign"
chunkLen = bufLen; nextVolRampTable = nextVolRampTable; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF];
#pragma GCC diagnostic pop
#else
chunkLen = bufLen; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF];
#endif
#else
chunkLen = bufLen; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF];
#endif
} else {
if (bufLen / i >= gAudioBufferParameters.samplesPerUpdateMax) {
chunkLen = gAudioBufferParameters.samplesPerUpdateMax; nextVolRampTable = 2; leftVolRamp = gLeftVolRampings[2]; rightVolRamp = gRightVolRampings[2];

View File

@ -31,7 +31,11 @@
static u16 gRandomSeed16;
// Unused function that directly jumps to a behavior command and resets the object's stack index.
#ifndef TARGET_WEB
static void goto_behavior_unused(const BehaviorScript *bhvAddr) {
#else
UNUSED static void goto_behavior_unused(const BehaviorScript *bhvAddr) {
#endif
gCurBhvCommand = segmented_to_virtual(bhvAddr);
gCurrentObject->bhvStackIndex = 0;
}
@ -107,7 +111,11 @@ static uintptr_t cur_obj_bhv_stack_pop(void) {
return bhvAddr;
}
#ifndef TARGET_WEB
static void stub_behavior_script_1(void) {
#else
UNUSED static void stub_behavior_script_1(void) {
#endif
for (;;) {
;
}
@ -691,11 +699,16 @@ static s32 bhv_cmd_begin(void) {
return BHV_PROC_CONTINUE;
}
#ifndef QOL_FIXES
// An unused, incomplete behavior command that does not have an entry in the lookup table, and so no command number.
// It cannot be simply re-added to the table, as unlike all other bhv commands it takes a parameter.
// Theoretically this command would have been of variable size.
// Included below is a modified/repaired version of this function that would work properly.
#ifndef TARGET_WEB
static void bhv_cmd_set_int_random_from_table(s32 tableSize) {
#else
UNUSED static void bhv_cmd_set_int_random_from_table(s32 tableSize) {
#endif
u8 field = BHV_CMD_GET_2ND_U8(0);
s32 table[16];
s32 i;
@ -709,12 +722,15 @@ static void bhv_cmd_set_int_random_from_table(s32 tableSize) {
// Does not increment gCurBhvCommand or return a bhv status
}
/**
#else
// Command 0x??: Sets the specified field to a random entry in the given table, up to size 16.
// Bytes: ?? FF SS SS V1 V1 V2 V2 V3 V3 V4 V4... ...V15 V15 V16 V16 (no macro exists)
// F -> field, S -> table size, V1, V2, etc. -> table entries (up to 16)
#ifndef TARGET_WEB
static s32 bhv_cmd_set_int_random_from_table(void) {
#else
UNUSED static s32 bhv_cmd_set_int_random_from_table(void) {
#endif
u8 field = BHV_CMD_GET_2ND_U8(0);
// Retrieve tableSize from the bhv command instead of as a parameter.
s16 tableSize = BHV_CMD_GET_2ND_S16(0); // tableSize should not be greater than 16
@ -733,7 +749,7 @@ static s32 bhv_cmd_set_int_random_from_table(void) {
gCurBhvCommand += (tableSize / 2) + 1;
return BHV_PROC_CONTINUE;
}
**/
#endif
// Command 0x2A: Loads collision data for the object.
// Usage: LOAD_COLLISION_DATA(collisionData)
@ -908,7 +924,12 @@ static BhvCommandProc BehaviorCmdTable[] = {
bhv_cmd_disable_rendering, //35
bhv_cmd_set_int_unused, //36
bhv_cmd_spawn_water_droplet, //37
#ifndef QOL_FIXES
bhv_cmd_cylboard //38
#else
bhv_cmd_cylboard, //38
bhv_cmd_set_int_random_from_table //39
#endif
};
// Execute the behavior script of the current object, process the object flags, and other miscellaneous code for updating objects.

View File

@ -14,8 +14,10 @@ int gSplineState;
// These functions have bogus return values.
// Disable the compiler warning.
#ifndef TARGET_WEB
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-local-addr"
#endif
/// Copy vector 'src' to 'dest'
void *vec3f_copy(Vec3f dest, Vec3f src) {
@ -23,8 +25,13 @@ void *vec3f_copy(Vec3f dest, Vec3f src) {
dest[1] = src[1];
dest[2] = src[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Set vector 'dest' to (x, y, z)
@ -33,8 +40,13 @@ void *vec3f_set(Vec3f dest, f32 x, f32 y, f32 z) {
dest[1] = y;
dest[2] = z;
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Add vector 'a' to 'dest'
@ -43,8 +55,13 @@ void *vec3f_add(Vec3f dest, Vec3f a) {
dest[1] += a[1];
dest[2] += a[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Make 'dest' the sum of vectors a and b.
@ -53,8 +70,13 @@ void *vec3f_sum(Vec3f dest, Vec3f a, Vec3f b) {
dest[1] = a[1] + b[1];
dest[2] = a[2] + b[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Multiply vector 'dest' by a
@ -64,8 +86,13 @@ void *vec3f_mul(Vec3f dest, f32 a)
dest[1] *= a;
dest[2] *= a;
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Copy vector src to dest
@ -74,8 +101,13 @@ void *vec3s_copy(Vec3s dest, Vec3s src) {
dest[1] = src[1];
dest[2] = src[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Set vector 'dest' to (x, y, z)
@ -84,8 +116,13 @@ void *vec3s_set(Vec3s dest, s16 x, s16 y, s16 z) {
dest[1] = y;
dest[2] = z;
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Add vector a to 'dest'
@ -94,8 +131,13 @@ void *vec3s_add(Vec3s dest, Vec3s a) {
dest[1] += a[1];
dest[2] += a[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Make 'dest' the sum of vectors a and b.
@ -104,8 +146,13 @@ void *vec3s_sum(Vec3s dest, Vec3s a, Vec3s b) {
dest[1] = a[1] + b[1];
dest[2] = a[2] + b[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Make 'dest' the difference of vectors a and b.
@ -114,8 +161,13 @@ void *vec3f_dif(Vec3f dest, Vec3f a, Vec3f b) {
dest[1] = a[1] - b[1];
dest[2] = a[2] - b[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Convert short vector a to float vector 'dest'
@ -124,8 +176,13 @@ void *vec3s_to_vec3f(Vec3f dest, Vec3s a) {
dest[1] = a[1];
dest[2] = a[2];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/**
@ -138,8 +195,13 @@ void *vec3f_to_vec3s(Vec3s dest, Vec3f a) {
dest[1] = a[1] + ((a[1] > 0) ? 0.5f : -0.5f);
dest[2] = a[2] + ((a[2] > 0) ? 0.5f : -0.5f);
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/**
@ -152,8 +214,13 @@ void *find_vector_perpendicular_to_plane(Vec3f dest, Vec3f a, Vec3f b, Vec3f c)
dest[1] = (b[2] - a[2]) * (c[0] - b[0]) - (c[2] - b[2]) * (b[0] - a[0]);
dest[2] = (b[0] - a[0]) * (c[1] - b[1]) - (c[0] - b[0]) * (b[1] - a[1]);
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Make vector 'dest' the cross product of vectors a and b.
@ -162,8 +229,13 @@ void *vec3f_cross(Vec3f dest, Vec3f a, Vec3f b) {
dest[1] = a[2] * b[0] - b[2] * a[0];
dest[2] = a[0] * b[1] - b[0] * a[1];
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Scale vector 'dest' so it has length 1
@ -182,8 +254,13 @@ void *vec3f_normalize(Vec3f dest) {
dest[1] *= invsqrt;
dest[2] *= invsqrt;
#ifndef QOL_FIXES
#ifndef TARGET_WEB
return &dest; //! warning: function returns address of local variable
#endif
#endif
#ifdef TARGET_WEB
return 0;
#endif
}
/// Get length of vector 'a'
@ -198,7 +275,9 @@ f32 vec3f_dot(Vec3f a, Vec3f b)
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
#ifndef TARGET_WEB
#pragma GCC diagnostic pop
#endif
/// Copy matrix 'src' to 'dest'
void mtxf_copy(Mat4 dest, Mat4 src) {

View File

@ -380,7 +380,11 @@ f32 unused_obj_find_floor_height(struct Object *obj) {
*/
struct FloorGeometry sFloorGeo;
#ifndef TARGET_WEB
static u8 unused8038BE50[0x40];
#else
UNUSED static u8 unused8038BE50[0x40];
#endif
/**
* Return the floor height underneath (xPos, yPos, zPos) and populate `floorGeo`

View File

@ -291,7 +291,11 @@ static void add_surface(struct Surface *surface, s32 dynamic) {
}
}
#ifndef TARGET_WEB
static void stub_surface_load_1(void) {
#else
UNUSED static void stub_surface_load_1(void) {
#endif
}
/**
@ -651,7 +655,11 @@ void clear_dynamic_surfaces(void) {
}
}
#ifndef TARGET_WEB
static void unused_80383604(void) {
#else
UNUSED static void unused_80383604(void) {
#endif
}
/**

View File

@ -83,6 +83,9 @@ void bhv_bowling_ball_roll_loop(void) {
#else
s32 sp18 = 0;
#endif
#ifdef TARGET_WEB
sp18 = 0;
#endif
bowling_ball_set_waypoints();
collisionFlags = object_step();
@ -117,6 +120,9 @@ void bhv_bowling_ball_initializeLoop(void) {
#else
s32 sp1c = 0;
#endif
#ifdef TARGET_WEB
sp1c = 0;
#endif
bowling_ball_set_waypoints();

View File

@ -181,7 +181,11 @@ void bowser_act_intro_walk(void) {
}
}
#ifndef TARGET_WEB
static void bowser_debug_actions(void) // unused
#else
UNUSED static void bowser_debug_actions(void)
#endif
{
if (gDebugInfo[5][1] != 0) {
o->oAction = D_8032F4FC[gDebugInfo[5][2] & 0xf];

View File

@ -65,8 +65,13 @@ static void camera_lakitu_intro_act_spawn_cloud(void) {
* Circle down to mario, show the dialog, then fly away.
*/
static void camera_lakitu_intro_act_show_dialog(void) {
#ifndef TARGET_WEB
s16 targetMovePitch;
s16 targetMoveYaw;
#else
s16 targetMovePitch = 0;
s16 targetMoveYaw = 0;
#endif
cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY);

View File

@ -71,7 +71,14 @@ s32 approach_forward_vel(f32 *arr, f32 spC, f32 sp10) {
}
void chuckya_act_0(void) {
#ifndef QOL_FIXES
s32 sp3C;
#else
s32 sp3C = 0;
#endif
#ifdef TARGET_WEB
sp3C = 0;
#endif
UNUSED u8 pad[16];
s32 sp28;
if (o->oTimer == 0)

View File

@ -34,7 +34,14 @@ void bhv_manta_ray_init(void) {
void manta_ray_move(void) {
s16 sp1E;
#ifndef QOL_FIXES
s32 sp18;
#else
s32 sp18 = 0;
#endif
#ifdef TARGET_WEB
sp18 = 0;
#endif
sp1E = o->header.gfx.unk38.animFrame;
gCurrentObject->oPathedStartWaypoint = (struct Waypoint *) sMantaRayTraj;

View File

@ -110,7 +110,14 @@ void bhv_mips_act_wait_for_nearby_mario(void) {
*/
void bhv_mips_act_follow_path(void) {
s16 collisionFlags = 0;
#ifndef QOL_FIXES
s32 followStatus;
#else
s32 followStatus = 0;
#endif
#ifdef TARGET_WEB
followStatus = 0;
#endif
struct Waypoint **pathBase;
struct Waypoint *waypoint;

View File

@ -52,7 +52,14 @@ void adjust_rolling_face_pitch(f32 f12) {
void snowmans_bottom_act_1(void) {
UNUSED s16 sp26;
#ifndef QOL_FIXES
s32 sp20;
#else
s32 sp20 = 0;
#endif
#ifdef TARGET_WEB
sp20 = 0;
#endif
UNUSED s16 sp1E;
o->oPathedStartWaypoint = segmented_to_virtual(&ccm_seg7_trajectory_snowman);

View File

@ -122,19 +122,40 @@ struct Object *spawn_star(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) {
}
void spawn_default_star(f32 sp20, f32 sp24, f32 sp28) {
#ifndef QOL_FIXES
struct Object *sp1C;
#else
struct Object *sp1C = NULL;
#endif
#ifdef TARGET_WEB
sp1C = NULL;
#endif
sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 0;
}
void spawn_red_coin_cutscene_star(f32 sp20, f32 sp24, f32 sp28) {
#ifndef QOL_FIXES
struct Object *sp1C;
#else
struct Object *sp1C = NULL;
#endif
#ifdef TARGET_WEB
sp1C = NULL;
#endif
sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 1;
}
void spawn_no_exit_star(f32 sp20, f32 sp24, f32 sp28) {
#ifndef QOL_FIXES
struct Object *sp1C;
#else
struct Object *sp1C = NULL;
#endif
#ifdef TARGET_WEB
sp1C = NULL;
#endif
sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 1;
sp1C->oInteractionSubtype |= INT_SUBTYPE_NO_EXIT;

View File

@ -501,7 +501,11 @@ void ukiki_free_loop(void) {
*
* Possibly unused so AnimState could be used for wearing a hat?
*/
#ifndef TARGET_WEB
static void ukiki_blink_timer(void) {
#else
UNUSED static void ukiki_blink_timer(void) {
#endif
if (gGlobalTimer % 50 < 7) {
o->oAnimState = UKIKI_ANIM_STATE_EYE_CLOSED;
} else {

View File

@ -704,6 +704,9 @@ f32 calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 *focOff, f32
if (*focOff < -focBound) {
*focOff = -focBound;
}
#ifdef TARGET_WEB
return 0;
#endif
}
//Compiler gets mad if I put this any further above. thanks refresh 7
#ifdef BETTERCAMERA
@ -1732,9 +1735,16 @@ struct ParallelTrackingPoint sBBHLibraryParTrackPath[] = {
};
s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) {
#ifdef TARGET_WEB
return 0;
#endif
}
#ifndef TARGET_WEB
static void stub_camera_1(UNUSED s32 unused) {
#else
UNUSED static void stub_camera_1(UNUSED s32 unused) {
#endif
}
void mode_boss_fight_camera(struct Camera *c) {
@ -2059,6 +2069,9 @@ void mode_behind_mario_camera(struct Camera *c) {
}
s32 nop_update_water_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) {
#ifdef TARGET_WEB
return 0;
#endif
}
/**
@ -4958,6 +4971,9 @@ s32 radial_camera_input(struct Camera *c, UNUSED f32 unused) {
#else
s16 dummy = 0;
#endif
#ifdef TARGET_WEB
dummy = 0;
#endif
if ((gCameraMovementFlags & CAM_MOVE_ENTERED_ROTATE_SURFACE) || !(gCameraMovementFlags & CAM_MOVE_ROTATE)) {
@ -5429,7 +5445,11 @@ void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack
* @param forwBack offset to Mario's front/back, relative to his faceAngle
* @param yawOff offset to Mario's faceAngle, changes the direction of `leftRight` and `forwBack`
*/
#ifndef TARGET_WEB
static void unused_set_pos_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) {
#else
UNUSED static void unused_set_pos_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) {
#endif
u16 yaw = sMarioCamState->faceAngle[1] + yawOff;
c->pos[0] = sMarioCamState->pos[0] + forwBack * sins(yaw) + leftRight * coss(yaw);
@ -5478,7 +5498,11 @@ void determine_pushing_or_pulling_door(s16 *rotation) {
if (sMarioCamState->action == ACT_PULLING_DOOR) {
*rotation = 0;
} else {
#ifndef TARGET_WEB
*rotation = DEGREES(180);
#else
*rotation = (s16)DEGREES(180);
#endif
}
}
@ -7354,7 +7378,11 @@ void cutscene_unsoften_music(UNUSED struct Camera *c) {
sequence_player_unlower(SEQ_PLAYER_LEVEL, 60);
}
#ifndef TARGET_WEB
static void stub_camera_5(UNUSED struct Camera *c) {
#else
UNUSED static void stub_camera_5(UNUSED struct Camera *c) {
#endif
}
BAD_RETURN(s32) cutscene_unused_start(UNUSED struct Camera *c) {
@ -7845,7 +7873,11 @@ BAD_RETURN(s32) cutscene_dance_rotate_move_towards_mario(struct Camera *c) {
/**
* Speculated to be dance-related due to its proximity to the other dance functions
*/
#ifndef TARGET_WEB
static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera *c) {
#else
UNUSED static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera *c) {
#endif
}
/**
@ -8762,7 +8794,11 @@ BAD_RETURN(s32) cutscene_death_stomach_goto_mario(struct Camera *c) {
/**
* Ah, yes
*/
#ifndef TARGET_WEB
static void unused_water_death_move_to_side_of_mario(struct Camera *c) {
#else
UNUSED static void unused_water_death_move_to_side_of_mario(struct Camera *c) {
#endif
water_death_move_to_mario_side(c);
}
@ -9038,7 +9074,11 @@ BAD_RETURN(s32) cutscene_enter_pyramid_top(struct Camera *c) {
}
}
#ifndef TARGET_WEB
static void unused_cutscene_goto_cvar(struct Camera *c) {
#else
UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) {
#endif
f32 dist;
dist = calc_abs_dist(sCutsceneVars[3].point, sMarioCamState->pos);
@ -9199,7 +9239,11 @@ BAD_RETURN(s32) cutscene_read_message_start(struct Camera *c) {
sCutsceneVars[0].angle[0] = 0;
}
#ifndef TARGET_WEB
static void unused_cam_to_mario(struct Camera *c) {
#else
UNUSED static void unused_cam_to_mario(struct Camera *c) {
#endif
Vec3s dir;
vec3s_set(dir, 0, sMarioCamState->faceAngle[1], 0);
@ -9674,15 +9718,24 @@ s32 intro_peach_move_camera_start_to_pipe(struct Camera *c, struct CutsceneSplin
// The two splines used by this function are reflected in the horizontal plane for some reason,
// so they are rotated every frame. Why do this, Nintendo?
#ifndef TARGET_WEB
rotate_in_xz(c->focus, c->focus, DEGREES(180));
rotate_in_xz(c->pos, c->pos, DEGREES(180));
#else
rotate_in_xz(c->focus, c->focus, (s16)DEGREES(180));
rotate_in_xz(c->pos, c->pos, (s16)DEGREES(180));
#endif
vec3f_set(offset, -1328.f, 260.f, 4664.f);
vec3f_add(c->focus, offset);
vec3f_add(c->pos, offset);
posReturn += focusReturn; // Unused
#ifndef QOL_FIXES
return focusReturn;
#else
return posReturn;
#endif
}
/**

View File

@ -210,32 +210,36 @@ void print_mapinfo(void) {
UNUSED f32 bgY;
UNUSED f32 water;
UNUSED s32 area;
// s32 angY;
//
// angY = gCurrentObject->oMoveAngleYaw / 182.044000;
// area = ((s32)gCurrentObject->oPosX + 0x2000) / 1024
// + ((s32)gCurrentObject->oPosZ + 0x2000) / 1024 * 16;
//
#ifndef VERSION_EU
s32 angY;
angY = gCurrentObject->oMoveAngleYaw / 182.044000;
area = ((s32)gCurrentObject->oPosX + 0x2000) / 1024
+ ((s32)gCurrentObject->oPosZ + 0x2000) / 1024 * 16;
#endif
bgY = find_floor(gCurrentObject->oPosX, gCurrentObject->oPosY, gCurrentObject->oPosZ, &pfloor);
water = find_water_level(gCurrentObject->oPosX, gCurrentObject->oPosZ);
print_debug_top_down_normal("mapinfo", 0);
// print_debug_top_down_mapinfo("area %x", area);
// print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
// print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
// print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
// print_debug_top_down_mapinfo("bgY %d", bgY);
// print_debug_top_down_mapinfo("angY %d", angY);
//
// if(pfloor) // not null
//{
// print_debug_top_down_mapinfo("bgcode %d", pfloor->type);
// print_debug_top_down_mapinfo("bgstatus %d", pfloor->flags);
// print_debug_top_down_mapinfo("bgarea %d", pfloor->room);
//}
//
// if(gCurrentObject->oPosY < water)
// print_debug_top_down_mapinfo("water %d", water);
#ifndef VERSION_EU
print_debug_top_down_mapinfo("area %x", area);
print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
print_debug_top_down_mapinfo("bgY %d", bgY);
print_debug_top_down_mapinfo("angY %d", angY);
if(pfloor) // not null
{
print_debug_top_down_mapinfo("bgcode %d", pfloor->type);
print_debug_top_down_mapinfo("bgstatus %d", pfloor->flags);
print_debug_top_down_mapinfo("bgarea %d", pfloor->room);
}
if(gCurrentObject->oPosY < water)
print_debug_top_down_mapinfo("water %d", water);
#endif
}
#endif
@ -341,7 +345,11 @@ void reset_debug_objectinfo(void) {
* C Right) and then toggles the debug flags from FF to 2; 2 is unused,
* despite so this has no effect, being called. (unused)
*/
#ifndef TARGET_WEB
static void check_debug_button_seq(void) {
#else
UNUSED static void check_debug_button_seq(void) {
#endif
s16 *buttonArr;
s16 cButtonMask;
@ -371,7 +379,11 @@ static void check_debug_button_seq(void) {
* Poll the debug info flags and controller for appropriate presses that
* control sDebugPage's range. (unused)
*/
#ifndef TARGET_WEB
static void try_change_debug_page(void) {
#else
UNUSED static void try_change_debug_page(void) {
#endif
if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT) {
if ((gPlayer1Controller->buttonPressed & L_JPAD)
&& (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) {

View File

@ -272,7 +272,11 @@ void envfx_update_snow_blizzard(s32 snowCylinderX, s32 snowCylinderY, s32 snowCy
* find it. The radius of 3000 units is quite large for that though, covering
* more than half of the mirror room.
*/
#ifndef TARGET_WEB
static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) {
#else
UNUSED static s32 is_in_mystery_snow_area(s32 x, UNUSED s32 y, s32 z) {
#endif
if (sqr(x - 3380) + sqr(z + 520) < sqr(3000)) {
return 1;
}

View File

@ -311,7 +311,11 @@ void display_and_vsync(void) {
// this function records distinct inputs over a 255-frame interval to RAM locations and was likely
// used to record the demo sequences seen in the final game. This function is unused.
#ifndef TARGET_WEB
static void record_demo(void) {
#else
UNUSED static void record_demo(void) {
#endif
// record the player's button mask and current rawStickX and rawStickY.
u8 buttonMask =
((gPlayer1Controller->buttonDown & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON)) >> 8)

View File

@ -55,7 +55,11 @@ static struct PowerMeterHUD sPowerMeterHUD = {
// when the power meter is hidden.
s32 sPowerMeterVisibleTimer = 0;
#ifndef TARGET_WEB
static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 };
#else
UNUSED static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 };
#endif
static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE };

View File

@ -276,7 +276,7 @@ void render_generic_char(u8 c) {
#ifdef VERSION_EU
static void alloc_ia4_tex_from_i1(u8 *out, u8 *in, s16 width, s16 height) {
u32 size = (u32) width * (u32) height;
UNUSED u32 size = (u32) width * (u32) height;
s32 inPos;
s16 outPos = 0;
u8 bitMask;
@ -2218,21 +2218,21 @@ u8 gTextCourseArr[][7] = {
{ TEXT_COURSE_FR },
{ TEXT_COURSE_DE }
};
#endif
#if defined(VERSION_EU) && defined(QOL_FIXES)
u8 gTextCatchArr[][7] {
#ifdef QOL_FIXES
u8 gTextCatchArr[][8] = {
{ TEXT_CATCH },
{ TEXT_CATCH_FR },
{ TEXT_CATCH_DE }
};
u8 gTextClearArr[][7] {
u8 gTextClearArr[][8] = {
{ TEXT_CLEAR },
{ TEXT_CLEAR_FR },
{ TEXT_CLEAR_DE }
};
#endif
#endif
#if defined(VERSION_JP) || defined(VERSION_SH)
#define CRS_NUM_X1 93

View File

@ -525,7 +525,11 @@ void hit_object_from_below(struct MarioState *m, UNUSED struct Object *o) {
set_camera_shake_from_hit(SHAKE_HIT_FROM_BELOW);
}
#ifndef TARGET_WEB
static u32 unused_determine_knockback_action(struct MarioState *m) {
#else
UNUSED static u32 unused_determine_knockback_action(struct MarioState *m) {
#endif
u32 bonkAction;
s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj);
s16 facingDYaw = angleToObject - m->faceAngle[1];
@ -1278,7 +1282,11 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
return FALSE;
}
#ifndef TARGET_WEB
static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
#else
UNUSED static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
#endif
if (!(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) {
sDelayInvincTimer = TRUE;
}

View File

@ -1123,7 +1123,11 @@ s32 play_mode_change_level(void) {
/**
* Unused play mode. Doesn't call transition update and doesn't reset transition at the end.
*/
#ifndef TARGET_WEB
static s32 play_mode_unused(void) {
#else
UNUSED static s32 play_mode_unused(void) {
#endif
if (--sTransitionTimer == -1) {
gHudDisplay.flags = HUD_DISPLAY_NONE;

View File

@ -79,7 +79,11 @@ void spawn_macro_abs_special(u32 model, const BehaviorScript *behavior, s16 x, s
newObj->oMacroUnk110 = (f32) unkC;
}
#ifndef TARGET_WEB
static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
#else
UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
#endif
struct Object *sp3C;
s16 model;

View File

@ -1712,7 +1712,11 @@ void mario_update_hitbox_and_cap_model(struct MarioState *m) {
* An unused and possibly a debug function. Z + another button input
* sets Mario with a different cap.
*/
#ifndef TARGET_WEB
static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) {
#else
UNUSED static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u16 capMusic) {
#endif
// This checks for Z_TRIG instead of Z_DOWN flag
// (which is also what other debug functions do),
// so likely debug behavior rather than unused behavior.

View File

@ -71,12 +71,16 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtype-limits"
#ifndef TARGET_WEB
//! Never true
if (m->actionState == ACT_GROUND_POUND) {
damageHeight = 600.0f;
} else {
damageHeight = 1150.0f;
}
#else
damageHeight = 1150.0f;
#endif
#pragma GCC diagnostic pop

View File

@ -219,7 +219,11 @@ s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) {
}
// unused
#ifndef TARGET_WEB
static void stub_is_textbox_active(u16 *a0) {
#else
UNUSED static void stub_is_textbox_active(u16 *a0) {
#endif
if (get_dialog_id() == -1) {
*a0 = 0;
}

View File

@ -632,8 +632,10 @@ static void obj_die_if_health_non_positive(void) {
} else {
obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
}
#ifndef QOL_FIXES
// This doesn't do anything
obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
#endif
if (o->oHealth < 0) {
cur_obj_hide();
@ -644,7 +646,11 @@ static void obj_die_if_health_non_positive(void) {
}
}
#ifndef TARGET_WEB
static void obj_unused_die(void) {
#else
UNUSED static void obj_unused_die(void) {
#endif
o->oHealth = 0;
obj_die_if_health_non_positive();
}

View File

@ -56,7 +56,7 @@ int detect_object_hitbox_overlap(struct Object *a, struct Object *b) {
return 1;
}
#ifdef QOL_FIXES
#if defined(QOL_FIXES) || defined(TARGET_WEB)
return 0;
#endif
//! no return value
@ -91,7 +91,7 @@ int detect_object_hurtbox_overlap(struct Object *a, struct Object *b) {
return 1;
}
#ifdef QOL_FIXES
#if defined(QOL_FIXES) || defined(TARGET_WEB)
return 0;
#endif
//! no return value

View File

@ -1390,7 +1390,11 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) {
}
}
#ifndef TARGET_WEB
static void stub_obj_helpers_1(void) {
#else
UNUSED static void stub_obj_helpers_1(void) {
#endif
}
static s32 clear_move_flag(u32 *bitSet, s32 flag) {
@ -1750,7 +1754,7 @@ static void cur_obj_update_floor(void) {
if (floor->type == SURFACE_BURNING) {
o->oMoveFlags |= OBJ_MOVE_ABOVE_LAVA;
}
#if !defined(VERSION_JP) || defined(QOL_FIXES)
#ifndef VERSION_JP
#ifndef QOL_FIXES
else if (floor->type == SURFACE_DEATH_PLANE) {
//! This misses SURFACE_VERTICAL_WIND (and maybe SURFACE_WARP)
@ -2253,7 +2257,11 @@ void bhv_dust_smoke_loop(void) {
o->oSmokeTimer++;
}
#ifndef TARGET_WEB
static void stub_obj_helpers_2(void) {
#else
UNUSED static void stub_obj_helpers_2(void) {
#endif
}
s32 cur_obj_set_direction_table(s8 *a0) {
@ -2279,7 +2287,11 @@ s32 cur_obj_progress_direction_table(void) {
return spF;
}
#ifndef TARGET_WEB
void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4) {
#else
UNUSED void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4) {
#endif
}
void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14) {
@ -2306,7 +2318,11 @@ void cur_obj_set_pos_to_home_with_debug(void) {
cur_obj_scale(gDebugInfo[5][3] / 100.0f + 1.0l);
}
#ifndef TARGET_WEB
void stub_obj_helpers_4(void) {
#else
UNUSED void stub_obj_helpers_4(void) {
#endif
}
s32 cur_obj_is_mario_on_platform(void) {
@ -2401,7 +2417,11 @@ s32 is_item_in_array(s8 item, s8 *array) {
return FALSE;
}
#ifndef TARGET_WEB
static void stub_obj_helpers_5(void) {
#else
UNUSED static void stub_obj_helpers_5(void) {
#endif
}
void bhv_init_room(void) {

View File

@ -606,7 +606,11 @@ void unload_deactivated_objects(void) {
/**
* Unused profiling function.
*/
#ifndef TARGET_WEB
static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
#else
UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
#endif
u16 time;
f64 cycles;

View File

@ -62,7 +62,11 @@ static const u8 menuStr[][32] = {
{ TEXT_OPT_CHEATS },
};
#ifndef TARGET_WEB
static const u8 optsCameraStr[][32] = {
#else
UNUSED static const u8 optsCameraStr[][32] = {
#endif
{ TEXT_OPT_CAMX },
{ TEXT_OPT_CAMY },
{ TEXT_OPT_INVERTX },
@ -134,7 +138,11 @@ static const u8 *filterChoices[] = {
optsVideoStr[8],
};
#ifndef TARGET_WEB
static const u8 *vsyncChoices[] = {
#else
UNUSED static const u8 *vsyncChoices[] = {
#endif
toggleStr[0],
toggleStr[1],
optsVideoStr[6],

View File

@ -263,6 +263,9 @@ f32 painting_ripple_y(struct Painting *painting, s8 ySource) {
return painting->size / 2.0; // some concentric ripples don't care about Mario
break;
}
#ifdef TARGET_WEB
return 0;
#endif
}
/**
@ -287,7 +290,13 @@ f32 painting_nearest_4th(struct Painting *painting) {
return secondQuarter;
} else if (painting->floorEntered & ENTER_RIGHT) {
return thirdQuarter;
#ifndef TARGET_WEB
}
#else
} else {
return 0;
}
#endif
}
/**
@ -319,6 +328,9 @@ f32 painting_ripple_x(struct Painting *painting, s8 xSource) {
return painting->size / 2.0;
break;
}
#ifdef TARGET_WEB
return 0;
#endif
}
/**

View File

@ -177,6 +177,7 @@ void apply_mario_platform_displacement(void) {
}
}
#ifndef QOL_FIXES
#ifndef VERSION_JP
/**
* Set Mario's platform to NULL.
@ -185,3 +186,11 @@ void clear_mario_platform(void) {
gMarioPlatform = NULL;
}
#endif
#else
/**
* Set Mario's platform to NULL.
*/
void clear_mario_platform(void) {
gMarioPlatform = NULL;
}
#endif

View File

@ -10,8 +10,12 @@ void get_mario_pos(f32 *x, f32 *y, f32 *z);
void set_mario_pos(f32 x, f32 y, f32 z);
void apply_platform_displacement(u32 isMario, struct Object *platform);
void apply_mario_platform_displacement(void);
#ifndef QOL_FIXES
#ifndef VERSION_JP
void clear_mario_platform(void);
#endif
#else
void clear_mario_platform(void);
#endif
#endif // PLATFORM_DISPLACEMENT_H

View File

@ -239,6 +239,9 @@ int render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct Wa
return render_textured_transition(fadeTimer, transTime, transData, TEX_TRANS_BOWSER, TRANS_TYPE_MIRROR);
break;
}
#ifdef TARGET_WEB
return 0;
#endif
}
Gfx *render_cannon_circle_base(void) {

View File

@ -190,7 +190,7 @@ f32 get_water_level_below_shadow(struct Shadow *s) {
}
//! @bug Missing return statement. This compiles to return `waterLevel`
//! incidentally.
#ifdef QOL_FIXES
#if defined(QOL_FIXES) || defined(TARGET_WEB)
return waterLevel;
#endif
}

View File

@ -29,7 +29,11 @@ static u16 sCurrentMusic = MUSIC_NONE;
static u16 sCurrentShellMusic = MUSIC_NONE;
static u16 sCurrentCapMusic = MUSIC_NONE;
static u8 sPlayingInfiniteStairs = FALSE;
#ifndef TARGET_WEB
static u8 unused8032C6D8[16] = { 0 };
#else
UNUSED static u8 unused8032C6D8[16] = { 0 };
#endif
static s16 sSoundMenuModeToSoundMode[] = { SOUND_MODE_STEREO, SOUND_MODE_MONO, SOUND_MODE_HEADSET };
// Only the 20th array element is used.
static u32 menuSoundsExtra[] = {

View File

@ -162,7 +162,11 @@ void clear_object_lists(struct ObjectNode *objLists) {
/**
* Delete the leaf graph nodes under obj and obj's siblings.
*/
#ifndef TARGET_WEB
static void unused_delete_leaf_nodes(struct Object *obj) {
#else
UNUSED static void unused_delete_leaf_nodes(struct Object *obj) {
#endif
struct Object *children;
struct Object *sibling;
struct Object *obj0 = obj;

View File

@ -410,6 +410,7 @@ void fatal_printf(const char *fmt, ...) {
case 's':
gd_printf("%s", va_arg(vl, char *));
break;
#ifndef TARGET_WEB
case 'c':
#ifndef QOL_FIXES
gd_printf("%c", va_arg(vl, char));
@ -417,6 +418,11 @@ void fatal_printf(const char *fmt, ...) {
gd_printf("%c", va_arg(vl, int));
#endif
break;
#else
case 'c':
gd_printf("%c", va_arg(vl, int));
break;
#endif
case 'x':
gd_printf("%x", va_arg(vl, s32));
break;

View File

@ -61,7 +61,11 @@ static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC
static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8
static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4
struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8
#ifndef TARGET_WEB
static void *sUnref801A80FC = NULL;
#else
UNUSED static void *sUnref801A80FC = NULL;
#endif
static s32 sUnreadShapeFlag = 0; // @ 801A8100
struct GdColour *sColourPalette[5] = { // @ 801A8104
&sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack
@ -71,20 +75,36 @@ struct GdColour *sWhiteBlack[2] = {
&sClrWhite,
&sClrBlack,
};
#ifndef TARGET_WEB
static Mat4f sUnref801A8120 = {
#else
UNUSED static Mat4f sUnref801A8120 = {
#endif
{ 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }
};
#ifndef TARGET_WEB
static Mat4f sUnrefIden801A8160 = {
#else
UNUSED static Mat4f sUnrefIden801A8160 = {
#endif
{ 1.0, 0.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }
};
static s32 sLightDlCounter = 1; // @ 801A81A0
#ifndef TARGET_WEB
static s32 sUnref801A81A4[4] = { 0 };
#else
UNUSED static s32 sUnref801A81A4[4] = { 0 };
#endif
// bss
u8 gUnref_801B9B30[0x88];
struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group?
#ifndef TARGET_WEB
static u8 sUnref_801B9BBC[0x40];
#else
UNUSED static u8 sUnref_801B9BBC[0x40];
#endif
static enum SceneType sSceneProcessType; // @ 801B9C00
static s32 sUseSelectedColor; // @ 801B9C04
static s16 sPickBuffer[100]; ///< buffer of objects near click

View File

@ -14,11 +14,20 @@
// data
s32 gGdMoveScene = TRUE; // @ 801A8050
#ifndef TARGET_WEB
static s32 sUnref801A8054 = TRUE;
#else
UNUSED static s32 sUnref801A8054 = TRUE;
#endif
f32 D_801A8058 = -600.0f;
s32 gGdUseVtxNormal = TRUE; // @ 801A805C; instead of face normals
#ifndef TARGET_WEB
static s32 sUnrefScnWidth = 320;
static s32 sUnrefScnHeight = 240;
#else
UNUSED static s32 sUnrefScnWidth = 320;
UNUSED static s32 sUnrefScnHeight = 240;
#endif
// bss
struct GdControl gGdCtrl; // @ 801B9920; processed controller info

View File

@ -23,7 +23,11 @@
// bss
static char sMenuStrBuf[0x100];
static struct GdVec3f sStaticVec;
#ifndef TARGET_WEB
static struct GdVec3f unusedVec;
#else
UNUSED static struct GdVec3f unusedVec;
#endif
static struct ObjGadget *sCurGadgetPtr;
// forward declarations

View File

@ -26,7 +26,11 @@ struct Connection {
};
// data
#ifndef TARGET_WEB
static void *sUnused801A81D0 = NULL;
#else
UNUSED static void *sUnused801A81D0 = NULL;
#endif
static s32 D_801A81D4[25] = {
/* ID? X Y Z */
9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55,

View File

@ -97,7 +97,11 @@ u8 EUpad2[0x64];
static OSMesg sGdMesgBuf[1]; // @ 801BE944
u8 EUpad3[0x34];
static OSMesg D_801BE97C; // msg buf for D_801BE8B0 queue
#ifndef TARGET_WEB
static OSIoMesg D_801BE980;
#else
UNUSED static OSIoMesg D_801BE980;
#endif
static struct ObjView *D_801BE994; // store if View flag 0x40 set
u8 EUpad4[0x88];
@ -110,10 +114,18 @@ static u8 D_801BAEA0;
static struct ObjGadget *sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8
static u32 D_801BAF28; // RAM addr offset?
static s16 D_801BAF30[13][8]; // [[s16; 8]; 13]? vert indices?
#ifndef TARGET_WEB
static u32 unref_801bb000[3];
#else
UNUSED static u32 unref_801bb000[3];
#endif
static u8 *sMemBlockPoolBase; // @ 801BB00C
static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes
#ifndef TARGET_WEB
static u32 unref_801bb014;
#else
UNUSED static u32 unref_801bb014;
#endif
static s32 D_801BB018;
static s32 D_801BB01C;
static void *D_801BB020[0x10]; // texture pointers
@ -133,11 +145,23 @@ static s32 D_801BB0CC; // Vtx start in GD Dl
static struct ObjView *sCarSceneView; // @ 801BB0D0
static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex?
static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex?
#ifndef TARGET_WEB
static u32 unref_801bb0dc;
#else
UNUSED static u32 unref_801bb0dc;
#endif
static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used
#ifndef TARGET_WEB
static u32 unref_801bb0e4;
#else
UNUSED static u32 unref_801bb0e4;
#endif
static struct GdVec3f D_801BB0E8;
#ifndef TARGET_WEB
static u32 unref_801bb0f8[2];
#else
UNUSED static u32 unref_801bb0f8[2];
#endif
static Mtx sIdnMtx; // @ 801BB100
static Mat4f sInitIdnMat4; // @ 801BB140
static s8 sVtxCvrtNormBuf[3]; // @ 801BB180
@ -168,21 +192,45 @@ static LookAt D_801BE7D0[3];
#ifndef VERSION_EU
static OSMesgQueue D_801BE830; // controller msg queue
static OSMesg D_801BE848[10];
#ifndef TARGET_WEB
static u32 unref_801be870[16];
#else
UNUSED static u32 unref_801be870[16];
#endif
static OSMesgQueue D_801BE8B0;
static OSMesgQueue sGdDMAQueue; // @ 801BE8C8
#ifndef TARGET_WEB
static u32 unref_801be8e0[25];
#else
UNUSED static u32 unref_801be8e0[25];
#endif
static OSMesg sGdMesgBuf[1]; // @ 801BE944
#ifndef TARGET_WEB
static u32 unref_801be948[13];
#else
UNUSED static u32 unref_801be948[13];
#endif
static OSMesg D_801BE97C; // msg buf for D_801BE8B0 queue
#ifndef TARGET_WEB
static OSIoMesg D_801BE980;
#else
UNUSED static OSIoMesg D_801BE980;
#endif
static struct ObjView *D_801BE994; // store if View flag 0x40 set
#endif
// data
#ifndef TARGET_WEB
static u32 unref_801a8670 = 0;
#else
UNUSED static u32 unref_801a8670 = 0;
#endif
static s32 D_801A8674 = 0;
#ifndef TARGET_WEB
static u32 unref_801a8678 = 0;
#else
UNUSED static u32 unref_801a8678 = 0;
#endif
static s32 D_801A867C = 0;
static s32 D_801A8680 = 0;
static f32 sTracked1FrameTime = 0.0f; // @ 801A8684
@ -197,11 +245,19 @@ static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp
static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp
static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp
s32 gGdFrameBuf = 0; // @ 801A86B0
#ifndef TARGET_WEB
static u32 unref_801a86B4 = 0;
#else
UNUSED static u32 unref_801a86B4 = 0;
#endif
static struct ObjShape *sHandShape = NULL; // @ 801A86B8
static s32 D_801A86BC = 1;
static s32 D_801A86C0 = 0; // gd_dl id for something?
#ifndef TARGET_WEB
static u32 unref_801a86C4 = 10;
#else
UNUSED static u32 unref_801a86C4 = 10;
#endif
static s32 sMtxParamType = G_MTX_PROJECTION;
static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f };
static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl
@ -212,10 +268,18 @@ static struct ObjView *sMenuView = NULL; // @ 801A86E8
static u32 sItemsInMenu = 0; // @ 801A86EC
static s32 D_801A86F0 = 0; // frame buffer idx into D_801BD7A0?
static s32 sNewZPresses = 0; // @ 801A86F4; timing activate cool down counter?
#ifndef TARGET_WEB
static u32 unref_801a86F8 = 0;
#else
UNUSED static u32 unref_801a86F8 = 0;
#endif
static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC
static u32 sGdDlCount = 0; // @ 801A8700
#ifndef TARGET_WEB
static struct DynListBankInfo sDynLists[] = { // @ 801A8704
#else
UNUSED static struct DynListBankInfo sDynLists[] = { // @ 801A8704
#endif
{ STD_LIST_BANK, dynlist_test_cube },
{ STD_LIST_BANK, dynlist_unused },
{ STD_LIST_BANK, dynlist_mario_master },
@ -223,7 +287,11 @@ static struct DynListBankInfo sDynLists[] = { // @ 801A8704
};
// textures and display list data
#ifndef TARGET_WEB
static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728
#else
UNUSED static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728
#endif
gsSPEndDisplayList(),
};
@ -231,7 +299,11 @@ ALIGNED8 static u8 gd_texture_hand_open[] = {
#include "textures/intro_raw/hand_open.rgba16.inc.c"
};
#ifndef TARGET_WEB
static Gfx gd_texture2_dummy_aligner1[] = {
#else
UNUSED static Gfx gd_texture2_dummy_aligner1[] = {
#endif
gsSPEndDisplayList()
};
@ -493,7 +565,11 @@ ALIGNED8 static u8 gd_texture_sparkle_4[] = {
//! No reference to this texture. Two DL's uses the same previous texture
// instead of using this texture.
// Fixed via setting QOL_FIXES to 1.
#ifndef TARGET_WEB
ALIGNED8 static u8 gd_texture_sparkle_5[] = {
#else
UNUSED ALIGNED8 static u8 gd_texture_sparkle_5[] = {
#endif
#include "textures/intro_raw/sparkle_5.rgba16.inc.c"
};
@ -570,7 +646,7 @@ static Gfx gd_dl_red_sparkle_4[] = {
};
#ifndef QOL_FIXES
static Gfx gd_dl_red_sparkle_4_dup[] ={
static Gfx gd_dl_red_sparkle_4_dup[] = {
gsDPPipeSync(),
gsSPDisplayList(gd_dl_sparkle_red_color),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), // 4 again, correct texture would be 5
@ -578,7 +654,7 @@ static Gfx gd_dl_red_sparkle_4_dup[] ={
};
#else
static Gfx gd_dl_red_sparkle_5[] ={
static Gfx gd_dl_red_sparkle_5[] = {
gsDPPipeSync(),
gsSPDisplayList(gd_dl_sparkle_red_color),
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_5),
@ -678,7 +754,11 @@ static Gfx *gd_silver_sparkle_dl_array[] = {
#endif
};
#ifndef TARGET_WEB
static Gfx gd_texture3_dummy_aligner1[] = {
#else
UNUSED static Gfx gd_texture3_dummy_aligner1[] = {
#endif
gsSPEndDisplayList(),
};
@ -723,13 +803,25 @@ static Gfx gd_dl_rdp_init[] = {
gsSPEndDisplayList(),
};
#ifndef TARGET_WEB
static u32 gd_unused_pad1 = 0;
#else
UNUSED static u32 gd_unused_pad1 = 0;
#endif
float sGdPerspTimer = 1.0;
#ifndef TARGET_WEB
static u32 gd_unused_pad2 = 0;
#else
UNUSED static u32 gd_unused_pad2 = 0;
#endif
#ifndef TARGET_WEB
static Gfx gd_texture4_dummy_aligner1[] = {
#else
UNUSED static Gfx gd_texture4_dummy_aligner1[] = {
#endif
gsDPPipeSync(),
gsSPEndDisplayList(),
};
@ -746,7 +838,11 @@ static Vtx_t gd_unused_mesh_vertex_group2[] = {
{{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}},
};
#ifndef TARGET_WEB
static Gfx gd_dl_unused_mesh[] = {
#else
UNUSED static Gfx gd_dl_unused_mesh[] = {
#endif
gsDPPipeSync(),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsSPClearGeometryMode(0xFFFFFFFF),
@ -2762,7 +2858,7 @@ s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, U
//! doesn't use four of its parameters, this function may have
//! had a fair amount of its code commented out. In game, the
//! returned value is always 0, so the fix returns that value
#ifdef AVOID_UB
#if defined(AVOID_UB) || defined(TARGET_WEB)
return 0;
#endif
}
@ -2789,6 +2885,9 @@ void func_801A43DC(UNUSED struct GdObj *obj) {
/* 252BC0 -> 252BE0 */
void *func_801A43F0(UNUSED const char *menufmt, ...) {
//! @bug no return; function was stubbed
#ifdef TARGET_WEB
return 0;
#endif
}
/* 252BE0 -> 252BF0 */

View File

@ -65,10 +65,22 @@ static struct UnkData sUnref801A835C = { { {
1,
4,
&sUnref801A835C };
#ifndef TARGET_WEB
static s32 sUnref801A838C[6] = { 0 };
#else
UNUSED static s32 sUnref801A838C[6] = { 0 };
#endif
struct ObjShape *D_801A83A4 = NULL;
#ifndef TARGET_WEB
static s32 sUnref801A83A8[31] = { 0 };
#else
UNUSED static s32 sUnref801A83A8[31] = { 0 };
#endif
#ifndef TARGET_WEB
static struct DynList sSimpleDylist[8] = {
#else
UNUSED static struct DynList sSimpleDylist[8] = {
#endif
StartList(),
StartGroup("simpleg"),
MakeDynObj(D_NET, "simple"),
@ -83,17 +95,29 @@ static struct DynList sDynlist801A84E4[3] = {
SetFlag(0x1800),
StopList(),
};
#ifndef TARGET_WEB
static struct DynList sDynlist801A85B3[5] = {
#else
UNUSED static struct DynList sDynlist801A85B3[5] = {
#endif
StartList(), JumpToList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01),
StopList(),
};
#ifndef TARGET_WEB
static struct DynList sDynlist801A85A4[4] = {
#else
UNUSED static struct DynList sDynlist801A85A4[4] = {
#endif
StartList(),
JumpToList(sDynlist801A84E4),
SetFriction(0.04, 0.01, 0.01),
StopList(),
};
#ifndef TARGET_WEB
static struct DynList sDynlist801A8604[4] = {
#else
UNUSED static struct DynList sDynlist801A8604[4] = {
#endif
StartList(),
JumpToList(sDynlist801A84E4),
SetFriction(0.005, 0.005, 0.005),
@ -102,35 +126,76 @@ static struct DynList sDynlist801A8604[4] = {
static f64 D_801A8668 = 0.0;
// bss
#ifndef TARGET_WEB
static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00
#else
UNUSED static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00
#endif
static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C
#ifndef TARGET_WEB
static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30
#else
UNUSED static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30
#endif
static struct ObjShape *sCubeShape; // @ 801BAB3C
#ifndef TARGET_WEB
static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40
#else
UNUSED static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40
#endif
static char sGdLineBuf[0x100]; // @ 801BAB48
static s32 sGdLineBufCsr; // @ 801BAC48
static struct GdFile *sGdShapeFile; // @ 801BAC4C
static struct ObjShape *sGdShapeListHead; // @ 801BAC50
static u32 sGdShapeCount; // @ 801BAC54
#ifndef TARGET_WEB
static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58
#else
UNUSED static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58
#endif
static struct GdVec3f D_801BAC60;
#ifndef TARGET_WEB
static u32 sUnrefSpaceC6C; // @ 801BAC6C
static u32 sUnrefSpaceC70; // @ 801BAC70
#else
UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C
UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70
#endif
static struct ObjPlane *D_801BAC74;
static struct ObjPlane *D_801BAC78; // sShapeNetHead?
#ifndef TARGET_WEB
static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80
#else
UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80
#endif
static struct ObjFace *D_801BAC9C;
static struct ObjFace *D_801BACA0;
#ifndef TARGET_WEB
static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8
#else
UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8
#endif
/// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()`
static struct GdVec3f sVertexScaleFactor;
/// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()`
static struct GdVec3f sVertexTranslateOffset;
#ifndef TARGET_WEB
static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8
#else
UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8
#endif
static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape
#ifndef TARGET_WEB
static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10
#else
UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10
#endif
static struct GdVec3f D_801BAD30; // printed with "c="
#ifndef TARGET_WEB
static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40
#else
UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40
#endif
// Forward Declarations
struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32);

View File

@ -39,7 +39,11 @@
// the large length difference between options.
// sSoundTextY unused (EU supports its existence).
static s16 sSoundTextX;
#ifndef TARGET_WEB
static s16 sSoundTextY;
#else
UNUSED static s16 sSoundTextY;
#endif
#endif
//! @Bug (UB Array Access) For PAL, more buttons were added than the array was extended.
@ -63,8 +67,13 @@ static struct Object *sMainMenuButtons[NUM_BUTTONS];
// The current sound mode is automatically centered on US due to
// the large length difference between options.
// sSoundTextY is unused
#ifndef TARGET_WEB
static s16 sSoundTextX;
static s16 sSoundTextY;
#else
UNUSED static s16 sSoundTextX;
UNUSED static s16 sSoundTextY;
#endif
#endif
// Used to defined yes/no fade colors after a file is selected in the erase menu.

View File

@ -61,7 +61,9 @@ int run_press_start_demo_timer(s32 timer) {
timer = (s8)((struct DemoInput *) gDemo.targetAnim)->timer;
gCurrSaveFileNum = 1;
gCurrActNum = 1;
#ifndef VERSION_JP
playMarioGreeting = 1;
#endif
}
} else { // activity was detected, so reset the demo countdown.
gDemoCountdown = 0;
@ -71,8 +73,14 @@ int run_press_start_demo_timer(s32 timer) {
}
#ifndef QOL_FIXES
#ifndef TARGET_WEB
extern int gDemoInputListID_2;
#else
#endif
#endif
#ifdef QOL_FIXES
extern unsigned int gDemoInputListID_2;
#endif
#ifdef TARGET_WEB
extern unsigned int gDemoInputListID_2;
#endif
extern int gPressedStart;

View File

@ -46,7 +46,11 @@ static u32 joy_binds[MAX_JOYBINDS][2];
static u32 mouse_binds[MAX_JOYBINDS][2];
static bool joy_buttons[MAX_JOYBUTTONS] = { false };
#ifndef TARGET_WEB
static u32 mouse_buttons = 0;
#else
UNUSED static u32 mouse_buttons = 0;
#endif
static u32 last_mouse = VK_INVALID;
static u32 last_joybutton = VK_INVALID;

View File

@ -172,6 +172,9 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
return "texVal1.a";
}
}
#ifdef TARGET_WEB
return "0";
#endif
}
static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
@ -531,7 +534,7 @@ static void gfx_opengl_select_texture(int tile, GLuint texture_id) {
gfx_opengl_set_texture_uniforms(opengl_prg, tile);
}
static void gfx_opengl_upload_texture(uint8_t *rgba32_buf, int width, int height) {
static void gfx_opengl_upload_texture(const uint8_t *rgba32_buf, int width, int height) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf);
opengl_tex[opengl_curtex]->size[0] = width;
opengl_tex[opengl_curtex]->size[1] = height;

View File

@ -181,7 +181,11 @@ static struct GfxRenderingAPI *gfx_rapi;
// 4x4 pink-black checkerboard texture to indicate missing textures
#define MISSING_W 4
#define MISSING_H 4
#ifndef TARGET_WEB
static const uint8_t missing_texture[MISSING_W * MISSING_H * 4] = {
#else
UNUSED static const uint8_t missing_texture[MISSING_W * MISSING_H * 4] = {
#endif
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
@ -197,9 +201,15 @@ static inline size_t string_hash(const uint8_t *str) {
}
#endif
#ifndef TARGET_WEB
static unsigned long get_time(void) {
return 0;
}
#else
UNUSED static unsigned long get_time(void) {
return 0;
}
#endif
static void gfx_flush(void) {
if (buf_vbo_len > 0) {
@ -305,7 +315,7 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co
hash = (hash >> HASH_SHIFT) & HASH_MASK;
struct TextureHashmapNode **node = &gfx_texture_cache.hashmap[hash];
while (*node != NULL && *node - gfx_texture_cache.pool < gfx_texture_cache.pool_pos) {
while (*node != NULL && *node - gfx_texture_cache.pool < (long)gfx_texture_cache.pool_pos) {
if (CMPADDR((*node)->texture_addr, orig_addr) && (*node)->fmt == fmt && (*node)->siz == siz) {
gfx_rapi->select_texture(tile, (*node)->texture_id);
*n = *node;
@ -1657,7 +1667,7 @@ static void gfx_run_dl(Gfx* cmd) {
case G_TEXRECT:
case G_TEXRECTFLIP:
{
int32_t lrx, lry, tile, ulx, uly;
int32_t lrx, lry, tile = 0, ulx, uly;
uint32_t uls, ult, dsdx, dtdy;
#ifdef F3DEX_GBI_2E
lrx = (int32_t)(C0(0, 24) << 8) >> 8;

View File

@ -36,11 +36,15 @@
#include "src/pc/controller/controller_keyboard.h"
#ifdef TARGET_WEB
#include "macros.h"
#endif
// TODO: figure out if this shit even works
#ifdef VERSION_EU
# define FRAMERATE 25
#define FRAMERATE 25
#else
# define FRAMERATE 30
#define FRAMERATE 30
#endif
static SDL_Window *wnd;
@ -268,7 +272,11 @@ static int translate_scancode(int scancode) {
}
}
#ifndef TARGET_WEB
static void gfx_sdl_onkeydown(int scancode) {
#else
UNUSED static void gfx_sdl_onkeydown(int scancode) {
#endif
if (kb_key_down)
kb_key_down(translate_scancode(scancode));
@ -280,7 +288,11 @@ static void gfx_sdl_onkeydown(int scancode) {
}
}
#ifndef TARGET_WEB
static void gfx_sdl_onkeyup(int scancode) {
#else
UNUSED static void gfx_sdl_onkeyup(int scancode) {
#endif
if (kb_key_up)
kb_key_up(translate_scancode(scancode));
}

View File

@ -16,7 +16,9 @@
#define HAS_NEON 0
#endif
#ifndef TARGET_WEB
#pragma GCC optimize ("unroll-loops")
#endif
#if HAS_SSE41
#define LOADLH(l, h) _mm_castpd_si128(_mm_loadh_pd(_mm_load_sd((const double *)(l)), (const double *)(h)))