mirror of
https://gitea.tendokyu.moe/TeamTofuShop/segatools.git
synced 2026-09-28 21:07:59 +03:00
This PR implements the missing NFC, FeliCa, and Mifare command handlers in `aimeio`. This expands the reader's capability to support games and tools that utilize these specific radio functions. **Changes:** * Implemented NFC radio control functions. * Added MIFARE and FeliCa command handling. * Updated `aimeio` DLL exports and hook definitions. **Testing Status:** * I have verified the implementation using a virtual `aimeio` test environment, and the command handling works as expected. But I currently do not have access to a physical card reader, so haven't been able to verify the behavior on actual hardware yet. Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/94 Co-authored-by: グローランプ <130208311+Gl0w1amp@users.noreply.github.com> Co-committed-by: グローランプ <130208311+Gl0w1amp@users.noreply.github.com>
73 lines
2.1 KiB
C
73 lines
2.1 KiB
C
#pragma once
|
|
|
|
#include <windows.h>
|
|
#include <stdbool.h>
|
|
|
|
#include "aimeio/aimeio.h"
|
|
|
|
struct aime_dll {
|
|
uint16_t api_version;
|
|
HRESULT (*init)(void);
|
|
HRESULT (*nfc_poll)(uint8_t unit_no);
|
|
HRESULT (*nfc_get_aime_id)(
|
|
uint8_t unit_no,
|
|
uint8_t *luid,
|
|
size_t luid_size);
|
|
HRESULT (*nfc_get_felica_id)(uint8_t unit_no, uint64_t *IDm);
|
|
HRESULT (*nfc_get_mifare_uid)(
|
|
uint8_t unit_no,
|
|
uint8_t *uid,
|
|
size_t uid_size);
|
|
HRESULT (*nfc_mifare_select)(
|
|
uint8_t unit_no,
|
|
const uint8_t *uid,
|
|
size_t uid_size);
|
|
HRESULT (*nfc_mifare_set_key)(
|
|
uint8_t unit_no,
|
|
uint8_t key_type,
|
|
const uint8_t *key,
|
|
size_t key_size);
|
|
HRESULT (*nfc_mifare_authenticate)(
|
|
uint8_t unit_no,
|
|
uint8_t key_type,
|
|
const uint8_t *payload,
|
|
size_t payload_size);
|
|
HRESULT (*nfc_mifare_read_block)(
|
|
uint8_t unit_no,
|
|
const uint8_t *uid,
|
|
size_t uid_size,
|
|
uint8_t block_no,
|
|
uint8_t *block,
|
|
size_t block_size);
|
|
HRESULT (*nfc_felica_transact)(
|
|
uint8_t unit_no,
|
|
const uint8_t *req,
|
|
size_t req_size,
|
|
uint8_t *res,
|
|
size_t res_size,
|
|
size_t *res_size_written);
|
|
HRESULT (*nfc_radio_on)(uint8_t unit_no);
|
|
HRESULT (*nfc_radio_off)(uint8_t unit_no);
|
|
HRESULT (*nfc_to_update_mode)(uint8_t unit_no);
|
|
HRESULT (*nfc_send_hex_data)(
|
|
uint8_t unit_no,
|
|
const uint8_t *payload,
|
|
size_t payload_size,
|
|
uint8_t *status_out);
|
|
void (*led_set_color)(uint8_t unit_no, uint8_t r, uint8_t g, uint8_t b);
|
|
void (*vfd_set_text)(
|
|
const uint8_t *text,
|
|
size_t text_len,
|
|
const struct aime_io_vfd_state *state);
|
|
void (*vfd_set_state)(const struct aime_io_vfd_state *state);
|
|
};
|
|
|
|
struct aime_dll_config {
|
|
wchar_t path[MAX_PATH];
|
|
bool path64;
|
|
};
|
|
|
|
extern struct aime_dll aime_dll;
|
|
|
|
HRESULT aime_dll_init(const struct aime_dll_config *cfg, HINSTANCE self);
|