mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-04-28 13:08:19 +00:00
[FIRMWARE] DSK selection feature for upcoming Amstrad core
This commit is contained in:
18
osd.c
18
osd.c
@@ -608,15 +608,6 @@ unsigned char OsdGetCtrl(void)
|
||||
(user_io_core_type() == CORE_TYPE_8BIT))
|
||||
c1 = OsdKeyGet();
|
||||
|
||||
// add front menu button
|
||||
if (!CheckButton())
|
||||
delay = GetTimer(BUTTONDELAY);
|
||||
else if (CheckTimer(delay))
|
||||
{
|
||||
c1 = KEY_MENU;
|
||||
delay = GetTimer(-1);
|
||||
}
|
||||
|
||||
// generate normal "key-pressed" event
|
||||
c = 0;
|
||||
if (c1 != c2)
|
||||
@@ -643,6 +634,15 @@ 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;
|
||||
}
|
||||
|
||||
return(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ extern fileTYPE file;
|
||||
extern char s[40];
|
||||
extern DIRENTRY DirEntry[MAXDIRENTRIES];
|
||||
extern unsigned char nDirEntries;
|
||||
extern unsigned char iSelectedEntry;
|
||||
|
||||
|
||||
// mouse and keyboard emulation state
|
||||
typedef enum { EMU_NONE, EMU_MOUSE, EMU_JOY0, EMU_JOY1 } emu_mode_t;
|
||||
@@ -455,6 +457,12 @@ void user_io_file_tx(fileTYPE *file, unsigned char index) {
|
||||
SPI(index);
|
||||
DisableFpga();
|
||||
|
||||
// send directory entry (for alpha amstrad core)
|
||||
EnableFpga();
|
||||
SPI(UIO_FILE_INFO);
|
||||
spi_write((void*)(DirEntry+iSelectedEntry), sizeof(DIRENTRY));
|
||||
DisableFpga();
|
||||
|
||||
// prepare transmission of new file
|
||||
EnableFpga();
|
||||
SPI(UIO_FILE_TX);
|
||||
|
||||
Reference in New Issue
Block a user