diff --git a/nu/ds.c b/amex/ds.c similarity index 99% rename from nu/ds.c rename to amex/ds.c index c7f3445..1130b77 100644 --- a/nu/ds.c +++ b/amex/ds.c @@ -18,12 +18,12 @@ #include #include +#include "amex/ds.h" +#include "amex/nvram.h" + #include "hook/iobuf.h" #include "hook/iohook.h" -#include "nu/ds.h" -#include "nu/nvram.h" - #include "util/crc.h" #include "util/dprintf.h" #include "util/setupapi.h" diff --git a/nu/ds.h b/amex/ds.h similarity index 100% rename from nu/ds.h rename to amex/ds.h diff --git a/nu/eeprom.c b/amex/eeprom.c similarity index 98% rename from nu/eeprom.c rename to amex/eeprom.c index 807b2d4..da173cc 100644 --- a/nu/eeprom.c +++ b/amex/eeprom.c @@ -10,10 +10,10 @@ #include -#include "hook/iohook.h" +#include "amex/eeprom.h" +#include "amex/nvram.h" -#include "nu/eeprom.h" -#include "nu/nvram.h" +#include "hook/iohook.h" #include "util/dprintf.h" #include "util/setupapi.h" diff --git a/nu/eeprom.h b/amex/eeprom.h similarity index 100% rename from nu/eeprom.h rename to amex/eeprom.h diff --git a/nu/gpio.c b/amex/gpio.c similarity index 99% rename from nu/gpio.c rename to amex/gpio.c index 0eee74a..6e1236d 100644 --- a/nu/gpio.c +++ b/amex/gpio.c @@ -4,9 +4,9 @@ #include #include -#include "hook/iohook.h" +#include "amex/gpio.h" -#include "nu/gpio.h" +#include "hook/iohook.h" #include "util/dprintf.h" #include "util/setupapi.h" diff --git a/nu/gpio.h b/amex/gpio.h similarity index 100% rename from nu/gpio.h rename to amex/gpio.h diff --git a/amex/guid.c b/amex/guid.c new file mode 100644 index 0000000..de51804 --- /dev/null +++ b/amex/guid.c @@ -0,0 +1,8 @@ +#include +#include + +#include "amex/ds.h" +#include "amex/eeprom.h" +#include "amex/gpio.h" +#include "amex/jvs.h" +#include "amex/sram.h" diff --git a/nu/jvs.c b/amex/jvs.c similarity index 99% rename from nu/jvs.c rename to amex/jvs.c index 31a4b59..f220bf7 100644 --- a/nu/jvs.c +++ b/amex/jvs.c @@ -8,13 +8,13 @@ #include #include +#include "amex/jvs.h" + #include "hook/iobuf.h" #include "hook/iohook.h" #include "jvs/jvs-bus.h" -#include "nu/jvs.h" - #include "util/dprintf.h" #include "util/dump.h" #include "util/setupapi.h" diff --git a/nu/jvs.h b/amex/jvs.h similarity index 100% rename from nu/jvs.h rename to amex/jvs.h diff --git a/nu/meson.build b/amex/meson.build similarity index 75% rename from nu/meson.build rename to amex/meson.build index c82912f..4b5c3a3 100644 --- a/nu/meson.build +++ b/amex/meson.build @@ -1,5 +1,5 @@ -nu_lib = static_library( - 'nu', +amex_lib = static_library( + 'amex', include_directories : inc, implicit_include_directories : false, c_pch : [ @@ -8,7 +8,6 @@ nu_lib = static_library( ], dependencies : [ capnhook.get_variable('hook_dep'), - capnhook.get_variable('hooklib_dep'), ], sources : [ 'ds.c', @@ -20,10 +19,6 @@ nu_lib = static_library( 'guid.c', 'jvs.c', 'jvs.h', - 'hwmon.c', - 'hwmon.h', - 'nusec.c', - 'nusec.h', 'nvram.c', 'nvram.h', 'sram.c', diff --git a/nu/nvram.c b/amex/nvram.c similarity index 98% rename from nu/nvram.c rename to amex/nvram.c index 1f34d61..5e4286a 100644 --- a/nu/nvram.c +++ b/amex/nvram.c @@ -4,9 +4,9 @@ #include #include -#include "util/dprintf.h" +#include "amex/nvram.h" -#include "nu/nvram.h" +#include "util/dprintf.h" HRESULT nvram_open_file(HANDLE *out, wchar_t *path, size_t size) { diff --git a/nu/nvram.h b/amex/nvram.h similarity index 100% rename from nu/nvram.h rename to amex/nvram.h diff --git a/nu/sram.c b/amex/sram.c similarity index 98% rename from nu/sram.c rename to amex/sram.c index 8424eac..c069c18 100644 --- a/nu/sram.c +++ b/amex/sram.c @@ -10,10 +10,10 @@ #include -#include "hook/iohook.h" +#include "amex/sram.h" +#include "amex/nvram.h" -#include "nu/sram.h" -#include "nu/nvram.h" +#include "hook/iohook.h" #include "util/dprintf.h" #include "util/setupapi.h" diff --git a/nu/sram.h b/amex/sram.h similarity index 100% rename from nu/sram.h rename to amex/sram.h diff --git a/chunihook/dllmain.c b/chunihook/dllmain.c index c6781fd..5179a62 100644 --- a/chunihook/dllmain.c +++ b/chunihook/dllmain.c @@ -3,6 +3,12 @@ #include #include +#include "amex/ds.h" +#include "amex/eeprom.h" +#include "amex/gpio.h" +#include "amex/jvs.h" +#include "amex/sram.h" + #include "chunihook/jvs.h" #include "chunihook/slider-hook.h" @@ -10,13 +16,8 @@ #include "hooklib/serial.h" -#include "nu/ds.h" -#include "nu/eeprom.h" -#include "nu/gpio.h" -#include "nu/jvs.h" -#include "nu/hwmon.h" -#include "nu/nusec.h" -#include "nu/sram.h" +#include "platform/hwmon.h" +#include "platform/nusec.h" #include "util/clock.h" #include "util/dprintf.h" @@ -47,16 +48,19 @@ static DWORD CALLBACK chuni_pre_startup(void) gfx_hook_init(); serial_hook_init(); - /* Initialize Nu emulation */ + /* Initialize platform API emulation */ - eeprom_hook_init(); - sram_hook_init(); - ds_hook_init(); - gpio_hook_init(); - jvs_hook_init(); hwmon_hook_init(); nusec_hook_init(); + /* Initialize AMEX emulation */ + + ds_hook_init(); + gpio_hook_init(); + eeprom_hook_init(); + jvs_hook_init(); + sram_hook_init(); + /* Initialize Chunithm board emulation */ slider_hook_init(); diff --git a/chunihook/jvs.c b/chunihook/jvs.c index 86fec1e..b46e844 100644 --- a/chunihook/jvs.c +++ b/chunihook/jvs.c @@ -5,12 +5,12 @@ #include #include +#include "amex/jvs.h" + #include "board/io3.h" #include "jvs/jvs-bus.h" -#include "nu/jvs.h" - #include "util/dprintf.h" static void chunithm_jvs_read_switches(void *ctx, struct io3_switch_state *out); diff --git a/chunihook/meson.build b/chunihook/meson.build index 3c299a6..40a7ad4 100644 --- a/chunihook/meson.build +++ b/chunihook/meson.build @@ -12,9 +12,10 @@ shared_library( capnhook.get_variable('hooklib_dep'), ], link_with : [ + amex_lib, board_lib, jvs_lib, - nu_lib, + platform_lib, util_lib, ], sources : [ diff --git a/meson.build b/meson.build index de254f6..9a2a757 100644 --- a/meson.build +++ b/meson.build @@ -30,9 +30,10 @@ xinput_lib = cc.find_library('xinput') inc = include_directories('.') capnhook = subproject('capnhook') +subdir('amex') subdir('board') subdir('jvs') -subdir('nu') +subdir('platform') subdir('util') subdir('aimeio') diff --git a/minihook/dllmain.c b/minihook/dllmain.c index 76de549..556f320 100644 --- a/minihook/dllmain.c +++ b/minihook/dllmain.c @@ -1,9 +1,10 @@ #include +#include "amex/ds.h" + #include "hook/process.h" -#include "nu/ds.h" -#include "nu/nusec.h" +#include "platform/nusec.h" #include "util/clock.h" #include "util/dprintf.h" @@ -15,10 +16,10 @@ static DWORD CALLBACK app_pre_startup(void) { dprintf("--- Begin %s ---\n", __func__); + spike_hook_init("minispike.txt"); + clock_hook_init(); ds_hook_init(); nusec_hook_init(); - clock_hook_init(); - spike_hook_init("minispike.txt"); dprintf("--- End %s ---\n", __func__); diff --git a/minihook/meson.build b/minihook/meson.build index 6972271..c3a78ba 100644 --- a/minihook/meson.build +++ b/minihook/meson.build @@ -11,7 +11,8 @@ shared_library( capnhook.get_variable('hook_dep'), ], link_with : [ - nu_lib, + amex_lib, + platform_lib, util_lib, ], sources : [ diff --git a/nu/guid.c b/nu/guid.c deleted file mode 100644 index 8a81fa8..0000000 --- a/nu/guid.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -#include "nu/ds.h" -#include "nu/eeprom.h" -#include "nu/gpio.h" -#include "nu/jvs.h" -#include "nu/sram.h" diff --git a/nu/hwmon.c b/platform/hwmon.c similarity index 98% rename from nu/hwmon.c rename to platform/hwmon.c index ded2d48..fe7aeb6 100644 --- a/nu/hwmon.c +++ b/platform/hwmon.c @@ -7,7 +7,7 @@ #include "hook/iohook.h" -#include "nu/hwmon.h" +#include "platform/hwmon.h" enum { HWMON_IOCTL_READ_CPU_TEMP = 0x80006000, diff --git a/nu/hwmon.h b/platform/hwmon.h similarity index 100% rename from nu/hwmon.h rename to platform/hwmon.h diff --git a/platform/meson.build b/platform/meson.build new file mode 100644 index 0000000..bdaef9d --- /dev/null +++ b/platform/meson.build @@ -0,0 +1,18 @@ +platform_lib = static_library( + 'platform', + include_directories : inc, + implicit_include_directories : false, + c_pch : [ + '../precompiled.c', + '../precompiled.h', + ], + dependencies : [ + capnhook.get_variable('hook_dep'), + ], + sources : [ + 'hwmon.c', + 'hwmon.h', + 'nusec.c', + 'nusec.h', + ], +) diff --git a/nu/nusec.c b/platform/nusec.c similarity index 99% rename from nu/nusec.c rename to platform/nusec.c index cfb3b4d..33df179 100644 --- a/nu/nusec.c +++ b/platform/nusec.c @@ -7,6 +7,8 @@ #include "hook/iohook.h" +#include "platform/nusec.h" + enum { NUSEC_IOCTL_PING = 0x22A114, NUSEC_IOCTL_ERASE_TRACE_LOG = 0x22E188, diff --git a/nu/nusec.h b/platform/nusec.h similarity index 100% rename from nu/nusec.h rename to platform/nusec.h