1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-01-13 15:17:43 +00:00

Disable OSD on/off action if OSD button has been used for scandoubler toggle.

This commit is contained in:
sorgelig 2017-02-07 01:36:37 +08:00
parent d169f95166
commit 06052723e8
3 changed files with 20 additions and 4 deletions

21
osd.c
View File

@ -580,6 +580,8 @@ void ConfigAutofire(unsigned char autofire)
spi_osd_cmd8(OSD_CMD_JOY, autofire & 0x07);
}
static unsigned char disable_menu = 0;
// get key status
unsigned char OsdGetCtrl(void)
{
@ -644,15 +646,26 @@ unsigned char OsdGetCtrl(void)
// currently no key pressed
if(!c) {
static unsigned char last_but = 0;
unsigned char but = CheckButton();
if(but && !last_but) c = KEY_MENU;
if(!but && last_but) c = KEY_MENU | KEY_UPSTROKE;
last_but = but;
if(!disable_menu)
{
unsigned char but = CheckButton();
if(!but && last_but) c = KEY_MENU;
last_but = but;
}
else
{
last_but = 0;
}
}
return(c);
}
void OsdDisableMenuButton(unsigned char disable)
{
disable_menu = disable;
}
unsigned char GetASCIIKey(unsigned char keycode)
{
if (keycode & KEY_UPSTROKE)

1
osd.h
View File

@ -121,6 +121,7 @@ void ConfigFloppy(unsigned char drives, unsigned char speed);
void ConfigIDE(unsigned char gayle, unsigned char master, unsigned char slave);
void ConfigAutofire(unsigned char autofire);
unsigned char OsdGetCtrl(void);
void OsdDisableMenuButton(unsigned char disable);
unsigned char GetASCIIKey(unsigned char c);
void OSD_PrintText(unsigned char line, char *text, unsigned long start, unsigned long width, unsigned long offset, unsigned char invert);
void OsdWriteDoubleSize(unsigned char n, char *s, unsigned char pass);

View File

@ -1297,12 +1297,14 @@ void user_io_poll() {
mist_cfg.scandoubler_disable = !mist_cfg.scandoubler_disable;
user_io_send_buttons(1);
timer = 2;
OsdDisableMenuButton(1);
}
}
}
else
{
timer = 1;
OsdDisableMenuButton(0);
}
}