1
0
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:
harbaum
2015-03-13 08:04:11 +00:00
parent e7450c8282
commit 236c7f4dda
3 changed files with 18 additions and 9 deletions

18
osd.c
View File

@@ -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);
}

View File

@@ -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);

View File

@@ -55,6 +55,7 @@
#define UIO_FILE_TX 0x53
#define UIO_FILE_TX_DAT 0x54
#define UIO_FILE_INDEX 0x55
#define UIO_FILE_INFO 0x56
#define JOY_RIGHT 0x01
#define JOY_LEFT 0x02