// File: jkingan[P]ladyheather/heather.cpp
// Function: show_term_screen(unsigned int)
void show_term_screen(unsigned port)
{
int row;
int col;
int c;
int left;

   // copy the teminal screen image buffer to the screen

   left = 0;
   erase_screen();
   for(row=0; row<term_rows; row++) {
      for(col=0; col<term_cols; col++) {
         c = term_screen[row][col];
         c &= 0xFF;
         if((col == term_col) && (row == term_row)) {  // blinking cursor
            if(blinker) dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, TERM_CURSOR, WHITE);  // header lines
            else        dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, TERM_CURSOR, BLACK);  // header lines
         }
         if(c == 0) break;

         if(row < term_header_lines) dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, WHITE);  // header lines
         else if(c & 0x80) {
            dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, YELLOW);   // user input chars
         }
         else dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, GREEN);  // received chars
      }
   }
   refresh_page();

   reset_com_timer(port);
   term_changed = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x14(%rbp)
callq 0x117e0
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x375809(%rip), %eax    # 0x3a1950
jge 0x2c2c1
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x3757f7(%rip), %eax    # 0x3a1954
jge 0x2c2b1
movslq -0x8(%rbp), %rcx
leaq 0x3736a2(%rip), %rax    # 0x39f810
imulq $0x85, %rcx, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x27147d(%rip), %eax    # 0x29d614
jne 0x2c1fa
movl -0x8(%rbp), %eax
cmpl 0x27146e(%rip), %eax    # 0x29d610
jne 0x2c1fa
cmpl $0x0, 0x375855(%rip)    # 0x3a1a00
je 0x2c1d5
movl -0xc(%rbp), %edi
addl -0x14(%rbp), %edi
imull 0x24b836(%rip), %edi    # 0x2779f0
movl -0x8(%rbp), %esi
imull 0x24b830(%rip), %esi    # 0x2779f4
movl $0x5f, %edx
movl $0xf, %ecx
callq 0x10450
jmp 0x2c1f8
movl -0xc(%rbp), %edi
addl -0x14(%rbp), %edi
imull 0x24b80e(%rip), %edi    # 0x2779f0
movl -0x8(%rbp), %esi
imull 0x24b808(%rip), %esi    # 0x2779f4
movl $0x5f, %edx
xorl %ecx, %ecx
callq 0x10450
jmp 0x2c1fa
cmpl $0x0, -0x10(%rbp)
jne 0x2c205
jmp 0x2c2b1
movl -0x8(%rbp), %eax
cmpl 0x37574e(%rip), %eax    # 0x3a195c
jge 0x2c23c
movl -0xc(%rbp), %edi
addl -0x14(%rbp), %edi
imull 0x24b7d3(%rip), %edi    # 0x2779f0
movl -0x8(%rbp), %esi
imull 0x24b7cd(%rip), %esi    # 0x2779f4
movl -0x10(%rbp), %eax
andl $0x7f, %eax
movl $0xf, %ecx
movzbl %al, %edx
callq 0x10450
jmp 0x2c2a1
movl -0x10(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x2c275
movl -0xc(%rbp), %edi
addl -0x14(%rbp), %edi
imull 0x24b79a(%rip), %edi    # 0x2779f0
movl -0x8(%rbp), %esi
imull 0x24b794(%rip), %esi    # 0x2779f4
movl -0x10(%rbp), %eax
andl $0x7f, %eax
movl $0xe, %ecx
movzbl %al, %edx
callq 0x10450
jmp 0x2c29f
movl -0xc(%rbp), %edi
addl -0x14(%rbp), %edi
imull 0x24b76e(%rip), %edi    # 0x2779f0
movl -0x8(%rbp), %esi
imull 0x24b768(%rip), %esi    # 0x2779f4
movl -0x10(%rbp), %eax
andl $0x7f, %eax
movl $0xa, %ecx
movzbl %al, %edx
callq 0x10450
jmp 0x2c2a1
jmp 0x2c2a3
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2c154
jmp 0x2c2b3
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2c13e
callq 0xb0d0
movl -0x4(%rbp), %edi
callq 0x2bd30
movl $0x0, 0x375680(%rip)    # 0x3a1958
addq $0x20, %rsp
popq %rbp
retq
nop