@@ -532,10 +532,117 @@ ubyte show_net_comms_box(struct ScreenBox *box)
532532
533533ubyte do_net_protocol_select (ubyte click )
534534{
535+ #if 0
535536 ubyte ret ;
536537 asm volatile ("call ASM_do_net_protocol_select\n"
537538 : "=r" (ret ) : "a" (click ));
538539 return ret ;
540+ #endif
541+ const char * text ;
542+ int i ;
543+ short proto ;
544+ short pos_x ;
545+
546+ if (byte_1C4A7C )
547+ {
548+ LbNetworkReset ();
549+ byte_1C4A7C = 0 ;
550+ }
551+
552+ pos_x = net_protocol_select_button .X - 12 + net_protocol_select_button .Width + 4 ;
553+
554+ proto = nsvc .I .Type ;
555+ if (click )
556+ {
557+ proto -- ;
558+ if (proto <= NetSvc_NONE )
559+ {
560+ proto = NetSvc_COM4 ;
561+ if (data_1c4a70 )
562+ {
563+ net_protocol_select_button .X -= 12 ;
564+ net_unkn40_button .X = pos_x ;
565+ byte_1C4A6F = 1 ;
566+ }
567+ }
568+ else if (proto == NetSvc_IPX ) // IPX needs to be accepted
569+ {
570+ if (byte_1C4A6F )
571+ {
572+ byte_1C4A6F = 0 ;
573+ proto = NetSvc_COM4 ;
574+ net_protocol_select_button .X += 12 ;
575+ }
576+ }
577+ nsvc .I .Type = proto ;
578+ }
579+ else
580+ {
581+ proto ++ ;
582+ if (proto > NetSvc_COM4 )
583+ {
584+ if (byte_1C4A6F || !data_1c4a70 )
585+ {
586+ proto = NetSvc_IPX ;
587+ if (byte_1C4A6F )
588+ {
589+ byte_1C4A6F = 0 ;
590+ net_protocol_select_button .X += 12 ;
591+ }
592+ }
593+ else
594+ {
595+ proto = NetSvc_COM1 ;
596+ net_protocol_select_button .X -= 12 ;
597+ net_unkn40_button .X = pos_x ;
598+ byte_1C4A6F = 1 ;
599+ }
600+ }
601+ nsvc .I .Type = proto ;
602+ }
603+
604+ switch (nsvc .I .Type )
605+ {
606+ case NetSvc_NONE :
607+ default :
608+ break ;
609+ case NetSvc_IPX :
610+ net_protocol_select_button .Text = gui_strings [497 + NetSvc_IPX ];
611+
612+ memset (unkstruct04_arr , 0 , sizeof (unkstruct04_arr ));
613+ byte_1C6D48 = 0 ;
614+ for (i = 0 ; i < 8 ; i ++ )
615+ unkn2_names [i ][0 ] = '\0' ;
616+ if (LbNetworkServiceStart (& nsvc .I ) != Lb_SUCCESS )
617+ {
618+ nsvc .I .Type = NetSvc_COM1 ;
619+ net_protocol_select_button .Text = gui_strings [499 ];
620+ net_protocol_option_button .Text = net_baudrate_text ;
621+ net_protocol_option_button .CallBackFn = ac_do_serial_speed_switch ;
622+
623+ alert_box_text_fmt ("%s" , gui_strings [568 ]);
624+ break ;
625+ }
626+ byte_1C4A7C = 1 ;
627+ byte_15516C = -1 ;
628+ net_protocol_option_button .Text = net_proto_param_text ;
629+ net_protocol_option_button .CallBackFn = ac_do_net_protocol_option ;
630+ break ;
631+ case NetSvc_COM1 :
632+ case NetSvc_COM2 :
633+ case NetSvc_COM3 :
634+ case NetSvc_COM4 :
635+ net_protocol_option_button .Text = net_baudrate_text ;
636+ if (byte_1C4A6F )
637+ text = gui_strings [522 + nsvc .I .Type ];
638+ else
639+ text = gui_strings [497 + nsvc .I .Type ];
640+ net_protocol_option_button .CallBackFn = ac_do_serial_speed_switch ;
641+ net_protocol_select_button .Text = text ;
642+ byte_15516C = 0 ;
643+ break ;
644+ }
645+ return 1 ;
539646}
540647
541648ubyte show_net_protocol_box (struct ScreenBox * box )
0 commit comments