1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-04-25 20:11:42 +00:00

Load a development ARC file after JTAG programming (#99)

A /CORENAME.ARC will be loaded when loading via USB Blaster is
detected. CORENAME comes from the built-in config string.
This commit is contained in:
Gyorgy Szombathelyi
2022-10-27 15:42:08 +02:00
parent 8810e06e63
commit b6de09c9f9
4 changed files with 23 additions and 9 deletions

1
fpga.c
View File

@@ -940,6 +940,7 @@ void fpga_init(const char *name) {
}
user_io_detect_core_type();
user_io_init_core();
mist_ini_parse();
user_io_send_buttons(true);
InitDB9();

12
main.c
View File

@@ -197,10 +197,18 @@ int main(void)
// tos config also contains cdc redirect settings used by minimig
tos_config_load(-1);
char mod = 0;
char mod = -1;
if((USB_LOAD_VAR != USB_LOAD_VALUE) && !user_io_dip_switch1())
if((USB_LOAD_VAR != USB_LOAD_VALUE) && !user_io_dip_switch1()) {
mod = arc_open("/CORE.ARC");
} else {
user_io_detect_core_type();
if(user_io_core_type() != CORE_TYPE_UNKNOWN && !user_io_create_config_name(s, "ARC", CONFIG_ROOT)) {
// when loaded from USB, try to load the development ARC file
iprintf("Load development ARC: %s\n", s);
mod = arc_open(s);
}
}
if(mod < 0 || !strlen(arc_get_rbfname())) {
fpga_init(NULL); // error opening default ARC, try with default RBF

View File

@@ -304,7 +304,7 @@ void user_io_detect_core_type() {
archie_init();
break;
case CORE_TYPE_8BIT: {
case CORE_TYPE_8BIT:
puts("Identified 8BIT core");
// send core variant first to allow the FPGA choosing the config string
@@ -322,6 +322,16 @@ void user_io_detect_core_type() {
// get requested features
user_io_read_core_features();
break;
default:
iprintf("Unable to identify core (%x)!\n", core_type);
core_type = CORE_TYPE_UNKNOWN;
}
}
void user_io_init_core() {
if(core_type == CORE_TYPE_8BIT) {
// send a reset
user_io_8bit_set_status(UIO_STATUS_RESET, ~0);
@@ -416,15 +426,9 @@ void user_io_detect_core_type() {
// release reset
user_io_8bit_set_status(0, UIO_STATUS_RESET);
} break;
default:
iprintf("Unable to identify core (%x)!\n", core_type);
core_type = CORE_TYPE_UNKNOWN;
}
}
static unsigned short usb2amiga( unsigned char k ) {
// replace MENU key by RGUI to allow using Right Amiga on reduced keyboards
// (it also disables the use of Menu for OSD)

View File

@@ -189,6 +189,7 @@ typedef struct {
void user_io_reset();
void user_io_init();
void user_io_detect_core_type();
void user_io_init_core();
unsigned char user_io_core_type();
uint32_t user_io_get_core_features();
char minimig_v1();