Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Jun 24, 2024
1 parent 49f3d0c commit 48753a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
5 changes: 3 additions & 2 deletions src/browser/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,9 @@ function ScreenAdapter(screen_container, bus)
bg_color = text_mode_data[offset + BG_COLOR_INDEX];
fg_color = text_mode_data[offset + FG_COLOR_INDEX];

if (blinking) {
color_element.classList.add('blink');
if(blinking)
{
color_element.classList.add("blink");
}

color_element.style.backgroundColor = number_as_color(bg_color);
Expand Down
8 changes: 4 additions & 4 deletions src/vga.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ VGAScreen.prototype.text_mode_redraw = function()

const split_screen_row = this.scan_line_to_screen_row(this.line_compare);
const row_offset = Math.max(0, (this.offset_register * 2 - this.max_cols) * 2);
const blink_flag = this.attribute_mode & (1<<3);
const blink_flag = this.attribute_mode & 1 << 3;
const bg_color_mask = blink_flag ? 7 : 0xF;

for(var row = 0; row < this.max_rows; row++)
Expand All @@ -865,7 +865,7 @@ VGAScreen.prototype.text_mode_redraw = function()
{
chr = this.vga_memory[addr];
color = this.vga_memory[addr | 1];
blinking = blink_flag && (color & (1<<7));
blinking = blink_flag && (color & 1 << 7);

this.bus.send("screen-put-char", [row, col, chr, blinking,
this.vga256_palette[this.dac_mask & this.dac_map[color >> 4 & bg_color_mask]],
Expand Down Expand Up @@ -920,8 +920,8 @@ VGAScreen.prototype.vga_memory_write_text_mode = function(addr, value)
chr = value;
color = this.vga_memory[addr | 1];
}
const blink_flag = this.attribute_mode & (1<<3);
const blinking = blink_flag && (color & (1<<7));
const blink_flag = this.attribute_mode & 1 << 3;
const blinking = blink_flag && (color & 1 << 7);
const bg_color_mask = blink_flag ? 7 : 0xF;

this.bus.send("screen-put-char", [row, col, chr, blinking,
Expand Down
37 changes: 16 additions & 21 deletions v86.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ h4 {
#terminal {
max-width: 1024px;
}
.blink {
animation: blink 0.6s step-start infinite;
}
@keyframes blink {
50% {
color: transparent;
}
}
.cursor {
animation: cursor 0.6s step-start infinite;
}
@keyframes cursor {
50% {
background-color: transparent;
}
}

/* the code below was copied from xterm.css */

Expand Down Expand Up @@ -305,24 +321,3 @@ h4 {
z-index: 2;
position: relative;
}

.blink {
animation: blink 0.6s step-start infinite;
}

.cursor {
animation: cursor 0.2s step-start infinite;
}

@keyframes blink {
50% {
color: transparent;
}
}

@keyframes cursor {
50% {
background-color: transparent;
}
}

0 comments on commit 48753a0

Please sign in to comment.