mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-21 17:57:59 +00:00
Removed unneeded function call param (band)
This commit is contained in:
parent
c3c344daec
commit
de174d072c
14
Makefile
14
Makefile
@ -4,7 +4,7 @@
|
||||
# 1 = enable
|
||||
#
|
||||
ENABLE_SWD := 0
|
||||
ENABLE_OVERLAY := 1
|
||||
ENABLE_OVERLAY := 0
|
||||
ENABLE_LTO := 0
|
||||
ENABLE_UART := 1
|
||||
ENABLE_AIRCOPY := 0
|
||||
@ -12,6 +12,7 @@ ENABLE_FMRADIO := 1
|
||||
ENABLE_NOAA := 0
|
||||
ENABLE_VOICE := 0
|
||||
ENABLE_ALARM := 0
|
||||
#ENABLE_1750HZ := 0
|
||||
ENABLE_BIG_FREQ := 0
|
||||
ENABLE_SMALL_BOLD := 1
|
||||
ENABLE_KEEP_MEM_NAME := 1
|
||||
@ -28,10 +29,10 @@ ENABLE_AM_FIX := 1
|
||||
ENABLE_AM_FIX_SHOW_DATA := 1
|
||||
ENABLE_SQUELCH_LOWER := 1
|
||||
ENABLE_RSSI_BAR := 1
|
||||
ENABLE_AUDIO_BAR := 1
|
||||
#ENABLE_COPY_CHAN_TO_VFO := 1
|
||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||
#ENABLE_BAND_SCOPE := 1
|
||||
ENABLE_AUDIO_BAR := 0
|
||||
#ENABLE_COPY_CHAN_TO_VFO := 1
|
||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||
#ENABLE_BAND_SCOPE := 1
|
||||
|
||||
#############################################################
|
||||
|
||||
@ -197,6 +198,9 @@ endif
|
||||
ifeq ($(ENABLE_ALARM),1)
|
||||
CFLAGS += -DENABLE_ALARM
|
||||
endif
|
||||
ifeq ($(ENABLE_1750HZ),1)
|
||||
CFLAGS += -DENABLE_1750HZ
|
||||
endif
|
||||
ifeq ($(ENABLE_KEEP_MEM_NAME),1)
|
||||
CFLAGS += -DKEEP_MEM_NAME
|
||||
endif
|
||||
|
@ -33,6 +33,7 @@ ENABLE_FMRADIO := 1 WBFM VHF band 2 RX
|
||||
ENABLE_NOAA := 0 everything NOAA
|
||||
ENABLE_VOICE := 0 want to hear voices ?
|
||||
ENABLE_ALARM := 0 TX alarms
|
||||
#ENABLE_1750HZ := 0 not not implemented .. side key 1750Hz TX tone
|
||||
ENABLE_BIG_FREQ := 0 big font frequencies
|
||||
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
|
||||
ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel
|
||||
|
@ -2181,9 +2181,6 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
if (gF_LOCK && (Key == KEY_PTT || Key == KEY_SIDE2 || Key == KEY_SIDE1))
|
||||
return;
|
||||
|
||||
if (!bFlag)
|
||||
{
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
|
@ -224,7 +224,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
|
||||
case 2:
|
||||
if (!gScanSingleFrequency)
|
||||
{
|
||||
RADIO_InitInfo(gTxVfo, gTxVfo->CHANNEL_SAVE, FREQUENCY_GetBand(gScanFrequency), gScanFrequency);
|
||||
RADIO_InitInfo(gTxVfo, gTxVfo->CHANNEL_SAVE, gScanFrequency);
|
||||
|
||||
if (gScanUseCssResult)
|
||||
{
|
||||
@ -367,7 +367,7 @@ void SCANNER_Start(void)
|
||||
BackupStep = gRxVfo->STEP_SETTING;
|
||||
BackupFrequency = gRxVfo->StepFrequency;
|
||||
|
||||
RADIO_InitInfo(gRxVfo, gRxVfo->CHANNEL_SAVE, gRxVfo->Band, gRxVfo->pRX->Frequency);
|
||||
RADIO_InitInfo(gRxVfo, gRxVfo->CHANNEL_SAVE, gRxVfo->pRX->Frequency);
|
||||
|
||||
gRxVfo->STEP_SETTING = BackupStep;
|
||||
gRxVfo->StepFrequency = BackupFrequency;
|
||||
|
@ -324,7 +324,7 @@ const uint8_t BITMAP_AntennaLevel6[3] =
|
||||
0b00000000
|
||||
};
|
||||
|
||||
const uint8_t BITMAP_CurrentIndicator[8] =
|
||||
const uint8_t BITMAP_MARKER[8] =
|
||||
{
|
||||
0b11111111,
|
||||
0b11111111,
|
||||
|
@ -52,7 +52,7 @@ extern const uint8_t BITMAP_AntennaLevel4[3];
|
||||
extern const uint8_t BITMAP_AntennaLevel5[3];
|
||||
extern const uint8_t BITMAP_AntennaLevel6[3];
|
||||
|
||||
extern const uint8_t BITMAP_CurrentIndicator[8];
|
||||
extern const uint8_t BITMAP_MARKER[8];
|
||||
|
||||
extern const uint8_t BITMAP_VFO_Default[8];
|
||||
extern const uint8_t BITMAP_VFO_NotDefault[8];
|
||||
|
2
board.c
2
board.c
@ -861,7 +861,7 @@ void BOARD_FactoryReset(bool bIsAll)
|
||||
|
||||
if (bIsAll)
|
||||
{
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, BAND6_400MHz, 43350000);
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, 43350000);
|
||||
|
||||
// set the first few memory channels
|
||||
for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++)
|
||||
|
@ -29,12 +29,14 @@ KEY_Code_t KEYBOARD_Poll(void)
|
||||
{
|
||||
KEY_Code_t Key = KEY_INVALID;
|
||||
|
||||
// if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||
// return KEY_PTT;
|
||||
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_7);
|
||||
|
||||
SYSTICK_DelayUs(1);
|
||||
SYSTICK_DelayUs(2);
|
||||
|
||||
// *****************
|
||||
// Keys connected to gnd
|
||||
@ -51,13 +53,11 @@ KEY_Code_t KEYBOARD_Poll(void)
|
||||
goto Bye;
|
||||
}
|
||||
|
||||
// Original doesn't do PTT
|
||||
|
||||
// *****************
|
||||
// First row
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
|
||||
SYSTICK_DelayUs(1);
|
||||
SYSTICK_DelayUs(2);
|
||||
|
||||
if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
|
||||
{
|
||||
@ -87,10 +87,8 @@ KEY_Code_t KEYBOARD_Poll(void)
|
||||
// Second row
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
|
||||
SYSTICK_DelayUs(1);
|
||||
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
|
||||
SYSTICK_DelayUs(1);
|
||||
SYSTICK_DelayUs(2);
|
||||
|
||||
if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
|
||||
{
|
||||
@ -120,16 +118,10 @@ KEY_Code_t KEYBOARD_Poll(void)
|
||||
// Third row
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
|
||||
SYSTICK_DelayUs(1);
|
||||
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
|
||||
SYSTICK_DelayUs(1);
|
||||
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
|
||||
SYSTICK_DelayUs(1);
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
|
||||
SYSTICK_DelayUs(1);
|
||||
SYSTICK_DelayUs(2);
|
||||
|
||||
if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
|
||||
{
|
||||
@ -159,10 +151,8 @@ KEY_Code_t KEYBOARD_Poll(void)
|
||||
// Fourth row
|
||||
|
||||
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_7);
|
||||
SYSTICK_DelayUs(1);
|
||||
|
||||
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
|
||||
SYSTICK_DelayUs(1);
|
||||
SYSTICK_DelayUs(2);
|
||||
|
||||
if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
|
||||
{
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -48,8 +48,8 @@ BOOT_Mode_t BOOT_GetMode(void)
|
||||
|
||||
if (Keys[0] == Keys[1])
|
||||
{
|
||||
gKeyReading0 = Keys[0];
|
||||
gKeyReading1 = Keys[0];
|
||||
gKeyReading0 = Keys[0];
|
||||
gKeyReading1 = Keys[0];
|
||||
|
||||
gDebounceCounter = 2;
|
||||
|
||||
@ -69,18 +69,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
{
|
||||
if (Mode == BOOT_MODE_F_LOCK)
|
||||
{
|
||||
/* // enable all the menu items
|
||||
gMenuListCount = 0;
|
||||
// while (MenuList[gMenuListCount].name != NULL)
|
||||
while (MenuList[gMenuListCount].name[0] != '\0')
|
||||
gMenuListCount++;
|
||||
|
||||
gMenuCursor = MENU_350TX;
|
||||
gSubMenuSelection = gSetting_350TX;
|
||||
*/
|
||||
GUI_SelectNextDisplay(DISPLAY_MENU);
|
||||
|
||||
gF_LOCK = true;
|
||||
}
|
||||
#ifdef ENABLE_AIRCOPY
|
||||
else
|
||||
@ -91,15 +80,15 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
gEeprom.VOX_SWITCH = false;
|
||||
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
|
||||
gEeprom.AUTO_KEYPAD_LOCK = false;
|
||||
gEeprom.KEY_1_SHORT_PRESS_ACTION = 0;
|
||||
gEeprom.KEY_1_LONG_PRESS_ACTION = 0;
|
||||
gEeprom.KEY_2_SHORT_PRESS_ACTION = 0;
|
||||
gEeprom.KEY_2_LONG_PRESS_ACTION = 0;
|
||||
gEeprom.KEY_1_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_1_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
gEeprom.KEY_2_LONG_PRESS_ACTION = ACTION_OPT_NONE;
|
||||
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 5, 41002500);
|
||||
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 41002500);
|
||||
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW;
|
||||
gRxVfo->OUTPUT_POWER = 0;
|
||||
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_WIDE;
|
||||
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
|
||||
|
||||
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
|
||||
|
||||
@ -110,6 +99,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
||||
BK4819_ResetFSK();
|
||||
|
||||
gAircopyState = AIRCOPY_READY;
|
||||
|
||||
GUI_SelectNextDisplay(DISPLAY_AIRCOPY);
|
||||
}
|
||||
#endif
|
||||
|
3
main.c
3
main.c
@ -109,9 +109,8 @@ void Main(void)
|
||||
while (MenuList[gMenuListCount].name[0] != '\0')
|
||||
gMenuListCount++;
|
||||
|
||||
gMenuCursor = MENU_350TX;
|
||||
gSubMenuSelection = gSetting_350TX;
|
||||
gF_LOCK = true;
|
||||
gMenuCursor = MENU_350TX;
|
||||
}
|
||||
else
|
||||
{ // hide the hidden menu items
|
||||
|
2
misc.c
2
misc.c
@ -216,7 +216,7 @@ uint8_t gNeverUsed;
|
||||
#endif
|
||||
|
||||
bool gUpdateDisplay;
|
||||
bool gF_LOCK;
|
||||
|
||||
uint8_t gShowChPrefix;
|
||||
|
||||
volatile bool gNextTimeslice;
|
||||
|
1
misc.h
1
misc.h
@ -280,7 +280,6 @@ extern bool gUpdateDisplay;
|
||||
#ifdef ENABLE_FMRADIO
|
||||
extern uint8_t gFM_ChannelPosition;
|
||||
#endif
|
||||
extern bool gF_LOCK;
|
||||
extern uint8_t gShowChPrefix;
|
||||
extern volatile uint8_t gFoundCDCSSCountdown_10ms;
|
||||
extern volatile uint8_t gFoundCTCSSCountdown_10ms;
|
||||
|
33
radio.c
33
radio.c
@ -114,25 +114,24 @@ uint8_t RADIO_FindNextChannel(uint8_t Channel, int8_t Direction, bool bCheckScan
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32_t Frequency)
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency)
|
||||
{
|
||||
memset(pInfo, 0, sizeof(*pInfo));
|
||||
|
||||
pInfo->Band = Band;
|
||||
pInfo->SCANLIST1_PARTICIPATION = true;
|
||||
pInfo->SCANLIST2_PARTICIPATION = true;
|
||||
pInfo->STEP_SETTING = STEP_12_5kHz;
|
||||
pInfo->StepFrequency = 2500;
|
||||
pInfo->CHANNEL_SAVE = ChannelSave;
|
||||
pInfo->FrequencyReverse = false;
|
||||
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
|
||||
pInfo->freq_config_RX.Frequency = Frequency;
|
||||
pInfo->freq_config_TX.Frequency = Frequency;
|
||||
pInfo->pRX = &pInfo->freq_config_RX;
|
||||
pInfo->pTX = &pInfo->freq_config_TX;
|
||||
pInfo->TX_OFFSET_FREQUENCY = 1000000;
|
||||
pInfo->Band = FREQUENCY_GetBand(Frequency);
|
||||
pInfo->SCANLIST1_PARTICIPATION = true;
|
||||
pInfo->SCANLIST2_PARTICIPATION = true;
|
||||
pInfo->STEP_SETTING = STEP_12_5kHz;
|
||||
pInfo->StepFrequency = 2500;
|
||||
pInfo->CHANNEL_SAVE = ChannelSave;
|
||||
pInfo->FrequencyReverse = false;
|
||||
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
|
||||
pInfo->freq_config_RX.Frequency = Frequency;
|
||||
pInfo->freq_config_TX.Frequency = Frequency;
|
||||
pInfo->pRX = &pInfo->freq_config_RX;
|
||||
pInfo->pTX = &pInfo->freq_config_TX;
|
||||
#ifdef ENABLE_COMPANDER
|
||||
pInfo->Compander = 0; // off
|
||||
pInfo->Compander = 0; // off
|
||||
#endif
|
||||
|
||||
if (ChannelSave == (FREQ_CHANNEL_FIRST + BAND2_108MHz))
|
||||
@ -167,7 +166,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
|
||||
#ifdef ENABLE_NOAA
|
||||
if (Channel >= NOAA_CHANNEL_FIRST)
|
||||
{
|
||||
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);
|
||||
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);
|
||||
|
||||
if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF)
|
||||
return;
|
||||
@ -211,7 +210,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
|
||||
|
||||
Index = Channel - FREQ_CHANNEL_FIRST;
|
||||
|
||||
RADIO_InitInfo(pRadio, Channel, Index, LowerLimitFrequencyBandTable[Index]);
|
||||
RADIO_InitInfo(pRadio, Channel, LowerLimitFrequencyBandTable[Index]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
2
radio.h
2
radio.h
@ -159,7 +159,7 @@ extern VfoState_t VfoState[2];
|
||||
|
||||
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
|
||||
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t ChIndex, uint32_t Frequency);
|
||||
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
|
||||
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
|
||||
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
|
||||
void RADIO_ApplyOffset(VFO_Info_t *pInfo);
|
||||
|
@ -319,7 +319,7 @@ void UI_DisplayMain(void)
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
{
|
||||
const unsigned int rx_line = (gEeprom.RX_CHANNEL == 0) ? line0 : line1;
|
||||
const unsigned int tx_line = (gEeprom.TX_CHANNEL == 0) ? line0 : line1;
|
||||
// const unsigned int tx_line = (gEeprom.TX_CHANNEL == 0) ? line0 : line1;
|
||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||
uint8_t channel = gEeprom.TX_CHANNEL;
|
||||
const bool same_vfo = (channel == vfo_num) ? true : false;
|
||||
@ -483,7 +483,7 @@ void UI_DisplayMain(void)
|
||||
{
|
||||
const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"};
|
||||
if (state >= 0 && state < ARRAY_SIZE(state_list))
|
||||
UI_PrintString(state_list[state], 31, 0, tx_line, 8);
|
||||
UI_PrintString(state_list[state], 31, 0, line, 8);
|
||||
}
|
||||
else
|
||||
if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) && gEeprom.TX_CHANNEL == vfo_num)
|
||||
|
80
ui/menu.c
80
ui/menu.c
@ -352,7 +352,7 @@ void UI_DisplayMenu(void)
|
||||
|
||||
// draw the left menu list
|
||||
#if 0
|
||||
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
if (gMenuCursor > 0 || i > 0)
|
||||
if ((gMenuListCount - 1) != gMenuCursor || i != 2)
|
||||
@ -368,49 +368,69 @@ void UI_DisplayMenu(void)
|
||||
// draw vertical separating dotted line
|
||||
for (i = 0; i < 7; i++)
|
||||
gFrameBuffer[i][(8 * menu_list_width) + 1] = 0xAA;
|
||||
|
||||
// draw the little triangle marker if we're in the sub-menu
|
||||
if (gIsInSubMenu)
|
||||
memmove(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
|
||||
|
||||
// draw the menu index number/count
|
||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||
UI_PrintStringSmall(String, 2, 0, 6);
|
||||
|
||||
#else
|
||||
{
|
||||
const int menu_index = gMenuCursor; // current selected menu item
|
||||
i = 1;
|
||||
while (i < 2)
|
||||
{ // leading menu items
|
||||
const int k = menu_index + i - 2;
|
||||
if (k < 0)
|
||||
UI_PrintStringSmall(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
||||
else
|
||||
if (k >= 0 && k < (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, i);
|
||||
i++;
|
||||
}
|
||||
{ // current menu item
|
||||
|
||||
if (!gIsInSubMenu)
|
||||
{
|
||||
while (i < 2)
|
||||
{ // leading menu items
|
||||
const int k = menu_index + i - 2;
|
||||
if (k < 0)
|
||||
UI_PrintStringSmall(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
||||
else
|
||||
if (k >= 0 && k < (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, i);
|
||||
i++;
|
||||
}
|
||||
|
||||
// current menu item
|
||||
if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 2, 8);
|
||||
i++;
|
||||
|
||||
while (i < 4)
|
||||
{ // trailing menu item
|
||||
const int k = menu_index + i - 2;
|
||||
if (k >= 0 && k < (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, 1 + i);
|
||||
else
|
||||
if (k >= (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
||||
i++;
|
||||
}
|
||||
|
||||
// draw the menu index number/count
|
||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||
UI_PrintStringSmall(String, 2, 0, 6);
|
||||
}
|
||||
while (i < 4)
|
||||
{ // trailing menu item
|
||||
const int k = menu_index + i - 2;
|
||||
if (k >= 0 && k < (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[k].name, 0, 0, 1 + i);
|
||||
else
|
||||
if (k >= (int)gMenuListCount)
|
||||
UI_PrintStringSmall(MenuList[gMenuListCount - k].name, 0, 0, 1 + i); // wrap-a-round
|
||||
i++;
|
||||
else
|
||||
if (menu_index >= 0 && menu_index < (int)gMenuListCount)
|
||||
{ // current menu item
|
||||
strcpy(String, MenuList[menu_index].name);
|
||||
// strcat(String, ":");
|
||||
UI_PrintStringSmall(String, 0, 0, 6);
|
||||
|
||||
// invert pixels
|
||||
// for (i = 0; i < (7 * strlen(String)); i++)
|
||||
// gFrameBuffer[6][i] ^= 0xFF;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// draw the menu index number/count
|
||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||
UI_PrintStringSmall(String, 8, 0, 6);
|
||||
|
||||
// draw the little triangle marker if we're in the sub-menu
|
||||
if (gIsInSubMenu)
|
||||
memmove(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
|
||||
|
||||
// **************
|
||||
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
|
||||
bool already_printed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user