1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-04-30 13:52:38 +00:00

int64_t for core_mod

This commit is contained in:
Gyorgy Szombathelyi
2025-09-22 15:59:14 +02:00
parent faf3587267
commit 2860004bcc
6 changed files with 15 additions and 11 deletions

View File

@@ -10,7 +10,7 @@
#define MAX_BUTTONS_SIZE 128
typedef struct {
char mod;
int64_t mod;
uint64_t conf_default;
char rbfname[33];
char corename[17];
@@ -33,7 +33,7 @@ const ini_section_t arc_ini_sections[] = {
// arc ini vars
const ini_var_t arc_ini_vars[] = {
{"MOD", (void*)(&arc.mod), UINT8, 0, 127, 1},
{"MOD", (void*)(&arc.mod), INT64, 0, 0x7fffffffffffffff, 1},
{"DEFAULT", (void*)(&arc.conf_default), UINT64, 0, ~0, 1},
{"RBF", (void*)arc.rbfname, STRING, 1, 32, 1},
{"NAME", (void*)arc.corename, STRING, 1, 16, 1},
@@ -55,7 +55,7 @@ char arc_set_conf(char *c, char action, int tag)
return 0;
}
char arc_open(const char *fname)
int64_t arc_open(const char *fname)
{
ini_cfg_t arc_ini_cfg;

View File

@@ -7,7 +7,9 @@
#ifndef ARC_FILE_H
#define ARC_FILE_H
char arc_open(const char *fname);
#include <stdint.h>
int64_t arc_open(const char *fname);
void arc_reset();
char *arc_get_rbfname();
char *arc_get_corename();

2
main.c
View File

@@ -214,7 +214,7 @@ int main(void)
// tos config also contains cdc redirect settings used by minimig
tos_config_load(-1);
char mod = -1;
int64_t mod = -1;
if((USB_LOAD_VAR != USB_LOAD_VALUE) && !user_io_dip_switch1()) {
mod = arc_open("/CORE.ARC");

2
menu.c
View File

@@ -363,7 +363,7 @@ static char CoreFileSelected(uint8_t idx, const char *SelectedName) {
//remember core name loaded
OsdCoreNameSet(SelectedName);
char mod = 0;
int64_t mod = 0;
char arc = 0;
unsigned char err;
const char *extension = GetExtension(SelectedName);

View File

@@ -66,7 +66,7 @@ extern char rom_direct_upload;
static uint32_t core_features = 0;
// core variant (mostly for arcades)
static char core_mod = 0;
static int64_t core_mod = 0;
// keep state of caps lock
static char caps_lock_toggle = 0;
@@ -234,13 +234,14 @@ static void user_io_read_core_name() {
iprintf("Core name from FPGA is \"%s\"\n", core_name);
}
void user_io_set_core_mod(char mod) {
void user_io_set_core_mod(int64_t mod) {
core_mod = mod;
}
static void user_io_send_core_mod() {
iprintf("Sending core mod = %d\n", core_mod);
spi_uio_cmd8(UIO_SET_MOD, core_mod);
spi_uio_cmd8(UIO_SET_MOD, core_mod & 0x7f);
spi_uio_cmd64(UIO_SET_MOD2, core_mod);
}
void user_io_send_rtc(void) {

View File

@@ -53,13 +53,14 @@
#define UIO_SIO_IN 0x1b // serial in
#define UIO_SET_SDSTAT 0x1c // set sd card status
#define UIO_SET_SDINFO 0x1d // send info about mounted image
#define UIO_SET_STATUS2 0x1e // 32bit status
#define UIO_SET_STATUS2 0x1e // 64bit status
#define UIO_GET_KBD_LED 0x1f // keyboard LEDs control
#define UIO_SIO_OUT 0x20 // serial out
#define UIO_SET_MOD 0x21 // send core variant from metadata (ARC) file
#define UIO_SET_RTC 0x22 // send real-time-clock data
#define UIO_SD_ACK 0x23 // send ack for sector read/write
#define UIO_GET_STR_EXT 0x24 // get config string from dedicated position
#define UIO_SET_MOD2 0x25 // send core variant from metadata (ARC) file (64 bit)
// I2c bridge
#define UIO_I2C_SEND 0x30 // start i2c transaction on the FPGA side
@@ -219,7 +220,7 @@ void user_io_file_mount(const unsigned char*, unsigned char);
char user_io_is_cue_mounted();
char user_io_cue_mount(const unsigned char*, unsigned char);
char *user_io_get_core_name();
void user_io_set_core_mod(char);
void user_io_set_core_mod(int64_t);
void user_io_sd_ack(char drive_index);
// io controllers interface for FPGA ethernet emulation using usb ethernet