mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 09:58:19 -07:00
ESC/P 2: Add "Auto LF" DIP switch
This commit is contained in:
@@ -265,6 +265,8 @@ typedef struct escp_t {
|
||||
uint8_t ctrl;
|
||||
|
||||
PALETTE palcol;
|
||||
|
||||
uint8_t auto_lf;
|
||||
} escp_t;
|
||||
|
||||
/* Codepage table, needed for ESC t ( */
|
||||
@@ -1749,7 +1751,7 @@ process_char(escp_t *dev, uint8_t ch)
|
||||
|
||||
case 0x0d: /* Carriage Return (CR) */
|
||||
dev->curr_x = dev->left_margin;
|
||||
if (!dev->autofeed)
|
||||
if (!dev->autofeed && !dev->auto_lf)
|
||||
return 1;
|
||||
fallthrough;
|
||||
|
||||
@@ -2214,7 +2216,9 @@ escp_init(const device_t *info)
|
||||
dev->page_height = LETTER_PAGE_HEIGHT;
|
||||
}
|
||||
|
||||
dev->dpi = dev->lang >= LANG_ESCP ? 360 : 240;
|
||||
dev->auto_lf = device_get_config_int("auto_lf");
|
||||
|
||||
dev->dpi = dev->lang >= LANG_ESCP ? 360 : 240;
|
||||
|
||||
/* Create 8-bit grayscale buffer for the page. */
|
||||
dev->page = (psurface_t *) malloc(sizeof(psurface_t));
|
||||
@@ -2328,6 +2332,17 @@ static const device_config_t lpt_prt_escp_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "auto_lf",
|
||||
.description = "Auto LF",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
Reference in New Issue
Block a user