@@ -243,7 +243,7 @@ int32_t getTotalItems()
243
243
return Counter;
244
244
}
245
245
246
- int32_t * getUpperAndLowerBounds (int32_t *tempArray , uint32_t currentMenu)
246
+ void getUpperAndLowerBounds (int32_t arrayOut[ 2 ] , uint32_t currentMenu)
247
247
{
248
248
uint32_t tempMenuSelectedOption = MenuSelectedOption;
249
249
uint32_t tempSelectedOption = SelectedOption;
@@ -595,12 +595,11 @@ int32_t *getUpperAndLowerBounds(int32_t *tempArray, uint32_t currentMenu)
595
595
}
596
596
}
597
597
598
- tempArray[0 ] = LowerBound;
599
- tempArray[1 ] = UpperBound;
600
- return tempArray;
598
+ arrayOut[0 ] = LowerBound;
599
+ arrayOut[1 ] = UpperBound;
601
600
}
602
601
603
- uint32_t *getPouchAddressAndSize (uint32_t * tempArray)
602
+ uint32_t *getPouchAddressAndSize (uint32_t tempArray[ 2 ] )
604
603
{
605
604
uint32_t tempAddressOffset;
606
605
uint32_t tempSize;
@@ -753,9 +752,10 @@ void correctInventoryCurrentMenuOptionAndPage(uint32_t maxOptionsPerPage)
753
752
uint32_t getHighestAdjustableValueDigit (uint32_t currentMenu)
754
753
{
755
754
int32_t UpperAndLowerBounds[2 ];
756
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
757
- int32_t LowerBound = tempArray[0 ];
758
- int32_t UpperBound = tempArray[1 ];
755
+ getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
756
+
757
+ int32_t LowerBound = UpperAndLowerBounds[0 ];
758
+ int32_t UpperBound = UpperAndLowerBounds[1 ];
759
759
760
760
// Make sure each value is positive
761
761
if (LowerBound < 0 )
@@ -812,18 +812,18 @@ int32_t getDigitBeingChanged(int32_t number, int32_t valueChangedBy)
812
812
void setAdjustableValueToMax (uint32_t currentMenu)
813
813
{
814
814
int32_t UpperAndLowerBounds[2 ];
815
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
816
- int32_t UpperBound = tempArray[1 ];
815
+ getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
817
816
817
+ int32_t UpperBound = UpperAndLowerBounds[1 ];
818
818
MenuSecondaryValue = UpperBound;
819
819
}
820
820
821
821
void setAdjustableValueToMin (uint32_t currentMenu)
822
822
{
823
823
int32_t UpperAndLowerBounds[2 ];
824
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
825
- int32_t LowerBound = tempArray[0 ];
824
+ getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
826
825
826
+ int32_t LowerBound = UpperAndLowerBounds[0 ];
827
827
MenuSecondaryValue = LowerBound;
828
828
}
829
829
@@ -1295,9 +1295,9 @@ uint32_t addByIconButtonControls(uint32_t currentMenu)
1295
1295
case DPADUP:
1296
1296
{
1297
1297
int32_t UpperAndLowerBounds[2 ];
1298
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
1299
- int32_t LowerBound = tempArray [0 ];
1300
- int32_t UpperBound = tempArray [1 ];
1298
+ getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
1299
+ int32_t LowerBound = UpperAndLowerBounds [0 ];
1300
+ int32_t UpperBound = UpperAndLowerBounds [1 ];
1301
1301
1302
1302
uint32_t MaxOptionsPerRow = 16 ;
1303
1303
uint32_t tempTotalMenuOptions = UpperBound - LowerBound + 1 ;
@@ -1924,9 +1924,10 @@ void adjustMenuItemBounds(int32_t valueChangedBy, uint32_t currentMenu)
1924
1924
}
1925
1925
1926
1926
int32_t UpperAndLowerBounds[2 ];
1927
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
1928
- int32_t LowerBound = tempArray[0 ];
1929
- int32_t UpperBound = tempArray[1 ];
1927
+ getUpperAndLowerBounds (UpperAndLowerBounds, currentMenu);
1928
+
1929
+ int32_t LowerBound = UpperAndLowerBounds[0 ];
1930
+ int32_t UpperBound = UpperAndLowerBounds[1 ];
1930
1931
1931
1932
adjustMenuItemBoundsMain (valueChangedBy, LowerBound, UpperBound);
1932
1933
}
@@ -2454,8 +2455,9 @@ void setAddByIdValue(void *address)
2454
2455
void setAddByIconValue (void *address)
2455
2456
{
2456
2457
int32_t UpperAndLowerBounds[2 ];
2457
- int32_t *tempArray = getUpperAndLowerBounds (UpperAndLowerBounds, MenuSelectedOption);
2458
- int32_t LowerBound = tempArray[0 ];
2458
+ getUpperAndLowerBounds (UpperAndLowerBounds, MenuSelectedOption);
2459
+
2460
+ int32_t LowerBound = UpperAndLowerBounds[0 ];
2459
2461
uint32_t tempSecondaryMenuOption = SecondaryMenuOption;
2460
2462
int32_t NewItem = LowerBound + tempSecondaryMenuOption;
2461
2463
@@ -2916,7 +2918,7 @@ int32_t getMapIndex()
2916
2918
return -1 ;
2917
2919
}
2918
2920
2919
- /* uint8_t * getButtonsPressedDynamic(uint8_t *buttonArray , uint16_t currentButtonCombo)
2921
+ /* void getButtonsPressedDynamic(uint8_t *buttonArrayOut , uint16_t currentButtonCombo)
2920
2922
{
2921
2923
uint32_t Counter = 0;
2922
2924
uint32_t Size = 1;
@@ -2931,10 +2933,10 @@ int32_t getMapIndex()
2931
2933
2932
2934
if (currentButtonCombo & (1 << i))
2933
2935
{
2934
- if (!buttonArray )
2936
+ if (!buttonArrayOut )
2935
2937
{
2936
- buttonArray = new uint8_t[2]; // Extra spot for a 0 at the end of the array
2937
- clearMemory(buttonArray , (2 * sizeof(uint8_t)));
2938
+ buttonArrayOut = new uint8_t[2]; // Extra spot for a 0 at the end of the array
2939
+ clearMemory(buttonArrayOut , (2 * sizeof(uint8_t)));
2938
2940
}
2939
2941
else
2940
2942
{
@@ -2945,48 +2947,46 @@ int32_t getMapIndex()
2945
2947
clearMemory(tempButtonArray, ((Size + 1) * sizeof(uint8_t)));
2946
2948
2947
2949
// Copy the contents of the old array to the new array
2948
- ttyd::__mem::memcpy(tempButtonArray, buttonArray , ((Size - 1) * sizeof(uint8_t)));
2950
+ ttyd::__mem::memcpy(tempButtonArray, buttonArrayOut , ((Size - 1) * sizeof(uint8_t)));
2949
2951
2950
2952
// Delete the old array
2951
- delete[] (buttonArray );
2953
+ delete[] (buttonArrayOut );
2952
2954
2953
2955
// Set the new array as the current array
2954
- buttonArray = tempButtonArray;
2956
+ buttonArrayOut = tempButtonArray;
2955
2957
}
2956
2958
2957
- buttonArray [Size - 1] = Counter + 1;
2959
+ buttonArrayOut [Size - 1] = Counter + 1;
2958
2960
}
2959
2961
2960
2962
Counter++;
2961
2963
}
2962
2964
2963
- if (buttonArray )
2965
+ if (buttonArrayOut )
2964
2966
{
2965
- buttonArray [Size] = 0;
2967
+ buttonArrayOut [Size] = 0;
2966
2968
}
2967
2969
else
2968
2970
{
2969
- buttonArray = new uint8_t[1];
2970
- buttonArray [0] = 0;
2971
+ buttonArrayOut = new uint8_t[1];
2972
+ buttonArrayOut [0] = 0;
2971
2973
}
2972
-
2973
- return buttonArray;
2974
2974
}*/
2975
2975
2976
- /* uint8_t * getButtonsPressedDynamic(uint8_t *buttonArray , uint16_t currentButtonCombo)
2976
+ /* void getButtonsPressedDynamic(uint8_t *buttonArrayOut , uint16_t currentButtonCombo)
2977
2977
{
2978
- if (!buttonArray )
2978
+ if (!buttonArrayOut )
2979
2979
{
2980
- buttonArray = new uint8_t[14]; // Extra spot for a 0 at the end of the array
2980
+ buttonArrayOut = new uint8_t[14]; // Extra spot for a 0 at the end of the array
2981
2981
}
2982
2982
2983
2983
// Clear the memory, so that the previous results do not interfere with the new results
2984
- clearMemory(buttonArray , (14 * sizeof(uint8_t)));
2984
+ clearMemory(buttonArrayOut , (14 * sizeof(uint8_t)));
2985
2985
2986
- return getButtonsPressed(buttonArray , currentButtonCombo);
2986
+ getButtonsPressed(buttonArrayOut , currentButtonCombo);
2987
2987
}*/
2988
2988
2989
- uint8_t * getButtonsPressed (uint8_t *buttonArray , uint16_t currentButtonCombo)
2989
+ void getButtonsPressed (uint8_t *buttonArrayOut , uint16_t currentButtonCombo)
2990
2990
{
2991
2991
uint32_t Counter = 1 ;
2992
2992
uint32_t Size = 0 ;
@@ -3001,20 +3001,18 @@ uint8_t *getButtonsPressed(uint8_t *buttonArray, uint16_t currentButtonCombo)
3001
3001
3002
3002
if (currentButtonCombo & (1 << i))
3003
3003
{
3004
- buttonArray [Size] = Counter;
3004
+ buttonArrayOut [Size] = Counter;
3005
3005
Size++;
3006
3006
}
3007
3007
3008
3008
Counter++;
3009
3009
}
3010
-
3011
- return buttonArray;
3012
3010
}
3013
3011
3014
- char * createButtonStringArray (char *tempArray , uint8_t *buttonArray)
3012
+ void createButtonStringArray (char *stringOut , uint8_t *buttonArray)
3015
3013
{
3016
3014
char *tempDisplayBuffer = DisplayBuffer;
3017
- const char *Button = " " ;
3015
+ const char *Button;
3018
3016
uint32_t i = 0 ;
3019
3017
3020
3018
while (buttonArray[i] != 0 )
@@ -3083,28 +3081,28 @@ char *createButtonStringArray(char *tempArray, uint8_t *buttonArray)
3083
3081
}
3084
3082
default :
3085
3083
{
3084
+ Button = " " ;
3086
3085
break ;
3087
3086
}
3088
3087
}
3089
3088
3090
3089
if (i == 0 )
3091
3090
{
3092
3091
// Set the initial button pressed
3093
- ttyd::string::strcpy (tempArray , Button);
3092
+ ttyd::string::strcpy (stringOut , Button);
3094
3093
}
3095
3094
else
3096
3095
{
3097
3096
// Add the next button pressed onto the first button pressed
3098
3097
sprintf (tempDisplayBuffer,
3099
3098
" + %s" ,
3100
3099
Button);
3101
- ttyd::string::strcat (tempArray, tempDisplayBuffer);
3100
+
3101
+ ttyd::string::strcat (stringOut, tempDisplayBuffer);
3102
3102
}
3103
3103
3104
3104
i++;
3105
3105
}
3106
-
3107
- return tempArray;
3108
3106
}
3109
3107
3110
3108
bool incrementCheatsBButtonCounter (uint32_t buttonInput)
@@ -3398,9 +3396,10 @@ void adjustMenuSelectionInventory(uint32_t button)
3398
3396
/* void adjustAddByIconCurrentOption(uint32_t button)
3399
3397
{
3400
3398
int32_t UpperAndLowerBounds[2];
3401
- int32_t *tempArray = getUpperAndLowerBounds(UpperAndLowerBounds, MenuSelectedOption);
3402
- int32_t LowerBound = tempArray[0];
3403
- int32_t UpperBound = tempArray[1];
3399
+ getUpperAndLowerBounds(UpperAndLowerBounds, MenuSelectedOption);
3400
+
3401
+ int32_t LowerBound = UpperAndLowerBounds[0];
3402
+ int32_t UpperBound = UpperAndLowerBounds[1];
3404
3403
3405
3404
uint32_t MaxIconsPerRow = 16;
3406
3405
0 commit comments