Skip to content
Snippets Groups Projects
Commit e4504028 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add support for conceal (toggle with tab)

parent fe79dd29
No related branches found
No related tags found
No related merge requests found
Pipeline #7013 passed
......@@ -544,6 +544,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
bool double_height = false;
bool bottom = false;
bool top = false;
bool not_hidden = true;
if(!bitmap_initialized) {
return(-1);
......@@ -602,6 +603,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
// PRESTEL!
if (vstat.mode == PRESTEL_40X24) {
struct vstat_vmem *vmem_ptr = get_vmem(&vstat);
unsigned char lattr = vc->legacy_attr;
if (ypos > 1) {
for (y = 0; y < ypos; y++) {
......@@ -631,6 +633,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
}
fg = vmem_ptr->vmem[(ypos - 2) * vstat.cols + (xpos - 1)].fg;
bg = vmem_ptr->vmem[(ypos - 2) * vstat.cols + (xpos - 1)].bg;
lattr = vmem_ptr->vmem[(ypos - 2) * vstat.cols + (xpos - 1)].legacy_attr;
}
else {
if (ypos != vstat.rows) {
......@@ -650,6 +653,12 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
fontoffset=(32) * (vstat.charheight * ((fdw + 7) / 8));
}
release_vmem(vmem_ptr);
if (lattr & 0x08) {
if (!(cio_api.options & CONIO_OPT_PRESTEL_REVEAL)) {
draw_fg = false;
not_hidden = false;
}
}
}
for (y = 0; y < vstat.charheight; y++) {
for(x = 0; x < vstat.charwidth; x++) {
......@@ -699,7 +708,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
}
}
if(fbb) {
if(fbb && not_hidden) {
if (screenb.rect->data[pixeloffset] != fg) {
screenb.update_pixels = 1;
screenb.rect->data[pixeloffset] = fg;
......
......@@ -313,6 +313,7 @@ typedef struct {
#define CONIO_OPT_BLOCKY_SCALING (1 << 13)
#define CONIO_OPT_EXTERNAL_SCALING (1 << 14)
#define CONIO_OPT_DISABLE_CLOSE (1 << 15) // Disable OS/WM app close control/menu-option
#define CONIO_OPT_PRESTEL_REVEAL (1 << 16)
void (*clreol) (void);
int (*puttext) (int,int,int,int,void *);
int (*vmem_puttext) (int,int,int,int,struct vmem_cell *);
......
......@@ -846,7 +846,7 @@ prestel_apply_ctrl_before(struct cterminal *cterm, uint8_t ch)
break;
case 88: // Conceal Display
cterm->attr |= 0x08;
cterm->extattr |= CTERM_EXTATTR_PRESTEL_MOSAIC;
cterm->extattr |= CTERM_EXTATTR_PRESTEL_CONCEAL;
break;
case 89: // Contiguous Mosaics
// TODO: Can be either way. :(
......@@ -6198,6 +6198,7 @@ CIOLIBEXPORT char* cterm_write(struct cterminal * cterm, const void *vbuf, int b
lastch = 0;
uctputs(cterm, prn);
prn[0]=0;
cio_api.options &= ~(CONIO_OPT_PRESTEL_REVEAL);
prestel_new_line(cterm);
cterm_clearscreen(cterm, (char)cterm->attr);
GOTOXY(CURR_MINX, CURR_MINY);
......
......@@ -4442,6 +4442,13 @@ doterm(struct bbslist *bbs)
ch[0] = 0x1f;
conn_send(ch, 1, 0);
break;
case '\t': {
cio_api.options ^= CONIO_OPT_PRESTEL_REVEAL;
struct ciolib_screen *savscrn = savescreen();
ciolib_vmem_puttext(1, 1, savscrn->text_info.screenwidth, savscrn->text_info.screenheight, savscrn->vmem);
freescreen(savscrn);
break;
}
case '_':
ch[0] = '`';
conn_send(ch, 1, 0);
......
......@@ -23,6 +23,7 @@ int orig_vidflags;
int orig_x;
int orig_y;
uint32_t orig_palette[16];
bool reveal;
static void
get_title(char *str, size_t sz)
......@@ -53,6 +54,8 @@ init_uifc(bool scrn, bool bottom)
gettextinfo(&txtinfo);
if (!uifc_initialized) {
reveal = !!(cio_api.options & CONIO_OPT_PRESTEL_REVEAL);
cio_api.options |= CONIO_OPT_PRESTEL_REVEAL;
/* Set scrn_len to 0 to prevent textmode() call */
uifc.scrn_len = 0;
orig_vidflags = getvideoflags();
......@@ -115,6 +118,8 @@ uifcbail(void)
setvideoflags(orig_vidflags);
loadfont(NULL);
gotoxy(orig_x, orig_y);
if (!reveal)
cio_api.options &= ~CONIO_OPT_PRESTEL_REVEAL;
}
uifc_initialized = 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment