From dfe7f126bd7936e5a285e2e9df433ac83292b390 Mon Sep 17 00:00:00 2001 From: Lowly Worm Date: Fri, 24 Mar 2023 15:51:57 -0400 Subject: [PATCH 1/3] Update sm_ad.c --- src/sm_ad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sm_ad.c b/src/sm_ad.c index cce72d2..5f316db 100644 --- a/src/sm_ad.c +++ b/src/sm_ad.c @@ -264,7 +264,7 @@ void MotherBrain_CalcHdma_Down_DownRight(void) { // 0xADE216 if (__CFADD__uint16(R20_, R24_)) v7 = -1; R24_ = v7; - uint16 v8 = R26_ | v7 & 0xFF00; + int16 v8 = R26_ | v7 & 0xFF00; if (v8 == -1) v8 = 255; *dst++ = v8; @@ -459,4 +459,4 @@ void HandleMotherBrainBodyFlickering(void) { // 0xADF41C *(uint16 *)®_TM &= ~2u; v0->properties |= kEnemyProps_Invisible; } -} \ No newline at end of file +} From 7453bb717579203d0a9b0e9db5b6e4d0c1c20b56 Mon Sep 17 00:00:00 2001 From: Lowly Worm Date: Fri, 24 Mar 2023 15:53:22 -0400 Subject: [PATCH 2/3] Update sm_8f.c --- src/sm_8f.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sm_8f.c b/src/sm_8f.c index 32e6551..9f7ddc1 100644 --- a/src/sm_8f.c +++ b/src/sm_8f.c @@ -515,8 +515,8 @@ void DoorCode_SetupElevatubeFromSouth(void) { // 0x8FE26C void DoorCode_SetupElevatubeFromNorth(void) { // 0x8FE291 *(uint16 *)&room_main_asm_variables[4] = 256; - strcpy((uint8 *)&room_main_asm_variables[2], "@"); - strcpy((uint8 *)&room_main_asm_variables[6], " "); + strcpy((char *)&room_main_asm_variables[2], "@"); + strcpy((char *)&room_main_asm_variables[6], " "); CallSomeSamusCode(0); SpawnHardcodedPlm(&unk_8FE2B1); } @@ -637,8 +637,8 @@ void DoorCode_CeresElevatorShaft(void) { // 0x8FE4E0 reg_M7X = 128; reg_M7Y = 1008; irq_enable_mode7 = 1; - strcpy((uint8 *)room_main_asm_variables, "\""); - strcpy((uint8 *)&room_main_asm_variables[2], "<"); + strcpy((char *)room_main_asm_variables, "\""); + strcpy((char *)&room_main_asm_variables[2], "<"); } void DoorCode_CeresElevatorShaft_2(void) { // 0x8FE513 @@ -659,7 +659,7 @@ static const uint16 kRoomCode_SpawnCeresFallingDebris_Tab[16] = { // 0x8FE525 void RoomCode_SpawnCeresFallingDebris(void) { if (ceres_status && (-- * (uint16 *)room_main_asm_variables, *(int16 *)room_main_asm_variables < 0)) { - strcpy((uint8 *)room_main_asm_variables, "\b"); + strcpy((char *)room_main_asm_variables, "\b"); uint16 v0 = addr_stru_869734; if (random_number & 0x8000) v0 = addr_stru_869742; @@ -684,7 +684,7 @@ void RoomCode_ShakeScreenHorizDiag(void) { // 0x8FE57C earthquake_type = v0; } } else if (NextRandom() < 0x200u) { - strcpy((uint8 *)room_main_asm_variables, "*"); + strcpy((char *)room_main_asm_variables, "*"); v0 = 23; goto LABEL_6; } @@ -701,7 +701,7 @@ void RoomCode_ShakeScreenHorizDiagStrong(void) { // 0x8FE5A4 *(uint16 *)&room_main_asm_variables[2] = v0; } } else if (NextRandom() < 0x180u) { - strcpy((uint8 *)room_main_asm_variables, "*"); + strcpy((char *)room_main_asm_variables, "*"); v0 = 26; goto LABEL_6; } @@ -991,4 +991,4 @@ void RoomCode_RidleyRoomShaking(void) { // 0x8FE950 reg_BG1VOFS += kRoomCode_RidleyRoomShaking_Y[v1]; reg_BG2VOFS += kRoomCode_RidleyRoomShaking_Y[v1]; } -} \ No newline at end of file +} From 7d5c126d0cdc70e266be9ce44834d6efcb5c5f7c Mon Sep 17 00:00:00 2001 From: Lowly Worm Date: Fri, 24 Mar 2023 16:08:34 -0400 Subject: [PATCH 3/3] Update sm_ad.c --- src/sm_ad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sm_ad.c b/src/sm_ad.c index 5f316db..9857ce3 100644 --- a/src/sm_ad.c +++ b/src/sm_ad.c @@ -264,8 +264,8 @@ void MotherBrain_CalcHdma_Down_DownRight(void) { // 0xADE216 if (__CFADD__uint16(R20_, R24_)) v7 = -1; R24_ = v7; - int16 v8 = R26_ | v7 & 0xFF00; - if (v8 == -1) + uint16 v8 = R26_ | v7 & 0xFF00; + if (v8 == 0xFFFF) v8 = 255; *dst++ = v8; ++mbn_var_3D;