]> git.sesse.net Git - pistorm/blobdiff - config_file/config_file.h
Add Meson build files.
[pistorm] / config_file / config_file.h
index 6880f0fcada497f7912ca1f9c3b62ee06dc2013a..cb82603b45b600361d1567f4be78ad2602762f1c 100644 (file)
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: MIT
+
 #ifndef _CONFIG_FILE_H
 #define _CONFIG_FILE_H
 
@@ -15,6 +17,8 @@ typedef enum {
   MAPTYPE_ROM,
   MAPTYPE_RAM,
   MAPTYPE_REGISTER,
+  MAPTYPE_RAM_NOALLOC,
+  MAPTYPE_RAM_WTC,
   MAPTYPE_NUM,
 } map_types;
 
@@ -27,6 +31,8 @@ typedef enum {
   MAPCMD_FILENAME,
   MAPCMD_OVL_REMAP,
   MAPCMD_MAP_ID,
+  MAPCMD_AUTODUMP_FILE,
+  MAPCMD_AUTODUMP_MEM,
   MAPCMD_NUM,
 } map_cmds;
 
@@ -39,6 +45,7 @@ typedef enum {
   CONFITEM_KEYBOARD,
   CONFITEM_PLATFORM,
   CONFITEM_SETVAR,
+  CONFITEM_KBFILE,
   CONFITEM_NUM,
 } config_items;
 
@@ -54,20 +61,20 @@ struct emulator_config {
   unsigned int cpu_type;
 
   unsigned char map_type[MAX_NUM_MAPPED_ITEMS];
-  long map_offset[MAX_NUM_MAPPED_ITEMS];
-  long map_high[MAX_NUM_MAPPED_ITEMS];
+  unsigned long map_offset[MAX_NUM_MAPPED_ITEMS];
+  unsigned long map_high[MAX_NUM_MAPPED_ITEMS];
   unsigned int map_size[MAX_NUM_MAPPED_ITEMS];
   unsigned int rom_size[MAX_NUM_MAPPED_ITEMS];
   unsigned char *map_data[MAX_NUM_MAPPED_ITEMS];
-  int map_mirror[MAX_NUM_MAPPED_ITEMS];
+  unsigned int map_mirror[MAX_NUM_MAPPED_ITEMS];
   char *map_id[MAX_NUM_MAPPED_ITEMS];
 
   struct platform_config *platform;
 
-  char *mouse_file;
+  char *mouse_file, *keyboard_file;
 
   char mouse_toggle_key, keyboard_toggle_key;
-  unsigned char mouse_enabled, keyboard_enabled;
+  unsigned char mouse_enabled, mouse_autoconnect, keyboard_enabled, keyboard_grab, keyboard_autoconnect;
 
   unsigned int loop_cycles;
   unsigned int mapped_low, mapped_high;
@@ -90,13 +97,20 @@ struct platform_config {
   void (*setvar)(struct emulator_config *cfg, char *var, char *val);
 };
 
+#ifdef __cplusplus
+extern "C" int get_mapped_item_by_address(struct emulator_config *cfg, uint32_t address);
+#else
 unsigned int get_m68k_cpu_type(char *name);
 struct emulator_config *load_config_file(char *filename);
+void free_config_file(struct emulator_config *cfg);
 
 int handle_mapped_read(struct emulator_config *cfg, unsigned int addr, unsigned int *val, unsigned char type);
 int handle_mapped_write(struct emulator_config *cfg, unsigned int addr, unsigned int value, unsigned char type);
 int get_named_mapped_item(struct emulator_config *cfg, char *name);
 int get_mapped_item_by_address(struct emulator_config *cfg, uint32_t address);
+uint8_t *get_mapped_data_pointer_by_address(struct emulator_config *cfg, uint32_t address);
+void add_mapping(struct emulator_config *cfg, unsigned int type, unsigned int addr, unsigned int size, int mirr_addr, char *filename, char *map_id, unsigned int autodump);
 unsigned int get_int(char *str);
+#endif
 
 #endif /* _CONFIG_FILE_H */