// File: 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
subq $0x10, %rsp
leaq 0x22dd95(%rip), %rax    # 0x2779e4
cmpl $0x190, (%rax)          # imm = 0x190
jl 0x49c66
leaq 0x22dd82(%rip), %rax    # 0x2779e0
cmpl $0x1c2, (%rax)          # imm = 0x1C2
jge 0x49c80
leaq 0x238ab3(%rip), %rax    # 0x282720
movl $0x0, (%rax)
leaq 0x238aaa(%rip), %rax    # 0x282724
movl $0x64, (%rax)
leaq 0x354839(%rip), %rdi    # 0x39e4c0
callq 0x9890
leaq 0x35482d(%rip), %rdi    # 0x39e4c0
leaq 0x140acd(%rip), %rsi    # 0x18a767
callq 0x9090
cmpq $0x0, %rax
je 0x49caa
jmp 0x49f55
movl $0x0, -0x4(%rbp)
leaq 0x354808(%rip), %rdi    # 0x39e4c0
leaq 0x13f588(%rip), %rsi    # 0x189247
callq 0x9090
cmpq $0x0, %rax
je 0x49cd6
movl $0xc, -0x4(%rbp)
jmp 0x49d6d
leaq 0x3547e3(%rip), %rdi    # 0x39e4c0
leaq 0x13b9d1(%rip), %rsi    # 0x1856b5
callq 0x9090
cmpq $0x0, %rax
je 0x49cf8
movl $0xc, -0x4(%rbp)
jmp 0x49d6b
leaq 0x3547c1(%rip), %rdi    # 0x39e4c0
leaq 0x137edf(%rip), %rsi    # 0x181be5
callq 0x9090
cmpq $0x0, %rax
je 0x49d1a
movl $0xe, -0x4(%rbp)
jmp 0x49d69
leaq 0x35479f(%rip), %rdi    # 0x39e4c0
leaq 0x13e613(%rip), %rsi    # 0x18833b
callq 0x9090
cmpq $0x0, %rax
je 0x49d3c
movl $0x10, -0x4(%rbp)
jmp 0x49d67
leaq 0x35477d(%rip), %rdi    # 0x39e4c0
leaq 0x128304(%rip), %rsi    # 0x17204e
callq 0x9090
cmpq $0x0, %rax
je 0x49d5e
movl $0x8, -0x4(%rbp)
jmp 0x49d65
movl $0x0, -0x4(%rbp)
jmp 0x49d67
jmp 0x49d69
jmp 0x49d6b
jmp 0x49d6d
leaq 0x35474c(%rip), %rdi    # 0x39e4c0
leaq 0x12b4c2(%rip), %rsi    # 0x17523d
callq 0x9090
cmpq $0x0, %rax
je 0x49d8b
callq 0x12300
leaq 0x22dc7f(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x63, %eax
jne 0x49e86
leaq 0x35471b(%rip), %rdi    # 0x39e4c0
leaq 0x1409bb(%rip), %rsi    # 0x18a767
callq 0x9090
cmpq $0x0, %rax
je 0x49dbc
jmp 0x49f55
leaq 0x22dc39(%rip), %rax    # 0x2779fc
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x22dc28(%rip), %rax    # 0x2779f8
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x3546e3(%rip), %rdi    # 0x39e4c0
leaq 0x138d07(%rip), %rsi    # 0x182aeb
leaq 0x22dc0d(%rip), %rdx    # 0x2779f8
leaq -0x9(%rbp), %rcx
leaq 0x22dc06(%rip), %r8     # 0x2779fc
movb $0x0, %al
callq 0x9370
movl %eax, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x49e0b
jmp 0x49f55
leaq 0x22dbe6(%rip), %rax    # 0x2779f8
cmpl $0x0, (%rax)
jge 0x49e1c
jmp 0x49f55
leaq 0x22dbd9(%rip), %rax    # 0x2779fc
cmpl $0x0, (%rax)
jge 0x49e2d
jmp 0x49f55
leaq 0x22dbc4(%rip), %rax    # 0x2779f8
cmpl $0x140, (%rax)          # imm = 0x140
jge 0x49e49
leaq 0x22dbb5(%rip), %rax    # 0x2779f8
movl $0x140, (%rax)          # imm = 0x140
leaq 0x22dba8(%rip), %rax    # 0x2779f8
cmpl $0x1000, (%rax)         # imm = 0x1000
jle 0x49e65
leaq 0x22db99(%rip), %rax    # 0x2779f8
movl $0x1000, (%rax)         # imm = 0x1000
leaq 0x22db90(%rip), %rax    # 0x2779fc
cmpl $0x140, (%rax)          # imm = 0x140
jge 0x49e81
leaq 0x22db81(%rip), %rax    # 0x2779fc
movl $0x140, (%rax)          # imm = 0x140
jmp 0x49f1d
leaq 0x22db84(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x66, %eax
jne 0x49f1b
leaq 0x22db38(%rip), %rax    # 0x2779d8
movl (%rax), %ecx
leaq 0x22db4f(%rip), %rax    # 0x2779f8
movl %ecx, (%rax)
leaq 0x22db2a(%rip), %rax    # 0x2779dc
movl (%rax), %ecx
leaq 0x22db41(%rip), %rax    # 0x2779fc
movl %ecx, (%rax)
leaq 0x22db34(%rip), %rax    # 0x2779f8
cmpl $0x140, (%rax)          # imm = 0x140
jge 0x49ed9
leaq 0x22db25(%rip), %rax    # 0x2779f8
movl $0x140, (%rax)          # imm = 0x140
leaq 0x22db18(%rip), %rax    # 0x2779f8
cmpl $0x1000, (%rax)         # imm = 0x1000
jle 0x49ef5
leaq 0x22db09(%rip), %rax    # 0x2779f8
movl $0x1000, (%rax)         # imm = 0x1000
leaq 0x22db00(%rip), %rax    # 0x2779fc
cmpl $0x140, (%rax)          # imm = 0x140
jge 0x49f11
leaq 0x22daf1(%rip), %rax    # 0x2779fc
movl $0x140, (%rax)          # imm = 0x140
leaq 0x22daf9(%rip), %rax    # 0x277a11
movb $0x63, (%rax)
jmp 0x49f1d
leaq 0x22db14(%rip), %rax    # 0x277a38
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x49f42
leaq 0x22dab1(%rip), %rax    # 0x2779e4
cmpl $0x258, (%rax)          # imm = 0x258
jge 0x49f42
movl $0xc, -0x4(%rbp)
movl -0x4(%rbp), %eax
movb %al, %cl
leaq 0x22daea(%rip), %rax    # 0x277a38
movb %cl, (%rax)
callq 0x49b20
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)