amex: Shift config structs around

This commit is contained in:
Tau 2019-11-05 19:36:35 -05:00
parent 8485879ff7
commit f8289689f0
13 changed files with 61 additions and 45 deletions

View File

@ -2,8 +2,19 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include "amex/ds.h"
#include "amex/eeprom.h"
#include "amex/gpio.h"
#include "amex/jvs.h" #include "amex/jvs.h"
#include "amex/sram.h"
struct amex_config {
struct ds_config ds;
struct eeprom_config eeprom;
struct gpio_config gpio;
struct jvs_config jvs;
struct sram_config sram;
};
HRESULT amex_hook_init( HRESULT amex_hook_init(
const struct amex_config *cfg, const struct amex_config *cfg,

View File

@ -6,7 +6,13 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "amex/amex.h"
#include "amex/config.h" #include "amex/config.h"
#include "amex/ds.h"
#include "amex/eeprom.h"
#include "amex/gpio.h"
#include "amex/jvs.h"
#include "amex/sram.h"
void ds_config_load(struct ds_config *cfg, const wchar_t *filename) void ds_config_load(struct ds_config *cfg, const wchar_t *filename)
{ {

View File

@ -6,40 +6,12 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
struct ds_config { #include "amex/amex.h"
bool enable; #include "amex/ds.h"
uint8_t region; #include "amex/eeprom.h"
wchar_t serial_no[17]; #include "amex/gpio.h"
}; #include "amex/jvs.h"
#include "amex/sram.h"
struct eeprom_config {
bool enable;
wchar_t path[MAX_PATH];
};
struct gpio_config {
bool enable;
uint8_t vk_sw1;
uint8_t vk_sw2;
bool dipsw[8];
};
struct jvs_config {
bool enable;
};
struct sram_config {
bool enable;
wchar_t path[MAX_PATH];
};
struct amex_config {
struct ds_config ds;
struct eeprom_config eeprom;
struct gpio_config gpio;
struct jvs_config jvs;
struct sram_config sram;
};
void ds_config_load(struct ds_config *cfg, const wchar_t *filename); void ds_config_load(struct ds_config *cfg, const wchar_t *filename);
void eeprom_config_load(struct eeprom_config *cfg, const wchar_t *filename); void eeprom_config_load(struct eeprom_config *cfg, const wchar_t *filename);

View File

@ -7,7 +7,6 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "amex/config.h"
#include "amex/ds.h" #include "amex/ds.h"
#include "amex/nvram.h" #include "amex/nvram.h"

View File

@ -2,7 +2,15 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
struct ds_config {
bool enable;
uint8_t region;
wchar_t serial_no[17];
};
DEFINE_GUID( DEFINE_GUID(
ds_guid, ds_guid,

View File

@ -10,7 +10,6 @@
#include <assert.h> #include <assert.h>
#include "amex/config.h"
#include "amex/eeprom.h" #include "amex/eeprom.h"
#include "amex/nvram.h" #include "amex/nvram.h"

View File

@ -2,7 +2,13 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include <stdbool.h>
#include <stddef.h>
struct eeprom_config {
bool enable;
wchar_t path[MAX_PATH];
};
DEFINE_GUID( DEFINE_GUID(
eeprom_guid, eeprom_guid,

View File

@ -4,7 +4,6 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "amex/config.h"
#include "amex/gpio.h" #include "amex/gpio.h"
#include "hook/iohook.h" #include "hook/iohook.h"

View File

@ -2,7 +2,15 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include <stdbool.h>
#include <stdint.h>
struct gpio_config {
bool enable;
uint8_t vk_sw1;
uint8_t vk_sw2;
bool dipsw[8];
};
DEFINE_GUID( DEFINE_GUID(
gpio_guid, gpio_guid,

View File

@ -8,7 +8,6 @@
#include <assert.h> #include <assert.h>
#include <stddef.h> #include <stddef.h>
#include "amex/config.h"
#include "amex/jvs.h" #include "amex/jvs.h"
#include "hook/iobuf.h" #include "hook/iobuf.h"

View File

@ -2,7 +2,7 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include <stdbool.h>
#include "jvs/jvs-bus.h" #include "jvs/jvs-bus.h"
@ -13,6 +13,10 @@ DEFINE_GUID(
0x4288, 0x4288,
0xAA, 0x00, 0x6C, 0x00, 0xD7, 0x67, 0xBD, 0xBF); 0xAA, 0x00, 0x6C, 0x00, 0xD7, 0x67, 0xBD, 0xBF);
struct jvs_config {
bool enable;
};
typedef HRESULT (*jvs_provider_t)(struct jvs_node **root); typedef HRESULT (*jvs_provider_t)(struct jvs_node **root);
HRESULT jvs_hook_init(const struct jvs_config *cfg, jvs_provider_t provider); HRESULT jvs_hook_init(const struct jvs_config *cfg, jvs_provider_t provider);

View File

@ -10,7 +10,6 @@
#include <assert.h> #include <assert.h>
#include "amex/config.h"
#include "amex/sram.h" #include "amex/sram.h"
#include "amex/nvram.h" #include "amex/nvram.h"

View File

@ -2,7 +2,13 @@
#include <windows.h> #include <windows.h>
#include "amex/config.h" #include <stdbool.h>
#include <stddef.h>
struct sram_config {
bool enable;
wchar_t path[MAX_PATH];
};
DEFINE_GUID( DEFINE_GUID(
sram_guid, sram_guid,