@@ -31,7 +31,7 @@ extern DeviceSlot deviceSlots[NUM_DEVICE_SLOTS];
3131extern HostSlot hostSlots [8 ];
3232
3333char uppercase_tmp [32 ]; // temp space for strupr(s) output.
34- // so original strings doesn't get changed.
34+ // so original strings doesn't get changed.
3535
3636char * screen_upper (char * s )
3737{
@@ -95,9 +95,12 @@ void screen_set_wifi(AdapterConfig *ac)
9595void screen_set_wifi_display_ssid (char n , SSIDInfo * s )
9696{
9797 char meter [4 ]= {0x20 ,0x20 ,0x20 ,0x00 };
98- char ds [32 ];
98+ char ds [33 ];
9999
100100 memset (ds ,0x20 ,32 );
101+ ds [32 ] = 0x00 ;
102+ // Print spaces first
103+ locate (0 ,n + 2 ); printf ("%-32s" ,screen_upper (ds ));
101104 strncpy (ds ,s -> ssid ,32 );
102105
103106 if (s -> rssi > -50 )
@@ -126,7 +129,7 @@ void screen_set_wifi_select_network(unsigned char nn)
126129 printf (" up/down TO SELECT " );
127130 printf ("hIDDEN SSID rESCAN enter SELECT" );
128131 bar_draw (0 ,false);
129- bar_set (2 ,1 ,nn ,0 );
132+ bar_set (2 ,0 ,nn ,0 );
130133
131134 screen_add_shadow (nn + 2 ,CYAN );
132135}
@@ -386,7 +389,7 @@ void screen_hosts_and_devices_hosts()
386389 locate (0 ,0 );
387390 printf ("%32s" ,"host\x80slots" );
388391
389- memset (0x400 ,0xAF ,22 );
392+ memset (SCREEN_RAM_TOP ,0xAF ,22 );
390393 (* (unsigned char * )0x041a ) = 0x20 ;
391394
392395 locate (0 ,13 );
@@ -451,13 +454,16 @@ const char host_slot_char(unsigned char hostSlot)
451454
452455const char device_slot_mode (unsigned char mode )
453456{
454- switch (mode )
457+ // Mask out 0x40
458+ unsigned char masked_mode = mode & ~MODE_MOUNTED ;
459+
460+ switch (masked_mode )
455461 {
456462 case 0 :
457463 return 0x80 ;
458- case 1 :
464+ case MODE_READ :
459465 return 0xAF ;
460- case 2 :
466+ case MODE_WRITE :
461467 return 0x9F ;
462468 }
463469}
@@ -513,19 +519,45 @@ void screen_hosts_and_devices_long_filename(const char *f)
513519
514520void screen_init (void )
515521{
516- // TODO: figure out lowercase.
522+ // Make sure the screen is in 32 column mode
523+ width (32 );
517524}
518525
519526void screen_destination_host_slot (char * h , char * p )
520527{
528+ cls (3 );
529+ locate (0 ,11 );
530+
531+ printf ("%32s" ,"copy\x80\x66rom\x80host\x80slot" );
532+
533+ locate (0 , 12 ); printf ("%-32s" , screen_upper (h ));
534+ locate (0 , 13 ); printf ("%-128s" , p );
521535}
522536
523537void screen_destination_host_slot_choose (void )
524538{
539+ locate (0 , 0 );
540+ printf ("%32s" ,"copy\x80to\x80host\x80slot" );
541+ screen_hosts_and_devices_host_slots (& hostSlots [0 ]);
542+ locate (0 ,13 );
543+ printf ("1-8 choose\x80slot ENTER select" );
544+ locate (0 ,14 );
545+ printf ("BREAK quit" );
546+ screen_add_shadow (15 ,BLUE );
547+
548+ bar_set (1 ,1 ,8 ,selected_host_slot );
525549}
526550
527551void screen_perform_copy (char * sh , char * p , char * dh , char * dp )
528552{
553+ cls (3 );
554+
555+ locate (0 ,0 ); printf ("%32s" ,"COPYING FILE FROM:" );
556+ locate (0 ,2 ); printf ("%32s" ,sh );
557+ locate (0 ,3 ); printf ("%-128s" ,p );
558+ locate (0 ,7 ); printf ("%32s" ,"COPYING FILE TO:" );
559+ locate (0 ,9 ); printf ("%32s" ,dh );
560+ locate (0 ,10 ); printf ("%-128s" ,dp );
529561}
530562
531563void screen_connect_wifi (NetConfig * nc )
0 commit comments