Improved support for Amstrad's boot expansions.

This commit is contained in:
sorgelig
2018-07-11 16:56:39 +08:00
parent 5f954ddd2b
commit a124947c4a
2 changed files with 14 additions and 10 deletions

View File

@@ -521,14 +521,18 @@ void user_io_init(const char *path)
if (is_cpc_core())
{
sprintf(mainpath, "%s/boot.eZZ", user_io_get_core_name());
user_io_file_tx(mainpath, 0x40);
sprintf(mainpath, "%s/boot.eZ0", user_io_get_core_name());
user_io_file_tx(mainpath, 0x40);
for (int i = 0; i < 256; i++)
for (int m = 0; m < 3; m++)
{
sprintf(mainpath, "%s/boot.e%02X", user_io_get_core_name(), i);
user_io_file_tx(mainpath, 0x40);
const char *model = !m ? "" : (m == 1) ? "0" : "1";
sprintf(mainpath, "%s/boot%s.eZZ", user_io_get_core_name(), model);
user_io_file_tx(mainpath, 0x40 * (m + 1),0,1);
sprintf(mainpath, "%s/boot%s.eZ0", user_io_get_core_name(), model);
user_io_file_tx(mainpath, 0x40 * (m + 1),0,1);
for (int i = 0; i < 256; i++)
{
sprintf(mainpath, "%s/boot%s.e%02X", user_io_get_core_name(), model, i);
user_io_file_tx(mainpath, 0x40 * (m + 1),0,1);
}
}
}
@@ -884,12 +888,12 @@ int user_io_file_mount(char *name, unsigned char index)
return ret ? 1 : 0;
}
int user_io_file_tx(char* name, unsigned char index, char opensave)
int user_io_file_tx(char* name, unsigned char index, char opensave, char mute)
{
fileTYPE f = { 0 };
static uint8_t buf[1024];
if (!FileOpen(&f, name)) return 0;
if (!FileOpen(&f, name, mute)) return 0;
unsigned long bytes2send = f.size;

View File

@@ -183,7 +183,7 @@ void user_io_osd_key_enable(char);
void user_io_serial_tx(char *, uint16_t);
char *user_io_8bit_get_string(char);
unsigned long user_io_8bit_set_status(unsigned long, unsigned long);
int user_io_file_tx(char* name, unsigned char index = 0, char opensave = 0);
int user_io_file_tx(char* name, unsigned char index = 0, char opensave = 0, char mute = 0);
int user_io_file_mount(char *name, unsigned char index = 0);
char user_io_dip_switch1(void);
char user_io_serial_status(serial_status_t *, uint8_t);