From 6819bdb8015b154d97a84e6710b0f4e62b6cf93b Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 3 Jan 2021 00:05:30 +1000 Subject: [PATCH] Decompile radarSetYIndicatorsEnabled --- src/game/data/data_02da90.c | 2 +- src/game/radar.c | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/game/data/data_02da90.c b/src/game/data/data_02da90.c index e27b3dbd1..f29efb23f 100644 --- a/src/game/data/data_02da90.c +++ b/src/game/data/data_02da90.c @@ -84,7 +84,7 @@ struct mppreset g_MpPresets[NUM_MPPRESETS] = { }; u32 var80087cbc = 0x00000000; -u32 var80087cc0 = 0x00000001; +bool g_RadarYIndicatorsEnabled = true; // 2dce4 u32 g_TeamColours[] = { diff --git a/src/game/radar.c b/src/game/radar.c index 28d1a78a6..374d651ac 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -23,14 +23,12 @@ #include "lib/lib_4a360.h" #include "types.h" -extern u32 var80087cc0; +extern bool g_RadarYIndicatorsEnabled; -GLOBAL_ASM( -glabel func0f18e5a0 -/* f18e5a0: 3c018008 */ lui $at,%hi(var80087cc0) -/* f18e5a4: 03e00008 */ jr $ra -/* f18e5a8: ac247cc0 */ sw $a0,%lo(var80087cc0)($at) -); +void radarSetYIndicatorsEnabled(bool enable) +{ + g_RadarYIndicatorsEnabled = enable; +} Gfx *func0f18e5ac(Gfx *gdl, struct textureconfig *tconfig, s32 arg2, s32 arg3, s32 arg4) { @@ -139,7 +137,7 @@ Gfx *radarDrawDot(Gfx *gdl, struct prop *prop, struct coord *dist, u32 colour1, gDPFillRectangleScaled(gdl++, x - 2, y + 0, x + 1, y + 1); gDPFillRectangleScaled(gdl++, x - 1, y - 1, x + 0, y + 0); gdl = func0f153838(gdl); - } else if (var80087cc0 && dist->y > 250) { + } else if (g_RadarYIndicatorsEnabled && dist->y > 250) { // Up triangle gdl = gfxSetPrimColour(gdl, (0xff >> shiftamount) + colour1); gDPFillRectangleScaled(gdl++, x - 3, y - 1, x + 2, y + 2); @@ -150,7 +148,7 @@ Gfx *radarDrawDot(Gfx *gdl, struct prop *prop, struct coord *dist, u32 colour1, gDPFillRectangleScaled(gdl++, x - 2, y + 0, x + 1, y + 1); gDPFillRectangleScaled(gdl++, x - 1, y - 1, x + 0, y + 0); gdl = func0f153838(gdl); - } else if (var80087cc0 && dist->y < -250) { + } else if (g_RadarYIndicatorsEnabled && dist->y < -250) { // Down triangle gdl = gfxSetPrimColour(gdl, (0xff >> shiftamount) + colour1); gDPFillRectangleScaled(gdl++, x - 3, y - 2, x + 2, y + 1); @@ -185,7 +183,7 @@ Gfx *radarDrawDot(Gfx *gdl, struct prop *prop, struct coord *dist, u32 colour1, gDPFillRectangleScaled(gdl++, x - 2, y + 0, x + 1, y + 1); gDPFillRectangleScaled(gdl++, x - 1, y - 1, x + 0, y + 0); gdl = func0f153838(gdl); - } else if (var80087cc0 && dist->y > 250) { + } else if (g_RadarYIndicatorsEnabled && dist->y > 250) { // Up triangle gdl = gfxSetPrimColour(gdl, (0xff >> shiftamount) + colour2); gDPFillRectangleScaled(gdl++, x - 3, y - 1, x + 2, y + 2); @@ -196,7 +194,7 @@ Gfx *radarDrawDot(Gfx *gdl, struct prop *prop, struct coord *dist, u32 colour1, gDPFillRectangleScaled(gdl++, x - 2, y + 0, x + 1, y + 1); gDPFillRectangleScaled(gdl++, x - 1, y - 1, x + 0, y + 0); gdl = func0f153838(gdl); - } else if (var80087cc0 && dist->y < -250) { + } else if (g_RadarYIndicatorsEnabled && dist->y < -250) { // Down triangle gdl = gfxSetPrimColour(gdl, (0xff >> shiftamount) + colour2); gDPFillRectangleScaled(gdl++, x - 3, y - 2, x + 2, y + 1);