1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-02-03 06:50:45 +00:00

[FIRMWARE] Disk image change detection for C64/C1541

This commit is contained in:
harbaum
2015-07-15 08:24:21 +00:00
parent 65f579cc80
commit 2cc2bb0d91
2 changed files with 13 additions and 5 deletions

View File

@@ -365,7 +365,7 @@ void user_io_sd_set_config(void) {
spi_write(data, sizeof(data));
DisableIO();
hexdump(data, sizeof(data), 0);
// hexdump(data, sizeof(data), 0);
}
// read 8+32 bit sd card status word from FPGA
@@ -481,9 +481,19 @@ static void kbd_fifo_poll() {
kbd_fifo_r = (kbd_fifo_r + 1)&(KBD_FIFO_SIZE-1);
}
static void user_io_set_index(unsigned char index) {
EnableFpga();
SPI(UIO_FILE_INDEX);
SPI(index);
DisableFpga();
}
void user_io_file_mount(fileTYPE *file) {
iprintf("selected %.12s with %d bytes\n", file->name, file->size);
memcpy(&sd_image, file, sizeof(fileTYPE));
// notify core of possible sd image change
spi_uio_cmd8(UIO_SET_SDSTAT, 0);
}
void user_io_file_tx(fileTYPE *file, unsigned char index) {
@@ -494,10 +504,7 @@ void user_io_file_tx(fileTYPE *file, unsigned char index) {
iprintf("Selected file %.11s with %lu bytes to send for index %d\n", file->name, bytes2send, index);
// set index byte (0=bios rom, 1-n=OSD entry index)
EnableFpga();
SPI(UIO_FILE_INDEX);
SPI(index);
DisableFpga();
user_io_set_index(index);
// send directory entry (for alpha amstrad core)
EnableFpga();

View File

@@ -48,6 +48,7 @@
#define UIO_SET_SDCONF 0x19 // send SD card configuration (CSD, CID)
#define UIO_ASTICK 0x1a
#define UIO_SIO_IN 0x1b // serial in
#define UIO_SET_SDSTAT 0x1c // set sd card status
// codes as used by 8bit (atari 800, zx81) via SS2
#define UIO_GET_STATUS 0x50