memset(mw_buf, 0, 24);
memcpy(mw_buf, (bmapbuf+(y*rowlength)), (rowlength > 12) ? 12 : rowlength);
memcpy((mw_buf+12), (bmapbuf+((y+1)*rowlength)), (rowlength > 12) ? 12 : rowlength);
- mw_write_buffer(mw_fd, mode, 0, 31+y, mw_buf, 24);
+ mw_write_buffer(mw_fd, mode, 0, offset+y, mw_buf, 24);
}
}