1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-05-03 14:59:36 +00:00

Allow configuring the profile names in Minimig, AtariST

This commit is contained in:
Gyorgy Szombathelyi
2020-05-12 23:10:31 +02:00
parent bacb5c7ad9
commit 4362a8bb0a
9 changed files with 128 additions and 45 deletions

View File

@@ -17,7 +17,7 @@
#include "config.h"
#include "user_io.h"
#include "usb/usb.h"
#include "minimig_cfg.h"
#include "misc_cfg.h"
configTYPE config;
fileTYPE file;

View File

@@ -14,6 +14,11 @@ void siprintf(char *str, const char *format, ...) {
int main() {
memset(&mist_cfg, 0, sizeof(mist_cfg));
memset(&minimig_cfg, 0, sizeof(minimig_cfg));
ini_parse(&mist_ini_cfg, "DEFENDER");
for (int i=0; i<5; i++) {
printf("minimig cfg[%d] = %s\n", i, minimig_cfg.conf_name[i]);
}
for (int i=0; i<5; i++) {
printf("atarist cfg[%d] = %s\n", i, atarist_cfg.conf_name[i]);
}
}

41
menu.c
View File

@@ -49,6 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "boot.h"
#include "archie.h"
#include "arc_file.h"
#include "misc_cfg.h"
#include "usb/joymapping.h"
// test features (not used right now)
@@ -1850,11 +1851,11 @@ void HandleUI(void)
OsdSetTitle("Load",0);
OsdWrite(0, "", 0, 0);
OsdWrite(1, " Default", menusub == 0,!(menumask & 0x01));
OsdWrite(2, " 1", menusub == 1,!(menumask & 0x02));
OsdWrite(3, " 2", menusub == 2,!(menumask & 0x04));
OsdWrite(4, " 3", menusub == 3,!(menumask & 0x08));
OsdWrite(5, " 4", menusub == 4,!(menumask & 0x10));
for(int i = 0; i < 5; i++) {
strcpy(s," ");
strcat(s, atarist_cfg.conf_name[i]);
OsdWrite(i+1, s, menusub == i, !(menumask & (1<<i)));
}
OsdWrite(6, "", 0,0);
OsdWrite(7, STD_EXIT, menusub == 5,0);
@@ -1894,11 +1895,11 @@ void HandleUI(void)
OsdSetTitle("Save",0);
OsdWrite(0, "", 0, 0);
OsdWrite(1, " Default", menusub == 0,0);
OsdWrite(2, " 1", menusub == 1,0);
OsdWrite(3, " 2", menusub == 2,0);
OsdWrite(4, " 3", menusub == 3,0);
OsdWrite(5, " 4", menusub == 4,0);
for(int i = 0; i < 5; i++) {
strcpy(s," ");
strcat(s, atarist_cfg.conf_name[i]);
OsdWrite(i+1, s, menusub == i, 0);
}
OsdWrite(6, "", 0,0);
OsdWrite(7, STD_EXIT, menusub == 5,0);
@@ -2136,11 +2137,11 @@ void HandleUI(void)
OsdSetTitle("Load",0);
OsdWrite(0, "", 0,0);
OsdWrite(1, " Default", menusub == 0,(menumask & 1)==0);
OsdWrite(2, " 1", menusub == 1,(menumask & 2)==0);
OsdWrite(3, " 2", menusub == 2,(menumask & 4)==0);
OsdWrite(4, " 3", menusub == 3,(menumask & 8)==0);
OsdWrite(5, " 4", menusub == 4,(menumask & 0x10)==0);
for(int i = 0; i < 5; i++) {
strcpy(s," ");
strcat(s, minimig_cfg.conf_name[i]);
OsdWrite(i+1, s, menusub == i, !(menumask & (1<<i)));
}
OsdWrite(6, "", 0,0);
OsdWrite(7, STD_EXIT, menusub == 5,0);
@@ -2401,11 +2402,11 @@ void HandleUI(void)
OsdSetTitle("Save",0);
OsdWrite(0, "", 0, 0);
OsdWrite(1, " Default", menusub == 0,0);
OsdWrite(2, " 1", menusub == 1,0);
OsdWrite(3, " 2", menusub == 2,0);
OsdWrite(4, " 3", menusub == 3,0);
OsdWrite(5, " 4", menusub == 4,0);
for(int i = 0; i < 5; i++) {
strcpy(s," ");
strcat(s, minimig_cfg.conf_name[i]);
OsdWrite(i+1, s, menusub == i, 0);
}
OsdWrite(6, "", 0,0);
OsdWrite(7, STD_EXIT, menusub == 5,0);

View File

@@ -1,18 +0,0 @@
// minimig_cfg.h
#ifndef __MINIMIG_CFG_H__
#define __MINIMIG_CFG_H__
//// type definitions ////
typedef struct {
uint8_t kick1x_memory_detection_patch;
} minimig_cfg_t;
//// global variables ////
extern minimig_cfg_t minimig_cfg;
#endif // __MINIMIG_CFG_H__

24
misc_cfg.h Normal file
View File

@@ -0,0 +1,24 @@
// misc_cfg.h
#ifndef __MISC_CFG_H__
#define __MISC_CFG_H__
//// type definitions ////
typedef struct {
uint8_t kick1x_memory_detection_patch;
char conf_name[5][11];
} minimig_cfg_t;
typedef struct {
char conf_name[5][11];
} atarist_cfg_t;
//// global variables ////
extern minimig_cfg_t minimig_cfg;
extern atarist_cfg_t atarist_cfg;
#endif // __MISC_CFG_H__

View File

@@ -7,3 +7,17 @@ mouse_boot_mode=0 ; set to 1 if a mouse does not work well
joystick_emu_fixed_index=0 ; set to 1 for always emulating the first two joystick via keyboard
joystick_remap=0583,2060,1,2,4,8,10,20,20,8,400,800,40,80
key_menu_as_rgui=0 ; set to 1 to make the MENU key map to RGUI in Minimig (e.g. for Right Amiga)
[minimig_config]
;conf_default="68020 AGA"
;conf_1="68000 ECS"
;conf_2="68000 OCS"
;conf_3=
;conf_4=
[atarist_config]
;conf_default="STe 2.06"
;conf_1="STf 1.04"
;conf_2="MSTe"
;conf_3="STeroids"
;conf_4=

View File

@@ -34,7 +34,6 @@ void mist_ini_parse()
joy_key_map_init();
data_io_rom_upload(NULL, 0); // prepare upload
memset(&mist_cfg, 0, sizeof(mist_cfg));
memset(&minimig_cfg, 0, sizeof(minimig_cfg));
minimig_cfg.kick1x_memory_detection_patch = 1;
ini_parse(&mist_ini_cfg, user_io_get_core_name());
data_io_rom_upload(NULL, 2); // upload done
@@ -62,13 +61,19 @@ mist_cfg_t mist_cfg = {
};
minimig_cfg_t minimig_cfg = {
.kick1x_memory_detection_patch = 0
.kick1x_memory_detection_patch = 0,
.conf_name = {"Default","1","2","3","4"}
};
atarist_cfg_t atarist_cfg = {
.conf_name = {"Default","1","2","3","4"}
};
// mist ini sections
const ini_section_t mist_ini_sections[] = {
{1, "MIST"},
{2, "MINIMIG_CONFIG"}
{2, "MINIMIG_CONFIG"},
{3, "ATARIST_CONFIG"}
};
// mist ini vars
@@ -96,7 +101,18 @@ const ini_var_t mist_ini_vars[] = {
#endif
{"ROM", (void*)ini_rom_upload, CUSTOM_HANDLER, 0, 0, 1},
// [MINIMIG_CONFIG]
{"KICK1X_MEMORY_DETECTION_PATCH", (void*)(&(minimig_cfg.kick1x_memory_detection_patch)), UINT8, 0, 1, 2}
{"KICK1X_MEMORY_DETECTION_PATCH", (void*)(&(minimig_cfg.kick1x_memory_detection_patch)), UINT8, 0, 1, 2},
{"CONF_DEFAULT", (void*)(&(minimig_cfg.conf_name[0])), STRING, 1, 10, 2},
{"CONF_1", (void*)(&(minimig_cfg.conf_name[1])), STRING, 1, 10, 2},
{"CONF_2", (void*)(&(minimig_cfg.conf_name[2])), STRING, 1, 10, 2},
{"CONF_3", (void*)(&(minimig_cfg.conf_name[3])), STRING, 1, 10, 2},
{"CONF_4", (void*)(&(minimig_cfg.conf_name[4])), STRING, 1, 10, 2},
// [ATARIST_CONFIG]
{"CONF_DEFAULT", (void*)(&(atarist_cfg.conf_name[0])), STRING, 1, 10, 3},
{"CONF_1", (void*)(&(atarist_cfg.conf_name[1])), STRING, 1, 10, 3},
{"CONF_2", (void*)(&(atarist_cfg.conf_name[2])), STRING, 1, 10, 3},
{"CONF_3", (void*)(&(atarist_cfg.conf_name[3])), STRING, 1, 10, 3},
{"CONF_4", (void*)(&(atarist_cfg.conf_name[4])), STRING, 1, 10, 3}
};
// mist ini config

View File

@@ -9,7 +9,7 @@
//// includes ////
#include <inttypes.h>
#include "ini_parser.h"
#include "minimig_cfg.h"
#include "misc_cfg.h"
//// type definitions ////

41
test.ini Normal file
View File

@@ -0,0 +1,41 @@
[mist]
scandoubler_disable=1 ; set to 1 to run supported cores in 15khz
mouse_boot_mode=0 ; set to 1 if a mouse does not work well
joystick_disable_shortcuts=0 ; set to 1 to remove joystick -> keyboard commands
joystick_ignore_hat=0 ; set to 1 if having issues on gamepads with 'POV hat'
joystick_ignore_osd=0 ; set to 1 to prevent gamepad from controlling OSD
key_menu_as_rgui=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ; set to 1 to bind Menu USB key to RGUI (=Right Amiga in Minimig)
joy_key_map=1000,29 ;L2 to ESC
joy_key_map=2000,3A ;R2 to F1
joystick_remap=0583,2060,1,2,4,8,10,20,40,80,100,200,1000,2000
[ROBOTRON]
joystick_remap=0583,2060,1,2,4,8,80,20,10,40,0,0,1000,2000,3000
[DEFENDER]
;none,none,up,down,start(A),B(B),select(X),A(Y),left(L),ESC(SELECT),F1(START),START+SELECT
;CORRECT joystick_remap=0583,2060,0,0,4,8,80,20,40,10,2,0,480,880,C0
joystick_remap=0583,2060,0,0,4,8,80,20,40,10,2,0,1000,2000,C0
[STARGATE]
;none,none,up,down,start(A),B(B),select(X),A(Y),left(L),ESC(SELECT),F1(START),START+SELECTdsdasdadasdasdasdas
joystick_remap=0583,2060,0,0,4,8,80,20,40,10,2,0,480,880,C0
[MINIMIG_CONFIG]
conf_default="68020 AGA"
conf_1="68000 ECS TOO LONG"
[ATARIST_CONFIG]
conf_2="STe 2.06"
conf_3="STf 1.04"
conf_4="Mega STe HDD TOO LONG"