// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathui.cpp
// Function: edit_screen_res()
void edit_screen_res()
{
int font_set;
int n;
char c;

   // change the screen size
   if((SCREEN_HEIGHT < TINY_TINY_HEIGHT) || (SCREEN_WIDTH < TINY_TINY_WIDTH)) {  // exit vector font mode if switching out of a TINY_TINY mode
      use_vc_fonts = 0;      // if not 0, draw fonts using vector chars
      vc_font_scale = 100;
   }

   strupr(edit_buffer);
   if(strstr(edit_buffer, "N")) return;

   font_set = 0;
   if     (strstr(edit_buffer, ":")) font_set = 12;
   else if(strstr(edit_buffer, "S")) font_set = 12;
   else if(strstr(edit_buffer, "M")) font_set = 14;
   else if(strstr(edit_buffer, "L")) font_set = 16;
   else if(strstr(edit_buffer, "T")) font_set = 8;
   else                              font_set = 0;

   if(strstr(edit_buffer, "I")) invert_screen();

   if(screen_type == 'c') {  // custom screen size
      if(strstr(edit_buffer, "N")) return;

      custom_width = custom_height = (-1);
      n = sscanf(edit_buffer, "%d%c%d", &custom_width,&c,&custom_height);
      if(n != 3) return;
      if(custom_width < 0) return;
      if(custom_height < 0) return;

#ifdef WIN_VFX
      custom_height &= (~1);
      custom_width &= (~1);
#endif  // USE_X11

      if(custom_width < MIN_WIDTH) custom_width = MIN_WIDTH;
      if(custom_width > MAX_WIDTH) custom_width = MAX_WIDTH;
      if(custom_height < MIN_HEIGHT) custom_height = MIN_HEIGHT;
   }
   else if(screen_type == 'f') {
      custom_width = display_width;
      custom_height= display_height;
      if(custom_width < MIN_WIDTH) custom_width = MIN_WIDTH;
      if(custom_width > MAX_WIDTH) custom_width = MAX_WIDTH;
      if(custom_height < MIN_HEIGHT) custom_height = MIN_HEIGHT;
#ifdef WIN_VFX
      custom_height &= (~1);
      custom_width &= (~1);
      custom_width -= 10;
      custom_height -= 32;
#endif  // USE_X11
      screen_type = 'c';
   }

   #ifdef WINDOWS
      if(font_set == 0) {
         if(screen_type == 'c') ;
         else if(strstr(edit_buffer, "Y")) ;
         else if(strstr(edit_buffer, "I")) ;
         else if(0 && strstr(edit_buffer, "F")) ;
         else return;
      }
      if(0 && strstr(edit_buffer, "F")) initial_window_mode = VFX_TRY_FULLSCREEN;
      else initial_window_mode = VFX_WINDOW_MODE;
   #else  // __linux__  __MACH__   __FreeBSD__
   #endif

   if((user_font_size == 0) && (SCREEN_HEIGHT < SHORT_SCREEN)) font_set = 12;
   user_font_size = font_set;

   change_screen_res();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x1d0ff1(%rip), %r15    # 0x202804
cmpl $0x190, (%r15)          # imm = 0x190
jl 0x3182b
leaq 0x1d0fdd(%rip), %rax    # 0x202800
cmpl $0x1c1, (%rax)          # imm = 0x1C1
jg 0x31842
leaq 0x1dbd0e(%rip), %rax    # 0x20d540
andl $0x0, (%rax)
leaq 0x1dbd08(%rip), %rax    # 0x20d544
movl $0x64, (%rax)
leaq 0x2f7a97(%rip), %rbx    # 0x3292e0
movq %rbx, %rdi
callq 0x988f
pushq $0x4e
popq %rsi
movq %rbx, %rdi
callq 0x9100
testq %rax, %rax
jne 0x31a16
leaq 0x2f7a74(%rip), %rdi    # 0x3292e0
pushq $0x3a
popq %rsi
callq 0x9100
movb $0xc, %r12b
testq %rax, %rax
jne 0x318d8
leaq 0x2f7a5d(%rip), %rdi    # 0x3292e0
pushq $0x53
popq %rsi
callq 0x9100
testq %rax, %rax
jne 0x318d8
leaq 0x2f7a49(%rip), %rdi    # 0x3292e0
pushq $0x4d
popq %rsi
callq 0x9100
movb $0xe, %r12b
testq %rax, %rax
jne 0x318d8
leaq 0x2f7a32(%rip), %rdi    # 0x3292e0
pushq $0x4c
popq %rsi
callq 0x9100
movb $0x10, %r12b
testq %rax, %rax
jne 0x318d8
leaq 0x2f7a1b(%rip), %rdi    # 0x3292e0
pushq $0x54
popq %rsi
callq 0x9100
testq %rax, %rax
setne %r12b
shlb $0x3, %r12b
leaq 0x2f7a01(%rip), %rdi    # 0x3292e0
pushq $0x49
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x318f1
callq 0xee68
leaq 0x1d0f39(%rip), %rax    # 0x202831
movzbl (%rax), %ecx
cmpl $0x66, %ecx
je 0x3199d
cmpl $0x63, %ecx
jne 0x319f1
leaq 0x2f79cc(%rip), %rdi    # 0x3292e0
pushq $0x4e
popq %rsi
callq 0x9100
testq %rax, %rax
jne 0x31a16
leaq 0x1d0ef0(%rip), %rbx    # 0x20281c
orl $-0x1, (%rbx)
leaq 0x1d0ee2(%rip), %r14    # 0x202818
orl $-0x1, (%r14)
leaq 0x2f799f(%rip), %rdi    # 0x3292e0
leaq 0xd6803(%rip), %rsi     # 0x10814b
leaq -0x21(%rbp), %rcx
movq %r14, %rdx
movq %rbx, %r8
xorl %eax, %eax
callq 0x9350
cmpl $0x3, %eax
jne 0x31a16
movl (%r14), %ecx
movl (%rbx), %eax
movl %ecx, %edx
orl %eax, %edx
js 0x31a16
movl $0x140, %edx            # imm = 0x140
cmpl $0x140, %ecx            # imm = 0x140
jb 0x3198b
movl $0x1000, %edx           # imm = 0x1000
cmpl $0x1001, %ecx           # imm = 0x1001
jb 0x3198e
movl %edx, (%r14)
cmpl $0x13f, %eax            # imm = 0x13F
ja 0x319f1
movl $0x140, (%rbx)          # imm = 0x140
jmp 0x319f1
leaq 0x1d0e54(%rip), %rcx    # 0x2027f8
movl (%rcx), %edi
leaq 0x1d0e6b(%rip), %rdx    # 0x202818
movl %edi, (%rdx)
leaq 0x1d0e46(%rip), %rcx    # 0x2027fc
movl (%rcx), %esi
leaq 0x1d0e5d(%rip), %rcx    # 0x20281c
movl %esi, (%rcx)
movl $0x140, %r8d            # imm = 0x140
cmpl $0x140, %edi            # imm = 0x140
jl 0x319dd
movl $0x1000, %r8d           # imm = 0x1000
cmpl $0x1001, %edi           # imm = 0x1001
jb 0x319e0
movl %r8d, (%rdx)
cmpl $0x13f, %esi            # imm = 0x13F
jg 0x319ee
movl $0x140, (%rcx)          # imm = 0x140
movb $0x63, (%rax)
leaq 0x1d0e60(%rip), %rax    # 0x202858
cmpl $0x258, (%r15)          # imm = 0x258
movzbl %r12b, %ecx
pushq $0xc
popq %rdx
cmovgel %ecx, %edx
cmpb $0x0, (%rax)
cmovnel %ecx, %edx
movb %dl, (%rax)
callq 0x31778
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq