URL
https://opencores.org/ocsvn/zet86/zet86/trunk
Subversion Repositories zet86
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 33 to Rev 34
- ↔ Reverse comparison
Rev 33 → Rev 34
/trunk/soc/bios/vgabios.h
0,0 → 1,47
#ifndef vgabios_h_included |
#define vgabios_h_included |
|
/* Types */ |
typedef unsigned char Bit8u; |
typedef unsigned short Bit16u; |
typedef unsigned long Bit32u; |
typedef unsigned short Boolean; |
|
/* Defines */ |
|
#define SET_AL(val8) AX = ((AX & 0xff00) | (val8)) |
#define SET_BL(val8) BX = ((BX & 0xff00) | (val8)) |
#define SET_CL(val8) CX = ((CX & 0xff00) | (val8)) |
#define SET_DL(val8) DX = ((DX & 0xff00) | (val8)) |
#define SET_AH(val8) AX = ((AX & 0x00ff) | ((val8) << 8)) |
#define SET_BH(val8) BX = ((BX & 0x00ff) | ((val8) << 8)) |
#define SET_CH(val8) CX = ((CX & 0x00ff) | ((val8) << 8)) |
#define SET_DH(val8) DX = ((DX & 0x00ff) | ((val8) << 8)) |
|
#define GET_AL() ( AX & 0x00ff ) |
#define GET_BL() ( BX & 0x00ff ) |
#define GET_CL() ( CX & 0x00ff ) |
#define GET_DL() ( DX & 0x00ff ) |
#define GET_AH() ( AX >> 8 ) |
#define GET_BH() ( BX >> 8 ) |
#define GET_CH() ( CX >> 8 ) |
#define GET_DH() ( DX >> 8 ) |
|
#define SET_CF() FLAGS |= 0x0001 |
#define CLEAR_CF() FLAGS &= 0xfffe |
#define GET_CF() (FLAGS & 0x0001) |
|
#define SET_ZF() FLAGS |= 0x0040 |
#define CLEAR_ZF() FLAGS &= 0xffbf |
#define GET_ZF() (FLAGS & 0x0040) |
|
#define SCROLL_DOWN 0 |
#define SCROLL_UP 1 |
#define NO_ATTR 2 |
#define WITH_ATTR 3 |
|
#define SCREEN_SIZE(x,y) (((x*y*2)|0x00ff)+1) |
#define SCREEN_MEM_START(x,y,p) ((((x*y*2)|0x00ff)+1)*p) |
#define SCREEN_IO_START(x,y,p) ((((x*y)|0x00ff)+1)*p) |
|
#endif |
/trunk/soc/bios/.bochsrc
0,0 → 1,6
romimage: file=zet-bios.out |
vgaromimage: file=vgabios.out |
#boot: floppy |
#loppya: 1_44="a-1.44.img", status=inserted |
debug: action=report |
log: bochs.log |
/trunk/soc/bios/biossums.c
1,5 → 1,5
/* |
* $Id: biossums.c,v 1.1 2008-10-01 02:25:51 zeus Exp $ |
* $Id: biossums.c,v 1.2 2008-10-13 00:24:30 zeus Exp $ |
* |
* This library is free software; you can redistribute it and/or |
* modify it under the terms of the GNU Lesser General Public |
/trunk/soc/bios/vgasums.c
0,0 → 1,220
/* biossums.c --- written by Eike W. for the Bochs BIOS */ |
/* adapted for the LGPL'd VGABIOS by vruppert */ |
|
/* This library is free software; you can redistribute it and/or |
* modify it under the terms of the GNU Lesser General Public |
* License as published by the Free Software Foundation; either |
* version 2 of the License, or (at your option) any later version. |
* |
* This library is distributed in the hope that it will be useful, |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
* Lesser General Public License for more details. |
* |
* You should have received a copy of the GNU Lesser General Public |
* License along with this library; if not, write to the Free Software |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
*/ |
#include <stdlib.h> |
#include <stdio.h> |
#include <string.h> |
|
typedef unsigned char byte; |
|
void check( int value, char* message ); |
|
#define MAX_BIOS_DATA 0x10000 |
|
long chksum_bios_get_offset( byte* data, long offset ); |
byte chksum_bios_calc_value( byte* data, long offset ); |
byte chksum_bios_get_value( byte* data, long offset ); |
void chksum_bios_set_value( byte* data, long offset, byte value ); |
|
|
#define PMID_LEN 20 |
#define PMID_CHKSUM 19 |
|
long chksum_pmid_get_offset( byte* data, long offset ); |
byte chksum_pmid_calc_value( byte* data, long offset ); |
byte chksum_pmid_get_value( byte* data, long offset ); |
void chksum_pmid_set_value( byte* data, long offset, byte value ); |
|
|
byte bios_data[MAX_BIOS_DATA]; |
long bios_len; |
|
|
int main( int argc, char* argv[] ) { |
|
FILE* stream; |
long offset, tmp_offset; |
byte cur_val = 0, new_val = 0; |
int hits; |
|
|
if (argc != 2) { |
printf( "Error. Need a file-name as an argument.\n" ); |
exit( EXIT_FAILURE ); |
} |
|
if ((stream = fopen(argv[1], "rb")) == NULL) { |
printf("Error opening %s for reading.\n", argv[1]); |
exit(EXIT_FAILURE); |
} |
memset(bios_data, 0, MAX_BIOS_DATA); |
bios_len = fread(bios_data, 1, MAX_BIOS_DATA, stream); |
if (bios_len >= MAX_BIOS_DATA) { |
printf("Error reading max. 65535 Bytes from %s.\n", argv[1]); |
fclose(stream); |
exit(EXIT_FAILURE); |
} |
fclose(stream); |
if (bios_len < 0x7FFF) { |
bios_len = 0x8000; |
} else { |
bios_len = (bios_len + 0x201) & ~0x1FF; |
} |
bios_data[2] = (byte)(bios_len / 512); |
|
hits = 0; |
offset = 0L; |
while( (tmp_offset = chksum_pmid_get_offset( bios_data, offset )) != -1L ) { |
offset = tmp_offset; |
cur_val = chksum_pmid_get_value( bios_data, offset ); |
new_val = chksum_pmid_calc_value( bios_data, offset ); |
printf( "\nPMID entry at: 0x%4lX\n", offset ); |
printf( "Current checksum: 0x%02X\n", cur_val ); |
printf( "Calculated checksum: 0x%02X ", new_val ); |
hits++; |
} |
if( hits == 1 && cur_val != new_val ) { |
printf( "Setting checksum." ); |
chksum_pmid_set_value( bios_data, offset, new_val ); |
} |
if( hits >= 2 ) { |
printf( "Multiple PMID entries! No checksum set." ); |
} |
if( hits ) { |
printf( "\n" ); |
} |
|
|
offset = 0L; |
offset = chksum_bios_get_offset( bios_data, offset ); |
cur_val = chksum_bios_get_value( bios_data, offset ); |
new_val = chksum_bios_calc_value( bios_data, offset ); |
printf( "\nBios checksum at: 0x%4lX\n", offset ); |
printf( "Current checksum: 0x%02X\n", cur_val ); |
printf( "Calculated checksum: 0x%02X ", new_val ); |
if( cur_val != new_val ) { |
printf( "Setting checksum." ); |
chksum_bios_set_value( bios_data, offset, new_val ); |
} |
printf( "\n" ); |
|
|
if(( stream = fopen( argv[1], "wb" )) == NULL ) { |
printf( "Error opening %s for writing.\n", argv[1] ); |
exit( EXIT_FAILURE ); |
} |
if( fwrite( bios_data, 1, bios_len, stream ) < bios_len ) { |
printf( "Error writing %d KBytes to %s.\n", bios_len / 1024, argv[1] ); |
fclose( stream ); |
exit( EXIT_FAILURE ); |
} |
fclose( stream ); |
|
return( EXIT_SUCCESS ); |
} |
|
|
void check( int okay, char* message ) { |
|
if( !okay ) { |
printf( "\n\nError. %s.\n", message ); |
exit( EXIT_FAILURE ); |
} |
} |
|
|
long chksum_bios_get_offset( byte* data, long offset ) { |
|
return (bios_len - 1); |
} |
|
|
byte chksum_bios_calc_value( byte* data, long offset ) { |
|
int i; |
byte sum; |
|
sum = 0; |
for( i = 0; i < offset; i++ ) { |
sum = sum + *( data + i ); |
} |
sum = -sum; /* iso ensures -s + s == 0 on unsigned types */ |
return( sum ); |
} |
|
|
byte chksum_bios_get_value( byte* data, long offset ) { |
|
return( *( data + offset ) ); |
} |
|
|
void chksum_bios_set_value( byte* data, long offset, byte value ) { |
|
*( data + offset ) = value; |
} |
|
|
byte chksum_pmid_calc_value( byte* data, long offset ) { |
|
int i; |
int len; |
byte sum; |
|
len = PMID_LEN; |
check((offset + len) <= (bios_len - 1), "PMID entry length out of bounds" ); |
sum = 0; |
for( i = 0; i < len; i++ ) { |
if( i != PMID_CHKSUM ) { |
sum = sum + *( data + offset + i ); |
} |
} |
sum = -sum; |
return( sum ); |
} |
|
|
long chksum_pmid_get_offset( byte* data, long offset ) { |
|
long result = -1L; |
|
while ((offset + PMID_LEN) < (bios_len - 1)) { |
offset = offset + 1; |
if( *( data + offset + 0 ) == 'P' && \ |
*( data + offset + 1 ) == 'M' && \ |
*( data + offset + 2 ) == 'I' && \ |
*( data + offset + 3 ) == 'D' ) { |
result = offset; |
break; |
} |
} |
return( result ); |
} |
|
|
byte chksum_pmid_get_value( byte* data, long offset ) { |
|
check((offset + PMID_CHKSUM) <= (bios_len - 1), "PMID checksum out of bounds" ); |
return( *( data + offset + PMID_CHKSUM ) ); |
} |
|
|
void chksum_pmid_set_value( byte* data, long offset, byte value ) { |
|
check((offset + PMID_CHKSUM) <= (bios_len - 1), "PMID checksum out of bounds" ); |
*( data + offset + PMID_CHKSUM ) = value; |
} |
/trunk/soc/bios/makesym.perl
1,6 → 1,6
#!/usr/bin/perl |
# |
# $Id: makesym.perl,v 1.1 2008-10-01 02:25:51 zeus Exp $ |
# $Id: makesym.perl,v 1.2 2008-10-13 00:24:30 zeus Exp $ |
# |
# Read output file from as86 (e.g. rombios.txt) and write out a symbol |
# table suitable for the Bochs debugger. |
/trunk/soc/bios/rombios.c
792,7 → 792,7
} |
} |
|
static char bios_svn_version_string[] = "$Revision: 1.2 $ $Date: 2008-10-04 23:11:53 $"; |
static char bios_svn_version_string[] = "$Revision: 1.3 $ $Date: 2008-10-13 00:24:30 $"; |
|
//-------------------------------------------------------------------------- |
// print_bios_banner |
1112,7 → 1112,9
push di ;; Save DI |
;; Push addr of ROM entry point |
push cx ;; Push seg |
push #0x0003 ;; Push offset |
;; push #0x0003 ;; Push offset - not an 8086 valid operand |
mov ax, #0x0003 |
push ax |
|
;; Point ES:DI at "$PnP", which tells the ROM that we are a PnP BIOS. |
;; That should stop it grabbing INT 19h; we will use its BEV instead. |
1270,7 → 1272,7
call rom_scan |
|
call _print_bios_banner |
|
hlt |
call _init_boot_vectors |
|
mov cx, #0xc800 ;; init option roms |
/trunk/soc/bios/vgabios.c
0,0 → 1,998
#include "vgabios.h" |
|
/* Declares */ |
static Bit8u read_byte(); |
static Bit16u read_word(); |
static void write_byte(); |
static void write_word(); |
static Bit8u inb(); |
static Bit16u inw(); |
static void outb(); |
static void outw(); |
|
static Bit16u get_SS(); |
|
static Bit8u find_vga_entry(); |
|
static void memsetb(); |
static void memsetw(); |
static void memcpyb(); |
static void memcpyw(); |
|
static void biosfn_set_video_mode(); |
static void biosfn_set_cursor_pos(); |
static void biosfn_get_cursor_pos(); |
static void biosfn_scroll(); |
static void biosfn_write_teletype(); |
static void biosfn_write_string(); |
extern Bit8u video_save_pointer_table[]; |
|
// This is for compiling with gcc2 and gcc3 |
#define ASM_START #asm |
#define ASM_END #endasm |
|
ASM_START |
|
MACRO SET_INT_VECTOR |
push ds |
xor ax, ax |
mov ds, ax |
mov ax, ?3 |
mov ?1*4, ax |
mov ax, ?2 |
mov ?1*4+2, ax |
pop ds |
MEND |
|
ASM_END |
|
ASM_START |
.text |
.rom |
.org 0 |
|
use16 8086 |
|
vgabios_start: |
.byte 0x55, 0xaa /* BIOS signature, required for BIOS extensions */ |
|
.byte 0x40 /* BIOS extension length in units of 512 bytes */ |
|
|
vgabios_entry_point: |
|
jmp vgabios_init_func |
|
vgabios_name: |
.ascii "Plex86/Bochs VGABios" |
.ascii " " |
.byte 0x00 |
|
// Info from Bart Oldeman |
.org 0x1e |
.ascii "IBM" |
.byte 0x00 |
|
vgabios_version: |
#ifndef VGABIOS_VERS |
.ascii "current-cvs" |
#else |
.ascii VGABIOS_VERS |
#endif |
.ascii " " |
|
vgabios_date: |
.ascii VGABIOS_DATE |
.byte 0x0a,0x0d |
.byte 0x00 |
|
vgabios_copyright: |
.ascii "(C) 2003 the LGPL VGABios developers Team" |
.byte 0x0a,0x0d |
.byte 0x00 |
|
vgabios_license: |
.ascii "This VGA/VBE Bios is released under the GNU LGPL" |
.byte 0x0a,0x0d |
.byte 0x0a,0x0d |
.byte 0x00 |
|
vgabios_website: |
.ascii "Please visit :" |
.byte 0x0a,0x0d |
;;.ascii " . http://www.plex86.org" |
;;.byte 0x0a,0x0d |
.ascii " . http://bochs.sourceforge.net" |
.byte 0x0a,0x0d |
.ascii " . http://www.nongnu.org/vgabios" |
.byte 0x0a,0x0d |
.byte 0x0a,0x0d |
.byte 0x00 |
|
|
;; ======================================================== |
;; |
;; Init Entry point |
;; |
;; ======================================================== |
vgabios_init_func: |
|
;; init basic bios vars |
call init_bios_area |
|
;; set int10 vect |
SET_INT_VECTOR(0x10, #0xC000, #vgabios_int10_handler) |
|
;; display splash screen |
call _display_splash_screen |
hlt |
;; init video mode and clear the screen |
mov ax,#0x0003 |
int #0x10 |
|
;; show info |
call _display_info |
|
retf |
ASM_END |
|
/* |
* int10 handled here |
*/ |
ASM_START |
vgabios_int10_handler: |
pushf |
|
int10_normal: |
push es |
push ds |
;pusha ; we do this instead: |
|
push ax |
push cx |
push dx |
push bx |
push sp |
mov bx, sp |
add [bx], #10 |
mov bx, [bx+2] |
push bp |
push si |
push di |
|
;; We have to set ds to access the right data segment |
mov bx, #0xc000 |
mov ds, bx |
call _int10_func |
|
; popa ; we do this instead: |
pop di |
pop si |
pop bp |
add sp, #2 |
pop bx |
pop dx |
pop cx |
pop ax |
|
pop ds |
pop es |
int10_end: |
popf |
iret |
ASM_END |
|
#include "vgatables.h" |
|
// -------------------------------------------------------- |
/* |
* Boot time bios area inits |
*/ |
ASM_START |
init_bios_area: |
push ds |
mov ax, # BIOSMEM_SEG |
mov ds, ax |
|
;; init detected hardware BIOS Area |
mov bx, # BIOSMEM_INITIAL_MODE |
mov ax, [bx] |
and ax, #0xffcf |
;; set 80x25 color (not clear from RBIL but usual) |
or ax, #0x0020 |
mov [bx], ax |
|
;; Just for the first int10 find its children |
|
;; the default char height |
mov bx, # BIOSMEM_CHAR_HEIGHT |
mov al, #0x10 |
mov [bx], al |
|
;; Clear the screen |
mov bx, # BIOSMEM_VIDEO_CTL |
mov al, #0x60 |
mov [bx], al |
|
;; Set the basic screen we have |
mov bx, # BIOSMEM_SWITCHES |
mov al, #0xf9 |
mov [bx], al |
|
;; Set the basic modeset options |
mov bx, # BIOSMEM_MODESET_CTL |
mov al, #0x51 |
mov [bx], al |
|
;; Set the default MSR |
mov bx, # BIOSMEM_CURRENT_MSR |
mov al, #0x09 |
mov [bx], al |
|
pop ds |
ret |
|
_video_save_pointer_table: |
.word _video_param_table |
.word 0xc000 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
.word 0 /* XXX: fill it */ |
.word 0 |
|
ASM_END |
|
// -------------------------------------------------------- |
/* |
* Boot time Splash screen |
*/ |
static void display_splash_screen() |
{ |
/* |
ASM_START |
push dx |
push ds |
mov dx, #0xb800 |
mov ds, dx |
mov [6], #0x0361 |
pop ds |
pop dx |
ASM_END |
*/ |
|
write_byte (0xb800, 0x2, 'o'); |
write_byte (0xb800, 0x0, 'H'); |
write_byte (0xb800, 0x4, 'l'); |
write_byte (0xb800, 0x6, 'a'); |
write_byte (0xb800, 0x8, ' '); |
write_byte (0xb800, 0xa, 't'); |
write_byte (0xb800, 0xc, 'i'); |
write_byte (0xb800, 0xe, 'o'); |
write_byte (0xb800, 0x10, '!'); |
write_byte (0xb800, 0x12, '!'); |
} |
|
// -------------------------------------------------------------------------------------------- |
/* |
* Tell who we are |
*/ |
|
static void display_info() |
{ |
ASM_START |
mov ax,#0xc000 |
mov ds,ax |
mov si,#vgabios_name |
call _display_string |
mov si,#vgabios_version |
call _display_string |
|
;;mov si,#vgabios_copyright |
;;call _display_string |
;;mov si,#crlf |
;;call _display_string |
|
mov si,#vgabios_license |
call _display_string |
mov si,#vgabios_website |
call _display_string |
ASM_END |
} |
|
static void display_string() |
{ |
// Get length of string |
ASM_START |
mov ax,ds |
mov es,ax |
mov di,si |
xor cx,cx |
not cx |
xor al,al |
cld |
repne |
scasb |
not cx |
dec cx |
push cx |
|
mov ax,#0x0300 |
mov bx,#0x0000 |
int #0x10 |
|
pop cx |
mov ax,#0x1301 |
mov bx,#0x000b |
mov bp,si |
int #0x10 |
ASM_END |
} |
|
// -------------------------------------------------------- |
/* |
* int10 main dispatcher |
*/ |
static void int10_func(DI, SI, BP, SP, BX, DX, CX, AX, DS, ES, FLAGS) |
Bit16u DI, SI, BP, SP, BX, DX, CX, AX, ES, DS, FLAGS; |
{ |
|
// BIOS functions |
switch(GET_AH()) |
{ |
case 0x00: |
biosfn_set_video_mode(GET_AL()); |
switch(GET_AL()&0x7F) |
{case 6: |
SET_AL(0x3F); |
break; |
case 0: |
case 1: |
case 2: |
case 3: |
case 4: |
case 5: |
case 7: |
SET_AL(0x30); |
break; |
default: |
SET_AL(0x20); |
} |
break; |
case 0x03: |
biosfn_get_cursor_pos(GET_BH(),&CX,&DX); |
break; |
case 0x0E: |
// Ralf Brown Interrupt list is WRONG on bh(page) |
// We do output only on the current page ! |
biosfn_write_teletype(GET_AL(),0xff,GET_BL(),NO_ATTR); |
break; |
case 0x13: |
biosfn_write_string(GET_AL(),GET_BH(),GET_BL(),CX,GET_DH(),GET_DL(),ES,BP); |
break; |
} |
} |
|
// ============================================================================================ |
// |
// BIOS functions |
// |
// ============================================================================================ |
|
static void biosfn_set_video_mode(mode) Bit8u mode; |
{// mode: Bit 7 is 1 if no clear screen |
|
// Should we clear the screen ? |
Bit8u noclearmem=mode&0x80; |
Bit8u line,mmask,*palette,vpti; |
Bit16u i,twidth,theightm1,cheight; |
Bit8u modeset_ctl,video_ctl,vga_switches; |
Bit16u crtc_addr; |
|
// The real mode |
mode=mode&0x7f; |
|
// find the entry in the video modes |
line=find_vga_entry(mode); |
|
if(line==0xFF) |
return; |
|
vpti=line_to_vpti[line]; |
twidth=video_param_table[vpti].twidth; |
theightm1=video_param_table[vpti].theightm1; |
cheight=video_param_table[vpti].cheight; |
|
// Read the bios vga control |
video_ctl=read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL); |
|
// Read the bios vga switches |
vga_switches=read_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES); |
|
// Read the bios mode set control |
modeset_ctl=read_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL); |
|
// Set CRTC address VGA or MDA |
crtc_addr=vga_modes[line].memmodel==MTEXT?VGAREG_MDA_CRTC_ADDRESS:VGAREG_VGA_CRTC_ADDRESS; |
|
// Set the BIOS mem |
write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,mode); |
write_word(BIOSMEM_SEG,BIOSMEM_NB_COLS,twidth); |
write_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,*(Bit16u *)&video_param_table[vpti].slength_l); |
write_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS,crtc_addr); |
write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS,theightm1); |
write_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,cheight); |
write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,(0x60|noclearmem)); |
write_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES,0xF9); |
write_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL,read_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL)&0x7f); |
|
// FIXME We nearly have the good tables. to be reworked |
write_byte(BIOSMEM_SEG,BIOSMEM_DCC_INDEX,0x08); // 8 is VGA should be ok for now |
write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER, video_save_pointer_table); |
write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER+2, 0xc000); |
|
// FIXME |
write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x00); // Unavailable on vanilla vga, but... |
write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL,0x00); // Unavailable on vanilla vga, but... |
|
} |
|
// -------------------------------------------------------------------------------------------- |
static void biosfn_set_cursor_pos (page, cursor) |
Bit8u page;Bit16u cursor; |
{ |
Bit8u xcurs,ycurs,current; |
Bit16u nbcols,nbrows,address,crtc_addr; |
|
// Should not happen... |
if(page>7)return; |
|
// Bios cursor pos |
write_word(BIOSMEM_SEG, BIOSMEM_CURSOR_POS+2*page, cursor); |
|
// Set the hardware cursor |
current=read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); |
if(page==current) |
{ |
// Get the dimensions |
nbcols=read_word(BIOSMEM_SEG,BIOSMEM_NB_COLS); |
nbrows=read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1; |
|
xcurs=cursor&0x00ff;ycurs=(cursor&0xff00)>>8; |
|
// Calculate the address knowing nbcols nbrows and page num |
address=SCREEN_IO_START(nbcols,nbrows,page)+xcurs+ycurs*nbcols; |
|
// CRTC regs 0x0e and 0x0f |
crtc_addr=read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS); |
outb(crtc_addr,0x0e); |
outb(crtc_addr+1,(address&0xff00)>>8); |
outb(crtc_addr,0x0f); |
outb(crtc_addr+1,address&0x00ff); |
} |
} |
|
// -------------------------------------------------------------------------------------------- |
static void biosfn_get_cursor_pos (page,shape, pos) |
Bit8u page;Bit16u *shape;Bit16u *pos; |
{ |
Bit16u ss=get_SS(); |
|
// Default |
write_word(ss, shape, 0); |
write_word(ss, pos, 0); |
|
if(page>7)return; |
// FIXME should handle VGA 14/16 lines |
write_word(ss,shape,read_word(BIOSMEM_SEG,BIOSMEM_CURSOR_TYPE)); |
write_word(ss,pos,read_word(BIOSMEM_SEG,BIOSMEM_CURSOR_POS+page*2)); |
} |
|
// -------------------------------------------------------------------------------------------- |
static void biosfn_scroll (nblines,attr,rul,cul,rlr,clr,page,dir) |
Bit8u nblines;Bit8u attr;Bit8u rul;Bit8u cul;Bit8u rlr;Bit8u clr;Bit8u page;Bit8u dir; |
{ |
// page == 0xFF if current |
|
Bit8u mode,line,cheight,bpp,cols; |
Bit16u nbcols,nbrows,i; |
Bit16u address; |
|
if(rul>rlr)return; |
if(cul>clr)return; |
|
// Get the mode |
mode=read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE); |
line=find_vga_entry(mode); |
if(line==0xFF)return; |
|
// Get the dimensions |
nbrows=read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1; |
nbcols=read_word(BIOSMEM_SEG,BIOSMEM_NB_COLS); |
|
// Get the current page |
if(page==0xFF) |
page=read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); |
|
if(rlr>=nbrows)rlr=nbrows-1; |
if(clr>=nbcols)clr=nbcols-1; |
if(nblines>nbrows)nblines=0; |
cols=clr-cul+1; |
|
if(vga_modes[line].class==TEXT) |
{ |
// Compute the address |
address=SCREEN_MEM_START(nbcols,nbrows,page); |
#ifdef DEBUG |
printf("Scroll, address %04x (%04x %04x %02x)\n",address,nbrows,nbcols,page); |
#endif |
|
if(nblines==0&&rul==0&&cul==0&&rlr==nbrows-1&&clr==nbcols-1) |
{ |
memsetw(vga_modes[line].sstart,address,(Bit16u)attr*0x100+' ',nbrows*nbcols); |
} |
else |
{// if Scroll up |
if(dir==SCROLL_UP) |
{for(i=rul;i<=rlr;i++) |
{ |
if((i+nblines>rlr)||(nblines==0)) |
memsetw(vga_modes[line].sstart,address+(i*nbcols+cul)*2,(Bit16u)attr*0x100+' ',cols); |
else |
memcpyw(vga_modes[line].sstart,address+(i*nbcols+cul)*2,vga_modes[line].sstart,((i+nblines)*nbcols+cul)*2,cols); |
} |
} |
else |
{for(i=rlr;i>=rul;i--) |
{ |
if((i<rul+nblines)||(nblines==0)) |
memsetw(vga_modes[line].sstart,address+(i*nbcols+cul)*2,(Bit16u)attr*0x100+' ',cols); |
else |
memcpyw(vga_modes[line].sstart,address+(i*nbcols+cul)*2,vga_modes[line].sstart,((i-nblines)*nbcols+cul)*2,cols); |
if (i>rlr) break; |
} |
} |
} |
} |
} |
|
// -------------------------------------------------------------------------------------------- |
static void biosfn_write_teletype (car, page, attr, flag) |
Bit8u car;Bit8u page;Bit8u attr;Bit8u flag; |
{// flag = WITH_ATTR / NO_ATTR |
|
Bit8u cheight,xcurs,ycurs,mode,line,bpp; |
Bit16u nbcols,nbrows,address; |
Bit16u cursor,dummy; |
|
// special case if page is 0xff, use current page |
if(page==0xff) |
page=read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); |
|
// Get the mode |
mode=read_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE); |
line=find_vga_entry(mode); |
if(line==0xFF)return; |
|
// Get the cursor pos for the page |
biosfn_get_cursor_pos(page,&dummy,&cursor); |
xcurs=cursor&0x00ff;ycurs=(cursor&0xff00)>>8; |
|
// Get the dimensions |
nbrows=read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1; |
nbcols=read_word(BIOSMEM_SEG,BIOSMEM_NB_COLS); |
|
switch(car) |
{ |
case 7: |
//FIXME should beep |
break; |
|
case 8: |
if(xcurs>0)xcurs--; |
break; |
|
case '\r': |
xcurs=0; |
break; |
|
case '\n': |
ycurs++; |
break; |
|
case '\t': |
do |
{ |
biosfn_write_teletype(' ',page,attr,flag); |
biosfn_get_cursor_pos(page,&dummy,&cursor); |
xcurs=cursor&0x00ff;ycurs=(cursor&0xff00)>>8; |
}while(xcurs%8==0); |
break; |
|
default: |
|
if(vga_modes[line].class==TEXT) |
{ |
// Compute the address |
address=SCREEN_MEM_START(nbcols,nbrows,page)+(xcurs+ycurs*nbcols)*2; |
|
// Write the char |
write_byte(vga_modes[line].sstart,address,car); |
|
if(flag==WITH_ATTR) |
write_byte(vga_modes[line].sstart,address+1,attr); |
} |
xcurs++; |
} |
|
// Do we need to wrap ? |
if(xcurs==nbcols) |
{xcurs=0; |
ycurs++; |
} |
|
// Do we need to scroll ? |
if(ycurs==nbrows) |
{ |
if(vga_modes[line].class==TEXT) |
{ |
biosfn_scroll(0x01,0x07,0,0,nbrows-1,nbcols-1,page,SCROLL_UP); |
} |
ycurs-=1; |
} |
|
// Set the cursor for the page |
cursor=ycurs; cursor<<=8; cursor+=xcurs; |
biosfn_set_cursor_pos(page,cursor); |
} |
|
// -------------------------------------------------------------------------------------------- |
static void biosfn_write_string (flag,page,attr,count,row,col,seg,offset) |
Bit8u flag;Bit8u page;Bit8u attr;Bit16u count;Bit8u row;Bit8u col;Bit16u seg;Bit16u offset; |
{ |
Bit16u newcurs,oldcurs,dummy; |
Bit8u car,carattr; |
|
// Read curs info for the page |
biosfn_get_cursor_pos(page,&dummy,&oldcurs); |
|
// if row=0xff special case : use current cursor position |
if(row==0xff) |
{col=oldcurs&0x00ff; |
row=(oldcurs&0xff00)>>8; |
} |
|
newcurs=row; newcurs<<=8; newcurs+=col; |
biosfn_set_cursor_pos(page,newcurs); |
|
while(count--!=0) |
{ |
car=read_byte(seg,offset++); |
if((flag&0x02)!=0) |
attr=read_byte(seg,offset++); |
|
biosfn_write_teletype(car,page,attr,WITH_ATTR); |
} |
|
// Set back curs pos |
if((flag&0x01)==0) |
biosfn_set_cursor_pos(page,oldcurs); |
} |
|
// ============================================================================================ |
// |
// Video Utils |
// |
// ============================================================================================ |
|
// -------------------------------------------------------------------------------------------- |
static Bit8u find_vga_entry(mode) |
Bit8u mode; |
{ |
Bit8u i,line=0xFF; |
for(i=0;i<=MODE_MAX;i++) |
if(vga_modes[i].svgamode==mode) |
{line=i; |
break; |
} |
return line; |
} |
|
// -------------------------------------------------------------------------------------------- |
static void memsetw(seg,offset,value,count) |
Bit16u seg; |
Bit16u offset; |
Bit16u value; |
Bit16u count; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push cx |
push es |
push di |
|
mov cx, 10[bp] ; count |
cmp cx, #0x00 |
je memsetw_end |
mov ax, 4[bp] ; segment |
mov es, ax |
mov ax, 6[bp] ; offset |
mov di, ax |
mov ax, 8[bp] ; value |
cld |
rep |
stosw |
|
memsetw_end: |
pop di |
pop es |
pop cx |
pop ax |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
static void memcpyw(dseg,doffset,sseg,soffset,count) |
Bit16u dseg; |
Bit16u doffset; |
Bit16u sseg; |
Bit16u soffset; |
Bit16u count; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push cx |
push es |
push di |
push ds |
push si |
|
mov cx, 12[bp] ; count |
cmp cx, #0x0000 |
je memcpyw_end |
mov ax, 4[bp] ; dsegment |
mov es, ax |
mov ax, 6[bp] ; doffset |
mov di, ax |
mov ax, 8[bp] ; ssegment |
mov ds, ax |
mov ax, 10[bp] ; soffset |
mov si, ax |
cld |
rep |
movsw |
|
memcpyw_end: |
pop si |
pop ds |
pop di |
pop es |
pop cx |
pop ax |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
static Bit8u |
read_byte(seg, offset) |
Bit16u seg; |
Bit16u offset; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push bx |
push ds |
mov ax, 4[bp] ; segment |
mov ds, ax |
mov bx, 6[bp] ; offset |
mov al, [bx] |
;; al = return value (byte) |
pop ds |
pop bx |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
static Bit16u |
read_word(seg, offset) |
Bit16u seg; |
Bit16u offset; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push bx |
push ds |
mov ax, 4[bp] ; segment |
mov ds, ax |
mov bx, 6[bp] ; offset |
mov ax, [bx] |
;; ax = return value (word) |
pop ds |
pop bx |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
static void |
write_byte(seg, offset, data) |
Bit16u seg; |
Bit16u offset; |
Bit8u data; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push bx |
push ds |
mov ax, 4[bp] ; segment |
mov ds, ax |
mov bx, 6[bp] ; offset |
mov al, 8[bp] ; data byte |
mov [bx], al ; write data byte |
pop ds |
pop bx |
pop ax |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
static void |
write_word(seg, offset, data) |
Bit16u seg; |
Bit16u offset; |
Bit16u data; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push bx |
push ds |
mov ax, 4[bp] ; segment |
mov ds, ax |
mov bx, 6[bp] ; offset |
mov ax, 8[bp] ; data word |
mov [bx], ax ; write data word |
pop ds |
pop bx |
pop ax |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
Bit8u |
inb(port) |
Bit16u port; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push dx |
mov dx, 4[bp] |
in al, dx |
pop dx |
|
pop bp |
ASM_END |
} |
|
Bit16u |
inw(port) |
Bit16u port; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push dx |
mov dx, 4[bp] |
in ax, dx |
pop dx |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
void |
outb(port, val) |
Bit16u port; |
Bit8u val; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push dx |
mov dx, 4[bp] |
mov al, 6[bp] |
out dx, al |
pop dx |
pop ax |
|
pop bp |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
void |
outw(port, val) |
Bit16u port; |
Bit16u val; |
{ |
ASM_START |
push bp |
mov bp, sp |
|
push ax |
push dx |
mov dx, 4[bp] |
mov ax, 6[bp] |
out dx, ax |
pop dx |
pop ax |
|
pop bp |
ASM_END |
} |
|
Bit16u get_SS() |
{ |
ASM_START |
mov ax, ss |
ASM_END |
} |
|
// -------------------------------------------------------------------------------------------- |
|
ASM_START |
;; DATA_SEG_DEFS_HERE |
ASM_END |
|
ASM_START |
.ascii "vgabios ends here" |
.byte 0x00 |
vgabios_end: |
.byte 0xCB |
;; BLOCK_STRINGS_BEGIN |
ASM_END |
/trunk/soc/bios/Makefile
9,6 → 9,8
|
CXX = g++ |
CXXFLAGS = -g3 -O0 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES |
CC = gcc |
CFLAGS = -g -O2 -Wall -Wstrict-prototypes |
|
LDFLAGS = |
LIBS = -lm |
28,19 → 30,38
# -------- end configurable options -------------------------- |
# |
|
bios: biossums zet-bios |
RELEASE = `pwd | sed "s-.*/--"` |
RELDATE = `date '+%d %b %Y'` |
RELVERS = `pwd | sed "s-.*/--" | sed "s/vgabios//" | sed "s/-//"` |
|
VGABIOS_DATE = "-DVGABIOS_DATE=\"$(RELDATE)\"" |
|
|
bios: bios.bin |
|
bios.bin: vgabios.rom ff.rom zet-bios.rom |
cat vgabios.rom ff.rom zet-bios.rom > $@ |
|
run: bios.bin |
prf |
kotku |
|
%.rom: %.out |
out2rom-ml403 < $< > $@ |
|
clean: |
rm -f *.o *.a *.s _rombios*_.c rombios*.txt rombios*.sym |
rm -f usage biossums |
rm -f usage biossums vgasums |
rm -f *.ld86 \ |
temp.awk.* vgabios*.orig _vgabios_* vgabios*.bin vgabios*.txt $(RELEASE).bin *.bak |
|
bios-clean: |
rm -f zet-bios |
rm -f zet-bios.out |
|
.cc.o: |
$(CXX) -c $(BX_INCDIRS) $(CXXFLAGS) $(LOCAL_CXXFLAGS) $< -o $@ |
|
zet-bios: rombios.c biossums rombios.h |
zet-bios.out: rombios.c biossums rombios.h |
$(GCC32) $(BIOS_BUILD_DATE) -DLEGACY -E -P $< > _rombiosl_.c |
$(BCC) -o rombiosl.s -C-c -D__i86__ -0 -S _rombiosl_.c |
sed -e 's/^\.text//' -e 's/^\.data//' rombiosl.s > _rombiosl_.s |
50,5 → 71,26
./biossums $@ |
rm -f _rombiosl_.s |
|
vgabios.out: vgabios.c vgabios.h vgatables.h vgasums |
$(GCC) -E vgabios.c $(VGABIOS_VERS) -P $(VGABIOS_DATE) > _vgabios_.c |
$(BCC) -o vgabios.s -C-c -D__i86__ -S -0 _vgabios_.c |
sed -e 's/^\.text//' -e 's/^\.data//' vgabios.s > _vgabios_.s |
$(AS86) _vgabios_.s -b vgabios.bin -u -w- -g -0 -j -O -l vgabios.txt |
rm -f _vgabios_.s _vgabios_.c vgabios.s |
mv vgabios.bin $@ |
./vgasums $@ |
|
%.rom: %.out |
out2rom-ml403 < $< > $@ |
|
%.bin: %.rom |
cat count.rom $< > $@ |
|
%.rtlrom: %.out |
hexdump -v -e '1/1 "%02X"' -e '"\n"' $< > ../../sim/$@ |
|
vgasums: vgasums.c |
$(CC) -o vgasums vgasums.c |
|
biossums: biossums.c |
$(GCC) -o biossums biossums.c |
$(GCC) -o biossums biossums.c |
/trunk/soc/bios/vgatables.h
0,0 → 1,622
/* |
* |
* BIOS Memory |
* |
*/ |
#define BIOSMEM_SEG 0x40 |
|
#define BIOSMEM_INITIAL_MODE 0x10 |
#define BIOSMEM_CURRENT_MODE 0x49 |
#define BIOSMEM_NB_COLS 0x4A |
#define BIOSMEM_PAGE_SIZE 0x4C |
#define BIOSMEM_CURRENT_START 0x4E |
#define BIOSMEM_CURSOR_POS 0x50 |
#define BIOSMEM_CURSOR_TYPE 0x60 |
#define BIOSMEM_CURRENT_PAGE 0x62 |
#define BIOSMEM_CRTC_ADDRESS 0x63 |
#define BIOSMEM_CURRENT_MSR 0x65 |
#define BIOSMEM_CURRENT_PAL 0x66 |
#define BIOSMEM_NB_ROWS 0x84 |
#define BIOSMEM_CHAR_HEIGHT 0x85 |
#define BIOSMEM_VIDEO_CTL 0x87 |
#define BIOSMEM_SWITCHES 0x88 |
#define BIOSMEM_MODESET_CTL 0x89 |
#define BIOSMEM_DCC_INDEX 0x8A |
#define BIOSMEM_VS_POINTER 0xA8 |
#define BIOSMEM_VBE_FLAG 0xB9 |
#define BIOSMEM_VBE_MODE 0xBA |
|
|
/* |
* |
* VGA registers |
* |
*/ |
#define VGAREG_ACTL_ADDRESS 0x3c0 |
#define VGAREG_ACTL_WRITE_DATA 0x3c0 |
#define VGAREG_ACTL_READ_DATA 0x3c1 |
|
#define VGAREG_INPUT_STATUS 0x3c2 |
#define VGAREG_WRITE_MISC_OUTPUT 0x3c2 |
#define VGAREG_VIDEO_ENABLE 0x3c3 |
#define VGAREG_SEQU_ADDRESS 0x3c4 |
#define VGAREG_SEQU_DATA 0x3c5 |
|
#define VGAREG_PEL_MASK 0x3c6 |
#define VGAREG_DAC_STATE 0x3c7 |
#define VGAREG_DAC_READ_ADDRESS 0x3c7 |
#define VGAREG_DAC_WRITE_ADDRESS 0x3c8 |
#define VGAREG_DAC_DATA 0x3c9 |
|
#define VGAREG_READ_FEATURE_CTL 0x3ca |
#define VGAREG_READ_MISC_OUTPUT 0x3cc |
|
#define VGAREG_GRDC_ADDRESS 0x3ce |
#define VGAREG_GRDC_DATA 0x3cf |
|
#define VGAREG_MDA_CRTC_ADDRESS 0x3b4 |
#define VGAREG_MDA_CRTC_DATA 0x3b5 |
#define VGAREG_VGA_CRTC_ADDRESS 0x3d4 |
#define VGAREG_VGA_CRTC_DATA 0x3d5 |
|
#define VGAREG_MDA_WRITE_FEATURE_CTL 0x3ba |
#define VGAREG_VGA_WRITE_FEATURE_CTL 0x3da |
#define VGAREG_ACTL_RESET 0x3da |
|
#define VGAREG_MDA_MODECTL 0x3b8 |
#define VGAREG_CGA_MODECTL 0x3d8 |
#define VGAREG_CGA_PALETTE 0x3d9 |
|
/* Video memory */ |
#define VGAMEM_GRAPH 0xA000 |
#define VGAMEM_CTEXT 0xB800 |
#define VGAMEM_MTEXT 0xB000 |
|
/* |
* |
* Tables of default values for each mode |
* |
*/ |
#define MODE_MAX 15 |
#define TEXT 0x00 |
#define GRAPH 0x01 |
|
#define CTEXT 0x00 |
#define MTEXT 0x01 |
#define CGA 0x02 |
#define PLANAR1 0x03 |
#define PLANAR4 0x04 |
#define LINEAR8 0x05 |
|
// for SVGA |
#define LINEAR15 0x10 |
#define LINEAR16 0x11 |
#define LINEAR24 0x12 |
#define LINEAR32 0x13 |
|
typedef struct |
{Bit8u svgamode; |
Bit8u class; /* TEXT, GRAPH */ |
Bit8u memmodel; /* CTEXT,MTEXT,CGA,PL1,PL2,PL4,P8,P15,P16,P24,P32 */ |
Bit8u pixbits; |
Bit16u sstart; |
Bit8u pelmask; |
Bit8u dacmodel; /* 0 1 2 3 */ |
} VGAMODES; |
|
static VGAMODES vga_modes[MODE_MAX+1]= |
{//mode class model bits sstart pelm dac |
{0x00, TEXT, CTEXT, 4, 0xB800, 0xFF, 0x02}, |
{0x01, TEXT, CTEXT, 4, 0xB800, 0xFF, 0x02}, |
{0x02, TEXT, CTEXT, 4, 0xB800, 0xFF, 0x02}, |
{0x03, TEXT, CTEXT, 4, 0xB800, 0xFF, 0x02}, |
{0x04, GRAPH, CGA, 2, 0xB800, 0xFF, 0x01}, |
{0x05, GRAPH, CGA, 2, 0xB800, 0xFF, 0x01}, |
{0x06, GRAPH, CGA, 1, 0xB800, 0xFF, 0x01}, |
{0x07, TEXT, MTEXT, 4, 0xB000, 0xFF, 0x00}, |
{0x0D, GRAPH, PLANAR4, 4, 0xA000, 0xFF, 0x01}, |
{0x0E, GRAPH, PLANAR4, 4, 0xA000, 0xFF, 0x01}, |
{0x0F, GRAPH, PLANAR1, 1, 0xA000, 0xFF, 0x00}, |
{0x10, GRAPH, PLANAR4, 4, 0xA000, 0xFF, 0x02}, |
{0x11, GRAPH, PLANAR1, 1, 0xA000, 0xFF, 0x02}, |
{0x12, GRAPH, PLANAR4, 4, 0xA000, 0xFF, 0x02}, |
{0x13, GRAPH, LINEAR8, 8, 0xA000, 0xFF, 0x03}, |
{0x6A, GRAPH, PLANAR4, 4, 0xA000, 0xFF, 0x02} |
}; |
|
/* convert index in vga_modes[] to index in video_param_table[] */ |
static Bit8u line_to_vpti[MODE_MAX+1]={ |
0x17, 0x17, 0x18, 0x18, 0x04, 0x05, 0x06, 0x07, |
0x0d, 0x0e, 0x11, 0x12, 0x1a, 0x1b, 0x1c, 0x1d, |
}; |
|
/* Default Palette */ |
#define DAC_MAX_MODEL 3 |
|
static Bit8u dac_regs[DAC_MAX_MODEL+1]= |
{0x3f,0x3f,0x3f,0xff}; |
|
/* standard BIOS Video Parameter Table */ |
typedef struct { |
Bit8u twidth; |
Bit8u theightm1; |
Bit8u cheight; |
Bit8u slength_l; |
Bit8u slength_h; |
Bit8u sequ_regs[4]; |
Bit8u miscreg; |
Bit8u crtc_regs[25]; |
Bit8u actl_regs[20]; |
Bit8u grdc_regs[9]; |
} VideoParamTableEntry; |
|
static VideoParamTableEntry video_param_table[30] = { |
{ |
/* index=0x00 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x01 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x02 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x03 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x04 vga mode 0x04 */ |
40, 24, 8, 0x00, 0x08, /* tw, th-1, ch, slength */ |
0x09, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x63, /* miscreg */ |
0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f, |
0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2, |
0xff, /* crtc_regs */ |
0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07, |
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
0x01, 0x00, 0x03, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x05 vga mode 0x05 */ |
40, 24, 8, 0x00, 0x08, /* tw, th-1, ch, slength */ |
0x09, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x63, /* miscreg */ |
0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f, |
0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2, |
0xff, /* crtc_regs */ |
0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07, |
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
0x01, 0x00, 0x03, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x06 vga mode 0x06 */ |
80, 24, 8, 0x00, 0x10, /* tw, th-1, ch, slength */ |
0x01, 0x01, 0x00, 0x06, /* sequ_regs */ |
0x63, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, |
0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xc2, |
0xff, /* crtc_regs */ |
0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, |
0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, |
0x01, 0x00, 0x01, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x07 vga mode 0x07 */ |
80, 24, 16, 0x00, 0x10, /* tw, th-1, ch, slength */ |
0x00, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x66, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f, |
0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3, |
0xff, /* crtc_regs */ |
0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, |
0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, |
0x0e, 0x00, 0x0f, 0x08, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x08 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x09 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x0a no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x0b no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x0c no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x0d vga mode 0x0d */ |
40, 24, 8, 0x00, 0x20, /* tw, th-1, ch, slength */ |
0x09, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0x63, /* miscreg */ |
0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f, |
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x0e vga mode 0x0e */ |
80, 24, 8, 0x00, 0x40, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0x63, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, |
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x0f no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x10 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x11 vga mode 0x0f */ |
80, 24, 14, 0x00, 0x80, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0xa3, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, |
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, |
0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, |
0x01, 0x00, 0x01, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x12 vga mode 0x10 */ |
80, 24, 14, 0x00, 0x80, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0xa3, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, |
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, |
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x13 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x14 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x15 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x16 no mode defined */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
}, |
{ |
/* index=0x17 vga mode 0x01 */ |
40, 24, 16, 0x00, 0x08, /* tw, th-1, ch, slength */ |
0x08, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x67, /* miscreg */ |
0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x1f, |
0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x14, 0x1f, 0x96, 0xb9, 0xa3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, |
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
0x0c, 0x00, 0x0f, 0x08, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x18 vga mode 0x03 */ |
80, 24, 16, 0x00, 0x10, /* tw, th-1, ch, slength */ |
0x00, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x67, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f, |
0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, |
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
0x0c, 0x00, 0x0f, 0x08, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x19 vga mode 0x07 */ |
80, 24, 16, 0x00, 0x10, /* tw, th-1, ch, slength */ |
0x00, 0x03, 0x00, 0x02, /* sequ_regs */ |
0x66, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f, |
0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3, |
0xff, /* crtc_regs */ |
0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, |
0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, |
0x0e, 0x00, 0x0f, 0x08, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x1a vga mode 0x11 */ |
80, 29, 16, 0x00, 0x00, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0xe3, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e, |
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, |
0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x1b vga mode 0x12 */ |
80, 29, 16, 0x00, 0x00, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0xe3, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e, |
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, |
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x1c vga mode 0x13 */ |
40, 24, 8, 0x00, 0x00, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x0e, /* sequ_regs */ |
0x63, /* miscreg */ |
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f, |
0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x9c, 0x8e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, |
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, |
0x41, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
{ |
/* index=0x1d vga mode 0x6a */ |
100, 36, 16, 0x00, 0x00, /* tw, th-1, ch, slength */ |
0x01, 0x0f, 0x00, 0x06, /* sequ_regs */ |
0xe3, /* miscreg */ |
0x7f, 0x63, 0x63, 0x83, 0x6b, 0x1b, 0x72, 0xf0, |
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x59, 0x8d, 0x57, 0x32, 0x00, 0x57, 0x73, 0xe3, |
0xff, /* crtc_regs */ |
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07, |
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, |
0x01, 0x00, 0x0f, 0x00, /* actl_regs */ |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff, /* grdc_regs */ |
}, |
}; |
|
/* Mono */ |
static Bit8u palette0[63+1][3]= |
{ |
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, |
0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, |
0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, |
0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, |
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, |
0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, |
0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, |
0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f |
}; |
|
static Bit8u palette1[63+1][3]= |
{ |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a, |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f, |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a, |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f |
}; |
|
static Bit8u palette2[63+1][3]= |
{ |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x2a,0x00, 0x2a,0x2a,0x2a, |
0x00,0x00,0x15, 0x00,0x00,0x3f, 0x00,0x2a,0x15, 0x00,0x2a,0x3f, 0x2a,0x00,0x15, 0x2a,0x00,0x3f, 0x2a,0x2a,0x15, 0x2a,0x2a,0x3f, |
0x00,0x15,0x00, 0x00,0x15,0x2a, 0x00,0x3f,0x00, 0x00,0x3f,0x2a, 0x2a,0x15,0x00, 0x2a,0x15,0x2a, 0x2a,0x3f,0x00, 0x2a,0x3f,0x2a, |
0x00,0x15,0x15, 0x00,0x15,0x3f, 0x00,0x3f,0x15, 0x00,0x3f,0x3f, 0x2a,0x15,0x15, 0x2a,0x15,0x3f, 0x2a,0x3f,0x15, 0x2a,0x3f,0x3f, |
0x15,0x00,0x00, 0x15,0x00,0x2a, 0x15,0x2a,0x00, 0x15,0x2a,0x2a, 0x3f,0x00,0x00, 0x3f,0x00,0x2a, 0x3f,0x2a,0x00, 0x3f,0x2a,0x2a, |
0x15,0x00,0x15, 0x15,0x00,0x3f, 0x15,0x2a,0x15, 0x15,0x2a,0x3f, 0x3f,0x00,0x15, 0x3f,0x00,0x3f, 0x3f,0x2a,0x15, 0x3f,0x2a,0x3f, |
0x15,0x15,0x00, 0x15,0x15,0x2a, 0x15,0x3f,0x00, 0x15,0x3f,0x2a, 0x3f,0x15,0x00, 0x3f,0x15,0x2a, 0x3f,0x3f,0x00, 0x3f,0x3f,0x2a, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f |
}; |
|
static Bit8u palette3[256][3]= |
{ |
0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a, |
0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f, |
0x00,0x00,0x00, 0x05,0x05,0x05, 0x08,0x08,0x08, 0x0b,0x0b,0x0b, 0x0e,0x0e,0x0e, 0x11,0x11,0x11, 0x14,0x14,0x14, 0x18,0x18,0x18, |
0x1c,0x1c,0x1c, 0x20,0x20,0x20, 0x24,0x24,0x24, 0x28,0x28,0x28, 0x2d,0x2d,0x2d, 0x32,0x32,0x32, 0x38,0x38,0x38, 0x3f,0x3f,0x3f, |
0x00,0x00,0x3f, 0x10,0x00,0x3f, 0x1f,0x00,0x3f, 0x2f,0x00,0x3f, 0x3f,0x00,0x3f, 0x3f,0x00,0x2f, 0x3f,0x00,0x1f, 0x3f,0x00,0x10, |
0x3f,0x00,0x00, 0x3f,0x10,0x00, 0x3f,0x1f,0x00, 0x3f,0x2f,0x00, 0x3f,0x3f,0x00, 0x2f,0x3f,0x00, 0x1f,0x3f,0x00, 0x10,0x3f,0x00, |
0x00,0x3f,0x00, 0x00,0x3f,0x10, 0x00,0x3f,0x1f, 0x00,0x3f,0x2f, 0x00,0x3f,0x3f, 0x00,0x2f,0x3f, 0x00,0x1f,0x3f, 0x00,0x10,0x3f, |
0x1f,0x1f,0x3f, 0x27,0x1f,0x3f, 0x2f,0x1f,0x3f, 0x37,0x1f,0x3f, 0x3f,0x1f,0x3f, 0x3f,0x1f,0x37, 0x3f,0x1f,0x2f, 0x3f,0x1f,0x27, |
|
0x3f,0x1f,0x1f, 0x3f,0x27,0x1f, 0x3f,0x2f,0x1f, 0x3f,0x37,0x1f, 0x3f,0x3f,0x1f, 0x37,0x3f,0x1f, 0x2f,0x3f,0x1f, 0x27,0x3f,0x1f, |
0x1f,0x3f,0x1f, 0x1f,0x3f,0x27, 0x1f,0x3f,0x2f, 0x1f,0x3f,0x37, 0x1f,0x3f,0x3f, 0x1f,0x37,0x3f, 0x1f,0x2f,0x3f, 0x1f,0x27,0x3f, |
0x2d,0x2d,0x3f, 0x31,0x2d,0x3f, 0x36,0x2d,0x3f, 0x3a,0x2d,0x3f, 0x3f,0x2d,0x3f, 0x3f,0x2d,0x3a, 0x3f,0x2d,0x36, 0x3f,0x2d,0x31, |
0x3f,0x2d,0x2d, 0x3f,0x31,0x2d, 0x3f,0x36,0x2d, 0x3f,0x3a,0x2d, 0x3f,0x3f,0x2d, 0x3a,0x3f,0x2d, 0x36,0x3f,0x2d, 0x31,0x3f,0x2d, |
0x2d,0x3f,0x2d, 0x2d,0x3f,0x31, 0x2d,0x3f,0x36, 0x2d,0x3f,0x3a, 0x2d,0x3f,0x3f, 0x2d,0x3a,0x3f, 0x2d,0x36,0x3f, 0x2d,0x31,0x3f, |
0x00,0x00,0x1c, 0x07,0x00,0x1c, 0x0e,0x00,0x1c, 0x15,0x00,0x1c, 0x1c,0x00,0x1c, 0x1c,0x00,0x15, 0x1c,0x00,0x0e, 0x1c,0x00,0x07, |
0x1c,0x00,0x00, 0x1c,0x07,0x00, 0x1c,0x0e,0x00, 0x1c,0x15,0x00, 0x1c,0x1c,0x00, 0x15,0x1c,0x00, 0x0e,0x1c,0x00, 0x07,0x1c,0x00, |
0x00,0x1c,0x00, 0x00,0x1c,0x07, 0x00,0x1c,0x0e, 0x00,0x1c,0x15, 0x00,0x1c,0x1c, 0x00,0x15,0x1c, 0x00,0x0e,0x1c, 0x00,0x07,0x1c, |
|
0x0e,0x0e,0x1c, 0x11,0x0e,0x1c, 0x15,0x0e,0x1c, 0x18,0x0e,0x1c, 0x1c,0x0e,0x1c, 0x1c,0x0e,0x18, 0x1c,0x0e,0x15, 0x1c,0x0e,0x11, |
0x1c,0x0e,0x0e, 0x1c,0x11,0x0e, 0x1c,0x15,0x0e, 0x1c,0x18,0x0e, 0x1c,0x1c,0x0e, 0x18,0x1c,0x0e, 0x15,0x1c,0x0e, 0x11,0x1c,0x0e, |
0x0e,0x1c,0x0e, 0x0e,0x1c,0x11, 0x0e,0x1c,0x15, 0x0e,0x1c,0x18, 0x0e,0x1c,0x1c, 0x0e,0x18,0x1c, 0x0e,0x15,0x1c, 0x0e,0x11,0x1c, |
0x14,0x14,0x1c, 0x16,0x14,0x1c, 0x18,0x14,0x1c, 0x1a,0x14,0x1c, 0x1c,0x14,0x1c, 0x1c,0x14,0x1a, 0x1c,0x14,0x18, 0x1c,0x14,0x16, |
0x1c,0x14,0x14, 0x1c,0x16,0x14, 0x1c,0x18,0x14, 0x1c,0x1a,0x14, 0x1c,0x1c,0x14, 0x1a,0x1c,0x14, 0x18,0x1c,0x14, 0x16,0x1c,0x14, |
0x14,0x1c,0x14, 0x14,0x1c,0x16, 0x14,0x1c,0x18, 0x14,0x1c,0x1a, 0x14,0x1c,0x1c, 0x14,0x1a,0x1c, 0x14,0x18,0x1c, 0x14,0x16,0x1c, |
0x00,0x00,0x10, 0x04,0x00,0x10, 0x08,0x00,0x10, 0x0c,0x00,0x10, 0x10,0x00,0x10, 0x10,0x00,0x0c, 0x10,0x00,0x08, 0x10,0x00,0x04, |
0x10,0x00,0x00, 0x10,0x04,0x00, 0x10,0x08,0x00, 0x10,0x0c,0x00, 0x10,0x10,0x00, 0x0c,0x10,0x00, 0x08,0x10,0x00, 0x04,0x10,0x00, |
|
0x00,0x10,0x00, 0x00,0x10,0x04, 0x00,0x10,0x08, 0x00,0x10,0x0c, 0x00,0x10,0x10, 0x00,0x0c,0x10, 0x00,0x08,0x10, 0x00,0x04,0x10, |
0x08,0x08,0x10, 0x0a,0x08,0x10, 0x0c,0x08,0x10, 0x0e,0x08,0x10, 0x10,0x08,0x10, 0x10,0x08,0x0e, 0x10,0x08,0x0c, 0x10,0x08,0x0a, |
0x10,0x08,0x08, 0x10,0x0a,0x08, 0x10,0x0c,0x08, 0x10,0x0e,0x08, 0x10,0x10,0x08, 0x0e,0x10,0x08, 0x0c,0x10,0x08, 0x0a,0x10,0x08, |
0x08,0x10,0x08, 0x08,0x10,0x0a, 0x08,0x10,0x0c, 0x08,0x10,0x0e, 0x08,0x10,0x10, 0x08,0x0e,0x10, 0x08,0x0c,0x10, 0x08,0x0a,0x10, |
0x0b,0x0b,0x10, 0x0c,0x0b,0x10, 0x0d,0x0b,0x10, 0x0f,0x0b,0x10, 0x10,0x0b,0x10, 0x10,0x0b,0x0f, 0x10,0x0b,0x0d, 0x10,0x0b,0x0c, |
0x10,0x0b,0x0b, 0x10,0x0c,0x0b, 0x10,0x0d,0x0b, 0x10,0x0f,0x0b, 0x10,0x10,0x0b, 0x0f,0x10,0x0b, 0x0d,0x10,0x0b, 0x0c,0x10,0x0b, |
0x0b,0x10,0x0b, 0x0b,0x10,0x0c, 0x0b,0x10,0x0d, 0x0b,0x10,0x0f, 0x0b,0x10,0x10, 0x0b,0x0f,0x10, 0x0b,0x0d,0x10, 0x0b,0x0c,0x10, |
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00 |
}; |
|
static Bit8u static_functionality[0x10]= |
{ |
/* 0 */ 0xff, // All modes supported #1 |
/* 1 */ 0xe0, // All modes supported #2 |
/* 2 */ 0x0f, // All modes supported #3 |
/* 3 */ 0x00, 0x00, 0x00, 0x00, // reserved |
/* 7 */ 0x07, // 200, 350, 400 scan lines |
/* 8 */ 0x02, // mamimum number of visible charsets in text mode |
/* 9 */ 0x08, // total number of charset blocks in text mode |
/* a */ 0xe7, // Change to add new functions |
/* b */ 0x0c, // Change to add new functions |
/* c */ 0x00, // reserved |
/* d */ 0x00, // reserved |
/* e */ 0x00, // Change to add new functions |
/* f */ 0x00 // reserved |
}; |