From 9316644f0b3ae554ce5adea3cc7981d648126fff Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 26 Jun 2022 17:52:09 -0400 Subject: [PATCH] hiti: Hook up P530D, probably won't work yet. --- README | 4 ++- backend_common.h | 1 + backend_hiti.c | 84 ++++++++++++++++++++++++++++++------------------ blacklist | 3 ++ 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/README b/README index 6af9b13..91a5cd7 100644 --- a/README +++ b/README @@ -83,6 +83,7 @@ DNP M8 Fujifilm ASK-500 HiTi M610 (not X610!) + HiTi P530D HiTi P720L / P728L HiTi P750L HiTi P910L @@ -1266,7 +1267,7 @@ Notes: hiti-p510k hiti-p510l hiti-p510s hiti-p510si hiti-p518a hiti-p518s - hiti-p520l hiti-p525l hiti-p52x + hiti-p520l hiti-p525l hiti-p52x hiti-p530 hiti-p720l hiti-p728l hiti-p750l hiti-cs200e hiti-cs220e hiti-cs230e hiti-cs250e hiti-cs290e @@ -1280,6 +1281,7 @@ Notes: Untested, but expected to work: HiTi P518 series + HiTi P530D HiTi P720L / P728L HiTi P750L diff --git a/backend_common.h b/backend_common.h index c33d215..84a1830 100644 --- a/backend_common.h +++ b/backend_common.h @@ -119,6 +119,7 @@ enum { P_HITI_CS2XX, P_HITI_51X, P_HITI_52X, + P_HITI_530, P_HITI_720, P_HITI_750, P_HITI_910, diff --git a/backend_hiti.c b/backend_hiti.c index 3374d4f..1a9131a 100644 --- a/backend_hiti.c +++ b/backend_hiti.c @@ -1069,7 +1069,7 @@ static uint8_t *hiti_get_correction_data(struct hiti_ctx *ctx, uint8_t mode) int ret, len; int mediaver = ctx->ribbonvendor & 0x3f; - int mediatype = ((ctx->ribbonvendor & 0xf000) == 0x1000); + int mediatype = ctx->ribbonvendor & 0xf000; switch (ctx->conn->type) { @@ -1077,15 +1077,8 @@ static uint8_t *hiti_get_correction_data(struct hiti_ctx *ctx, uint8_t mode) fname = "CS2xx_CMPBcd.bin"; break; case P_HITI_51X: - if (!mediatype) { /* DNP media */ - if (mode) { - fname = "P51x_CMQPra.bin"; - break; - } else { - fname = "P51x_CMPPra.bin"; - break; - } - } else { /* CHC media */ + if (mediatype == 0x1000) { /* CHC media */ + if (mode) { switch(mediaver) { case 0: @@ -1128,6 +1121,14 @@ static uint8_t *hiti_get_correction_data(struct hiti_ctx *ctx, uint8_t mode) break; } } + } else { /* DNP media */ + if (mode) { + fname = "P51x_CMQPra.bin"; + break; + } else { + fname = "P51x_CMPPra.bin"; + break; + } } break; case P_HITI_52X: @@ -1156,16 +1157,11 @@ static uint8_t *hiti_get_correction_data(struct hiti_ctx *ctx, uint8_t mode) break; } break; + case P_HITI_530: + fname = "P53x_CCPPrk.bin"; + break; case P_HITI_720: - if (!mediatype) { - if (mode) { - fname = "P72x_CMQPrd.bin"; - break; - } else { - fname = "P72x_CMPPrd.bin"; - break; - } - } else { + if (mediatype == 0x1000) { if (mode) { switch(mediaver) { case 0: @@ -1217,6 +1213,14 @@ static uint8_t *hiti_get_correction_data(struct hiti_ctx *ctx, uint8_t mode) break; } } + } else { + if (mode) { + fname = "P72x_CMQPrd.bin"; + break; + } else { + fname = "P72x_CMPPrd.bin"; + break; + } } break; case P_HITI_750: @@ -1362,19 +1366,14 @@ static int hiti_cvd(struct hiti_ctx *ctx, uint8_t *buf, uint32_t buf_len) static const char* hiti_get_heat_file(struct hiti_ctx *ctx, uint8_t mode) { int mediaver = ctx->ribbonvendor & 0x3f; - int mediatype = ((ctx->ribbonvendor & 0xf000) == 0x1000); + int mediatype = ctx->ribbonvendor & 0xf000; // XXX if field_0x70 != 100) send blank/empty tables.. // no idea what sets this field. switch (ctx->conn->type) { case P_HITI_51X: - if (!mediatype) { /* DNP media */ - if (mode) { - return "P51x_heatqhra.bin"; - } else { - return "P51x_heatthra.bin"; - } - } else { /* CHC media */ + if (mediatype == 0x1000) { /* CHC media */ + // what mode does 'P' (PC) match? if (mode) { switch(mediaver) { case 0: @@ -1384,8 +1383,11 @@ static const char* hiti_get_heat_file(struct hiti_ctx *ctx, uint8_t mode) case 2: return "P51x_hea2qcra.bin"; case 3: - default: return "P51x_hea3qcra.bin"; + case 4: + return "P51x_hea4qcra.bin"; + default: + return "P51x_heatqcra.bin"; } } else { switch(mediaver) { @@ -1396,14 +1398,33 @@ static const char* hiti_get_heat_file(struct hiti_ctx *ctx, uint8_t mode) case 2: return "P51x_hea2tcra.bin"; case 3: - default: return "P51x_hea3tcra.bin"; + case 4: + return "P51x_hea4tcra.bin"; + case 5: + return "P51x_hea5tcra.bin"; + default: + return "P51x_heattcra.bin"; } } + } else { /* DNP media */ + // what mode does 'P' or 'R' (PH, RH) match? + if (mode) { + return "P51x_heatqhra.bin"; + } else { + return "P51x_heatthra.bin"; + } } break; + case P_HITI_530: + if (mode) { + return "P53x_heattcrk.bin"; + } else { + return "P53x_heatpcrk.bin"; + } case P_HITI_52X: case P_HITI_720: + case P_HITI_750: default: return NULL; } @@ -2643,6 +2664,7 @@ const struct dyesub_backend hiti_backend = { { 0x0d16, 0x0112, P_HITI_51X, NULL, "hiti-p518s"}, { 0x0d16, 0x0502, P_HITI_52X, NULL, "hiti-p520l"}, { 0x0d16, 0x0502, P_HITI_52X, NULL, "hiti-p525l"}, /* Duplicate */ + { 0x0d16, 0x000f, P_HITI_530, NULL, "hiti-p530d"}, { 0x0d16, 0x0009, P_HITI_720, NULL, "hiti-p720l"}, { 0x0d16, 0x000a, P_HITI_720, NULL, "hiti-p728l"}, { 0x0d16, 0x0501, P_HITI_750, NULL, "hiti-p750l"}, @@ -2651,7 +2673,6 @@ const struct dyesub_backend hiti_backend = { }; /* -#define USB_PID_HITI_P530 0x000F #define USB_PID_HITI_P110S 0x0110 #define USB_PID_HITI_P310L 0x0503 #define USB_PID_HITI_P310W 0x050A @@ -2687,7 +2708,6 @@ const struct dyesub_backend hiti_backend = { - Start research into P530D, X610 - Incorporate changes for CS-series card printers - More "Matrix table" decoding work - - Investigate Suspicion that HiTi keeps tweaking LUTs and/or Heat tables - - Pull in heat tables & LUTs from windows drivers + - Pull in updated heat tables & LUTs from windows drivers */ diff --git a/blacklist b/blacklist index a9dda04..afefc2a 100644 --- a/blacklist +++ b/blacklist @@ -316,6 +316,9 @@ # HiTi P520L / P525L 0x0d16 0x0502 blacklist +# HiTi P530D +0x0d16 0x000f blacklist + # HiTi P720L 0x0d16 0x0009 blacklist