forked from Hay1tsme/segatools
sekito: implement rest
This commit is contained in:
16
Package.mk
16
Package.mk
@ -279,11 +279,7 @@ $(BUILD_DIR_ZIP)/sekito.zip:
|
|||||||
$(V)echo ... $@
|
$(V)echo ... $@
|
||||||
$(V)mkdir -p $(BUILD_DIR_ZIP)/sekito
|
$(V)mkdir -p $(BUILD_DIR_ZIP)/sekito
|
||||||
$(V)mkdir -p $(BUILD_DIR_ZIP)/sekito/DEVICE
|
$(V)mkdir -p $(BUILD_DIR_ZIP)/sekito/DEVICE
|
||||||
$(V)cp $(BUILD_DIR_32)/subprojects/capnhook/inject/inject_x86.exe \
|
$(V)cp $(DIST_DIR)/sekito/segatools_terminal.ini \
|
||||||
$(V)cp $(BUILD_DIR_64)/subprojects/capnhook/inject/inject_x64.exe \
|
|
||||||
$(BUILD_DIR_GAMES_64)/sekitohook/sekitohook_x64.dll \
|
|
||||||
$(BUILD_DIR_GAMES_32)/sekitohook/sekitohook_x86.dll \
|
|
||||||
$(DIST_DIR)/sekito/segatools_terminal.ini \
|
|
||||||
$(DIST_DIR)/sekito/segatools_satellite.ini \
|
$(DIST_DIR)/sekito/segatools_satellite.ini \
|
||||||
$(DIST_DIR)/sekito/launch_terminal.bat \
|
$(DIST_DIR)/sekito/launch_terminal.bat \
|
||||||
$(DIST_DIR)/sekito/launch_satellite.bat \
|
$(DIST_DIR)/sekito/launch_satellite.bat \
|
||||||
@ -293,6 +289,16 @@ $(BUILD_DIR_ZIP)/sekito.zip:
|
|||||||
$(V)cp pki/billing.pub \
|
$(V)cp pki/billing.pub \
|
||||||
pki/ca.crt \
|
pki/ca.crt \
|
||||||
$(BUILD_DIR_ZIP)/sekito/DEVICE
|
$(BUILD_DIR_ZIP)/sekito/DEVICE
|
||||||
|
$(V)cp $(BUILD_DIR_32)/subprojects/capnhook/inject/inject.exe \
|
||||||
|
$(BUILD_DIR_ZIP)/sekito/inject_x86.exe
|
||||||
|
$(V)cp $(BUILD_DIR_64)/subprojects/capnhook/inject/inject.exe \
|
||||||
|
$(BUILD_DIR_ZIP)/sekito/inject_x64.exe
|
||||||
|
$(V)cp $(BUILD_DIR_32)/subprojects/capnhook/inject/inject.exe \
|
||||||
|
$(BUILD_DIR_ZIP)/sekito/inject_x86.exe
|
||||||
|
$(V)cp $(BUILD_DIR_GAMES_32)/sekitohook/sekitohook.dll \
|
||||||
|
$(BUILD_DIR_ZIP)/sekito/sekitohook_x86.dll
|
||||||
|
$(V)cp $(BUILD_DIR_GAMES_64)/sekitohook/sekitohook.dll \
|
||||||
|
$(BUILD_DIR_ZIP)/sekito/sekitohook_x64.dll
|
||||||
$(V)strip $(BUILD_DIR_ZIP)/sekito/*.{exe,dll}
|
$(V)strip $(BUILD_DIR_ZIP)/sekito/*.{exe,dll}
|
||||||
$(V)cd $(BUILD_DIR_ZIP)/sekito ; zip -r ../sekito.zip *
|
$(V)cd $(BUILD_DIR_ZIP)/sekito ; zip -r ../sekito.zip *
|
||||||
|
|
||||||
|
@ -149,6 +149,7 @@ int WINAPI chcusb_getEEPROM(uint8_t index, uint8_t *rData, uint16_t *rResult);
|
|||||||
int WINAPI chcusb_setParameter(uint8_t a1, uint32_t a2, uint16_t *rResult);
|
int WINAPI chcusb_setParameter(uint8_t a1, uint32_t a2, uint16_t *rResult);
|
||||||
int WINAPI chcusb_getParameter(uint8_t a1, uint8_t *a2, uint16_t *rResult);
|
int WINAPI chcusb_getParameter(uint8_t a1, uint8_t *a2, uint16_t *rResult);
|
||||||
int WINAPI chcusb_universal_command(int32_t a1, uint8_t a2, int32_t a3, uint8_t *a4, uint16_t *rResult);
|
int WINAPI chcusb_universal_command(int32_t a1, uint8_t a2, int32_t a3, uint8_t *a4, uint16_t *rResult);
|
||||||
|
int WINAPI chcusb_writeIred(uint8_t* a1, uint8_t* a2, uint16_t* rResult);
|
||||||
|
|
||||||
/* PrintDLL API hooks */
|
/* PrintDLL API hooks */
|
||||||
|
|
||||||
@ -866,6 +867,336 @@ static const struct hook_symbol C3XXusb_hooks[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* CHC320 x86 hook table */
|
||||||
|
|
||||||
|
static const struct hook_symbol C320usb_hooks[] = {
|
||||||
|
{
|
||||||
|
.name = "__imp_chcusb_MakeThread",
|
||||||
|
.ordinal= 1,
|
||||||
|
.patch = chcusb_MakeThread,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_open",
|
||||||
|
.ordinal= 2,
|
||||||
|
.patch = chcusb_open,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_close",
|
||||||
|
.ordinal= 3,
|
||||||
|
.patch = chcusb_close,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_ReleaseThread",
|
||||||
|
.ordinal= 4,
|
||||||
|
.patch = chcusb_ReleaseThread,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_listupPrinter",
|
||||||
|
.ordinal= 5,
|
||||||
|
.patch = chcusb_listupPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_listupPrinterSN",
|
||||||
|
.ordinal= 6,
|
||||||
|
.patch = chcusb_listupPrinterSN,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_selectPrinter",
|
||||||
|
.ordinal= 7,
|
||||||
|
.patch = chcusb_selectPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_selectPrinterSN",
|
||||||
|
.ordinal= 8,
|
||||||
|
.patch = chcusb_selectPrinterSN,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getPrinterInfo",
|
||||||
|
.ordinal= 9,
|
||||||
|
.patch = chcusb_getPrinterInfo,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_imageformat",
|
||||||
|
.ordinal= 10,
|
||||||
|
.patch = chcusb_imageformat_330,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setmtf",
|
||||||
|
.ordinal= 11,
|
||||||
|
.patch = chcusb_setmtf,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_makeGamma",
|
||||||
|
.ordinal= 12,
|
||||||
|
.patch = chcusb_makeGamma,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setIcctable",
|
||||||
|
.ordinal= 13,
|
||||||
|
.patch = chcusb_setIcctable,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_copies",
|
||||||
|
.ordinal= 14,
|
||||||
|
.patch = chcusb_copies,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_status",
|
||||||
|
.ordinal= 15,
|
||||||
|
.patch = chcusb_status,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_statusAll",
|
||||||
|
.ordinal= 16,
|
||||||
|
.patch = chcusb_statusAll,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_startpage",
|
||||||
|
.ordinal= 17,
|
||||||
|
.patch = chcusb_startpage,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_endpage",
|
||||||
|
.ordinal= 18,
|
||||||
|
.patch = chcusb_endpage,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_write",
|
||||||
|
.ordinal= 19,
|
||||||
|
.patch = chcusb_write,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_writeLaminate",
|
||||||
|
.ordinal= 20,
|
||||||
|
.patch = chcusb_writeLaminate,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_writeHolo",
|
||||||
|
.ordinal= 21,
|
||||||
|
.patch = chcusb_writeHolo,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setPrinterInfo",
|
||||||
|
.ordinal= 22,
|
||||||
|
.patch = chcusb_setPrinterInfo,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getGamma",
|
||||||
|
.ordinal= 23,
|
||||||
|
.patch = chcusb_getGamma,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getMtf",
|
||||||
|
.ordinal= 24,
|
||||||
|
.patch = chcusb_getMtf,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_cancelCopies",
|
||||||
|
.ordinal= 25,
|
||||||
|
.patch = chcusb_cancelCopies,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setPrinterToneCurve",
|
||||||
|
.ordinal= 26,
|
||||||
|
.patch = chcusb_setPrinterToneCurve,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getPrinterToneCurve",
|
||||||
|
.ordinal= 27,
|
||||||
|
.patch = chcusb_getPrinterToneCurve,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "chcusb_blinkLED",
|
||||||
|
.ordinal= 28,
|
||||||
|
.patch = chcusb_blinkLED,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "chcusb_resetPrinter",
|
||||||
|
.ordinal= 29,
|
||||||
|
.patch = chcusb_resetPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_AttachThreadCount",
|
||||||
|
.ordinal= 30,
|
||||||
|
.patch = chcusb_AttachThreadCount,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getPrintIDStatus",
|
||||||
|
.ordinal= 31,
|
||||||
|
.patch = chcusb_getPrintIDStatus,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setPrintStandby",
|
||||||
|
.ordinal= 32,
|
||||||
|
.patch = chcusb_setPrintStandby,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "chcusb_testCardFeed",
|
||||||
|
.ordinal= 33,
|
||||||
|
.patch = chcusb_testCardFeed,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_exitCard",
|
||||||
|
.ordinal= 34,
|
||||||
|
.patch = chcusb_exitCard,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getCardRfidTID",
|
||||||
|
.ordinal= 35,
|
||||||
|
.patch = chcusb_getCardRfidTID,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_commCardRfidReader",
|
||||||
|
.ordinal= 36,
|
||||||
|
.patch = chcusb_commCardRfidReader,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_updateCardRfidReader",
|
||||||
|
.ordinal= 37,
|
||||||
|
.patch = chcusb_updateCardRfidReader,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getErrorLog",
|
||||||
|
.ordinal= 38,
|
||||||
|
.patch = chcusb_getErrorLog,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getErrorStatus",
|
||||||
|
.ordinal= 39,
|
||||||
|
.patch = chcusb_getErrorStatus,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setCutList",
|
||||||
|
.ordinal= 40,
|
||||||
|
.patch = chcusb_setCutList,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setLaminatePattern",
|
||||||
|
.ordinal= 41,
|
||||||
|
.patch = chcusb_setLaminatePattern,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_color_adjustment",
|
||||||
|
.ordinal= 42,
|
||||||
|
.patch = chcusb_color_adjustment,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_color_adjustmentEx",
|
||||||
|
.ordinal= 43,
|
||||||
|
.patch = chcusb_color_adjustmentEx,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_writeIred",
|
||||||
|
.ordinal= 50,
|
||||||
|
.patch = chcusb_writeIred,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getEEPROM",
|
||||||
|
.ordinal= 58,
|
||||||
|
.patch = chcusb_getEEPROM,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_setParameter",
|
||||||
|
.ordinal= 64,
|
||||||
|
.patch = chcusb_setParameter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_getParameter",
|
||||||
|
.ordinal= 65,
|
||||||
|
.patch = chcusb_getParameter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_chcusb_universal_command",
|
||||||
|
.ordinal= 73,
|
||||||
|
.patch = chcusb_universal_command,
|
||||||
|
.link = NULL
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct hook_symbol C320FWDLusb_hooks[] = {
|
||||||
|
{
|
||||||
|
.name = "__imp_fwdlusb_open",
|
||||||
|
.ordinal= 1,
|
||||||
|
.patch = fwdlusb_open,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_close",
|
||||||
|
.ordinal= 2,
|
||||||
|
.patch = fwdlusb_close,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_listupPrinter",
|
||||||
|
.ordinal= 3,
|
||||||
|
.patch = fwdlusb_listupPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_listupPrinterSN",
|
||||||
|
.ordinal= 4,
|
||||||
|
.patch = fwdlusb_listupPrinterSN,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_selectPrinter",
|
||||||
|
.ordinal= 5,
|
||||||
|
.patch = fwdlusb_selectPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_selectPrinterSN",
|
||||||
|
.ordinal= 6,
|
||||||
|
.patch = fwdlusb_selectPrinterSN,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_getPrinterInfo",
|
||||||
|
.ordinal= 7,
|
||||||
|
.patch = fwdlusb_getPrinterInfo,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_status",
|
||||||
|
.ordinal= 8,
|
||||||
|
.patch = fwdlusb_status,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_statusAll",
|
||||||
|
.ordinal= 9,
|
||||||
|
.patch = fwdlusb_statusAll,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_resetPrinter",
|
||||||
|
.ordinal= 10,
|
||||||
|
.patch = fwdlusb_resetPrinter,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_updateFirmware",
|
||||||
|
.ordinal= 11,
|
||||||
|
.patch = fwdlusb_updateFirmware,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_getFirmwareInfo",
|
||||||
|
.ordinal= 12,
|
||||||
|
.patch = fwdlusb_getFirmwareInfo,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_MakeThread",
|
||||||
|
.ordinal= 13,
|
||||||
|
.patch = fwdlusb_MakeThread,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_ReleaseThread",
|
||||||
|
.ordinal= 14,
|
||||||
|
.patch = fwdlusb_ReleaseThread,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_AttachThreadCount",
|
||||||
|
.ordinal= 15,
|
||||||
|
.patch = fwdlusb_AttachThreadCount,
|
||||||
|
.link = NULL
|
||||||
|
}, {
|
||||||
|
.name = "__imp_fwdlusb_getErrorLog",
|
||||||
|
.ordinal= 16,
|
||||||
|
.patch = fwdlusb_getErrorLog,
|
||||||
|
.link = NULL
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/* PrintDLL hook tbl */
|
/* PrintDLL hook tbl */
|
||||||
|
|
||||||
static struct hook_symbol printdll_hooks[] = {
|
static struct hook_symbol printdll_hooks[] = {
|
||||||
@ -1236,8 +1567,8 @@ void printer_chc_hook_insert_hooks(HMODULE target) {
|
|||||||
hook_table_apply(target, "C310Busb.dll", C3XXusb_hooks, _countof(C3XXusb_hooks));
|
hook_table_apply(target, "C310Busb.dll", C3XXusb_hooks, _countof(C3XXusb_hooks));
|
||||||
hook_table_apply(target, "C310FWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
hook_table_apply(target, "C310FWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
||||||
hook_table_apply(target, "C310BFWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
hook_table_apply(target, "C310BFWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
||||||
hook_table_apply(target, "C320Ausb.dll", C3XXusb_hooks, _countof(C3XXusb_hooks));
|
hook_table_apply(target, "C320Ausb.dll", C320usb_hooks, _countof(C3XXusb_hooks));
|
||||||
hook_table_apply(target, "C320AFWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
hook_table_apply(target, "C320AFWDLusb.dll", C320FWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
||||||
hook_table_apply(target, "C330Ausb.dll", C3XXusb_hooks, _countof(C3XXusb_hooks));
|
hook_table_apply(target, "C330Ausb.dll", C3XXusb_hooks, _countof(C3XXusb_hooks));
|
||||||
hook_table_apply(target, "C330AFWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
hook_table_apply(target, "C330AFWDLusb.dll", C3XXFWDLusb_hooks, _countof(C3XXFWDLusb_hooks));
|
||||||
|
|
||||||
@ -2162,6 +2493,11 @@ int WINAPI chcusb_getPrinterInfo(uint16_t tagNumber, uint8_t *rBuffer, uint32_t
|
|||||||
if (rBuffer) memset(rBuffer, 0, *rLen);
|
if (rBuffer) memset(rBuffer, 0, *rLen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 2: // unknown
|
||||||
|
if (*rLen != 0x17) *rLen = 0x17;
|
||||||
|
if (rBuffer) memset(rBuffer, 0, *rLen);
|
||||||
|
break;
|
||||||
|
|
||||||
case 3: // getFirmwareVersion
|
case 3: // getFirmwareVersion
|
||||||
if (*rLen != 0x99) *rLen = 0x99;
|
if (*rLen != 0x99) *rLen = 0x99;
|
||||||
if (rBuffer) {
|
if (rBuffer) {
|
||||||
@ -3153,3 +3489,12 @@ void printer_set_dimensions(int width, int height){
|
|||||||
WIDTH = width;
|
WIDTH = width;
|
||||||
HEIGHT = height;
|
HEIGHT = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int WINAPI chcusb_writeIred(uint8_t* a1, uint8_t* a2, uint16_t* rResult) {
|
||||||
|
dprintf("Printer: C3XXusb: %s, %p, %p\n", __func__, a1, a2);
|
||||||
|
dump(a1, 16);
|
||||||
|
dump(a2, 16);
|
||||||
|
*rResult = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
@ -18,6 +18,7 @@
|
|||||||
static HRESULT amvideo_reg_read_name(void *bytes, uint32_t *nbytes);
|
static HRESULT amvideo_reg_read_name(void *bytes, uint32_t *nbytes);
|
||||||
static HRESULT amvideo_reg_read_port_X(void *bytes, uint32_t *nbytes);
|
static HRESULT amvideo_reg_read_port_X(void *bytes, uint32_t *nbytes);
|
||||||
static HRESULT amvideo_reg_read_resolution_1(void *bytes, uint32_t *nbytes);
|
static HRESULT amvideo_reg_read_resolution_1(void *bytes, uint32_t *nbytes);
|
||||||
|
static HRESULT amvideo_reg_read_resolution_2(void *bytes, uint32_t *nbytes);
|
||||||
static HRESULT amvideo_reg_read_setting(void *bytes, uint32_t *nbytes);
|
static HRESULT amvideo_reg_read_setting(void *bytes, uint32_t *nbytes);
|
||||||
static HRESULT amvideo_reg_read_use_segatiming(void *bytes, uint32_t *nbytes);
|
static HRESULT amvideo_reg_read_use_segatiming(void *bytes, uint32_t *nbytes);
|
||||||
|
|
||||||
@ -81,6 +82,10 @@ static const struct reg_hook_val amvideo_reg_mode_vals[] = {
|
|||||||
.name = L"resolution_1",
|
.name = L"resolution_1",
|
||||||
.read = amvideo_reg_read_resolution_1,
|
.read = amvideo_reg_read_resolution_1,
|
||||||
.type = REG_SZ,
|
.type = REG_SZ,
|
||||||
|
}, {
|
||||||
|
.name = L"resolution_2",
|
||||||
|
.read = amvideo_reg_read_resolution_2,
|
||||||
|
.type = REG_SZ,
|
||||||
}, {
|
}, {
|
||||||
.name = L"use_segatiming",
|
.name = L"use_segatiming",
|
||||||
.read = amvideo_reg_read_use_segatiming,
|
.read = amvideo_reg_read_use_segatiming,
|
||||||
@ -171,6 +176,11 @@ static HRESULT amvideo_reg_read_resolution_1(void *bytes, uint32_t *nbytes)
|
|||||||
return reg_hook_read_wstr(bytes, nbytes, L"1920x1080");
|
return reg_hook_read_wstr(bytes, nbytes, L"1920x1080");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT amvideo_reg_read_resolution_2(void *bytes, uint32_t *nbytes)
|
||||||
|
{
|
||||||
|
return reg_hook_read_wstr(bytes, nbytes, L"1920x1080");
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT amvideo_reg_read_setting(void *bytes, uint32_t *nbytes)
|
static HRESULT amvideo_reg_read_setting(void *bytes, uint32_t *nbytes)
|
||||||
{
|
{
|
||||||
return reg_hook_read_wstr(bytes, nbytes, L"0");
|
return reg_hook_read_wstr(bytes, nbytes, L"0");
|
||||||
|
2
dist/ekt/card_player.html
vendored
2
dist/ekt/card_player.html
vendored
@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function connect(){
|
function connect(){
|
||||||
socket = new WebSocket("ws://127.0.0.1:3497/y3io");
|
socket = new WebSocket("ws://127.0.0.1:3594/y3io");
|
||||||
|
|
||||||
socket.onopen = function(e) {
|
socket.onopen = function(e) {
|
||||||
document.getElementById("status").innerText = "Connected. Loading information...";
|
document.getElementById("status").innerText = "Connected. Loading information...";
|
||||||
|
2
dist/sekito/card_player.html
vendored
2
dist/sekito/card_player.html
vendored
@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function connect(){
|
function connect(){
|
||||||
socket = new WebSocket("ws://127.0.0.1:3497/y3io");
|
socket = new WebSocket("ws://127.0.0.1:3594/y3io");
|
||||||
|
|
||||||
socket.onopen = function(e) {
|
socket.onopen = function(e) {
|
||||||
document.getElementById("status").innerText = "Connected. Loading information...";
|
document.getElementById("status").innerText = "Connected. Loading information...";
|
||||||
|
22
dist/sekito/segatools_satellite.ini
vendored
22
dist/sekito/segatools_satellite.ini
vendored
@ -76,6 +76,28 @@ dipsw1=0
|
|||||||
; Misc. hooks settings
|
; Misc. hooks settings
|
||||||
; -----------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
[printer]
|
||||||
|
; Sinfonia CHC-C320 printer emulation setting.
|
||||||
|
enable=1
|
||||||
|
; Change the printer serial number here.
|
||||||
|
serial_no="5A-A123"
|
||||||
|
; Insert the path to the image output directory here.
|
||||||
|
printerOutPath="DEVICE\print"
|
||||||
|
; Rotate all printed images by 180 degrees.
|
||||||
|
rotate180=1
|
||||||
|
|
||||||
|
[gfx]
|
||||||
|
; Enables the graphics hook.
|
||||||
|
enable=1
|
||||||
|
; Force the game to run windowed.
|
||||||
|
windowed=1
|
||||||
|
; Add a frame to the game window if running windowed.
|
||||||
|
framed=0
|
||||||
|
; Select the monitor to run the game on. (Fullscreen only, 0 =primary screen)
|
||||||
|
monitor=0
|
||||||
|
; Enable DPI awareness for the game process, preventing Windows from stretching the game window if a DPI scaling higher than 100% is used
|
||||||
|
dpiAware=1
|
||||||
|
|
||||||
[flatPanelReader]
|
[flatPanelReader]
|
||||||
; Enable the Y3 board emulation.
|
; Enable the Y3 board emulation.
|
||||||
enable=1
|
enable=1
|
||||||
|
16
dist/sekito/segatools_terminal.ini
vendored
16
dist/sekito/segatools_terminal.ini
vendored
@ -72,6 +72,22 @@ enable=1
|
|||||||
; this to 0 on exactly one machine and set this to 1 on all others.
|
; this to 0 on exactly one machine and set this to 1 on all others.
|
||||||
dipsw1=0
|
dipsw1=0
|
||||||
|
|
||||||
|
; -----------------------------------------------------------------------------
|
||||||
|
; Misc. hooks settings
|
||||||
|
; -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
[gfx]
|
||||||
|
; Enables the graphics hook.
|
||||||
|
enable=1
|
||||||
|
; Force the game to run windowed.
|
||||||
|
windowed=1
|
||||||
|
; Add a frame to the game window if running windowed.
|
||||||
|
framed=0
|
||||||
|
; Select the monitor to run the game on. (Fullscreen only, 0 =primary screen)
|
||||||
|
monitor=0
|
||||||
|
; Enable DPI awareness for the game process, preventing Windows from stretching the game window if a DPI scaling higher than 100% is used
|
||||||
|
dpiAware=1
|
||||||
|
|
||||||
; -----------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------
|
||||||
; LED settings
|
; LED settings
|
||||||
; -----------------------------------------------------------------------------
|
; -----------------------------------------------------------------------------
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
#include "amex/config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "board/config.h"
|
#include "board/config.h"
|
||||||
|
#include "gfxhook/config.h"
|
||||||
|
|
||||||
#include "sekitohook/config.h"
|
#include "sekitohook/config.h"
|
||||||
#include "sekitohook/sekito-dll.h"
|
#include "sekitohook/sekito-dll.h"
|
||||||
@ -102,6 +105,8 @@ void sekito_hook_config_load(
|
|||||||
led15093_config_load(&cfg->led15093, filename);
|
led15093_config_load(&cfg->led15093, filename);
|
||||||
y3_config_load(&cfg->y3, filename);
|
y3_config_load(&cfg->y3, filename);
|
||||||
printer_chc_config_load(&cfg->printer, filename);
|
printer_chc_config_load(&cfg->printer, filename);
|
||||||
unity_config_load(&cfg->unity, filename);
|
|
||||||
sekito_dll_config_load(&cfg->dll, filename);
|
sekito_dll_config_load(&cfg->dll, filename);
|
||||||
|
gfx_config_load(&cfg->gfx, filename);
|
||||||
|
amex_config_load(&cfg->amex, filename);
|
||||||
|
amvideo_config_load(&cfg->amvideo, filename);
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "amex/amex.h"
|
||||||
#include "board/sg-reader.h"
|
#include "board/sg-reader.h"
|
||||||
#include "board/config.h"
|
#include "board/config.h"
|
||||||
#include "board/led15093.h"
|
#include "board/led15093.h"
|
||||||
|
#include "gfxhook/gfx.h"
|
||||||
|
|
||||||
#include "sekitohook/sekito-dll.h"
|
#include "sekitohook/sekito-dll.h"
|
||||||
|
|
||||||
@ -14,7 +16,6 @@
|
|||||||
|
|
||||||
#include "platform/config.h"
|
#include "platform/config.h"
|
||||||
|
|
||||||
#include "unityhook/config.h"
|
|
||||||
|
|
||||||
struct sekito_hook_config {
|
struct sekito_hook_config {
|
||||||
struct platform_config platform;
|
struct platform_config platform;
|
||||||
@ -24,8 +25,10 @@ struct sekito_hook_config {
|
|||||||
struct led15093_config led15093;
|
struct led15093_config led15093;
|
||||||
struct y3_config y3;
|
struct y3_config y3;
|
||||||
struct sekito_dll_config dll;
|
struct sekito_dll_config dll;
|
||||||
struct unity_config unity;
|
|
||||||
struct printer_chc_config printer;
|
struct printer_chc_config printer;
|
||||||
|
struct gfx_config gfx;
|
||||||
|
struct amex_config amex;
|
||||||
|
struct amvideo_config amvideo;
|
||||||
};
|
};
|
||||||
|
|
||||||
void sekito_dll_config_load(
|
void sekito_dll_config_load(
|
||||||
|
@ -3,19 +3,20 @@
|
|||||||
|
|
||||||
Devices
|
Devices
|
||||||
|
|
||||||
USB: 837-15257-01 "Type 4" I/O Board
|
USB: 837-14572 "Type 3" I/O Board
|
||||||
COM12: 837-15396 "Gen 3" Aime Reader
|
COM12: Aime
|
||||||
|
|
||||||
[Satellite]
|
[Satellite]
|
||||||
|
|
||||||
USB: Printer
|
USB: Printer
|
||||||
COM1: 837-15093-06 LED Controller Board
|
COM1: 837-15093-06 LED Controller Board
|
||||||
|
COM10: 601-13160-01 "Flat Panel Reader" Y3CR BD SIE F720MM Board
|
||||||
COM11: Printer Camera
|
COM11: Printer Camera
|
||||||
|
|
||||||
[Terminal]
|
[Terminal]
|
||||||
|
|
||||||
COM1: 837-15396 "Gen 3" Aime Reader
|
COM1: Aime
|
||||||
COM3: 837-15093-06 LED Controller Board
|
COM11: 837-15093-06 LED Controller Board
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -23,36 +24,31 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "sekito-dll.h"
|
#include "sekito-dll.h"
|
||||||
|
#include "amex/amex.h"
|
||||||
#include "board/sg-reader.h"
|
#include "board/sg-reader.h"
|
||||||
#include "board/led15093.h"
|
#include "board/led15093.h"
|
||||||
|
#include "gfxhook/gfx.h"
|
||||||
|
|
||||||
#include "hook/process.h"
|
#include "hook/process.h"
|
||||||
#include "hook/iohook.h"
|
#include "hook/iohook.h"
|
||||||
|
#include "hooklib/dll.h"
|
||||||
|
|
||||||
#include "hooklib/serial.h"
|
#include "hooklib/serial.h"
|
||||||
#include "hooklib/spike.h"
|
#include "hooklib/spike.h"
|
||||||
|
|
||||||
#include "sekitohook/config.h"
|
#include "sekitohook/config.h"
|
||||||
#include "sekitohook/io4.h"
|
#include "sekitohook/jvs.h"
|
||||||
#include "hooklib/printer_cx.h"
|
|
||||||
|
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
|
|
||||||
#include "unityhook/hook.h"
|
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
#include "util/env.h"
|
#include "util/env.h"
|
||||||
#include "hooklib/y3-dll.h"
|
|
||||||
#include "hooklib/y3.h"
|
#include "hooklib/y3.h"
|
||||||
|
|
||||||
static HMODULE sekito_hook_mod;
|
static HMODULE sekito_hook_mod;
|
||||||
static process_entry_t sekito_startup;
|
static process_entry_t sekito_startup;
|
||||||
static struct sekito_hook_config sekito_hook_cfg;
|
static struct sekito_hook_config sekito_hook_cfg;
|
||||||
|
|
||||||
static void unity_hook_callback(HMODULE hmodule, const wchar_t* p) {
|
|
||||||
netenv_hook_apply_hooks(hmodule);
|
|
||||||
}
|
|
||||||
|
|
||||||
static DWORD CALLBACK sekito_pre_startup(void)
|
static DWORD CALLBACK sekito_pre_startup(void)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@ -67,7 +63,9 @@ static DWORD CALLBACK sekito_pre_startup(void)
|
|||||||
/* Hook Win32 APIs */
|
/* Hook Win32 APIs */
|
||||||
|
|
||||||
dvd_hook_init(&sekito_hook_cfg.dvd, sekito_hook_mod);
|
dvd_hook_init(&sekito_hook_cfg.dvd, sekito_hook_mod);
|
||||||
|
gfx_hook_init(&sekito_hook_cfg.gfx);
|
||||||
serial_hook_init();
|
serial_hook_init();
|
||||||
|
sekito_io_init();
|
||||||
|
|
||||||
/* Hook external DLL APIs */
|
/* Hook external DLL APIs */
|
||||||
|
|
||||||
@ -78,6 +76,10 @@ static DWORD CALLBACK sekito_pre_startup(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printer_chc_hook_init(&sekito_hook_cfg.printer, 0, sekito_hook_mod);
|
printer_chc_hook_init(&sekito_hook_cfg.printer, 0, sekito_hook_mod);
|
||||||
|
if (sekito_hook_cfg.printer.enable) {
|
||||||
|
dll_hook_push(sekito_hook_mod, L"C320Ausb.dll");
|
||||||
|
dll_hook_push(sekito_hook_mod, L"C320AFWDLusb.dll");
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize emulation hooks */
|
/* Initialize emulation hooks */
|
||||||
|
|
||||||
@ -104,8 +106,8 @@ static DWORD CALLBACK sekito_pre_startup(void)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
// LED: terminal uses COM 3 and satellite use COM 2
|
// LED: terminal uses COM 11 and satellite use COM 2
|
||||||
unsigned int led_port_no[2] = {is_terminal ? 3 : 2, 0};
|
unsigned int led_port_no[2] = {is_terminal ? 11 : 1, 0};
|
||||||
|
|
||||||
hr = sekito_dll_init(&sekito_hook_cfg.dll, sekito_hook_mod);
|
hr = sekito_dll_init(&sekito_hook_cfg.dll, sekito_hook_mod);
|
||||||
|
|
||||||
@ -113,12 +115,6 @@ static DWORD CALLBACK sekito_pre_startup(void)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = sekito_io4_hook_init(&sekito_hook_cfg.io4, is_terminal);
|
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr = led15093_hook_init(&sekito_hook_cfg.led15093,
|
hr = led15093_hook_init(&sekito_hook_cfg.led15093,
|
||||||
sekito_dll.led_init, sekito_dll.led_set_leds, led_port_no);
|
sekito_dll.led_init, sekito_dll.led_set_leds, led_port_no);
|
||||||
|
|
||||||
@ -144,6 +140,18 @@ static DWORD CALLBACK sekito_pre_startup(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sekito_jvs_set_terminal(is_terminal);
|
||||||
|
hr = amex_hook_init(&sekito_hook_cfg.amex, sekito_jvs_init);
|
||||||
|
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
hr = amvideo_hook_init(&sekito_hook_cfg.amvideo, sekito_hook_mod);
|
||||||
|
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize debug helpers */
|
/* Initialize debug helpers */
|
||||||
|
|
||||||
spike_hook_init(get_config_path());
|
spike_hook_init(get_config_path());
|
||||||
|
@ -1,212 +0,0 @@
|
|||||||
#include "io4.h"
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "board/io4.h"
|
|
||||||
|
|
||||||
#include "sekitohook/sekito-dll.h"
|
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
|
||||||
|
|
||||||
static HRESULT sekito_io4_poll(void *ctx, struct io4_state *state);
|
|
||||||
static uint16_t coins;
|
|
||||||
|
|
||||||
static const struct io4_ops sekito_io4_ops = {
|
|
||||||
.poll = sekito_io4_poll,
|
|
||||||
};
|
|
||||||
|
|
||||||
static bool io_is_terminal;
|
|
||||||
|
|
||||||
HRESULT sekito_io4_hook_init(const struct io4_config *cfg, bool is_terminal)
|
|
||||||
{
|
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
assert(sekito_dll.init != NULL);
|
|
||||||
|
|
||||||
hr = io4_hook_init(cfg, &sekito_io4_ops, NULL);
|
|
||||||
|
|
||||||
io_is_terminal = is_terminal;
|
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return sekito_dll.init();
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT sekito_io4_poll(void *ctx, struct io4_state *state)
|
|
||||||
{
|
|
||||||
uint8_t opbtn;
|
|
||||||
uint16_t x, y;
|
|
||||||
uint32_t gamebtn;
|
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
assert(sekito_dll.poll != NULL);
|
|
||||||
assert(sekito_dll.get_opbtns != NULL);
|
|
||||||
assert(sekito_dll.get_gamebtns != NULL);
|
|
||||||
assert(sekito_dll.get_trackball_position != NULL);
|
|
||||||
|
|
||||||
memset(state, 0, sizeof(*state));
|
|
||||||
|
|
||||||
hr = sekito_dll.poll();
|
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
opbtn = 0;
|
|
||||||
gamebtn = 0;
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
|
|
||||||
sekito_dll.get_opbtns(&opbtn);
|
|
||||||
sekito_dll.get_gamebtns(&gamebtn);
|
|
||||||
sekito_dll.get_trackball_position(&x, &y);
|
|
||||||
|
|
||||||
if (opbtn & SEKITO_IO_OPBTN_TEST) {
|
|
||||||
state->buttons[0] |= IO4_BUTTON_TEST;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opbtn & SEKITO_IO_OPBTN_SERVICE) {
|
|
||||||
state->buttons[0] |= IO4_BUTTON_SERVICE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opbtn & SEKITO_IO_OPBTN_SW1) {
|
|
||||||
state->buttons[0] |= 1 << 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opbtn & SEKITO_IO_OPBTN_SW2) {
|
|
||||||
state->buttons[0] |= 1 << 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opbtn & SEKITO_IO_OPBTN_COIN) {
|
|
||||||
coins++;
|
|
||||||
}
|
|
||||||
state->chutes[0] = coins << 8;
|
|
||||||
|
|
||||||
if (!io_is_terminal) {
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_HOUGU) {
|
|
||||||
state->buttons[1] |= 1 << 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_MENU) {
|
|
||||||
state->buttons[1] |= 1 << 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_START) {
|
|
||||||
state->buttons[0] |= 1 << 15;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_STRATAGEM) {
|
|
||||||
state->buttons[1] |= 1 << 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_STRATAGEM_LOCK) {
|
|
||||||
state->buttons[1] |= 1 << 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_0) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C2;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_1) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C1;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_2) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C2;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_3) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C3;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_4) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C1;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_5) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C2;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_6) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C3;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_7) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C1;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_8) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C2;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_9) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C3;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_CLEAR) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C1;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_ENTER) {
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_C3;
|
|
||||||
state->buttons[0] |= SEKITO_NUMPAD_R4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (io_is_terminal) {
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_CANCEL) {
|
|
||||||
state->buttons[1] |= 1 << 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_DECIDE) {
|
|
||||||
state->buttons[1] |= 1 << 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_LEFT) {
|
|
||||||
state->buttons[0] |= 1 << 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_UP) {
|
|
||||||
state->buttons[0] |= 1 << 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_RIGHT) {
|
|
||||||
state->buttons[0] |= 1 << 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_DOWN) {
|
|
||||||
state->buttons[0] |= 1 << 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_LEFT_2) {
|
|
||||||
state->buttons[1] |= 1 << 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_RIGHT_2) {
|
|
||||||
state->buttons[1] |= 1 << 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
state->spinners[2] = x;
|
|
||||||
state->spinners[3] = y;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
252
games/sekitohook/jvs.c
Normal file
252
games/sekitohook/jvs.c
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
#include "jvs.h"
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "amex/jvs.h"
|
||||||
|
|
||||||
|
#include "board/io3.h"
|
||||||
|
|
||||||
|
#include "sekitohook/config.h"
|
||||||
|
|
||||||
|
#include "jvs/jvs-bus.h"
|
||||||
|
|
||||||
|
#include "util/dprintf.h"
|
||||||
|
|
||||||
|
static void sekito_jvs_read_switches(void* ctx, struct io3_switch_state* out);
|
||||||
|
|
||||||
|
static void sekito_jvs_read_coin_counter(
|
||||||
|
void* ctx,
|
||||||
|
uint8_t slot_no,
|
||||||
|
uint16_t* out);
|
||||||
|
|
||||||
|
static void sekito_jvs_read_rotary(
|
||||||
|
void* ctx,
|
||||||
|
uint16_t* rotary,
|
||||||
|
uint8_t nrotary);
|
||||||
|
|
||||||
|
static const struct io3_ops sekito_jvs_io3_ops = {
|
||||||
|
.read_switches = sekito_jvs_read_switches,
|
||||||
|
.read_rotarys = sekito_jvs_read_rotary,
|
||||||
|
.read_coin_counter = sekito_jvs_read_coin_counter,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct io3 sekito_jvs_io3;
|
||||||
|
|
||||||
|
static bool io_is_terminal;
|
||||||
|
|
||||||
|
HRESULT sekito_jvs_init(struct jvs_node** out) {
|
||||||
|
assert(out != NULL);
|
||||||
|
|
||||||
|
dprintf("JVS I/O: Starting JVS\n");
|
||||||
|
|
||||||
|
io3_init(&sekito_jvs_io3, NULL, &sekito_jvs_io3_ops, NULL);
|
||||||
|
*out = io3_to_jvs_node(&sekito_jvs_io3);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sekito_jvs_set_terminal(bool is_terminal) {
|
||||||
|
io_is_terminal = is_terminal;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sekito_jvs_read_switches(void* ctx, struct io3_switch_state* out) {
|
||||||
|
assert(out != NULL);
|
||||||
|
|
||||||
|
uint8_t opbtn;
|
||||||
|
uint32_t gamebtn;
|
||||||
|
|
||||||
|
assert(sekito_dll.poll != NULL);
|
||||||
|
assert(sekito_dll.get_opbtns != NULL);
|
||||||
|
assert(sekito_dll.get_gamebtns != NULL);
|
||||||
|
|
||||||
|
memset(out, 0, sizeof(*out));
|
||||||
|
|
||||||
|
sekito_dll.poll();
|
||||||
|
|
||||||
|
opbtn = 0;
|
||||||
|
gamebtn = 0;
|
||||||
|
|
||||||
|
sekito_dll.get_opbtns(&opbtn);
|
||||||
|
sekito_dll.get_gamebtns(&gamebtn);
|
||||||
|
|
||||||
|
if (opbtn & SEKITO_IO_OPBTN_TEST) {
|
||||||
|
out->system = 0x80;
|
||||||
|
} else {
|
||||||
|
out->system = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opbtn & SEKITO_IO_OPBTN_SERVICE) {
|
||||||
|
out->p1 |= 1 << 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opbtn & SEKITO_IO_OPBTN_SW1) {
|
||||||
|
out->p1 |= 1 << 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opbtn & SEKITO_IO_OPBTN_SW2) {
|
||||||
|
out->p1 |= 1 << 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opbtn & SEKITO_IO_OPBTN_COIN) {
|
||||||
|
out->p1 |= 1 << 14;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!io_is_terminal) {
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_HOUGU) {
|
||||||
|
out->p2 |= 1 << 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_MENU) {
|
||||||
|
out->p2 |= 1 << 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_START) {
|
||||||
|
out->p1 |= 1 << 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_STRATAGEM) {
|
||||||
|
out->p2 |= 1 << 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_STRATAGEM_LOCK) {
|
||||||
|
out->p2 |= 1 << 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
out->p1 |= 0 << 2; // card_sensor
|
||||||
|
out->p2 |= 1 << 2; // open_sensor
|
||||||
|
out->p2 |= 1 << 3; // lock
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_0) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C2;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_1) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C1;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_2) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C2;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_3) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C3;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_4) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C1;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_5) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C2;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_6) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C3;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_7) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C1;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_8) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C2;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_9) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C3;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_CLEAR) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C1;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_NUMPAD_ENTER) {
|
||||||
|
out->p1 |= SEKITO_NUMPAD_C3;
|
||||||
|
out->p1 |= SEKITO_NUMPAD_R4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (io_is_terminal) {
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_CANCEL) {
|
||||||
|
out->p2 |= 1 << 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_DECIDE) {
|
||||||
|
out->p2 |= 1 << 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_LEFT) {
|
||||||
|
out->p1 |= 1 << 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_UP) {
|
||||||
|
out->p1 |= 1 << 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_RIGHT) {
|
||||||
|
out->p1 |= 1 << 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_DOWN) {
|
||||||
|
out->p1 |= 1 << 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_LEFT_2) {
|
||||||
|
out->p2 |= 1 << 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gamebtn & SEKITO_IO_GAMEBTN_TERMINAL_RIGHT_2) {
|
||||||
|
out->p2 |= 1 << 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sekito_jvs_read_rotary(
|
||||||
|
void* ctx,
|
||||||
|
uint16_t* rotary,
|
||||||
|
uint8_t nrotary) {
|
||||||
|
assert(rotary != NULL);
|
||||||
|
assert(sekito_dll.get_trackball_position != NULL);
|
||||||
|
|
||||||
|
uint16_t x, y;
|
||||||
|
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
|
||||||
|
sekito_dll.get_trackball_position(&x, &y);
|
||||||
|
|
||||||
|
if (nrotary >= 4) {
|
||||||
|
rotary[2] = x;
|
||||||
|
rotary[3] = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sekito_jvs_read_coin_counter(
|
||||||
|
void* ctx,
|
||||||
|
uint8_t slot_no,
|
||||||
|
uint16_t* out) {
|
||||||
|
if (slot_no > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unused(!)
|
||||||
|
*out = 0;
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "board/io4.h"
|
#include "jvs/jvs-bus.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SEKITO_NUMPAD_R1 = 1 << 9,
|
SEKITO_NUMPAD_R1 = 1 << 9,
|
||||||
@ -14,4 +14,5 @@ enum {
|
|||||||
SEKITO_NUMPAD_C3 = 1 << 3
|
SEKITO_NUMPAD_C3 = 1 << 3
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT sekito_io4_hook_init(const struct io4_config *cfg, bool is_terminal);
|
HRESULT sekito_jvs_init(struct jvs_node **root);
|
||||||
|
void sekito_jvs_set_terminal(bool is_terminal);
|
@ -10,12 +10,13 @@ shared_library(
|
|||||||
],
|
],
|
||||||
link_with : [
|
link_with : [
|
||||||
aimeio_lib,
|
aimeio_lib,
|
||||||
|
amex_lib,
|
||||||
board_lib,
|
board_lib,
|
||||||
sekitoio_lib,
|
|
||||||
hooklib_lib,
|
hooklib_lib,
|
||||||
|
gfxhook_lib,
|
||||||
jvs_lib,
|
jvs_lib,
|
||||||
platform_lib,
|
platform_lib,
|
||||||
unityhook_lib,
|
sekitoio_lib,
|
||||||
util_lib,
|
util_lib,
|
||||||
y3io_lib,
|
y3io_lib,
|
||||||
],
|
],
|
||||||
@ -23,8 +24,8 @@ shared_library(
|
|||||||
'config.c',
|
'config.c',
|
||||||
'config.h',
|
'config.h',
|
||||||
'dllmain.c',
|
'dllmain.c',
|
||||||
'io4.c',
|
'jvs.c',
|
||||||
'io4.h',
|
'jvs.h',
|
||||||
'sekito-dll.c',
|
'sekito-dll.c',
|
||||||
'sekito-dll.h',
|
'sekito-dll.h',
|
||||||
],
|
],
|
||||||
|
@ -19,6 +19,10 @@ EXPORTS
|
|||||||
y3_io_init
|
y3_io_init
|
||||||
y3_io_close
|
y3_io_close
|
||||||
y3_io_get_cards
|
y3_io_get_cards
|
||||||
|
amDllVideoClose
|
||||||
|
amDllVideoGetVBiosVersion
|
||||||
|
amDllVideoOpen
|
||||||
|
amDllVideoSetResolution
|
||||||
API_DLLVersion @1
|
API_DLLVersion @1
|
||||||
API_GetLastError @2
|
API_GetLastError @2
|
||||||
API_GetErrorMessage @3
|
API_GetErrorMessage @3
|
||||||
|
Reference in New Issue
Block a user