|
42 | 42 | #include <hw/flatreal/flatreal.h>
|
43 | 43 | #include <hw/dos/doswin.h>
|
44 | 44 |
|
| 45 | +static int vga_setbmode = -1; |
45 | 46 | static int info = 0; /* show info */
|
46 | 47 | static int sstep = 0; /* single step */
|
47 | 48 |
|
@@ -778,7 +779,16 @@ int main(int argc,char **argv) {
|
778 | 779 | else if (!strcmp(a,"6")) {
|
779 | 780 | md.dac8 = 0;
|
780 | 781 | }
|
781 |
| - else { |
| 782 | + else if (!strcmp(a,"vb")) { |
| 783 | + vga_setbmode = 0;//byte mode |
| 784 | + } |
| 785 | + else if (!strcmp(a,"vw")) { |
| 786 | + vga_setbmode = 1;//word mode |
| 787 | + } |
| 788 | + else if (!strcmp(a,"vd")) { |
| 789 | + vga_setbmode = 2;//dword mode |
| 790 | + } |
| 791 | + else { |
782 | 792 | printf("I don't know what switch '%s' means\n",a);
|
783 | 793 | return 1;
|
784 | 794 | }
|
@@ -924,6 +934,31 @@ int main(int argc,char **argv) {
|
924 | 934 | printf(" Failed to set mode\n");
|
925 | 935 | return 1;
|
926 | 936 | }
|
| 937 | + |
| 938 | + if (vga_setbmode >= 0) { |
| 939 | + /* Test whether SVGA modes are immune or not to the BYTE/WORD/DWORD bits */ |
| 940 | + unsigned char un,mc; |
| 941 | + |
| 942 | + if (!probe_vga()) |
| 943 | + return 1; |
| 944 | + |
| 945 | + un = vga_read_CRTC(0x14); |
| 946 | + mc = vga_read_CRTC(0x17); |
| 947 | + |
| 948 | + if (vga_setbmode >= 2)//DW BIT |
| 949 | + un |= 0x40; |
| 950 | + else |
| 951 | + un &= ~0x40; |
| 952 | + |
| 953 | + if (vga_setbmode >= 1)//W BIT (set to 0 for word mode) |
| 954 | + mc &= ~0x40; |
| 955 | + else |
| 956 | + mc |= 0x40; |
| 957 | + |
| 958 | + vga_write_CRTC(0x14,un); |
| 959 | + vga_write_CRTC(0x17,mc); |
| 960 | + } |
| 961 | + |
927 | 962 | sstep_wait();
|
928 | 963 | if (!vbe_mode_decision_acceptmode(&md,&mi)) {
|
929 | 964 | vbe_reset_video_to_text();
|
|
0 commit comments