summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 20:48:59 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 20:48:59 +0300
commitd5b5baf119a514731a2e73f36a50ac94b33f9a0e (patch)
treea9e07636dcee07a9f8286a2bed60334ea96db4f1 /src
parent9898471695e80011e74e09d7a95b11e01a71dae6 (diff)
Optimize DECALN screen alignment fill with row memory replication
Diffstat (limited to 'src')
-rw-r--r--src/core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 01218cc..f9d547d 100644
--- a/src/core.c
+++ b/src/core.c
@@ -475,10 +475,16 @@ void term_sc_deccara(struct term *t, const struct csi *csi)
void term_sc_decaln(struct term *t)
{
struct cell fill = { .c = 'E', .fg = TERM_COLOR_FG, .bg = TERM_COLOR_BG };
+ struct cell *row0 = NULL;
for (int y = 0; y < t->rows; y++) {
int p = phys_row(t, y);
struct cell *row = row_cells(t, p);
- for (int x = 0; x < t->cols; x++) row[x] = fill;
+ if (row0) {
+ memcpy(row, row0, (size_t)t->cols * sizeof(struct cell));
+ } else {
+ for (int x = 0; x < t->cols; x++) row[x] = fill;
+ row0 = row;
+ }
struct srow *srow = &t->scr.slot[p];
srow->len = (uint16_t)t->cols;
srow->flags = RF_TAIL_PADDED;