DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/ints/int10_vptable.cpp
00001 /*
00002  *  Copyright (C) 2002-2013  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 
00020 #include "dosbox.h"
00021 #include "mem.h"
00022 #include "bios.h"
00023 #include "inout.h"
00024 #include "int10.h"
00025 
00026 bool rom_bios_vptable_enable = true;
00027 
00028 const Bit8u vparams[] = {
00029         // 40x25 mode 0 and 1 crtc registers
00030         0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00031         // 80x25 mode 2 and 3 crtc registers
00032         0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00033         // graphics modes 4, 5 and 6
00034         0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70, 0x02, 0x01, 0x06, 0x07, 0,0,0,0,
00035         // mode 7 MDA text
00036         0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19, 0x02, 0x0d, 0x0b, 0x0c, 0,0,0,0,
00037         // buffer length words 2048, 4096, 16384, 16384
00038         0x00, 0x08, 0x00, 0x10, 0x00, 0x40, 0x00, 0x40,
00039         // columns
00040         40, 40, 80, 80, 40, 40, 80, 80,
00041         // CGA mode register
00042         0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29
00043 };
00044 
00045 const Bit8u vparams_pcjr[] = {
00046         // 40x25 mode 0 and 1 crtc registers
00047         0x38, 0x28, 0x2c, 0x06, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00048         // 80x25 mode 2 and 3 crtc registers
00049         0x71, 0x50, 0x5a, 0x0c, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00050         // graphics modes 4, 5, 6, 8
00051         0x38, 0x28, 0x2b, 0x06, 0x7f, 0x06, 0x64, 0x70, 0x02, 0x01, 0x26, 0x07, 0,0,0,0,
00052         // other graphics modes
00053         0x71, 0x50, 0x56, 0x0c, 0x3f, 0x06, 0x32, 0x38, 0x02, 0x03, 0x26, 0x07, 0,0,0,0,
00054         // buffer length words 2048, 4096, 16384, 16384
00055         0x00, 0x08, 0x00, 0x10, 0x00, 0x40, 0x00, 0x40,
00056         // columns
00057         40, 40, 80, 80, 40, 40, 80, 80,
00058         // CGA mode register
00059         0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29
00060 };
00061 
00062 const Bit8u vparams_tandy[] = {
00063         // 40x25 mode 0 and 1 crtc registers
00064         0x38, 0x28, 0x2c, 0x08, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00065         // 80x25 mode 2 and 3 crtc registers
00066         0x71, 0x50, 0x58, 0x10, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00067         // graphics modes 4, 5 and 6
00068         0x38, 0x28, 0x2c, 0x08, 0x7f, 0x06, 0x64, 0x70, 0x02, 0x01, 0x06, 0x07, 0,0,0,0,
00069         // graphics mode 7
00070         0x71, 0x50, 0x58, 0x10, 0x3f, 0x06, 0x32, 0x38, 0x02, 0x03, 0x06, 0x07, 0,0,0,0,
00071         // buffer length words 2048, 4096, 16384, 16384
00072         0x00, 0x08, 0x00, 0x10, 0x00, 0x40, 0x00, 0x40,
00073         // columns
00074         40, 40, 80, 80, 40, 40, 80, 80,
00075         // CGA mode register
00076         0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29
00077 };
00078 
00079 #if 0//unused
00080 const Bit8u vparams_tandy_td[] = {
00081         // 40x25 mode 0 and 1 crtc registers
00082         0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00083         // 80x25 mode 2 and 3 crtc registers
00084         0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0,0,0,0,
00085         // graphics modes 4, 5 and 6
00086         0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70, 0x02, 0x01, 0x06, 0x07, 0,0,0,0,
00087         // mode 7 MDA text
00088         0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19, 0x02, 0x0d, 0x0b, 0x0c, 0,0,0,0,
00089         // ?? mode 2 and 3 crtc registers
00090         0x71, 0x50, 0x5a, 0x0a, 0x3f, 0x06, 0x32, 0x38, 0x02, 0x03, 0x06, 0x07, 0,0,0,0,
00091         // buffer length words 2048, 4096, 16384, 16384
00092         0x00, 0x08, 0x00, 0x10, 0x00, 0x40, 0x00, 0x40,
00093         // columns
00094         40, 40, 80, 80, 40, 40, 80, 80,
00095         // CGA mode register
00096         0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29
00097 };
00098 #endif
00099 
00100 
00101 static Bit8u video_parameter_table_vga[0x40*0x1d]={
00102 // video parameter table for mode 0 (cga emulation)
00103   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00104   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00105   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00106   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00107 // video parameter table for mode 1 (cga emulation)
00108   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00109   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00110   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00111   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00112 // video parameter table for mode 2 (cga emulation)
00113   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00114   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00115   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00116   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00117 // video parameter table for mode 3 (cga emulation)
00118   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00119   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00120   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00121   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00122 // video parameter table for mode 4
00123   0x28, 0x18, 0x08, 0x00, 0x40, // bios data
00124   0x09, 0x00, 0x00, 0x02, // sequencer registers
00125   0x63, // misc output registers
00126   0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00127   0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00128   0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2, 0xff, // crtc registers 16-24
00129   0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,       // attr registers 0-7
00130   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00131   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00132   0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0f, 0x0f, 0xff, // graphics registers 0-8
00133 // video parameter table for mode 5
00134   0x28, 0x18, 0x08, 0x00, 0x40, // bios data
00135   0x09, 0x00, 0x00, 0x02, // sequencer registers
00136   0x63, // misc output registers
00137   0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00138   0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00139   0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2, 0xff, // crtc registers 16-24
00140   0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,       // attr registers 0-7
00141   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00142   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00143   0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0f, 0x0f, 0xff, // graphics registers 0-8
00144 // video parameter table for mode 6
00145   0x50, 0x18, 0x08, 0x00, 0x40, // bios data
00146   0x09, 0x0f, 0x00, 0x02, // sequencer registers
00147   0x63, // misc output registers
00148   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00149   0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00150   0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xc2, 0xff, // crtc registers 16-24
00151   0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,       // attr registers 0-7
00152   0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,       // attr registers 8-15
00153   0x01, 0x00, 0x01, 0x00, // attr registers 16-19
00154   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0xff, // graphics registers 0-8
00155 // video parameter table for mode 7
00156   0x50, 0x18, 0x10, 0x00, 0x10, // bios data
00157   0x00, 0x0f, 0x00, 0x07, // sequencer registers
00158   0x66, // misc output registers
00159   0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,       // crtc registers 0-7
00160   0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00161   0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3, 0xff, // crtc registers 16-24
00162   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00163   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00164   0x0c, 0x00, 0x0f, 0x08, // attr registers 16-19
00165   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff, // graphics registers 0-8
00166 // video parameter table for mode 8
00167   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00168   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00169   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00170   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00171 // video parameter table for mode 9
00172   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00173   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00174   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00175   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00176 // video parameter table for mode a
00177   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00178   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00179   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00180   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00181 // video parameter table for mode b
00182   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00183   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00184   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00185   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00186 // video parameter table for mode c
00187   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00188   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00189   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00190   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00191 // video parameter table for mode d
00192   0x28, 0x18, 0x08, 0x00, 0x20, // bios data
00193   0x09, 0x0f, 0x00, 0x02, // sequencer registers
00194   0x63, // misc output registers
00195   0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00196   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00197   0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xe3, 0xff, // crtc registers 16-24
00198   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00199   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00200   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00201   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00202 // video parameter table for mode e
00203   0x50, 0x18, 0x08, 0x00, 0x40, // bios data
00204   0x01, 0x0f, 0x00, 0x02, // sequencer registers
00205   0x63, // misc output registers
00206   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00207   0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00208   0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xe3, 0xff, // crtc registers 16-24
00209   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00210   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00211   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00212   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00213 // video parameter table for mode f (64k graphics memory)
00214   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00215   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00216   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00217   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00218 // video parameter table for mode 10 (64k graphics memory)
00219   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00220   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00221   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00222   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00223 // video parameter table for mode f (>64k graphics memory)
00224   0x50, 0x18, 0x0e, 0x00, 0x80, // bios data
00225   0x01, 0x0f, 0x00, 0x02, // sequencer registers
00226   0xa2, // misc output registers
00227   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00228   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00229   0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3, 0xff, // crtc registers 16-24
00230   0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,       // attr registers 0-7
00231   0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,       // attr registers 8-15
00232   0x0b, 0x00, 0x0f, 0x00, // attr registers 16-19
00233   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00234 // video parameter table for mode 10 (>64k graphics memory)
00235   0x50, 0x18, 0x0e, 0x00, 0x80, // bios data
00236   0x01, 0x0f, 0x00, 0x02, // sequencer registers
00237   0xa3, // misc output registers
00238   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00239   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00240   0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3, 0xff, // crtc registers 16-24
00241   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00242   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00243   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00244   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00245 // video parameter table for mode 0 (350 lines)
00246   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00247   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00248   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00249   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00250 // video parameter table for mode 1 (350 lines)
00251   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00252   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00253   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00254   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00255 // video parameter table for mode 2 (350 lines)
00256   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00257   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00258   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00259   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00260 // video parameter table for mode 3 (350 lines)
00261   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00262   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00263   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00264   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00265 // video parameter table for mode e
00266   0x28, 0x18, 0x10, 0x00, 0x08, // bios data
00267   0x08, 0x0f, 0x00, 0x07, // sequencer registers
00268   0x67, // misc output registers
00269   0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x1f,       // crtc registers 0-7
00270   0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00271   0x9c, 0x8e, 0x8f, 0x14, 0x1f, 0x96, 0xb9, 0xa3, 0xff, // crtc registers 16-24
00272   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00273   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00274   0x0c, 0x00, 0x0f, 0x08, // attr registers 16-19
00275   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00276 // video parameter table for mode f
00277   0x50, 0x18, 0x10, 0x00, 0x10, // bios data
00278   0x00, 0x0f, 0x00, 0x07, // sequencer registers
00279   0x67, // misc output registers
00280   0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,       // crtc registers 0-7
00281   0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00282   0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3, 0xff, // crtc registers 16-24
00283   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00284   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00285   0x0c, 0x00, 0x0f, 0x08, // attr registers 16-19
00286   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00287 // video parameter table for mode 10
00288   0x50, 0x18, 0x10, 0x00, 0x10, // bios data
00289   0x00, 0x0f, 0x00, 0x07, // sequencer registers
00290   0x66, // misc output registers
00291   0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,       // crtc registers 0-7
00292   0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00293   0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3, 0xff, // crtc registers 16-24
00294   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00295   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00296   0x0c, 0x00, 0x0f, 0x08, // attr registers 16-19
00297   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff, // graphics registers 0-8
00298 // video parameter table for mode 11
00299   0x50, 0x1d, 0x10, 0x00, 0xa0, // bios data
00300   0x01, 0x0f, 0x00, 0x02, // sequencer registers
00301   0xe3, // misc output registers
00302   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,       // crtc registers 0-7
00303   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00304   0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xc3, 0xff, // crtc registers 16-24
00305   0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,       // attr registers 0-7
00306   0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,       // attr registers 8-15
00307   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00308   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00309 // video parameter table for mode 12
00310   0x50, 0x1d, 0x10, 0x00, 0xa0, // bios data
00311   0x01, 0x0f, 0x00, 0x02, // sequencer registers
00312   0xe3, // misc output registers
00313   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,       // crtc registers 0-7
00314   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00315   0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3, 0xff, // crtc registers 16-24
00316   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,       // attr registers 0-7
00317   0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,       // attr registers 8-15
00318   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00319   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00320 // video parameter table for mode 13
00321   0x28, 0x18, 0x08, 0x00, 0x20, // bios data
00322   0x01, 0x0f, 0x00, 0x0e, // sequencer registers
00323   0x63, // misc output registers
00324   0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,       // crtc registers 0-7
00325   0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00326   0x9c, 0x8e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3, 0xff, // crtc registers 16-24
00327   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00328   0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,       // attr registers 8-15
00329   0x41, 0x00, 0x0f, 0x00, // attr registers 16-19
00330   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff  // graphics registers 0-8
00331 };
00332 
00333 static Bit8u video_parameter_table_ega[0x40*0x17]={
00334 // video parameter table for mode 0 (cga emulation)
00335   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00336   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00337   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00338   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00339 // video parameter table for mode 1 (cga emulation)
00340   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00341   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00342   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00343   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00344 // video parameter table for mode 2 (cga emulation)
00345   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00346   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00347   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00348   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00349 // video parameter table for mode 3 (cga emulation)
00350   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00351   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00352   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00353   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00354 // video parameter table for mode 4
00355   0x28, 0x18, 0x08, 0x00, 0x40, // bios data
00356   0x09, 0x03, 0x00, 0x02, // sequencer registers
00357   0x63, // misc output registers
00358   0x37, 0x27, 0x28, 0x9a, 0x2b, 0x8a, 0x04, 0x11,       // crtc registers 0-7
00359   0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00360   0xd4, 0x86, 0xc7, 0x14, 0x00, 0xd0, 0xfc, 0xb2, 0xff, // crtc registers 16-24
00361   0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,       // attr registers 0-7
00362   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00363   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00364   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff, // graphics registers 0-8
00365 // video parameter table for mode 5
00366   0x28, 0x18, 0x08, 0x00, 0x40, // bios data
00367   0x09, 0x03, 0x00, 0x02, // sequencer registers
00368   0x63, // misc output registers
00369   0x37, 0x27, 0x28, 0x9a, 0x2b, 0x8a, 0x04, 0x11,       // crtc registers 0-7
00370   0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00371   0xd4, 0x86, 0xc7, 0x14, 0x00, 0xd0, 0xfc, 0xb2, 0xff, // crtc registers 16-24
00372   0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,       // attr registers 0-7
00373   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00374   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00375   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff, // graphics registers 0-8
00376 // video parameter table for mode 6
00377   0x50, 0x18, 0x08, 0x00, 0x40, // bios data
00378   0x01, 0x0f, 0x00, 0x06, // sequencer registers
00379   0x63, // misc output registers
00380   0x73, 0x4f, 0x50, 0x96, 0x54, 0x94, 0x04, 0x11,       // crtc registers 0-7
00381   0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00382   0xd4, 0x86, 0xc7, 0x28, 0x00, 0xd0, 0xfc, 0xd2, 0xff, // crtc registers 16-24
00383   0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,       // attr registers 0-7
00384   0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,       // attr registers 8-15
00385   0x01, 0x00, 0x01, 0x00, // attr registers 16-19
00386   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0xff, // graphics registers 0-8
00387 // video parameter table for mode 7
00388   0x50, 0x18, 0x0e, 0x00, 0x10, // bios data
00389   0x00, 0x0f, 0x00, 0x03, // sequencer registers
00390   0xa2, // misc output registers
00391   0x73, 0x4f, 0x50, 0x96, 0x55, 0x95, 0xb6, 0x1f,       // crtc registers 0-7
00392   0x00, 0x4d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00393   0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xb1, 0xb3, 0xff, // crtc registers 16-24
00394   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00395   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00396   0x08, 0x00, 0x0f, 0x00, // attr registers 16-19
00397   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00398 // video parameter table for mode 8
00399   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00400   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00401   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00402   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00403 // video parameter table for mode 9
00404   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00405   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00406   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00407   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00408 // video parameter table for mode a
00409   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00410   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00411   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00412   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00413 // video parameter table for mode b
00414   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00415   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00416   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00417   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00418 // video parameter table for mode c
00419   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00420   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00421   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00422   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00423 // video parameter table for mode d
00424   0x28, 0x18, 0x08, 0x00, 0x20, // bios data
00425   0x09, 0x0f, 0x00, 0x06, // sequencer registers
00426   0x63, // misc output registers
00427   0x37, 0x27, 0x28, 0x9a, 0x2b, 0x8a, 0x04, 0x11,       // crtc registers 0-7
00428   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00429   0xd4, 0x86, 0xc7, 0x14, 0x00, 0xd0, 0xfc, 0xd3, 0xff, // crtc registers 16-24
00430   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00431   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00432   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00433   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00434 // video parameter table for mode e
00435   0x50, 0x18, 0x08, 0x00, 0x40, // bios data
00436   0x01, 0x0f, 0x00, 0x06, // sequencer registers
00437   0x63, // misc output registers
00438   0x73, 0x4f, 0x50, 0x96, 0x54, 0x94, 0x04, 0x11,       // crtc registers 0-7
00439   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00440   0xd4, 0x86, 0xc7, 0x28, 0x00, 0xd0, 0xfc, 0xd3, 0xff, // crtc registers 16-24
00441   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00442   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00443   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00444   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00445 // video parameter table for mode f (64k graphics memory)
00446   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00447   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00448   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00449   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00450 // video parameter table for mode 10 (64k graphics memory)
00451   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00452   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00453   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00454   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00455 // video parameter table for mode f (>64k graphics memory)
00456   0x50, 0x18, 0x0e, 0x00, 0x80, // bios data
00457   0x01, 0x0f, 0x00, 0x06, // sequencer registers
00458   0xa2, // misc output registers
00459   0x73, 0x4f, 0x50, 0x96, 0x54, 0x94, 0xb6, 0x1f,       // crtc registers 0-7
00460   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00461   0x83, 0x85, 0x5d, 0x14, 0x0f, 0x63, 0xb1, 0x9b, 0xff, // crtc registers 16-24
00462   0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,       // attr registers 0-7
00463   0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,       // attr registers 8-15
00464   0x0b, 0x00, 0x0f, 0x00, // attr registers 16-19
00465   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00466 // video parameter table for mode 10 (>64k graphics memory)
00467   0x50, 0x18, 0x0e, 0x00, 0x80, // bios data
00468   0x01, 0x0f, 0x00, 0x06, // sequencer registers
00469   0xa3, // misc output registers
00470   0x5b, 0x4f, 0x50, 0x9e, 0x54, 0x1c, 0x4e, 0x1f,       // crtc registers 0-7
00471   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00472   0x83, 0x85, 0x5d, 0x14, 0x0f, 0x63, 0x49, 0x9b, 0xff, // crtc registers 16-24
00473   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00474   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00475   0x01, 0x00, 0x0f, 0x00, // attr registers 16-19
00476   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, // graphics registers 0-8
00477 // video parameter table for mode 0 (350 lines)
00478   0x28, 0x18, 0x0e, 0x00, 0x08, // bios data
00479   0x09, 0x0f, 0x00, 0x03, // sequencer registers
00480   0xa3, // misc output registers
00481   0x37, 0x27, 0x28, 0x9a, 0x2b, 0xaa, 0x04, 0x1f,       // crtc registers 0-7
00482   0x00, 0x4d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00483   0x83, 0x85, 0x5d, 0x14, 0x0f, 0x63, 0xff, 0xb3, 0xff, // crtc registers 16-24
00484   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00485   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00486   0x08, 0x00, 0x0f, 0x00, // attr registers 16-19
00487   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00488 // video parameter table for mode 1 (350 lines)
00489   0x28, 0x18, 0x0e, 0x00, 0x08, // bios data
00490   0x09, 0x0f, 0x00, 0x03, // sequencer registers
00491   0xa3, // misc output registers
00492   0x37, 0x27, 0x28, 0x9a, 0x2b, 0xaa, 0x04, 0x1f,       // crtc registers 0-7
00493   0x00, 0x4d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00494   0x83, 0x85, 0x5d, 0x14, 0x0f, 0x63, 0xff, 0xb3, 0xff, // crtc registers 16-24
00495   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00496   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00497   0x08, 0x00, 0x0f, 0x00, // attr registers 16-19
00498   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00499 // video parameter table for mode 2 (350 lines)
00500   0x50, 0x18, 0x0e, 0x00, 0x10, // bios data
00501   0x01, 0x0f, 0x00, 0x03, // sequencer registers
00502   0xa3, // misc output registers
00503   0x73, 0x4f, 0x50, 0x96, 0x55, 0x95, 0xb6, 0x1f,       // crtc registers 0-7
00504   0x00, 0x4d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00505   0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xb1, 0xb3, 0xff, // crtc registers 16-24
00506   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00507   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00508   0x08, 0x00, 0x0f, 0x00, // attr registers 16-19
00509   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, // graphics registers 0-8
00510 // video parameter table for mode 3 (350 lines)
00511   0x50, 0x18, 0x0e, 0x00, 0x10, // bios data
00512   0x01, 0x0f, 0x00, 0x03, // sequencer registers
00513   0xa3, // misc output registers
00514   0x73, 0x4f, 0x50, 0x96, 0x55, 0x95, 0xb6, 0x1f,       // crtc registers 0-7
00515   0x00, 0x4d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,       // crtc registers 8-15
00516   0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xb1, 0xb3, 0xff, // crtc registers 16-24
00517   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,       // attr registers 0-7
00518   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,       // attr registers 8-15
00519   0x08, 0x00, 0x0f, 0x00, // attr registers 16-19
00520   0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff // graphics registers 0-8
00521 };
00522 
00523 
00524 Bit16u INT10_SetupVideoParameterTable(PhysPt basepos) {
00525         if (IS_VGA_ARCH) {
00526                 for (Bitu i=0;i<0x40*0x1d;i++) {
00527                         phys_writeb(basepos+i,video_parameter_table_vga[i]);
00528                 }
00529                 return 0x40*0x1d;
00530         } else {
00531                 for (Bitu i=0;i<0x40*0x17;i++) {
00532                         phys_writeb(basepos+i,video_parameter_table_ega[i]);
00533                 }
00534                 return 0x40*0x17;
00535         }
00536 }
00537 
00538 Bitu RealToPhys(Bitu x) {
00539         return PhysMake(x>>16,x&0xFFFF);
00540 }
00541 
00542 void INT10_SetupBasicVideoParameterTable(void) {
00543         const unsigned char *copy = NULL;
00544         size_t copy_sz = 0;
00545         Bitu ofs;
00546 
00547         switch (machine) {
00548                 case MCH_TANDY:
00549                         copy = vparams_tandy;
00550                         copy_sz = sizeof(vparams_tandy);
00551                         break;
00552                 case MCH_PCJR:
00553                         copy = vparams_pcjr;
00554                         copy_sz = sizeof(vparams_pcjr);
00555                         break;
00556                 default:
00557                         copy = vparams;
00558                         copy_sz = sizeof(vparams);
00559                         break;
00560         }
00561 
00562         if (BIOS_VIDEO_TABLE_LOCATION == ~(0U) || BIOS_VIDEO_TABLE_SIZE != (Bitu)copy_sz) {
00563                 if (rom_bios_vptable_enable) {
00564                         /* TODO: Free previous block */
00565 
00566                         BIOS_VIDEO_TABLE_SIZE = (Bitu)copy_sz;
00567             BIOS_VIDEO_TABLE_LOCATION = (Bitu)PhysToReal416(ROMBIOS_GetMemory((Bitu)copy_sz,"BIOS video table (INT 1Dh)")); /* TODO: make option */
00568 
00569                         /* NTS: Failure to allocate means BIOS_VIDEO_TABLE_LOCATION == 0 */
00570                 }
00571                 else {
00572                         BIOS_VIDEO_TABLE_LOCATION = 0;
00573                 }
00574         }
00575 
00576         RealSetVec(0x1d,BIOS_VIDEO_TABLE_LOCATION);
00577         ofs = RealToPhys(BIOS_VIDEO_TABLE_LOCATION);
00578         if (ofs != 0) {
00579                 if (copy && copy_sz <= BIOS_VIDEO_TABLE_SIZE) {
00580                         for (size_t i=0;i < copy_sz;i++)
00581                                 phys_writeb(ofs+(PhysPt)i,copy[i]);
00582                 }
00583                 else {
00584                         E_Exit("Somehow, INT 10 video param table too large");
00585                 }
00586         }
00587 }
00588 
00589 #if 0
00590 void INT10_GenerateVideoParameterTable(void) {
00591         if (!IS_VGA_ARCH) E_Exit("Be sure that all graphics registers are readable!");
00592         Bitu i;
00593         for (i=0; i<4; i++) {
00594                 LOG_MSG("// video parameter table for mode %x (cga emulation)",i);
00595                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00596                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00597                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00598                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00599         }
00600         for (i=4; i<0x0f; i++) {
00601                 Bitu ct;
00602                 LOG_MSG("// video parameter table for mode %x",i);
00603                 if ((i>=8) && (i<0x0d)) {
00604                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00605                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00606                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00607                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00608                 } else {
00609                         INT10_SetVideoMode(i);
00610                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // bios data",real_readb(0x40,0x4a),real_readb(0x40,0x84),real_readb(0x40,0x85),real_readb(0x40,0x4c),real_readb(0x40,0x4d));
00611                         Bitu seq_regs[4];
00612                         for (ct=0; ct<4; ct++) {
00613                                 IO_WriteB(0x3c4,ct+1);
00614                                 seq_regs[ct]=IO_ReadB(0x3c5);
00615                         }
00616                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // sequencer registers",seq_regs[0],seq_regs[1],seq_regs[2],seq_regs[3]);
00617                         LOG_MSG("  0x%02x, // misc output registers",IO_ReadB(0x3cc));
00618                         Bitu crtc_regs[0x19];
00619                         Bit16u crt_addr=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
00620                         for (ct=0; ct<0x19; ct++) {
00621                                 IO_WriteB(crt_addr,ct);
00622                                 crtc_regs[ct]=IO_ReadB(crt_addr+1);
00623                         }
00624                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 0-7",
00625                                 crtc_regs[0x00],crtc_regs[0x01],crtc_regs[0x02],crtc_regs[0x03],
00626                                 crtc_regs[0x04],crtc_regs[0x05],crtc_regs[0x06],crtc_regs[0x07]);
00627                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 8-15",
00628                                 crtc_regs[0x08],crtc_regs[0x09],crtc_regs[0x0a],crtc_regs[0x0b],
00629                                 crtc_regs[0x0c],crtc_regs[0x0d],crtc_regs[0x0e],crtc_regs[0x0f]);
00630                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // crtc registers 16-24",
00631                                 crtc_regs[0x10],crtc_regs[0x11],crtc_regs[0x12],crtc_regs[0x13],
00632                                 crtc_regs[0x14],crtc_regs[0x15],crtc_regs[0x16],crtc_regs[0x17],crtc_regs[0x18]);
00633                         Bitu attr_regs[0x14];
00634                         for (ct=0; ct<0x14; ct++) {
00635                                 IO_ReadB(crt_addr+6);
00636                                 IO_WriteB(0x3c0,ct);
00637                                 attr_regs[ct]=IO_ReadB(0x3c1);
00638                         }
00639                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 0-7",
00640                                 attr_regs[0x00],attr_regs[0x01],attr_regs[0x02],attr_regs[0x03],
00641                                 attr_regs[0x04],attr_regs[0x05],attr_regs[0x06],attr_regs[0x07]);
00642                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 8-15",
00643                                 attr_regs[0x08],attr_regs[0x09],attr_regs[0x0a],attr_regs[0x0b],
00644                                 attr_regs[0x0c],attr_regs[0x0d],attr_regs[0x0e],attr_regs[0x0f]);
00645                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // attr registers 16-19",
00646                                 attr_regs[0x10],attr_regs[0x11],attr_regs[0x12],attr_regs[0x13]);
00647                         Bitu gfx_regs[9];
00648                         for (ct=0; ct<0x09; ct++) {
00649                                 IO_WriteB(0x3ce,ct);
00650                                 gfx_regs[ct]=IO_ReadB(0x3cf);
00651                         }
00652                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // graphics registers 0-8",
00653                                 gfx_regs[0x00],gfx_regs[0x01],gfx_regs[0x02],gfx_regs[0x03],
00654                                 gfx_regs[0x04],gfx_regs[0x05],gfx_regs[0x06],gfx_regs[0x07],gfx_regs[0x08]);
00655                 }
00656         }
00657         for (i=0x0f; i<0x11; i++) {
00658                 LOG_MSG("// video parameter table for mode %x (64k graphics memory)",i);
00659                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00660                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00661                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00662                 LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00663         }
00664         for (i=0x0f; i<0x11; i++) {
00665                 Bitu ct;
00666                 INT10_SetVideoMode(i);
00667                 LOG_MSG("// video parameter table for mode %x (>64k graphics memory)",i);
00668                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // bios data",real_readb(0x40,0x4a),real_readb(0x40,0x84),real_readb(0x40,0x85),real_readb(0x40,0x4c),real_readb(0x40,0x4d));
00669                 Bitu seq_regs[4];
00670                 for (ct=0; ct<4; ct++) {
00671                         IO_WriteB(0x3c4,ct+1);
00672                         seq_regs[ct]=IO_ReadB(0x3c5);
00673                 }
00674                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // sequencer registers",seq_regs[0],seq_regs[1],seq_regs[2],seq_regs[3]);
00675                 LOG_MSG("  0x%02x, // misc output registers",IO_ReadB(0x3cc));
00676                 Bitu crtc_regs[0x19];
00677                 Bit16u crt_addr=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
00678                 for (ct=0; ct<0x19; ct++) {
00679                         IO_WriteB(crt_addr,ct);
00680                         crtc_regs[ct]=IO_ReadB(crt_addr+1);
00681                 }
00682                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 0-7",
00683                         crtc_regs[0x00],crtc_regs[0x01],crtc_regs[0x02],crtc_regs[0x03],
00684                         crtc_regs[0x04],crtc_regs[0x05],crtc_regs[0x06],crtc_regs[0x07]);
00685                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 8-15",
00686                         crtc_regs[0x08],crtc_regs[0x09],crtc_regs[0x0a],crtc_regs[0x0b],
00687                         crtc_regs[0x0c],crtc_regs[0x0d],crtc_regs[0x0e],crtc_regs[0x0f]);
00688                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // crtc registers 16-24",
00689                         crtc_regs[0x10],crtc_regs[0x11],crtc_regs[0x12],crtc_regs[0x13],
00690                         crtc_regs[0x14],crtc_regs[0x15],crtc_regs[0x16],crtc_regs[0x17],crtc_regs[0x18]);
00691                 Bitu attr_regs[0x14];
00692                 for (ct=0; ct<0x14; ct++) {
00693                         IO_ReadB(crt_addr+6);
00694                         IO_WriteB(0x3c0,ct);
00695                         attr_regs[ct]=IO_ReadB(0x3c1);
00696                 }
00697                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 0-7",
00698                         attr_regs[0x00],attr_regs[0x01],attr_regs[0x02],attr_regs[0x03],
00699                         attr_regs[0x04],attr_regs[0x05],attr_regs[0x06],attr_regs[0x07]);
00700                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 8-15",
00701                         attr_regs[0x08],attr_regs[0x09],attr_regs[0x0a],attr_regs[0x0b],
00702                         attr_regs[0x0c],attr_regs[0x0d],attr_regs[0x0e],attr_regs[0x0f]);
00703                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // attr registers 16-19",
00704                         attr_regs[0x10],attr_regs[0x11],attr_regs[0x12],attr_regs[0x13]);
00705                 Bitu gfx_regs[9];
00706                 for (ct=0; ct<0x09; ct++) {
00707                         IO_WriteB(0x3ce,ct);
00708                         gfx_regs[ct]=IO_ReadB(0x3cf);
00709                 }
00710                 LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // graphics registers 0-8",
00711                         gfx_regs[0x00],gfx_regs[0x01],gfx_regs[0x02],gfx_regs[0x03],
00712                         gfx_regs[0x04],gfx_regs[0x05],gfx_regs[0x06],gfx_regs[0x07],gfx_regs[0x08]);
00713         }
00714         for (i=0; i<4; i++) {
00715                 if (IS_VGA_ARCH) {
00716                         LOG_MSG("// video parameter table for mode %x (350 lines)",i);
00717                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00718                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00719                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00720                         LOG_MSG("  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,");
00721                 } else {
00722                         Bitu ct;
00723                         INT10_SetVideoMode(i);
00724                         LOG_MSG("// video parameter table for mode %x (350 lines)",i);
00725                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // bios data",real_readb(0x40,0x4a),real_readb(0x40,0x84),real_readb(0x40,0x85),real_readb(0x40,0x4c),real_readb(0x40,0x4d));
00726                         Bitu seq_regs[4];
00727                         for (ct=0; ct<4; ct++) {
00728                                 IO_WriteB(0x3c4,ct+1);
00729                                 seq_regs[ct]=IO_ReadB(0x3c5);
00730                         }
00731                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // sequencer registers",seq_regs[0],seq_regs[1],seq_regs[2],seq_regs[3]);
00732                         LOG_MSG("  0x%02x, // misc output registers",IO_ReadB(0x3cc));
00733                         Bitu crtc_regs[0x19];
00734                         Bit16u crt_addr=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
00735                         for (ct=0; ct<0x19; ct++) {
00736                                 IO_WriteB(crt_addr,ct);
00737                                 crtc_regs[ct]=IO_ReadB(crt_addr+1);
00738                         }
00739                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 0-7",
00740                                 crtc_regs[0x00],crtc_regs[0x01],crtc_regs[0x02],crtc_regs[0x03],
00741                                 crtc_regs[0x04],crtc_regs[0x05],crtc_regs[0x06],crtc_regs[0x07]);
00742                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 8-15",
00743                                 crtc_regs[0x08],crtc_regs[0x09],crtc_regs[0x0a],crtc_regs[0x0b],
00744                                 crtc_regs[0x0c],crtc_regs[0x0d],crtc_regs[0x0e],crtc_regs[0x0f]);
00745                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // crtc registers 16-24",
00746                                 crtc_regs[0x10],crtc_regs[0x11],crtc_regs[0x12],crtc_regs[0x13],
00747                                 crtc_regs[0x14],crtc_regs[0x15],crtc_regs[0x16],crtc_regs[0x17],crtc_regs[0x18]);
00748                         Bitu attr_regs[0x14];
00749                         for (ct=0; ct<0x14; ct++) {
00750                                 IO_ReadB(crt_addr+6);
00751                                 IO_WriteB(0x3c0,ct);
00752                                 attr_regs[ct]=IO_ReadB(0x3c1);
00753                         }
00754                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 0-7",
00755                                 attr_regs[0x00],attr_regs[0x01],attr_regs[0x02],attr_regs[0x03],
00756                                 attr_regs[0x04],attr_regs[0x05],attr_regs[0x06],attr_regs[0x07]);
00757                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 8-15",
00758                                 attr_regs[0x08],attr_regs[0x09],attr_regs[0x0a],attr_regs[0x0b],
00759                                 attr_regs[0x0c],attr_regs[0x0d],attr_regs[0x0e],attr_regs[0x0f]);
00760                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // attr registers 16-19",
00761                                 attr_regs[0x10],attr_regs[0x11],attr_regs[0x12],attr_regs[0x13]);
00762                         Bitu gfx_regs[9];
00763                         for (ct=0; ct<0x09; ct++) {
00764                                 IO_WriteB(0x3ce,ct);
00765                                 gfx_regs[ct]=IO_ReadB(0x3cf);
00766                         }
00767                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // graphics registers 0-8",
00768                                 gfx_regs[0x00],gfx_regs[0x01],gfx_regs[0x02],gfx_regs[0x03],
00769                                 gfx_regs[0x04],gfx_regs[0x05],gfx_regs[0x06],gfx_regs[0x07],gfx_regs[0x08]);
00770                 }
00771         }
00772         if (IS_VGA_ARCH) {
00773                 for (i=0x0e; i<0x14; i++) {
00774                         Bitu ct=i;
00775                         if (i==0x0e) ct=1;
00776                         if (i==0x0f) ct=3;
00777                         if (i==0x010) ct=7;
00778                         INT10_SetVideoMode(ct);
00779                         LOG_MSG("// video parameter table for mode %x",i);
00780                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // bios data",real_readb(0x40,0x4a),real_readb(0x40,0x84),real_readb(0x40,0x85),real_readb(0x40,0x4c),real_readb(0x40,0x4d));
00781                         Bitu seq_regs[4];
00782                         for (ct=0; ct<4; ct++) {
00783                                 IO_WriteB(0x3c4,ct+1);
00784                                 seq_regs[ct]=IO_ReadB(0x3c5);
00785                         }
00786                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // sequencer registers",seq_regs[0],seq_regs[1],seq_regs[2],seq_regs[3]);
00787                         LOG_MSG("  0x%02x, // misc output registers",IO_ReadB(0x3cc));
00788                         Bitu crtc_regs[0x19];
00789                         Bit16u crt_addr=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
00790                         for (ct=0; ct<0x19; ct++) {
00791                                 IO_WriteB(crt_addr,ct);
00792                                 crtc_regs[ct]=IO_ReadB(crt_addr+1);
00793                         }
00794                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 0-7",
00795                                 crtc_regs[0x00],crtc_regs[0x01],crtc_regs[0x02],crtc_regs[0x03],
00796                                 crtc_regs[0x04],crtc_regs[0x05],crtc_regs[0x06],crtc_regs[0x07]);
00797                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // crtc registers 8-15",
00798                                 crtc_regs[0x08],crtc_regs[0x09],crtc_regs[0x0a],crtc_regs[0x0b],
00799                                 crtc_regs[0x0c],crtc_regs[0x0d],crtc_regs[0x0e],crtc_regs[0x0f]);
00800                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // crtc registers 16-24",
00801                                 crtc_regs[0x10],crtc_regs[0x11],crtc_regs[0x12],crtc_regs[0x13],
00802                                 crtc_regs[0x14],crtc_regs[0x15],crtc_regs[0x16],crtc_regs[0x17],crtc_regs[0x18]);
00803                         Bitu attr_regs[0x14];
00804                         for (ct=0; ct<0x14; ct++) {
00805                                 IO_ReadB(crt_addr+6);
00806                                 IO_WriteB(0x3c0,ct);
00807                                 attr_regs[ct]=IO_ReadB(0x3c1);
00808                         }
00809                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 0-7",
00810                                 attr_regs[0x00],attr_regs[0x01],attr_regs[0x02],attr_regs[0x03],
00811                                 attr_regs[0x04],attr_regs[0x05],attr_regs[0x06],attr_regs[0x07]);
00812                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,       // attr registers 8-15",
00813                                 attr_regs[0x08],attr_regs[0x09],attr_regs[0x0a],attr_regs[0x0b],
00814                                 attr_regs[0x0c],attr_regs[0x0d],attr_regs[0x0e],attr_regs[0x0f]);
00815                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, // attr registers 16-19",
00816                                 attr_regs[0x10],attr_regs[0x11],attr_regs[0x12],attr_regs[0x13]);
00817                         Bitu gfx_regs[9];
00818                         for (ct=0; ct<0x09; ct++) {
00819                                 IO_WriteB(0x3ce,ct);
00820                                 gfx_regs[ct]=IO_ReadB(0x3cf);
00821                         }
00822                         LOG_MSG("  0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, // graphics registers 0-8",
00823                                 gfx_regs[0x00],gfx_regs[0x01],gfx_regs[0x02],gfx_regs[0x03],
00824                                 gfx_regs[0x04],gfx_regs[0x05],gfx_regs[0x06],gfx_regs[0x07],gfx_regs[0x08]);
00825                 }
00826         }
00827         INT10_SetVideoMode(3);
00828         E_Exit("done!");
00829 }
00830 #endif