// File: jkingan[P]ladyheather/heathui.cpp
// Function: adjust_screen_options()
int adjust_screen_options()
{
int stm;
int old_azel;

   stm = 0;   // set text mode
   old_azel = plot_azel;

// plot_signals = 0;
   if(screen_type == 't') {  // text mode
      plot_azel = 0;
      stm = 2;
   }
   else if(screen_type == 'z') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'h') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'x') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'v') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'l') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'k') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'j') ; // plot_azel = AZEL_OK;
   else if(screen_type == 'm') ; // plot_azel = 0;
   else if(screen_type == 'n') ; // plot_azel = 0;   // netbook
   else if(screen_type == 'p') ; // plot_azel = 0;   // Raspberry pi touchscreen
   else if(screen_type == 'r') ; // plot_azel = 0;   // Reduced screen size
   else if(screen_type == 's') ; // plot_azel = 0;
   else if(screen_type == 'u') ; // plot_azel = 0;
   else if(screen_type == 'c') ; // plot_azel = 0;   //!!! custom screen
   else if(screen_type == 'd') {
      if(rcvr_type == NO_RCVR) {
         plot_digital_clock = 1;
      }
   }
   else if(screen_type == 'e') {
      if(rcvr_type == NO_RCVR) {
         plot_digital_clock = 1;
      }
   }
   else if(screen_type == 'f') {
      plot_azel = 0;
      go_fullscreen = 1;
//      kill_deco = 1;
      need_screen_init = 1;
   }
   else {
      screen_type = 'm';
      text_mode = stm;
      return 1;
   }
   if(SCREEN_WIDTH < TINY_TINY_WIDTH) {  // TINY_TINY_SIZE vertical format 320x480
      plot_digital_clock = 0;
   }

   if(plot_azel || plot_signals) update_azel = 1;
   text_mode = stm;
if(text_mode == 0) no_x_margin = no_y_margin = 0;

   if(plot_watch) {
      plot_azel = old_azel;
      if(user_set_clock_plot == 0) {
         if(rcvr_type == NO_RCVR) plot_digital_clock = 1;
         else                     plot_digital_clock = 0;
      }
      if(plot_azel || plot_signals) update_azel = 1;
   }
   else if(user_set_clock_plot == 0) {
      if(rcvr_type == NO_RCVR) plot_digital_clock = 1;
      else                     plot_digital_clock = plot_azel;
   }
// shared_plot = 0;

   if(screen_type == 'm') {
      if((TEXT_HEIGHT <= 12) && (user_set_clock_plot == 0)) plot_digital_clock = 1;
   }

   if(ebolt) {  // adjust ebolt sat count for time clock display
      last_ebolt = (-3);
      saw_ebolt();
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x8(%rbp)
leaq 0x230e6d(%rip), %rax    # 0x27a5f3
movzbl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x22e27e(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x74, %eax
jne 0x497b1
leaq 0x230e51(%rip), %rax    # 0x27a5f3
movb $0x0, (%rax)
movl $0x2, -0x8(%rbp)
jmp 0x4999b
leaq 0x22e259(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x7a, %eax
jne 0x497c5
jmp 0x49999
leaq 0x22e245(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x68, %eax
jne 0x497d9
jmp 0x49997
leaq 0x22e231(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x78, %eax
jne 0x497ed
jmp 0x49995
leaq 0x22e21d(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x76, %eax
jne 0x49801
jmp 0x49993
leaq 0x22e209(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6c, %eax
jne 0x49815
jmp 0x49991
leaq 0x22e1f5(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x49829
jmp 0x4998f
leaq 0x22e1e1(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6a, %eax
jne 0x4983d
jmp 0x4998d
leaq 0x22e1cd(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6d, %eax
jne 0x49851
jmp 0x4998b
leaq 0x22e1b9(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6e, %eax
jne 0x49865
jmp 0x49989
leaq 0x22e1a5(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x70, %eax
jne 0x49879
jmp 0x49987
leaq 0x22e191(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x72, %eax
jne 0x4988d
jmp 0x49985
leaq 0x22e17d(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x73, %eax
jne 0x498a1
jmp 0x49983
leaq 0x22e169(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x75, %eax
jne 0x498b5
jmp 0x49981
leaq 0x22e155(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x63, %eax
jne 0x498c9
jmp 0x4997f
leaq 0x22e141(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x64, %eax
jne 0x498f7
leaq 0x22e1d1(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0x498f2
leaq 0x230cd6(%rip), %rax    # 0x27a5c5
movb $0x1, (%rax)
jmp 0x4997d
leaq 0x22e113(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x65, %eax
jne 0x49922
leaq 0x22e1a3(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0x49920
leaq 0x230ca8(%rip), %rax    # 0x27a5c5
movb $0x1, (%rax)
jmp 0x4997b
leaq 0x22e0e8(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x66, %eax
jne 0x49957
leaq 0x230cbb(%rip), %rax    # 0x27a5f3
movb $0x0, (%rax)
leaq 0x22e07e(%rip), %rax    # 0x2779c0
movl $0x1, (%rax)
leaq 0x22e079(%rip), %rax    # 0x2779c8
movl $0x1, (%rax)
jmp 0x49979
leaq 0x22e0b3(%rip), %rax    # 0x277a11
movb $0x6d, (%rax)
movl -0x8(%rbp), %ecx
leaq 0x22e04d(%rip), %rax    # 0x2779b8
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x49b13
jmp 0x4997b
jmp 0x4997d
jmp 0x4997f
jmp 0x49981
jmp 0x49983
jmp 0x49985
jmp 0x49987
jmp 0x49989
jmp 0x4998b
jmp 0x4998d
jmp 0x4998f
jmp 0x49991
jmp 0x49993
jmp 0x49995
jmp 0x49997
jmp 0x49999
jmp 0x4999b
leaq 0x22e03e(%rip), %rax    # 0x2779e0
cmpl $0x1c2, (%rax)          # imm = 0x1C2
jge 0x499b4
leaq 0x230c14(%rip), %rax    # 0x27a5c5
movb $0x0, (%rax)
leaq 0x230c38(%rip), %rax    # 0x27a5f3
cmpb $0x0, (%rax)
jne 0x499cc
leaq 0x230c2e(%rip), %rax    # 0x27a5f5
cmpb $0x0, (%rax)
je 0x499d6
leaq 0x230c21(%rip), %rax    # 0x27a5f4
movb $0x1, (%rax)
movl -0x8(%rbp), %ecx
leaq 0x22dfd8(%rip), %rax    # 0x2779b8
movl %ecx, (%rax)
leaq 0x22dfcf(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
jne 0x49a02
leaq 0x22e046(%rip), %rax    # 0x277a3b
movb $0x0, (%rax)
leaq 0x22e03b(%rip), %rax    # 0x277a3a
movb $0x0, (%rax)
leaq 0x230bdf(%rip), %rax    # 0x27a5e8
cmpb $0x0, (%rax)
je 0x49a77
movl -0xc(%rbp), %eax
movb %al, %cl
leaq 0x230bd9(%rip), %rax    # 0x27a5f3
movb %cl, (%rax)
leaq 0x323622(%rip), %rax    # 0x36d045
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x49a53
leaq 0x22e07e(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0x49a47
leaq 0x230b83(%rip), %rax    # 0x27a5c5
movb $0x1, (%rax)
jmp 0x49a51
leaq 0x230b77(%rip), %rax    # 0x27a5c5
movb $0x0, (%rax)
jmp 0x49a53
leaq 0x230b99(%rip), %rax    # 0x27a5f3
cmpb $0x0, (%rax)
jne 0x49a6b
leaq 0x230b8f(%rip), %rax    # 0x27a5f5
cmpb $0x0, (%rax)
je 0x49a75
leaq 0x230b82(%rip), %rax    # 0x27a5f4
movb $0x1, (%rax)
jmp 0x49ab8
leaq 0x3235c7(%rip), %rax    # 0x36d045
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x49ab6
leaq 0x22e023(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0x49aa2
leaq 0x230b28(%rip), %rax    # 0x27a5c5
movb $0x1, (%rax)
jmp 0x49ab4
leaq 0x230b4a(%rip), %rax    # 0x27a5f3
movb (%rax), %cl
leaq 0x230b13(%rip), %rax    # 0x27a5c5
movb %cl, (%rax)
jmp 0x49ab6
jmp 0x49ab8
leaq 0x22df52(%rip), %rax    # 0x277a11
movzbl (%rax), %eax
cmpl $0x6d, %eax
jne 0x49aee
leaq 0x22df26(%rip), %rax    # 0x2779f4
cmpl $0xc, (%rax)
jg 0x49aec
leaq 0x32356b(%rip), %rax    # 0x36d045
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x49aec
leaq 0x230adc(%rip), %rax    # 0x27a5c5
movb $0x1, (%rax)
jmp 0x49aee
leaq 0x25460f(%rip), %rax    # 0x29e104
cmpl $0x0, (%rax)
je 0x49b0c
leaq 0x254607(%rip), %rax    # 0x29e108
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
callq 0x81d20
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)