summaryrefslogtreecommitdiffstats
path: root/backend_mitsu9550.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-09-26 21:05:47 -0400
committerSolomon Peachy <pizza@shaftnet.org>2018-09-26 21:55:29 -0400
commit64bd2ff920f4903ef4ca55529d538ea37ca4c669 (patch)
tree2a569482a4d43930bc3f4444f45d4826f1c228ba /backend_mitsu9550.c
parent2d061350b20156a8b989886bf9c4b5d5d22bb827 (diff)
downloadselphy_print-64bd2ff920f4903ef4ca55529d538ea37ca4c669.tar.gz
selphy_print-64bd2ff920f4903ef4ca55529d538ea37ca4c669.tar.bz2
selphy_print-64bd2ff920f4903ef4ca55529d538ea37ca4c669.zip
mitsu98xx: Fix problem with printing matte on 9810/9820
Diffstat (limited to 'backend_mitsu9550.c')
-rw-r--r--backend_mitsu9550.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/backend_mitsu9550.c b/backend_mitsu9550.c
index 9a74462..b898c5a 100644
--- a/backend_mitsu9550.c
+++ b/backend_mitsu9550.c
@@ -303,7 +303,7 @@ static int mitsu98xx_fillmatte(struct mitsu9550_printjob *job)
int fd, i;
uint32_t j, remain;
- DEBUG("Reading %d bytes of matte data from disk (%d/%d)\n", job->cols * job->rows, job->cols, LAMINATE_STRIDE);
+ DEBUG("Reading %d bytes of matte data from disk (%d/%d)\n", job->cols * job->rows * 2, job->cols, LAMINATE_STRIDE);
fd = open(MITSU_M98xx_LAMINATE_FILE, O_RDONLY);
if (fd < 0) {
WARNING("Unable to open matte lamination data file '%s'\n", MITSU_M98xx_LAMINATE_FILE);
@@ -319,8 +319,8 @@ static int mitsu98xx_fillmatte(struct mitsu9550_printjob *job)
matte->cmd[3] = 0x10;
matte->row_offset = 0;
matte->col_offset = 0;
- matte->cols = job->hdr1.cols;
- matte->rows = job->hdr1.rows;
+ matte->cols = cpu_to_be16(job->hdr1.cols);
+ matte->rows = cpu_to_be16(job->hdr1.rows);
job->datalen += sizeof(struct mitsu9550_plane);
/* Read in the matte data plane */
@@ -833,8 +833,10 @@ hdr_done:
memcpy(job->databuf + job->datalen, buf, 4);
job->datalen += 4;
- /* Unless we have a matte plane following, we're done */
- if (job->hdr1.matte != 0x01)
+ /* Unless we have a raw matte plane following,
+ we're done */
+ if (job->hdr1.matte != 0x01 ||
+ !job->is_raw)
break;
remain = sizeof(buf);
} else {
@@ -1200,7 +1202,7 @@ static int mitsu9550_main_loop(void *vctx, const void *vjob) {
int i, remain, planelen;
planelen = job->rows * job->cols * 2;
- remain = (job->hdr1.matte ? 3 : 4) * (planelen + sizeof(struct mitsu9550_plane)) + sizeof(struct mitsu9550_cmd);
+ remain = (job->hdr1.matte ? 4 : 3) * (planelen + sizeof(struct mitsu9550_plane)) + sizeof(struct mitsu9550_cmd) * (job->hdr1.matte? 2 : 1);
newbuf = malloc(remain);
if (!newbuf) {
ERROR("Memory allocation Failure!\n");
@@ -1736,7 +1738,7 @@ static const char *mitsu9550_prefixes[] = {
/* Exported */
struct dyesub_backend mitsu9550_backend = {
.name = "Mitsubishi CP9xxx family",
- .version = "0.41",
+ .version = "0.42",
.uri_prefixes = mitsu9550_prefixes,
.cmdline_usage = mitsu9550_cmdline,
.cmdline_arg = mitsu9550_cmdline_arg,