From a5fc05a953e8a1807442e3e7de4093d72fe4087e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 16 May 2021 15:59:29 +1000 Subject: [PATCH] Fix indentation --- src/game/chr/chraction.c | 10 +-- src/game/endscreen.c | 10 +-- src/game/game_1531a0.c | 4 +- src/game/lv.c | 2 +- src/game/menu/items.c | 8 +-- src/game/prop.c | 2 +- src/game/timing.c | 12 ++-- src/include/gbiex.h | 4 -- src/include/libultra_internal.h | 20 +++--- src/include/sgidefs.h | 10 +-- src/include/types.h | 20 +++--- src/inflate/inflate.c | 35 +++++----- src/lib/lib_06550.c | 10 +-- src/lib/lib_0c000.c | 54 ++++++++-------- src/lib/lib_24e40.c | 22 +++---- src/lib/lib_30ce0.c | 4 +- src/lib/reset.c | 2 +- src/lib/sched.c | 6 +- src/lib/ultra/audio/cseq.c | 96 ++++++++++++++-------------- src/lib/ultra/gu/ortho.c | 2 +- src/lib/ultra/io/dpsetstat.c | 2 +- src/lib/ultra/io/epirawdma.c | 6 +- src/lib/ultra/io/epirawread.c | 14 ++-- src/lib/ultra/io/epirawwrite.c | 14 ++-- src/lib/ultra/io/pfsgetstatus.c | 4 +- src/lib/ultra/io/sirawwrite.c | 8 +-- src/lib/ultra/io/vigetcurrframebuf.c | 12 ++-- src/lib/ultra/io/vigetnextframebuf.c | 12 ++-- src/lib/ultra/libc/sprintf.c | 2 +- 29 files changed, 203 insertions(+), 204 deletions(-) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index e70ebe9e2..52547e865 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -9009,12 +9009,12 @@ glabel chrCanSeeEntity bool chrCanSeeAttackTarget(struct chrdata *chr, struct coord *pos, s16 *rooms, bool arg3) { u32 entitytype = ENTITYTYPE_TARGET; - u32 entityid = 0; + u32 entityid = 0; - if (chr->actiontype == ACT_ATTACK) { - entitytype = chr->act_attack.entitytype; - entityid = chr->act_attack.entityid; - } + if (chr->actiontype == ACT_ATTACK) { + entitytype = chr->act_attack.entitytype; + entityid = chr->act_attack.entityid; + } return chrCanSeeEntity(chr, pos, rooms, arg3, entitytype, entityid); } diff --git a/src/game/endscreen.c b/src/game/endscreen.c index 1f81f946e..f16d85044 100644 --- a/src/game/endscreen.c +++ b/src/game/endscreen.c @@ -225,12 +225,12 @@ char *soloMenuTextAccuracy(struct menuitem *item) accuracy = 0; } - if (accuracy > 100.0f) { - accuracy = 100.0f; - } + if (accuracy > 100.0f) { + accuracy = 100.0f; + } - sprintf(g_StringPointer, "%s%s%.1f%%", "", "", accuracy); - return g_StringPointer; + sprintf(g_StringPointer, "%s%s%.1f%%", "", "", accuracy); + return g_StringPointer; } char *soloMenuTextMissionStatus(struct menuitem *item) diff --git a/src/game/game_1531a0.c b/src/game/game_1531a0.c index 07bc59c5c..93c9d7143 100644 --- a/src/game/game_1531a0.c +++ b/src/game/game_1531a0.c @@ -413,8 +413,8 @@ Gfx *func0f153780(Gfx *gdl) Gfx *gfxSetPrimColour(Gfx *gdl, u32 colour) { gDPPipeSync(gdl++); - gDPSetRenderMode(gdl++, G_RM_XLU_SURF, G_RM_XLU_SURF2); - gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPSetRenderMode(gdl++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetPrimColorViaWord(gdl++, 0, 0, colour); diff --git a/src/game/lv.c b/src/game/lv.c index 5cc0db784..14601feb6 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -1146,7 +1146,7 @@ Gfx *lvRenderFade(Gfx *gdl) gDPPipeSync(gdl++); gDPSetRenderMode(gdl++, G_RM_CLD_SURF, G_RM_CLD_SURF2); - gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPSetCombineMode(gdl++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetPrimColorViaWord(gdl++, 0, 0, colour); gDPFillRectangle(gdl++, diff --git a/src/game/menu/items.c b/src/game/menu/items.c index 8420f3165..a10981ba8 100644 --- a/src/game/menu/items.c +++ b/src/game/menu/items.c @@ -5968,10 +5968,10 @@ Gfx *menuRenderItemObjectives(Gfx *gdl, struct menurendercontext *context) position++; - if (context->item->param == 0) { - y += 18; - } else if (context->item->param == 2) { - y += PAL ? 34 : 30; + if (context->item->param == 0) { + y += 18; + } else if (context->item->param == 2) { + y += PAL ? 34 : 30; } else { y += 14; } diff --git a/src/game/prop.c b/src/game/prop.c index 59be940d7..14f220659 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -389,7 +389,7 @@ Gfx *propsRender(Gfx *gdl, s16 arg1, s32 arg2, s16 *arg3) if (prop) { if ((arg2 == 0 && (prop->flags & (PROPFLAG_20 | PROPFLAG_01)) == 0) - || (arg2 == 2 && (prop->flags & (PROPFLAG_20 | PROPFLAG_01)) == 1)) { + || (arg2 == 2 && (prop->flags & (PROPFLAG_20 | PROPFLAG_01)) == 1)) { gdl = propRender(gdl, prop, false); } } diff --git a/src/game/timing.c b/src/game/timing.c index a98be6b56..b607e518b 100644 --- a/src/game/timing.c +++ b/src/game/timing.c @@ -34,7 +34,7 @@ void frametimeCalculate(void) u32 diffframe60; u32 diffframe240; - do { + do { count = osGetCount(); thisframeticks = count - g_Vars.thisframetime; g_Vars.thisframeticks = thisframeticks; @@ -49,15 +49,15 @@ void frametimeCalculate(void) } while (diffframe60 < g_Vars.mininc60); #if PAL - g_Vars.lostframetime = (g_Vars.lostframetime + thisframeticks) - (diffframe60 * 937500); - g_Vars.lostframetime240 = (g_Vars.lostframetime240 + thisframeticks) - (diffframe240 * 234375); + g_Vars.lostframetime = (g_Vars.lostframetime + thisframeticks) - (diffframe60 * 937500); + g_Vars.lostframetime240 = (g_Vars.lostframetime240 + thisframeticks) - (diffframe240 * 234375); #else - g_Vars.lostframetime = (g_Vars.lostframetime + thisframeticks) - (diffframe60 * 781250); - g_Vars.lostframetime240 = (g_Vars.lostframetime240 + thisframeticks) - (diffframe240 * 195312); + g_Vars.lostframetime = (g_Vars.lostframetime + thisframeticks) - (diffframe60 * 781250); + g_Vars.lostframetime240 = (g_Vars.lostframetime240 + thisframeticks) - (diffframe240 * 195312); #endif g_Vars.mininc60 = 1; - frametimeApply(diffframe60, diffframe240, count); + frametimeApply(diffframe60, diffframe240, count); } void func0f16cf8c(s32 arg0) diff --git a/src/include/gbiex.h b/src/include/gbiex.h index 1c006308b..c17caf196 100644 --- a/src/include/gbiex.h +++ b/src/include/gbiex.h @@ -18,7 +18,6 @@ #define gDPSetVerticeArray(pkt, ptr, numvertices) \ { \ Gfx *_g = (Gfx *)(pkt); \ - \ _g->words.w0 = (_SHIFTL(0x04, 24, 8) \ | _SHIFTL(numvertices - 1, 20, 4) \ | _SHIFTL(numvertices * sizeof(struct gfxvtx), 0, 20)); \ @@ -40,7 +39,6 @@ #define gDPSetColorArray(pkt, ptr, numcolors) \ { \ Gfx *_g = (Gfx *)(pkt); \ - \ _g->words.w0 = (_SHIFTL(0x07, 24, 8) \ | _SHIFTL((numcolors - 1) * 4, 16, 8) \ | _SHIFTL(numcolors * 4, 0, 16)); \ @@ -72,7 +70,6 @@ #define gDPTri4(pkt, x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) \ { \ Gfx *_g = (Gfx *)(pkt); \ - \ _g->words.w0 = (_SHIFTL(0xb1, 24, 8) \ | _SHIFTL(z4, 12, 4) \ | _SHIFTL(z3, 8, 4) \ @@ -98,7 +95,6 @@ #define gDPSetPrimColorViaWord(pkt, m, l, rgba) \ { \ Gfx *_g = (Gfx *)(pkt); \ - \ _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) \ | _SHIFTL(m, 8, 8) \ | _SHIFTL(l, 0, 8)); \ diff --git a/src/include/libultra_internal.h b/src/include/libultra_internal.h index 6878874d8..87194c830 100644 --- a/src/include/libultra_internal.h +++ b/src/include/libultra_internal.h @@ -4,20 +4,20 @@ typedef struct { - u32 initialized; //probably something like initialized? - OSThread *mgrThread; - OSMesgQueue *unk08; - OSMesgQueue *unk0c; - OSMesgQueue *unk10; - s32 (*dma_func)(s32,u32,void*,size_t); - u64 force_align; + u32 initialized; //probably something like initialized? + OSThread *mgrThread; + OSMesgQueue *unk08; + OSMesgQueue *unk0c; + OSMesgQueue *unk10; + s32 (*dma_func)(s32,u32,void*,size_t); + u64 force_align; } OSMgrArgs; typedef struct { - /* 0x0 */ __OSInode inode; - /* 0x100 */ u8 bank; - /* 0x101 */ u8 map[256]; + /* 0x0 */ __OSInode inode; + /* 0x100 */ u8 bank; + /* 0x101 */ u8 map[256]; } __OSInodeCache; s32 __osDisableInt(); diff --git a/src/include/sgidefs.h b/src/include/sgidefs.h index bee627b86..2ff0a8992 100755 --- a/src/include/sgidefs.h +++ b/src/include/sgidefs.h @@ -140,12 +140,12 @@ typedef unsigned long long __uint64_t; #else typedef struct { - int hi32; - int lo32; + int hi32; + int lo32; } __int64_t; typedef struct { - unsigned int hi32; - unsigned int lo32; + unsigned int hi32; + unsigned int lo32; } __uint64_t; #endif /* _LONGLONG */ @@ -178,7 +178,7 @@ typedef __uint64_t __scunsigned_t; typedef __int32_t __scint_t; typedef __uint32_t __scunsigned_t; -#endif +#endif #endif /* C || C++ */ diff --git a/src/include/types.h b/src/include/types.h index fe981b6be..8ce6b0f11 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -13,8 +13,8 @@ // Mtxs use a union and a long long int to force alignments. Mtxfs are not // aligned but still use the union for consistency with Mtx. typedef union { - f32 m[4][4]; - s32 unused; + f32 m[4][4]; + s32 unused; } Mtxf; // This hacky structure allows coords to be accessed using @@ -6731,14 +6731,14 @@ struct var80067e6c { }; struct textureconfig { - u32 texturenum; - u8 width; - u8 height; - u8 level; - u8 format; - u8 depth; - u8 s; - u8 t; + u32 texturenum; + u8 width; + u8 height; + u8 level; + u8 format; + u8 depth; + u8 s; + u8 t; }; struct gfxvtx { diff --git a/src/inflate/inflate.c b/src/inflate/inflate.c index d52a2f55d..77df9cc39 100644 --- a/src/inflate/inflate.c +++ b/src/inflate/inflate.c @@ -20,36 +20,36 @@ u32 wp = 0; struct huft *huftlist = NULL; u8 border[] = { /* Order of the bit length code lengths */ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; /* Tables for deflate from PKZIP's appnote.txt. */ u16 cplens[] = { /* Copy lengths for literal codes 257..285 */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* actually lengths - 2; also see note #13 above about 258 */ +/* actually lengths - 2; also see note #13 above about 258 */ u8 cplext[] = { /* Extra bits for literal codes 257..285 */ - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 128==invalid */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 128==invalid */ u16 cpdist[] = { /* Copy offsets for distance codes 0..29 */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577}; + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; u8 cpdext[] = { /* Extra bits for distance codes */ - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13}; + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; u32 bb = 0; u32 bk = 0; /* And'ing with mask[n] masks the lower n bits */ u16 mask_bits[] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; u32 lbits = 9; @@ -190,8 +190,9 @@ s32 huft_build(u32 *b, u32 n, u32 s, u16 *d, u8 *e, struct huft **t, s32 *m) z = (z = g - w) > l ? l : z; /* upper limit on table size */ if ((f = 1 << (j = k - w)) > a + 1) { /* try a k-w bit table */ - /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ + /* too few codes for k-w bit table */ + /* deduct codes from patterns left */ + f -= a + 1; xp = c + k; while (++j < z) { /* try smaller tables up to z bits */ diff --git a/src/lib/lib_06550.c b/src/lib/lib_06550.c index 542328cb6..c94ea8e5c 100644 --- a/src/lib/lib_06550.c +++ b/src/lib/lib_06550.c @@ -611,12 +611,12 @@ s32 osPfsInitPak(OSMesgQueue *queue, OSPfs *pfs, s32 channel) ret = 0; - __osSiGetAccess(); - ret = __osPfsGetStatus(queue, channel); - __osSiRelAccess(); + __osSiGetAccess(); + ret = __osPfsGetStatus(queue, channel); + __osSiRelAccess(); - if (ret != 0) { - return ret; + if (ret != 0) { + return ret; } pfs->queue = queue; diff --git a/src/lib/lib_0c000.c b/src/lib/lib_0c000.c index 03b966c66..f3e508ec2 100644 --- a/src/lib/lib_0c000.c +++ b/src/lib/lib_0c000.c @@ -25,33 +25,33 @@ struct crashdescription { struct crashdescription g_CrashCauseDescriptions[] = { { CAUSE_BD, CAUSE_BD, "BD" }, - { CAUSE_IP8, CAUSE_IP8, "IP8" }, - { CAUSE_IP7, CAUSE_IP7, "IP7" }, - { CAUSE_IP6, CAUSE_IP6, "IP6" }, - { CAUSE_IP5, CAUSE_IP5, "IP5" }, - { CAUSE_IP4, CAUSE_IP4, "IP4" }, - { CAUSE_IP3, CAUSE_IP3, "IP3" }, - { CAUSE_SW2, CAUSE_SW2, "IP2" }, - { CAUSE_SW1, CAUSE_SW1, "IP1" }, - { CAUSE_EXCMASK, EXC_INT, "Int" }, - { CAUSE_EXCMASK, EXC_MOD, "TLBmod" }, - { CAUSE_EXCMASK, EXC_RMISS, "TLBload" }, - { CAUSE_EXCMASK, EXC_WMISS, "TLBstore" }, - { CAUSE_EXCMASK, EXC_RADE, "Address error on load or instruction fetch" }, - { CAUSE_EXCMASK, EXC_WADE, "Address error on store" }, - { CAUSE_EXCMASK, EXC_IBE, "Bus error exception on instruction fetch" }, - { CAUSE_EXCMASK, EXC_DBE, "Bus error exception on data reference" }, - { CAUSE_EXCMASK, EXC_SYSCALL, "Syscall" }, - { CAUSE_EXCMASK, EXC_BREAK, "Brk" }, - { CAUSE_EXCMASK, EXC_II, "Reserved instruction" }, - { CAUSE_EXCMASK, EXC_CPU, "Cop unusable" }, - { CAUSE_EXCMASK, EXC_OV, "Overflow" }, - { CAUSE_EXCMASK, EXC_TRAP, "Trap" }, - { CAUSE_EXCMASK, EXC_VCEI, "Virtual coherency exception on intruction fetch" }, - { CAUSE_EXCMASK, EXC_FPE, "Fp exception" }, - { CAUSE_EXCMASK, EXC_WATCH, "Watchpoint" }, - { CAUSE_EXCMASK, EXC_VCED, "Virtual coherency exception on data reference" }, - { 0, 0, "" }, + { CAUSE_IP8, CAUSE_IP8, "IP8" }, + { CAUSE_IP7, CAUSE_IP7, "IP7" }, + { CAUSE_IP6, CAUSE_IP6, "IP6" }, + { CAUSE_IP5, CAUSE_IP5, "IP5" }, + { CAUSE_IP4, CAUSE_IP4, "IP4" }, + { CAUSE_IP3, CAUSE_IP3, "IP3" }, + { CAUSE_SW2, CAUSE_SW2, "IP2" }, + { CAUSE_SW1, CAUSE_SW1, "IP1" }, + { CAUSE_EXCMASK, EXC_INT, "Int" }, + { CAUSE_EXCMASK, EXC_MOD, "TLBmod" }, + { CAUSE_EXCMASK, EXC_RMISS, "TLBload" }, + { CAUSE_EXCMASK, EXC_WMISS, "TLBstore" }, + { CAUSE_EXCMASK, EXC_RADE, "Address error on load or instruction fetch" }, + { CAUSE_EXCMASK, EXC_WADE, "Address error on store" }, + { CAUSE_EXCMASK, EXC_IBE, "Bus error exception on instruction fetch" }, + { CAUSE_EXCMASK, EXC_DBE, "Bus error exception on data reference" }, + { CAUSE_EXCMASK, EXC_SYSCALL, "Syscall" }, + { CAUSE_EXCMASK, EXC_BREAK, "Brk" }, + { CAUSE_EXCMASK, EXC_II, "Reserved instruction" }, + { CAUSE_EXCMASK, EXC_CPU, "Cop unusable" }, + { CAUSE_EXCMASK, EXC_OV, "Overflow" }, + { CAUSE_EXCMASK, EXC_TRAP, "Trap" }, + { CAUSE_EXCMASK, EXC_VCEI, "Virtual coherency exception on intruction fetch" }, + { CAUSE_EXCMASK, EXC_FPE, "Fp exception" }, + { CAUSE_EXCMASK, EXC_WATCH, "Watchpoint" }, + { CAUSE_EXCMASK, EXC_VCED, "Virtual coherency exception on data reference" }, + { 0, 0, "" }, }; struct crashdescription g_CrashSrDescriptions[] = { diff --git a/src/lib/lib_24e40.c b/src/lib/lib_24e40.c index 8365cd362..dbdd2e1bc 100644 --- a/src/lib/lib_24e40.c +++ b/src/lib/lib_24e40.c @@ -627,20 +627,20 @@ void func00025928(struct tile *tile, struct coord *arg1) s32 sp20[3]; sp38[0] = tile0->vertices[1][0] - tile0->vertices[0][0]; - sp38[1] = tile0->vertices[1][1] - tile0->vertices[0][1]; - sp38[2] = tile0->vertices[1][2] - tile0->vertices[0][2]; + sp38[1] = tile0->vertices[1][1] - tile0->vertices[0][1]; + sp38[2] = tile0->vertices[1][2] - tile0->vertices[0][2]; - sp2c[0] = tile0->vertices[2][0] - tile0->vertices[0][0]; - sp2c[1] = tile0->vertices[2][1] - tile0->vertices[0][1]; - sp2c[2] = tile0->vertices[2][2] - tile0->vertices[0][2]; + sp2c[0] = tile0->vertices[2][0] - tile0->vertices[0][0]; + sp2c[1] = tile0->vertices[2][1] - tile0->vertices[0][1]; + sp2c[2] = tile0->vertices[2][2] - tile0->vertices[0][2]; - sp20[0] = sp38[1] * sp2c[2] - sp38[2] * sp2c[1]; - sp20[1] = sp38[2] * sp2c[0] - sp38[0] * sp2c[2]; - sp20[2] = sp38[0] * sp2c[1] - sp38[1] * sp2c[0]; + sp20[0] = sp38[1] * sp2c[2] - sp38[2] * sp2c[1]; + sp20[1] = sp38[2] * sp2c[0] - sp38[0] * sp2c[2]; + sp20[2] = sp38[0] * sp2c[1] - sp38[1] * sp2c[0]; - arg1->x = sp20[0]; - arg1->y = sp20[1]; - arg1->z = sp20[2]; + arg1->x = sp20[0]; + arg1->y = sp20[1]; + arg1->z = sp20[2]; } else if (tile->type == TILETYPE_01) { struct tiletype1 *tile1 = (struct tiletype1 *) tile; f32 sp10[3]; diff --git a/src/lib/lib_30ce0.c b/src/lib/lib_30ce0.c index 327c21d5c..564b97bfe 100644 --- a/src/lib/lib_30ce0.c +++ b/src/lib/lib_30ce0.c @@ -497,8 +497,8 @@ ALParam *__allocParam() void __freeParam(ALParam *param) { - param->next = n_syn->drvr.paramList; - n_syn->drvr.paramList = param; + param->next = n_syn->drvr.paramList; + n_syn->drvr.paramList = param; } void _collectPVoices(void) diff --git a/src/lib/reset.c b/src/lib/reset.c index 4ac2b63d6..0082e8dc7 100644 --- a/src/lib/reset.c +++ b/src/lib/reset.c @@ -66,7 +66,7 @@ void resetproc(void *data) osViBlack(1); // Wait about 0.048 seconds - prenmitime = osGetTime(); + prenmitime = osGetTime(); while (osGetTime() < prenmitime + OS_NSEC_TO_CYCLES(48484848)) { // empty diff --git a/src/lib/sched.c b/src/lib/sched.c index c90023ec5..150b82d2a 100644 --- a/src/lib/sched.c +++ b/src/lib/sched.c @@ -210,9 +210,9 @@ OSMesgQueue *osScGetCmdQ(OSSched *sc) void __scMain(void *arg) { - OSMesg msg = 0; - OSSched *sc = (OSSched *)arg; - int done = 0; + OSMesg msg = 0; + OSSched *sc = (OSSched *)arg; + int done = 0; bbufResetBuffers(); diff --git a/src/lib/ultra/audio/cseq.c b/src/lib/ultra/audio/cseq.c index 83e0ad31d..1cbdb1b91 100644 --- a/src/lib/ultra/audio/cseq.c +++ b/src/lib/ultra/audio/cseq.c @@ -385,65 +385,67 @@ glabel func00039718 u8 __getTrackByte(ALCSeq *seq, u32 track) { - u8 theByte; + u8 theByte; - if (seq->curBULen[track]) { - theByte = *seq->curBUPtr[track]; - seq->curBUPtr[track]++; - seq->curBULen[track]--; - } else /* need to handle backup mode */ { - theByte = *seq->curLoc[track]; - seq->curLoc[track]++; + if (seq->curBULen[track]) { + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } else /* need to handle backup mode */ { + theByte = *seq->curLoc[track]; + seq->curLoc[track]++; - if (theByte == AL_CMIDI_BLOCK_CODE) { - u8 loBackUp, hiBackUp, theLen, nextByte; - u32 backup; + if (theByte == AL_CMIDI_BLOCK_CODE) { + u8 loBackUp, hiBackUp, theLen, nextByte; + u32 backup; - nextByte = *seq->curLoc[track]; - seq->curLoc[track]++; + nextByte = *seq->curLoc[track]; + seq->curLoc[track]++; - if (nextByte != AL_CMIDI_BLOCK_CODE) { - /* if here, then got a backup section. get the amount of - backup, and the len of the section. Subtract the amount of - backup from the curLoc ptr, and subtract four more, since - curLoc has been advanced by four while reading the codes. */ - hiBackUp = nextByte; - loBackUp = *seq->curLoc[track]; - seq->curLoc[track]++; - theLen = *seq->curLoc[track]; - seq->curLoc[track]++; - backup = (u32)hiBackUp; - backup = backup << 8; - backup += loBackUp; - seq->curBUPtr[track] = seq->curLoc[track] - (backup + 4); - seq->curBULen[track] = (u32)theLen; + if (nextByte != AL_CMIDI_BLOCK_CODE) { + /** + * if here, then got a backup section. get the amount of + * backup, and the len of the section. Subtract the amount of + * backup from the curLoc ptr, and subtract four more, since + * curLoc has been advanced by four while reading the codes. + */ + hiBackUp = nextByte; + loBackUp = *seq->curLoc[track]; + seq->curLoc[track]++; + theLen = *seq->curLoc[track]; + seq->curLoc[track]++; + backup = (u32)hiBackUp; + backup = backup << 8; + backup += loBackUp; + seq->curBUPtr[track] = seq->curLoc[track] - (backup + 4); + seq->curBULen[track] = (u32)theLen; - /* now get the byte */ - theByte = *seq->curBUPtr[track]; - seq->curBUPtr[track]++; - seq->curBULen[track]--; - } - } - } + /* now get the byte */ + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } + } + } - return theByte; + return theByte; } u32 __readVarLen(ALCSeq *seq, u32 track) { - u32 value; - u32 c; + u32 value; + u32 c; - value = (u32)__getTrackByte(seq, track); + value = (u32)__getTrackByte(seq, track); - if (value & 0x80) { - value &= 0x7f; + if (value & 0x80) { + value &= 0x7f; - do { - c = (u32)__getTrackByte(seq, track); - value = (value << 7) + (c & 0x7f); - } while (c & 0x80); - } + do { + c = (u32)__getTrackByte(seq, track); + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } - return value; + return value; } diff --git a/src/lib/ultra/gu/ortho.c b/src/lib/ultra/gu/ortho.c index a41ce91a7..5f69807ef 100644 --- a/src/lib/ultra/gu/ortho.c +++ b/src/lib/ultra/gu/ortho.c @@ -15,7 +15,7 @@ void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float mf[3][3] = 1; for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { + for (j = 0; j < 4; j++) { mf[i][j] *= scale; } } diff --git a/src/lib/ultra/io/dpsetstat.c b/src/lib/ultra/io/dpsetstat.c index fea9905e6..2fd495208 100644 --- a/src/lib/ultra/io/dpsetstat.c +++ b/src/lib/ultra/io/dpsetstat.c @@ -3,5 +3,5 @@ void osDpSetStatus(u32 data) { - IO_WRITE(DPC_STATUS_REG, data); + IO_WRITE(DPC_STATUS_REG, data); } diff --git a/src/lib/ultra/io/epirawdma.c b/src/lib/ultra/io/epirawdma.c index d8e7851e4..ec7d0b8ea 100644 --- a/src/lib/ultra/io/epirawdma.c +++ b/src/lib/ultra/io/epirawdma.c @@ -5,8 +5,8 @@ s32 osEPiRawStartDma(OSPiHandle *handle, s32 direction, u32 devAddr, void *dramA { u32 stat = IO_READ(PI_STATUS_REG); - while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { - stat = IO_READ(PI_STATUS_REG); + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { + stat = IO_READ(PI_STATUS_REG); } if (handle->type != __osCurrentHandle[handle->domain]->type) { @@ -28,7 +28,7 @@ s32 osEPiRawStartDma(OSPiHandle *handle, s32 direction, u32 devAddr, void *dramA if (cHandle->pulse != handle->pulse) { IO_WRITE(PI_BSD_DOM1_PWD_REG, handle->pulse); } - } else { + } else { if (cHandle->latency != handle->latency) { IO_WRITE(PI_BSD_DOM2_LAT_REG, handle->latency); } diff --git a/src/lib/ultra/io/epirawread.c b/src/lib/ultra/io/epirawread.c index fe78015bc..0d1e645a0 100644 --- a/src/lib/ultra/io/epirawread.c +++ b/src/lib/ultra/io/epirawread.c @@ -5,14 +5,14 @@ s32 osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data) { u32 stat = IO_READ(PI_STATUS_REG); - while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { - stat = IO_READ(PI_STATUS_REG); + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { + stat = IO_READ(PI_STATUS_REG); } - if (__osCurrentHandle[handle->domain]->type != handle->type) { - OSPiHandle *cHandle = __osCurrentHandle[handle->domain]; + if (__osCurrentHandle[handle->domain]->type != handle->type) { + OSPiHandle *cHandle = __osCurrentHandle[handle->domain]; - if (handle->domain == PI_DOMAIN1) { + if (handle->domain == PI_DOMAIN1) { if (cHandle->latency != handle->latency) { IO_WRITE(PI_BSD_DOM1_LAT_REG, handle->latency); } @@ -28,7 +28,7 @@ s32 osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data) if (cHandle->pulse != handle->pulse) { IO_WRITE(PI_BSD_DOM1_PWD_REG, handle->pulse); } - } else { + } else { if (cHandle->latency != handle->latency) { IO_WRITE(PI_BSD_DOM2_LAT_REG, handle->latency); } @@ -44,7 +44,7 @@ s32 osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data) if (cHandle->pulse != handle->pulse) { IO_WRITE(PI_BSD_DOM2_PWD_REG, handle->pulse); } - } + } cHandle->type = handle->type; cHandle->latency = handle->latency; diff --git a/src/lib/ultra/io/epirawwrite.c b/src/lib/ultra/io/epirawwrite.c index f3c765454..1f46ec449 100644 --- a/src/lib/ultra/io/epirawwrite.c +++ b/src/lib/ultra/io/epirawwrite.c @@ -5,14 +5,14 @@ s32 osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data) { u32 stat = IO_READ(PI_STATUS_REG); - while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { - stat = IO_READ(PI_STATUS_REG); + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) { + stat = IO_READ(PI_STATUS_REG); } - if (__osCurrentHandle[handle->domain]->type != handle->type) { - OSPiHandle *cHandle = __osCurrentHandle[handle->domain]; + if (__osCurrentHandle[handle->domain]->type != handle->type) { + OSPiHandle *cHandle = __osCurrentHandle[handle->domain]; - if (handle->domain == PI_DOMAIN1) { + if (handle->domain == PI_DOMAIN1) { if (cHandle->latency != handle->latency) { IO_WRITE(PI_BSD_DOM1_LAT_REG, handle->latency); } @@ -28,7 +28,7 @@ s32 osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data) if (cHandle->pulse != handle->pulse) { IO_WRITE(PI_BSD_DOM1_PWD_REG, handle->pulse); } - } else { + } else { if (cHandle->latency != handle->latency) { IO_WRITE(PI_BSD_DOM2_LAT_REG, handle->latency); } @@ -44,7 +44,7 @@ s32 osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data) if (cHandle->pulse != handle->pulse) { IO_WRITE(PI_BSD_DOM2_PWD_REG, handle->pulse); } - } + } cHandle->type = handle->type; cHandle->latency = handle->latency; diff --git a/src/lib/ultra/io/pfsgetstatus.c b/src/lib/ultra/io/pfsgetstatus.c index 3188eb3b4..95deef075 100644 --- a/src/lib/ultra/io/pfsgetstatus.c +++ b/src/lib/ultra/io/pfsgetstatus.c @@ -70,8 +70,8 @@ void __osPfsGetOneChannelData(int channel, OSContStatus *data) ptr = (u8*)&__osPfsPifRam; - for (i = 0; i < channel; i++) { - ptr++; + for (i = 0; i < channel; i++) { + ptr++; } requestformat = *(__OSContRequestFormatShort *)ptr; diff --git a/src/lib/ultra/io/sirawwrite.c b/src/lib/ultra/io/sirawwrite.c index da0f823d5..492e01ef0 100644 --- a/src/lib/ultra/io/sirawwrite.c +++ b/src/lib/ultra/io/sirawwrite.c @@ -3,11 +3,11 @@ s32 __osSiRawWriteIo(u32 devAddr, u32 data) { - if (__osSiDeviceBusy()) { - return -1; + if (__osSiDeviceBusy()) { + return -1; } - IO_WRITE(devAddr, data); + IO_WRITE(devAddr, data); - return 0; + return 0; } diff --git a/src/lib/ultra/io/vigetcurrframebuf.c b/src/lib/ultra/io/vigetcurrframebuf.c index 51386ea5d..0a0c2f733 100644 --- a/src/lib/ultra/io/vigetcurrframebuf.c +++ b/src/lib/ultra/io/vigetcurrframebuf.c @@ -3,14 +3,14 @@ void *osViGetCurrentFramebuffer(void) { - register u32 saveMask; - void *framep; + register u32 saveMask; + void *framep; - saveMask = __osDisableInt(); + saveMask = __osDisableInt(); - framep = __osViCurr->framep; + framep = __osViCurr->framep; - __osRestoreInt(saveMask); + __osRestoreInt(saveMask); - return framep; + return framep; } diff --git a/src/lib/ultra/io/vigetnextframebuf.c b/src/lib/ultra/io/vigetnextframebuf.c index 576c8ebb1..e16ea5e02 100644 --- a/src/lib/ultra/io/vigetnextframebuf.c +++ b/src/lib/ultra/io/vigetnextframebuf.c @@ -3,14 +3,14 @@ void *osViGetNextFramebuffer(void) { - register u32 saveMask; - void *framep; + register u32 saveMask; + void *framep; - saveMask = __osDisableInt(); + saveMask = __osDisableInt(); - framep = __osViNext->framep; + framep = __osViNext->framep; - __osRestoreInt(saveMask); + __osRestoreInt(saveMask); - return framep; + return framep; } diff --git a/src/lib/ultra/libc/sprintf.c b/src/lib/ultra/libc/sprintf.c index 8b25f3744..31340f738 100644 --- a/src/lib/ultra/libc/sprintf.c +++ b/src/lib/ultra/libc/sprintf.c @@ -2,7 +2,7 @@ char *proutSprintf(char *dst, const char *src, size_t count) { - return (char *)memcpy((u8 *)dst, (u8 *)src, count) + count; + return (char *)memcpy((u8 *)dst, (u8 *)src, count) + count; } GLOBAL_ASM(