1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-11 23:17:08 +01:00

Split libnu into libplatform, libamex

Going to add some ALLS stuff to libplatform and the ALLS hardware
does not contain an AMEX board.
This commit is contained in:
Tau 2019-03-04 17:22:38 -05:00
parent 727ce5171f
commit bc297b2480
26 changed files with 76 additions and 53 deletions

View File

@ -18,12 +18,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "amex/ds.h"
#include "amex/nvram.h"
#include "hook/iobuf.h" #include "hook/iobuf.h"
#include "hook/iohook.h" #include "hook/iohook.h"
#include "nu/ds.h"
#include "nu/nvram.h"
#include "util/crc.h" #include "util/crc.h"
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/setupapi.h" #include "util/setupapi.h"

View File

View File

@ -10,10 +10,10 @@
#include <assert.h> #include <assert.h>
#include "hook/iohook.h" #include "amex/eeprom.h"
#include "amex/nvram.h"
#include "nu/eeprom.h" #include "hook/iohook.h"
#include "nu/nvram.h"
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/setupapi.h" #include "util/setupapi.h"

View File

@ -4,9 +4,9 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "hook/iohook.h" #include "amex/gpio.h"
#include "nu/gpio.h" #include "hook/iohook.h"
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/setupapi.h" #include "util/setupapi.h"

8
amex/guid.c Normal file
View File

@ -0,0 +1,8 @@
#include <windows.h>
#include <initguid.h>
#include "amex/ds.h"
#include "amex/eeprom.h"
#include "amex/gpio.h"
#include "amex/jvs.h"
#include "amex/sram.h"

View File

@ -8,13 +8,13 @@
#include <assert.h> #include <assert.h>
#include <stddef.h> #include <stddef.h>
#include "amex/jvs.h"
#include "hook/iobuf.h" #include "hook/iobuf.h"
#include "hook/iohook.h" #include "hook/iohook.h"
#include "jvs/jvs-bus.h" #include "jvs/jvs-bus.h"
#include "nu/jvs.h"
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/dump.h" #include "util/dump.h"
#include "util/setupapi.h" #include "util/setupapi.h"

View File

@ -1,5 +1,5 @@
nu_lib = static_library( amex_lib = static_library(
'nu', 'amex',
include_directories : inc, include_directories : inc,
implicit_include_directories : false, implicit_include_directories : false,
c_pch : [ c_pch : [
@ -8,7 +8,6 @@ nu_lib = static_library(
], ],
dependencies : [ dependencies : [
capnhook.get_variable('hook_dep'), capnhook.get_variable('hook_dep'),
capnhook.get_variable('hooklib_dep'),
], ],
sources : [ sources : [
'ds.c', 'ds.c',
@ -20,10 +19,6 @@ nu_lib = static_library(
'guid.c', 'guid.c',
'jvs.c', 'jvs.c',
'jvs.h', 'jvs.h',
'hwmon.c',
'hwmon.h',
'nusec.c',
'nusec.h',
'nvram.c', 'nvram.c',
'nvram.h', 'nvram.h',
'sram.c', 'sram.c',

View File

@ -4,9 +4,9 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#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) HRESULT nvram_open_file(HANDLE *out, wchar_t *path, size_t size)
{ {

View File

@ -10,10 +10,10 @@
#include <assert.h> #include <assert.h>
#include "hook/iohook.h" #include "amex/sram.h"
#include "amex/nvram.h"
#include "nu/sram.h" #include "hook/iohook.h"
#include "nu/nvram.h"
#include "util/dprintf.h" #include "util/dprintf.h"
#include "util/setupapi.h" #include "util/setupapi.h"

View File

@ -3,6 +3,12 @@
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#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/jvs.h"
#include "chunihook/slider-hook.h" #include "chunihook/slider-hook.h"
@ -10,13 +16,8 @@
#include "hooklib/serial.h" #include "hooklib/serial.h"
#include "nu/ds.h" #include "platform/hwmon.h"
#include "nu/eeprom.h" #include "platform/nusec.h"
#include "nu/gpio.h"
#include "nu/jvs.h"
#include "nu/hwmon.h"
#include "nu/nusec.h"
#include "nu/sram.h"
#include "util/clock.h" #include "util/clock.h"
#include "util/dprintf.h" #include "util/dprintf.h"
@ -47,16 +48,19 @@ static DWORD CALLBACK chuni_pre_startup(void)
gfx_hook_init(); gfx_hook_init();
serial_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(); hwmon_hook_init();
nusec_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 */ /* Initialize Chunithm board emulation */
slider_hook_init(); slider_hook_init();

View File

@ -5,12 +5,12 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "amex/jvs.h"
#include "board/io3.h" #include "board/io3.h"
#include "jvs/jvs-bus.h" #include "jvs/jvs-bus.h"
#include "nu/jvs.h"
#include "util/dprintf.h" #include "util/dprintf.h"
static void chunithm_jvs_read_switches(void *ctx, struct io3_switch_state *out); static void chunithm_jvs_read_switches(void *ctx, struct io3_switch_state *out);

View File

@ -12,9 +12,10 @@ shared_library(
capnhook.get_variable('hooklib_dep'), capnhook.get_variable('hooklib_dep'),
], ],
link_with : [ link_with : [
amex_lib,
board_lib, board_lib,
jvs_lib, jvs_lib,
nu_lib, platform_lib,
util_lib, util_lib,
], ],
sources : [ sources : [

View File

@ -30,9 +30,10 @@ xinput_lib = cc.find_library('xinput')
inc = include_directories('.') inc = include_directories('.')
capnhook = subproject('capnhook') capnhook = subproject('capnhook')
subdir('amex')
subdir('board') subdir('board')
subdir('jvs') subdir('jvs')
subdir('nu') subdir('platform')
subdir('util') subdir('util')
subdir('aimeio') subdir('aimeio')

View File

@ -1,9 +1,10 @@
#include <windows.h> #include <windows.h>
#include "amex/ds.h"
#include "hook/process.h" #include "hook/process.h"
#include "nu/ds.h" #include "platform/nusec.h"
#include "nu/nusec.h"
#include "util/clock.h" #include "util/clock.h"
#include "util/dprintf.h" #include "util/dprintf.h"
@ -15,10 +16,10 @@ static DWORD CALLBACK app_pre_startup(void)
{ {
dprintf("--- Begin %s ---\n", __func__); dprintf("--- Begin %s ---\n", __func__);
spike_hook_init("minispike.txt");
clock_hook_init();
ds_hook_init(); ds_hook_init();
nusec_hook_init(); nusec_hook_init();
clock_hook_init();
spike_hook_init("minispike.txt");
dprintf("--- End %s ---\n", __func__); dprintf("--- End %s ---\n", __func__);

View File

@ -11,7 +11,8 @@ shared_library(
capnhook.get_variable('hook_dep'), capnhook.get_variable('hook_dep'),
], ],
link_with : [ link_with : [
nu_lib, amex_lib,
platform_lib,
util_lib, util_lib,
], ],
sources : [ sources : [

View File

@ -1,8 +0,0 @@
#include <windows.h>
#include <initguid.h>
#include "nu/ds.h"
#include "nu/eeprom.h"
#include "nu/gpio.h"
#include "nu/jvs.h"
#include "nu/sram.h"

View File

@ -7,7 +7,7 @@
#include "hook/iohook.h" #include "hook/iohook.h"
#include "nu/hwmon.h" #include "platform/hwmon.h"
enum { enum {
HWMON_IOCTL_READ_CPU_TEMP = 0x80006000, HWMON_IOCTL_READ_CPU_TEMP = 0x80006000,

18
platform/meson.build Normal file
View File

@ -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',
],
)

View File

@ -7,6 +7,8 @@
#include "hook/iohook.h" #include "hook/iohook.h"
#include "platform/nusec.h"
enum { enum {
NUSEC_IOCTL_PING = 0x22A114, NUSEC_IOCTL_PING = 0x22A114,
NUSEC_IOCTL_ERASE_TRACE_LOG = 0x22E188, NUSEC_IOCTL_ERASE_TRACE_LOG = 0x22E188,