Commit 866a32b5f503c6dda77b2bb782fdda44e7d1e2d4
1 parent
b0fa314d
Exists in
master
and in
3 other branches
Updating sf.
Showing
1 changed file
with
22 additions
and
29 deletions
Show diff stats
src/core/sf.c
@@ -62,11 +62,18 @@ | @@ -62,11 +62,18 @@ | ||
62 | #include "utilc.h" | 62 | #include "utilc.h" |
63 | 63 | ||
64 | /* Screen globals. */ | 64 | /* Screen globals. */ |
65 | -static const int cw = 7; | 65 | +/* |
66 | +static const int cw = 0x09; | ||
66 | static const int * char_width = &cw; | 67 | static const int * char_width = &cw; |
67 | 68 | ||
68 | -static const int ch = 7; | 69 | +static const int ch = 0x0C; |
69 | static const int * char_height = &ch; | 70 | static const int * char_height = &ch; |
71 | +*/ | ||
72 | + | ||
73 | +#define SW_3279_2 0x09 | ||
74 | +#define SH_3279_2 0x0c | ||
75 | +#define Xr_3279_2 0x000a02e5 | ||
76 | +#define Yr_3279_2 0x0002006f | ||
70 | 77 | ||
71 | /* Globals */ | 78 | /* Globals */ |
72 | static const Boolean sfont = False; | 79 | static const Boolean sfont = False; |
@@ -610,13 +617,14 @@ static enum pds sf_create_partition(H3270 *hSession, unsigned char buf[], int bu | @@ -610,13 +617,14 @@ static enum pds sf_create_partition(H3270 *hSession, unsigned char buf[], int bu | ||
610 | GET16(pw, &buf[26]); | 617 | GET16(pw, &buf[26]); |
611 | trace_ds(hSession,",pw=%d", pw); | 618 | trace_ds(hSession,",pw=%d", pw); |
612 | } else | 619 | } else |
613 | - pw = *char_width; | 620 | + pw = SW_3279_2; |
614 | 621 | ||
615 | if (buflen > 29) { | 622 | if (buflen > 29) { |
616 | GET16(ph, &buf[28]); | 623 | GET16(ph, &buf[28]); |
617 | trace_ds(hSession,",ph=%d", ph); | 624 | trace_ds(hSession,",ph=%d", ph); |
618 | } else | 625 | } else |
619 | - ph = *char_height; | 626 | + ph = SH_3279_2; |
627 | + | ||
620 | trace_ds(hSession,")\n"); | 628 | trace_ds(hSession,")\n"); |
621 | 629 | ||
622 | cursor_move(hSession,0); | 630 | cursor_move(hSession,0); |
@@ -784,39 +792,24 @@ static void do_qr_summary(H3270 *hSession) | @@ -784,39 +792,24 @@ static void do_qr_summary(H3270 *hSession) | ||
784 | 792 | ||
785 | static void do_qr_usable_area(H3270 *hSession) | 793 | static void do_qr_usable_area(H3270 *hSession) |
786 | { | 794 | { |
787 | - unsigned short num, denom; | ||
788 | - | ||
789 | trace_ds(hSession,"> QueryReply(UsableArea)\n"); | 795 | trace_ds(hSession,"> QueryReply(UsableArea)\n"); |
790 | space3270out(hSession,19); | 796 | space3270out(hSession,19); |
791 | *hSession->output.ptr++ = 0x01; /* 12/14-bit addressing */ | 797 | *hSession->output.ptr++ = 0x01; /* 12/14-bit addressing */ |
792 | *hSession->output.ptr++ = 0x00; /* no special character features */ | 798 | *hSession->output.ptr++ = 0x00; /* no special character features */ |
793 | SET16(hSession->output.ptr, hSession->max.cols); /* usable width */ | 799 | SET16(hSession->output.ptr, hSession->max.cols); /* usable width */ |
794 | SET16(hSession->output.ptr, hSession->max.rows); /* usable height */ | 800 | SET16(hSession->output.ptr, hSession->max.rows); /* usable height */ |
795 | - *hSession->output.ptr++ = 0x01; /* units (mm) */ | ||
796 | 801 | ||
797 | - num = display_widthMM(); | ||
798 | - denom = display_width(); | ||
799 | - while (!(num %2) && !(denom % 2)) | ||
800 | - { | ||
801 | - num /= 2; | ||
802 | - denom /= 2; | ||
803 | - } | ||
804 | - SET16(hSession->output.ptr, (int)num); /* Xr numerator */ | ||
805 | - SET16(hSession->output.ptr, (int)denom); /* Xr denominator */ | 802 | + *hSession->output.ptr++ = 0x01; /* units (mm) */ |
806 | 803 | ||
807 | - num = display_heightMM(); | ||
808 | - denom = display_height(); | ||
809 | - while (!(num %2) && !(denom % 2)) | ||
810 | - { | ||
811 | - num /= 2; | ||
812 | - denom /= 2; | ||
813 | - } | 804 | + // |
805 | + // Got from C3270 source code. | ||
806 | + // | ||
814 | 807 | ||
815 | - SET16(hSession->output.ptr, (int)num); /* Yr numerator */ | ||
816 | - SET16(hSession->output.ptr, (int)denom); /* Yr denominator */ | 808 | + SET32(hSession->output.ptr, Xr_3279_2); // Xr, canned from 3279-2 |
809 | + SET32(hSession->output.ptr, Yr_3279_2); // Yr, canned from 3279-2 | ||
817 | 810 | ||
818 | - *hSession->output.ptr++ = *char_width; /* AW */ | ||
819 | - *hSession->output.ptr++ = *char_height; /* AH */ | 811 | + *hSession->output.ptr++ = SW_3279_2; // AW, canned from 3279-2 |
812 | + *hSession->output.ptr++ = SH_3279_2; // AH, canned from 3279-2 | ||
820 | 813 | ||
821 | SET16(hSession->output.ptr, hSession->max.cols * hSession->max.rows); /* buffer, questionable */ | 814 | SET16(hSession->output.ptr, hSession->max.cols * hSession->max.rows); /* buffer, questionable */ |
822 | 815 | ||
@@ -922,8 +915,8 @@ static void do_qr_charsets(H3270 *hSession) | @@ -922,8 +915,8 @@ static void do_qr_charsets(H3270 *hSession) | ||
922 | *hSession->output.ptr++ = 0x82; /* flags: GE, CGCSGID present */ | 915 | *hSession->output.ptr++ = 0x82; /* flags: GE, CGCSGID present */ |
923 | 916 | ||
924 | *hSession->output.ptr++ = 0x00; /* more flags */ | 917 | *hSession->output.ptr++ = 0x00; /* more flags */ |
925 | - *hSession->output.ptr++ = *char_width; /* SDW */ | ||
926 | - *hSession->output.ptr++ = *char_height; /* SDW */ | 918 | + *hSession->output.ptr++ = SW_3279_2; /* SDW */ |
919 | + *hSession->output.ptr++ = SH_3279_2; /* SDW */ | ||
927 | *hSession->output.ptr++ = 0x00; /* no load PS */ | 920 | *hSession->output.ptr++ = 0x00; /* no load PS */ |
928 | *hSession->output.ptr++ = 0x00; | 921 | *hSession->output.ptr++ = 0x00; |
929 | *hSession->output.ptr++ = 0x00; | 922 | *hSession->output.ptr++ = 0x00; |