Skip to content

Commit

Permalink
Fix sync workflow (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
bates64 authored Feb 22, 2025
2 parents 2878182 + ac8f47f commit ab49c27
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
types:
- webhook # 'push' event on upstream
schedule:
- cron: 0 0 * * *
- cron: 0 0 * * 0
jobs:
sync:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
git merge --no-ff --log FETCH_HEAD -m "Merge upstream changes"
- name: Create Pull Request
run: |
gh pr create --title "Sync with $UPSTREAM" --body "Automated PR to keep this repository in sync with upstream. Beep boop." --base ${BASE_BRANCH}
gh pr create --title "Sync with $UPSTREAM" --body "Automated PR to keep this repository in sync with upstream. Beep boop." --base ${BASE_BRANCH} --head $(git branch --show-current)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 0 additions & 6 deletions include/common.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#ifndef _COMMON_H_
#define _COMMON_H_
#if defined __GNUC__ && __GNUC__ >= 14
#pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#pragma GCC diagnostic warning "-Wint-conversion"
#pragma GCC diagnostic warning "-Wreturn-mismatch"
#endif

#include "ultra64.h"
#include "gbi_custom.h"
Expand Down
2 changes: 2 additions & 0 deletions include/ultra64.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef _ULTRA64_H_
#define _ULTRA64_H_

#pragma GCC system_header

#include <PR/ultratypes.h>
#include <PR/rcp.h>
#include <PR/os.h>
Expand Down
8 changes: 4 additions & 4 deletions src/audio/2e230_len_2190.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void au_engine_init(s32 outputRate) {
voice->priority = AU_PRIORITY_FREE;
}

au_load_INIT(globals, audio_ROM_START, alHeap);
au_load_INIT(globals, (s32)audio_ROM_START, alHeap);

for (i = 0; i < ARRAY_COUNT(globals->banks); i++) {
globals->banks[i] = alHeapAlloc(alHeap, 1, 0x840);
Expand Down Expand Up @@ -145,7 +145,7 @@ void au_engine_init(s32 outputRate) {
func_80055050(alHeap);
}

static void au_reset_instrument(Instrument* instrument) {
void au_reset_instrument(Instrument* instrument) {
instrument->base = DummyInstrumentBase;
instrument->wavDataLength = sizeof(DummyInstrumentBase);
instrument->predictor = DummyInstrumentPredictor;
Expand All @@ -167,7 +167,7 @@ static void au_reset_instrument(Instrument* instrument) {
instrument->pitchRatio = 0.5f;
}

static void au_reset_drum_entry(BGMDrumInfo* arg0) {
void au_reset_drum_entry(BGMDrumInfo* arg0) {
arg0->bankPatch = 0x2010;
arg0->keyBase = 4800; // middle C?
arg0->volume = 0x7F;
Expand All @@ -179,7 +179,7 @@ static void au_reset_drum_entry(BGMDrumInfo* arg0) {
arg0->randReverb = 0;
}

static void au_reset_instrument_entry(BGMInstrumentInfo* arg0) {
void au_reset_instrument_entry(BGMInstrumentInfo* arg0) {
arg0->bankPatch = 0x2010;
arg0->volume = 0x7F;
arg0->pan = 64;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ void au_voice_set_vol_changed(AuVoice* arg0);
//2e230_len_2190.c
void func_80052E30(u8 index);
void au_engine_init(s32 outputRate);
static void au_reset_instrument(Instrument* instrument);
static void au_reset_drum_entry(BGMDrumInfo* arg0);
static void au_reset_instrument_entry(BGMInstrumentInfo* arg0);
void au_reset_instrument(Instrument* instrument);
void au_reset_drum_entry(BGMDrumInfo* arg0);
void au_reset_instrument_entry(BGMInstrumentInfo* arg0);
void au_update_clients_2(void);
void au_update_players_main(void);
void au_syn_update(AuGlobals* globals);
Expand Down
1 change: 0 additions & 1 deletion src/battle/common/move/ItemRefund.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ API_CALLABLE(N(GiveRefund)) {
f32 posZ;
f32 angle = 0.0f;
s32 delayTime = 0;
s32 tempIcon;

if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) {
s32 iconX;
Expand Down
48 changes: 25 additions & 23 deletions src/dx/debug_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ enum DebugMenuStates {
DBM_EDIT_MEMORY,
DBM_VIEW_COLLISION,
DBM_CHEAT_MENU,
};

s32 DebugMenuState = DBM_NONE;
} DebugMenuState = DBM_NONE;
b32 DebugStateChanged = FALSE;

const s32 DefaultColor = MSG_PAL_WHITE;
Expand Down Expand Up @@ -157,23 +155,23 @@ void dx_debug_draw_box(s32 posX, s32 posY, s32 sizeX, s32 sizeY, int style, s32
}

void dx_debug_draw_ascii(char* text, s32 color, s32 posX, s32 posY) {
char buf[128] = {
u8 buf[128] = {
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SIZE, 12, 12
};
dx_string_to_msg(&buf[4], text);
draw_msg((s32)buf, posX, posY, 255, color, 0);
}

void dx_debug_draw_ascii_with_effect(char* text, s32 color, s32 posX, s32 posY, s32 effect) {
char buf[128] = {
u8 buf[128] = {
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SIZE, 12, 12
};
dx_string_to_msg(&buf[4], text);
draw_msg((s32)buf, posX, posY, 255, color, effect);
}

void dx_debug_draw_msg(s32 msgID, s32 color, s32 alpha, s32 posX, s32 posY) {
char buf[128] = {
u8 buf[128] = {
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SIZE, 12, 12
};
dma_load_msg(msgID, &buf[4]);
Expand All @@ -182,7 +180,7 @@ void dx_debug_draw_msg(s32 msgID, s32 color, s32 alpha, s32 posX, s32 posY) {

void dx_debug_draw_number(s32 number, char* fmt, s32 color, s32 alpha, s32 posX, s32 posY) {
char fmtBuf[16];
char buf[16] = {
u8 buf[16] = {
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SIZE, 12, 12
};
sprintf(fmtBuf, fmt, number);
Expand All @@ -192,7 +190,7 @@ void dx_debug_draw_number(s32 number, char* fmt, s32 color, s32 alpha, s32 posX,

// efficiently renders an number with (optionally) a digit highlighted using a single draw_msg call
void dx_debug_draw_editable_number(s32 number, char* fmt, s32 selectedDigit, b32 hasSelected, s32 posX, s32 posY) {
char msgBuf[32] = {
u8 msgBuf[32] = {
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SIZE, 12, 12,
MSG_CHAR_READ_FUNCTION, MSG_READ_FUNC_SPACING, 8
};
Expand Down Expand Up @@ -499,7 +497,9 @@ void dx_debug_menu_main() {
// main menu is always drawn if the debug menu is open at all
dx_debug_draw_main_menu();

switch(DebugMenuState) {
switch (DebugMenuState) {
case DBM_NONE: // to satisfy compiler
break;
case DBM_MAIN_MENU:
dx_debug_update_main_menu();
break;
Expand Down Expand Up @@ -844,7 +844,7 @@ void dx_debug_update_select_entry() {
char fmtBuf[16];
dx_debug_draw_ascii(map.id, DefaultColor, SubmenuPosX, SubmenuPosY + RowHeight);
dx_debug_draw_ascii("Entry:", DefaultColor, SubmenuPosX, SubmenuPosY + 2 * RowHeight);
sprintf(fmtBuf, "%2X", SelectedEntryValue);
sprintf(fmtBuf, "%2lX", SelectedEntryValue);
dx_debug_draw_ascii(fmtBuf, HighlightColor, SubmenuPosX + 40, SubmenuPosY + 2 * RowHeight);
}
}
Expand Down Expand Up @@ -887,7 +887,7 @@ Enemy DebugDummyEnemy = {

Encounter DebugDummyEncounter = {
.encounterID = DX_DEBUG_DUMMY_ID,
.enemy = &DebugDummyEnemy,
.enemy = { &DebugDummyEnemy },
.count = 0,
.battle = 0,
.stage = 0,
Expand Down Expand Up @@ -1250,6 +1250,8 @@ void dx_debug_update_edit_items() {
invItems = gPlayerData.badges;
invSize = ARRAY_COUNT(gPlayerData.badges);
break;
default:
PANIC_MSG("invalid debug menu state");
}

if (DebugStateChanged) {
Expand Down Expand Up @@ -1949,20 +1951,20 @@ void dx_debug_update_banner() {
s32 effect;

if (gGameStatus.context == CONTEXT_WORLD) {
sprintf(fmtBuf, "Map: %7s (%X)", LastMapName, LastMapEntry);
sprintf(fmtBuf, "Map: %7s (%lX)", LastMapName, LastMapEntry);
dx_debug_draw_ascii(fmtBuf, DefaultColor, 220, BottomRowY);

dx_debug_draw_ascii("Pos:", DefaultColor, 20, BottomRowY);

effect = dx_debug_is_cheat_enabled(DEBUG_CHEAT_SPEED_MODE) ? DRAW_MSG_STYLE_RAINBOW : 0;

sprintf(fmtBuf, "%5d", round(gPlayerStatus.pos.x));
sprintf(fmtBuf, "%5ld", round(gPlayerStatus.pos.x));
dx_debug_draw_ascii_with_effect(fmtBuf, DefaultColor, 48, BottomRowY, effect);

sprintf(fmtBuf, "%5d", round(gPlayerStatus.pos.y));
sprintf(fmtBuf, "%5ld", round(gPlayerStatus.pos.y));
dx_debug_draw_ascii_with_effect(fmtBuf, DefaultColor, 80, BottomRowY, effect);

sprintf(fmtBuf, "%5d", round(gPlayerStatus.pos.z));
sprintf(fmtBuf, "%5ld", round(gPlayerStatus.pos.z));
dx_debug_draw_ascii_with_effect(fmtBuf, DefaultColor, 112, BottomRowY, effect);

if (dx_debug_is_cheat_enabled(DEBUG_CHEAT_GOD_MODE)) {
Expand All @@ -1973,7 +1975,7 @@ void dx_debug_update_banner() {
s32 battleID = (LastBattleID >> 16) & 0xFF;
s32 stageID = LastBattleID & 0xFFFF;

sprintf(fmtBuf, "Battle: %02X-%02X (%X)", areaID, battleID, stageID);
sprintf(fmtBuf, "Battle: %02lX-%02lX (%lX)", areaID, battleID, stageID);
dx_debug_draw_ascii(fmtBuf, DefaultColor, 200, BottomRowY);

sprintf(fmtBuf, "Stage: %-15s", LastStageName);
Expand Down Expand Up @@ -2017,11 +2019,11 @@ DebugConsoleLine *DebugConsole[8] = {
&DebugConsoleLine7,
};

u32 dx_debug_hash_location(char* filename, s32 line) {
u32 dx_debug_hash_location(const char* filename, s32 line) {
u32 hash = 5381;
s32 c;

while (c = *filename++) {
while ((c = *filename++)) {
hash = ((hash << 5) + hash) + c;
}

Expand Down Expand Up @@ -2092,9 +2094,9 @@ API_CALLABLE(_dxDebugIntPrintf) {
s32 nargs = 0;
s32 idx;

char* filename = *args++;
char* filename = (char*)*args++;
s32 line = *args++;
char* fmt = *args++;
char* fmt = (char*)*args++;

for (idx = 0; idx < 8; idx++) {
s32 var = *args++;
Expand Down Expand Up @@ -2125,9 +2127,9 @@ API_CALLABLE(_dxDebugFloatPrintf) {
s32 nargs = 0;
s32 idx;

char* filename = *args++;
char* filename = (char*)*args++;
s32 line = *args++;
char* fmt = *args++;
char* fmt = (char*)*args++;

for (idx = 0; idx < 8; idx++) {
s32 var = *args++;
Expand Down Expand Up @@ -2171,7 +2173,7 @@ void dx_debug_console_main() {
alpha = round(254 * (timeLeft / 20.0f));
}

draw_msg(DebugConsole[idx]->buf, 32, 200 - 15 * idx, alpha, DefaultColor, 0);
draw_msg((s32)DebugConsole[idx]->buf, 32, 200 - 15 * idx, alpha, DefaultColor, 0);
DebugConsole[idx]->timeLeft--;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dx/utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "dx/utils.h"

u8 dx_ascii_char_to_msg(u8 in) {
u8 dx_ascii_char_to_msg(char in) {
switch (in) {
case '\0': return MSG_CHAR_READ_END;
case ' ': case '\t': return MSG_CHAR_READ_SPACE;
Expand All @@ -13,7 +13,7 @@ u8 dx_ascii_char_to_msg(u8 in) {
}
}

u8* dx_string_to_msg(u8* msg, const u8* str) {
u8* dx_string_to_msg(u8* msg, const char* str) {
while (*str) {
*msg++ = dx_ascii_char_to_msg(*str++);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dx/utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "common.h"

u8* dx_string_to_msg(u8* msg, const u8* str);
u8* dx_string_to_msg(u8* msg, const char* str);

u8 dx_ascii_char_to_msg(u8 in);
u8 dx_ascii_char_to_msg(char in);
2 changes: 2 additions & 0 deletions src/entity/WoodenCrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ s32 entity_WoodenCrate_idle(Entity* entity) {
exec_entity_commandlist(entity);
sfx_play_sound(SOUND_BREAK_CRATE);
}

return 0;
}

f32 player_get_camera_facing_angle(void);
Expand Down
1 change: 0 additions & 1 deletion src/evt/virtual_entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ API_CALLABLE(VirtualEntityJumpTo) {
f32 zTemp;
s32 moveTime;
f32 goalPosX;
f32 goalPosY;
f32 goalPosZ;

if (isInitialCall) {
Expand Down
12 changes: 6 additions & 6 deletions src/filemenu/filemenu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void filemenu_draw_contents_title(

sprintf(strBuf, "%s (v%d.%d.%d)", DX_MOD_NAME, DX_MOD_VER_MAJOR, DX_MOD_VER_MINOR, DX_MOD_VER_PATCH);
dx_string_to_msg(msgBuf, strBuf);
msgWidth = get_msg_width(msgBuf, 0);
msgWidth = get_msg_width((s32)msgBuf, 0);
filemenu_draw_message(msgBuf, (SCREEN_WIDTH - msgWidth) / 2, 245 - baseY, 255, 0, 0);
}

Expand Down Expand Up @@ -541,14 +541,14 @@ void filemenu_draw_contents_file_info(s32 fileIdx,

// do not show file summary from mods that don't match the current one
if (!gSaveSlotMetadata[fileIdx].validData) {
char buf[32];
u8 buf[32];
if (gSaveSlotMetadata[fileIdx].modName[0] == '\0') {
dx_string_to_msg(&buf, "Paper Mario");
dx_string_to_msg(buf, "Paper Mario");
} else {
dx_string_to_msg(&buf, gSaveSlotMetadata[fileIdx].modName);
dx_string_to_msg(buf, gSaveSlotMetadata[fileIdx].modName);
}
xOffset = 66 - get_msg_width(&buf, 0) / 2;
filemenu_draw_message(&buf, baseX + xOffset, baseY + 20, 255, MSG_PAL_RED, 0);
xOffset = 66 - get_msg_width((s32)&buf, 0) / 2;
filemenu_draw_message(buf, baseX + xOffset, baseY + 20, 255, MSG_PAL_RED, 0);
return;
}

Expand Down
7 changes: 3 additions & 4 deletions src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -4575,7 +4575,6 @@ OPTIMIZE_OFAST void execute_render_tasks(void) {
s32* sorted;
RenderTask* taskList;
RenderTask* task;
RenderTask* task2;
Matrix4f mtxFlipY;
void (*appendGfx)(void*);
s32 tmp;
Expand All @@ -4588,20 +4587,20 @@ OPTIMIZE_OFAST void execute_render_tasks(void) {

// sort in ascending order of dist
taskList = RenderTaskLists[RENDER_TASK_LIST_MID];
sorted = &sorteds[RENDER_TASK_LIST_MID];
sorted = sorteds[RENDER_TASK_LIST_MID];
#define LESS(i, j) taskList[sorted[i]].dist < taskList[sorted[j]].dist
#define SWAP(i, j) tmp = sorted[i], sorted[i] = sorted[j], sorted[j] = tmp
QSORT(RenderTaskCount[RENDER_TASK_LIST_MID], LESS, SWAP);

// tasks with dist >= 3M sort in descending order
taskList = RenderTaskLists[RENDER_TASK_LIST_FAR];
sorted = &sorteds[RENDER_TASK_LIST_FAR];
sorted = sorteds[RENDER_TASK_LIST_FAR];
#define LESS(i, j) taskList[sorted[i]].dist > taskList[sorted[j]].dist
QSORT(RenderTaskCount[RENDER_TASK_LIST_FAR], LESS, SWAP);

// tasks with dist <= 800k sort in descending order
taskList = RenderTaskLists[RENDER_TASK_LIST_NEAR];
sorted = &sorteds[RENDER_TASK_LIST_NEAR];
sorted = sorteds[RENDER_TASK_LIST_NEAR];
QSORT(RenderTaskCount[RENDER_TASK_LIST_NEAR], LESS, SWAP);

gLastRenderTaskCount = RenderTaskCount[RENDER_TASK_LIST_MID] + RenderTaskCount[RENDER_TASK_LIST_FAR] + RenderTaskCount[RENDER_TASK_LIST_NEAR];
Expand Down
Loading

0 comments on commit ab49c27

Please sign in to comment.