vgabios.c revision b4514c911ccdb647c9c0f503f3cee0660f41104a
// ============================================================================================
/*
*/
// ============================================================================================
//
// Copyright (C) 2001,2002 the LGPL VGABios developers Team
//
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// ============================================================================================
//
// You can NOT drive any physical vga card with it.
//
// ============================================================================================
//
// This file contains code ripped from :
// - rombios.c of plex86
//
// This VGA Bios contains fonts from :
// - fntcol16.zip (c) by Joseph Gil avalable at :
// These fonts are public domain
//
// This VGA Bios is based on information taken from :
// - Ralf Brown's interrupts list available at http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html
// - Finn Thogersons' VGADOC4b available at http://home.worldonline.dk/~finth/
// - Michael Abrash's Graphics Programming Black Book
// - Francois Gervais' book "programmation des cartes graphiques cga-ega-vga" edited by sybex
// - DOSEMU 1.0.1 source code for several tables values and formulas
//
// Thanks for patches, comments and ideas to :
// - techt@pikeonline.net
//
// ============================================================================================
#include "vgabios.h"
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifdef VBE
#include "vbe.h"
#endif
/* Declares */
static void write_byte();
static void write_word();
static void outb();
static void outw();
// Output
static void printf();
static void unimplemented();
static void unknown();
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_shape();
static void biosfn_set_cursor_pos();
static void biosfn_get_cursor_pos();
static void biosfn_set_active_page();
static void biosfn_scroll();
static void biosfn_read_char_attr();
static void biosfn_write_char_attr();
static void biosfn_write_char_only();
static void biosfn_write_pixel();
static void biosfn_read_pixel();
static void biosfn_write_teletype();
static void biosfn_perform_gray_scale_summing();
static void biosfn_load_text_user_pat();
static void biosfn_load_text_8_14_pat();
static void biosfn_load_text_8_8_pat();
static void biosfn_load_text_8_16_pat();
static void biosfn_load_gfx_8_8_chars();
static void biosfn_load_gfx_user_chars();
static void biosfn_load_gfx_8_14_chars();
static void biosfn_load_gfx_8_8_dd_chars();
static void biosfn_load_gfx_8_16_chars();
static void biosfn_get_font_info();
static void biosfn_alternate_prtsc();
static void biosfn_switch_video_interface();
static void biosfn_enable_video_refresh_control();
static void biosfn_write_string();
static void biosfn_read_state_info();
static void biosfn_read_video_state_size();
static Bit16u biosfn_save_video_state();
static Bit16u biosfn_restore_video_state();
extern Bit8u video_save_pointer_table[];
// This is for compiling with gcc2 and gcc3
#define ASM_START #asm
.text
.rom
.org 0
use16 386
#ifdef VBOX
.ascii "VirtualBox VGA BIOS"
#else
#endif
.ascii " "
.byte 0x00
// Info from Bart Oldeman
.org 0x1e
.ascii "IBM"
.byte 0x00
#ifndef VBOX
#ifndef VGABIOS_VERS
.ascii "current-cvs"
#else
#endif
.ascii " "
.byte 0x00
#endif
#ifndef VBOX
.ascii "(C) 2003 the LGPL VGABios developers Team"
.byte 0x00
#endif
#ifndef VBOX
.byte 0x00
.ascii "Please visit :"
;;.ascii " . http://www.plex86.org"
.byte 0x00
#endif
;; ============================================================================================
;;
;;
;; ============================================================================================
#ifdef VBE
#endif
#ifdef CIRRUS
#endif
#ifndef VBOX
int #0x10
#ifdef VBE
#endif
#ifdef CIRRUS
#endif
#else /* VBOX */
#ifdef DEBUG_bird
int #0x10
#endif
#endif /* VBOX */
/*
* int10 handled here
*/
#ifdef DEBUG
#endif
#ifndef VBE
#else
#endif
#ifdef VBE
#endif
#include "vgatables.h"
#include "vgafonts.h"
/*
* Boot time harware inits
*/
.ascii "Sun VirtualBox Version "
.ascii " VGA BIOS"
// --------------------------------------------------------------------------------------------
/*
* Boot time bios area inits
*/
.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
// --------------------------------------------------------------------------------------------
/*
* Boot time Splash screen
*/
static void display_splash_screen()
{
}
#ifndef VBOX
// --------------------------------------------------------------------------------------------
/*
* Tell who we are
*/
static void display_info()
{
}
static void display_string()
{
// Get length of string
int #0x10
int #0x10
}
#endif
// --------------------------------------------------------------------------------------------
#ifdef DEBUG
{
// 0E is write char...
if(GET_AH()!=0x0E)
}
#endif
// --------------------------------------------------------------------------------------------
/*
* int10 main dispatcher
*/
{
// BIOS functions
switch(GET_AH())
{
case 0x00:
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 0x01:
break;
case 0x02:
break;
case 0x03:
break;
case 0x04:
// Read light pen pos (unimplemented)
#ifdef DEBUG
#endif
AX=0x00;
BX=0x00;
CX=0x00;
DX=0x00;
break;
case 0x05:
break;
case 0x06:
break;
case 0x07:
break;
case 0x08:
break;
case 0x09:
break;
case 0x0A:
break;
case 0x0C:
break;
case 0x0D:
break;
case 0x0E:
// Ralf Brown Interrupt list is WRONG on bh(page)
// We do output only on the current page !
#ifdef DEBUG
#endif
break;
case 0x10:
// All other functions of group AH=0x10 rewritten in assembler
break;
case 0x11:
switch(GET_AL())
{
case 0x00:
case 0x10:
break;
case 0x01:
case 0x11:
break;
case 0x02:
case 0x12:
break;
case 0x04:
case 0x14:
break;
case 0x20:
break;
case 0x21:
break;
case 0x22:
break;
case 0x23:
break;
case 0x24:
break;
case 0x30:
break;
#ifdef DEBUG
default:
unknown();
#endif
}
break;
case 0x12:
switch(GET_BL())
{
case 0x20:
break;
case 0x35:
SET_AL(0x12);
break;
case 0x36:
SET_AL(0x12);
break;
#ifdef DEBUG
default:
unknown();
#endif
}
break;
case 0x13:
break;
case 0x1B:
SET_AL(0x1B);
break;
case 0x1C:
switch(GET_AL())
{
case 0x00:
break;
case 0x01:
break;
case 0x02:
break;
#ifdef DEBUG
default:
unknown();
#endif
}
SET_AL(0x1C);
break;
#ifdef VBE
case 0x4f:
if (vbe_has_vbe_display()) {
switch(GET_AL())
{
case 0x00:
break;
case 0x01:
break;
case 0x02:
break;
case 0x04:
break;
case 0x09:
//FIXME
#ifdef DEBUG
#endif
// function failed
AX=0x100;
break;
case 0x0A:
//FIXME
#ifdef DEBUG
#endif
// function failed
AX=0x100;
break;
default:
#ifdef DEBUG
unknown();
#endif
// function failed
AX=0x100;
}
}
else {
// No VBE display
AX=0x0100;
}
break;
#endif
#ifdef DEBUG
default:
unknown();
#endif
}
}
// ============================================================================================
//
// BIOS functions
//
// ============================================================================================
{// mode: Bit 7 is 1 if no clear screen
// Should we clear the screen ?
#ifdef VBE
if (vbe_has_vbe_display()) {
}
#endif // def VBE
// The real mode
// find the entry in the video modes
#ifdef DEBUG
#endif
if(line==0xFF)
return;
// Read the bios vga control
// Read the bios vga switches
// Read the bios mode set control
// Then we know the number of lines
// FIXME
// if palette loading (bit 3 of modeset ctl = 0)
if((modeset_ctl&0x08)==0)
{// Set the PEL mask
// Set the whole dac always, from 0
// From which palette
{case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
// Always 256*3 values
for(i=0;i<0x0100;i++)
}
else
{outb(VGAREG_DAC_DATA,0);
outb(VGAREG_DAC_DATA,0);
outb(VGAREG_DAC_DATA,0);
}
}
{
}
}
// Reset Attribute Ctl flip-flop
// Set Attribute Ctl
for(i=0;i<=0x13;i++)
{outb(VGAREG_ACTL_ADDRESS,i);
}
// Set Sequencer Ctl
for(i=1;i<=4;i++)
{outb(VGAREG_SEQU_ADDRESS,i);
}
// Set Grafx Ctl
for(i=0;i<=8;i++)
{outb(VGAREG_GRDC_ADDRESS,i);
}
// Set CRTC address VGA or MDA
// Disable CRTC write protection
// Set CRTC regs
for(i=0;i<=0x18;i++)
}
// Set the misc register
// Enable video
if(noclearmem==0x00)
{
{
}
else
{
if(mode<0x0d)
{
}
else
{
}
}
}
// Set the BIOS mem
// FIXME We nearly have the good tables. to be reworked
// FIXME
// Set cursor shape
{
}
// Set cursor pos for page 0..7
for(i=0;i<8;i++)
biosfn_set_cursor_pos(i,0x0000);
// Set active page 0
biosfn_set_active_page(0x00);
// Write the fonts in memory
{
int #0x10
int #0x10
}
// Set the ints 0x1F and 0x43
switch(cheight)
{case 8:
break;
case 14:
break;
case 16:
break;
}
}
// --------------------------------------------------------------------------------------------
CH&=0x3f;
CL&=0x1f;
{
{
}
else
{
}
}
// CTRC regs 0x0a and 0x0b
}
// --------------------------------------------------------------------------------------------
{
// Should not happen...
if(page>7)return;
// Bios cursor pos
// Set the hardware cursor
{
// Get the dimensions
// Calculate the address knowing nbcols nbrows and page num
// CRTC regs 0x0e and 0x0f
}
}
// --------------------------------------------------------------------------------------------
{
// Default
if(page>7)return;
// FIXME should handle VGA 14/16 lines
}
// --------------------------------------------------------------------------------------------
static void biosfn_set_active_page (page)
{
if(page>7)return;
// Get the mode
if(line==0xFF)return;
// Get pos curs pos for the right page
{
// Get the dimensions
// Calculate the address knowing nbcols nbrows and page num
// Start address
}
else
{
}
// CRTC regs 0x0c and 0x0d
// And change the BIOS page
#ifdef DEBUG
#endif
// Display the cursor, now the page is active
}
// --------------------------------------------------------------------------------------------
{
Bit8u i;
for(i=0;i<cheight;i++)
{
}
}
// --------------------------------------------------------------------------------------------
{
Bit8u i;
for(i=0;i<cheight;i++)
{
}
}
// --------------------------------------------------------------------------------------------
{
Bit8u i;
for(i=0;i<cheight;i++)
{
if (i & 1)
else
}
}
// --------------------------------------------------------------------------------------------
{
Bit8u i;
for(i=0;i<cheight;i++)
{
if (i & 1)
else
}
}
// --------------------------------------------------------------------------------------------
{
// page == 0xFF if current
// Get the mode
if(line==0xFF)return;
// Get the dimensions
// Get the current page
if(page==0xFF)
{
// Compute the address
#ifdef DEBUG
#endif
{
}
else
{// if Scroll up
{
else
memcpyw(vga_modes[line].sstart,address+(i*nbcols+cul)*2,vga_modes[line].sstart,((i+nblines)*nbcols+cul)*2,cols);
}
}
else
{
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;
}
}
}
}
else
{
// FIXME gfx mode not complete
{
case PLANAR4:
case PLANAR1:
{
}
else
{// if Scroll up
{
else
}
}
else
{
else
if (i>rlr) break;
}
}
}
break;
case CGA:
{
}
else
{
if(bpp==2)
{
cul<<=1;
cols<<=1;
nbcols<<=1;
}
// if Scroll up
{
else
}
}
else
{
else
if (i>rlr) break;
}
}
}
break;
#ifdef DEBUG
default:
printf("Scroll in graphics mode ");
#endif
}
}
}
// --------------------------------------------------------------------------------------------
// Get the mode
if(line==0xFF)return;
// Get the cursor pos for the page
// Get the dimensions
{
// Compute the address
}
else
{
// FIXME gfx mode
#ifdef DEBUG
#endif
}
}
// --------------------------------------------------------------------------------------------
{
switch(cheight)
{case 14:
break;
case 16:
break;
default:
}
if(attr&0x80)
{
}
else
{
}
for(i=0;i<cheight;i++)
{
for(j=0;j<8;j++)
{
mask=0x80>>j;
{
}
else
{
}
}
}
}
// --------------------------------------------------------------------------------------------
{
for(i=0;i<8;i++)
{
mask = 0x80;
if (bpp == 1)
{
if (attr & 0x80)
{
}
else
{
data = 0x00;
}
for(j=0;j<8;j++)
{
{
if (attr & 0x80)
{
}
else
{
}
}
mask >>= 1;
}
}
else
{
while (mask > 0)
{
if (attr & 0x80)
{
}
else
{
data = 0x00;
}
for(j=0;j<4;j++)
{
{
if (attr & 0x80)
{
}
else
{
}
}
mask >>= 1;
}
dest += 1;
}
}
}
}
// --------------------------------------------------------------------------------------------
{
for(i=0;i<8;i++)
{
mask = 0x80;
for(j=0;j<8;j++)
{
data = 0x00;
{
}
mask >>= 1;
}
}
}
// --------------------------------------------------------------------------------------------
{
// Get the mode
if(line==0xFF)return;
// Get the cursor pos for the page
// Get the dimensions
{
// Compute the address
}
else
{
// FIXME gfx mode not complete
{
{
case PLANAR4:
case PLANAR1:
break;
case CGA:
break;
case LINEAR8:
break;
#ifdef DEBUG
default:
#endif
}
xcurs++;
}
}
}
// --------------------------------------------------------------------------------------------
{
// Get the mode
if(line==0xFF)return;
// Get the cursor pos for the page
// Get the dimensions
{
// Compute the address
while(count-->0)
address+=2;
}
}
else
{
// FIXME gfx mode not complete
{
{
case PLANAR4:
case PLANAR1:
break;
case CGA:
break;
case LINEAR8:
break;
#ifdef DEBUG
default:
#endif
}
xcurs++;
}
}
}
// --------------------------------------------------------------------------------------------
#ifdef DEBUG
#endif
#ifdef VBOX
#endif /* VBOX */
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
{
// Get the mode
if(line==0xFF)return;
{
case PLANAR4:
case PLANAR1:
if (AL & 0x80)
{
}
break;
case CGA:
{
}
else
{
}
{
}
else
{
}
if (AL & 0x80)
{
}
else
{
}
break;
case LINEAR8:
break;
#ifdef DEBUG
default:
#endif
}
}
// --------------------------------------------------------------------------------------------
{
// Get the mode
if(line==0xFF)return;
{
case PLANAR4:
case PLANAR1:
attr = 0x00;
for(i=0;i<4;i++)
{
}
break;
case CGA:
{
}
else
{
}
break;
case LINEAR8:
break;
default:
#ifdef DEBUG
#endif
attr = 0;
}
}
// --------------------------------------------------------------------------------------------
{// flag = WITH_ATTR / NO_ATTR
// special case if page is 0xff, use current page
if(page==0xff)
// Get the mode
if(line==0xFF)return;
// Get the cursor pos for the page
// Get the dimensions
switch(car)
{
case 7:
//FIXME should beep
break;
case 8:
break;
case '\r':
xcurs=0;
break;
case '\n':
ycurs++;
break;
case '\t':
do
{
}while(xcurs%8==0);
break;
default:
{
// Compute the address
// Write the char
}
else
{
// FIXME gfx mode not complete
{
case PLANAR4:
case PLANAR1:
break;
case CGA:
break;
case LINEAR8:
break;
#ifdef DEBUG
default:
#endif
}
}
xcurs++;
}
// Do we need to wrap ?
{xcurs=0;
ycurs++;
}
// Do we need to scroll ?
{
{
}
else
{
}
ycurs-=1;
}
// Set the cursor for the page
}
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
#ifdef DEBUG
#endif
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
#ifdef VBOX
#endif /* VBOX */
// --------------------------------------------------------------------------------------------
{Bit8u r,g,b;
Bit16u i;
{
// set read address and switch to read mode
// get 6-bit wide RGB data values
r=inb( VGAREG_DAC_DATA );
g=inb( VGAREG_DAC_DATA );
b=inb( VGAREG_DAC_DATA );
// intensity = ( 0.3 * Red ) + ( 0.59 * Green ) + ( 0.11 * Blue )
i = ( ( 77*r + 151*g + 28*b ) + 0x80 ) >> 8;
if(i>0x3f)i=0x3f;
// set write address and switch to write mode
// write new intensity value
start++;
}
#ifdef VBOX
#endif /* VBOX */
}
// --------------------------------------------------------------------------------------------
static void get_font_access()
{
}
static void release_font_access()
{
}
{
if(lines==8)
{
}
else
{
}
}
static void biosfn_load_text_user_pat (AL,ES,BP,CX,DX,BL,BH) Bit8u AL;Bit16u ES;Bit16u BP;Bit16u CX;Bit16u DX;Bit8u BL;Bit8u BH;
{
for(i=0;i<CX;i++)
{
}
if(AL>=0x10)
{
}
}
{
for(i=0;i<0x100;i++)
{
src = i * 14;
}
if(AL>=0x10)
{
set_scan_lines(14);
}
}
{
for(i=0;i<0x100;i++)
{
src = i * 8;
}
if(AL>=0x10)
{
set_scan_lines(8);
}
}
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
{
for(i=0;i<0x100;i++)
{
src = i * 16;
}
if(AL>=0x10)
{
set_scan_lines(16);
}
}
{
#ifdef DEBUG
#endif
}
static void biosfn_load_gfx_user_chars (ES,BP,CX,BL,DL) Bit16u ES;Bit16u BP;Bit16u CX;Bit8u BL;Bit8u DL;
{
#ifdef DEBUG
#endif
}
{
#ifdef DEBUG
#endif
}
{
#ifdef DEBUG
#endif
}
{
#ifdef DEBUG
#endif
}
// --------------------------------------------------------------------------------------------
switch(BH)
{case 0x00:
break;
case 0x01:
break;
case 0x02:
break;
case 0x03:
break;
case 0x04:
break;
case 0x05:
break;
case 0x06:
break;
case 0x07:
break;
default:
#ifdef DEBUG
#endif
return;
}
// Set Highest char row
}
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
static void biosfn_alternate_prtsc()
{
#ifdef DEBUG
#endif
}
// --------------------------------------------------------------------------------------------
#ifdef DEBUG
#endif
#ifdef DEBUG
.ascii "Select vert res (%02x) was discarded"
#endif
// --------------------------------------------------------------------------------------------
{
#ifdef DEBUG
#endif
}
{
#ifdef DEBUG
#endif
}
// --------------------------------------------------------------------------------------------
{
// Read curs info for the page
// if row=0xff special case : use current cursor position
if(row==0xff)
}
while(count--!=0)
{
if((flag&0x02)!=0)
}
// Set back curs pos
if((flag&0x01)==0)
}
// --------------------------------------------------------------------------------------------
#ifdef DEBUG
#endif
#ifdef DEBUG
#endif
#ifdef DEBUG
.ascii "Alternate Display code (%02x) was discarded"
#endif
// --------------------------------------------------------------------------------------------
{
// Address of static functionality table
// Hard coded copy from BIOS area. Should it be cleaner ?
}
// --------------------------------------------------------------------------------------------
{
size = 0;
if (CX & 1) {
size += 0x46;
}
if (CX & 2) {
}
if (CX & 4) {
}
return size;
}
{
}
{
if (CX & 1) {
for(i=1;i<=4;i++){
outb(VGAREG_SEQU_ADDRESS, i);
}
outb(VGAREG_SEQU_ADDRESS, 0);
for(i=0;i<=0x18;i++) {
}
for(i=0;i<=0x13;i++) {
}
for(i=0;i<=8;i++) {
}
/* XXX: read plane latches */
}
if (CX & 2) {
for(i=0;i<8;i++) {
BX += 2;
}
/* current font */
}
if (CX & 4) {
/* XXX: check this */
// Set the whole dac always, from 0
for(i=0;i<256*3;i++) {
}
}
return BX;
}
{
if (CX & 1) {
// Reset Attribute Ctl flip-flop
BX += 5;
for(i=1;i<=4;i++){
outb(VGAREG_SEQU_ADDRESS, i);
}
outb(VGAREG_SEQU_ADDRESS, 0);
// Disable CRTC write protection
// Set CRTC regs
for(i=0;i<=0x18;i++) {
if (i != 0x11) {
}
BX++;
}
// select crtc base address
if (crtc_addr = 0x3d4)
v |= 0x01;
// enable write protection if needed
// Set Attribute Ctl
for(i=0;i<=0x13;i++) {
}
for(i=0;i<=8;i++) {
}
addr1++;
}
if (CX & 2) {
for(i=0;i<8;i++) {
BX += 2;
}
/* current font */
}
if (CX & 4) {
BX++;
// Set the whole dac always, from 0
for(i=0;i<256*3;i++) {
}
BX++;
}
return BX;
}
// ============================================================================================
//
// Video Utils
//
// ============================================================================================
// --------------------------------------------------------------------------------------------
{
for(i=0;i<=MODE_MAX;i++)
{line=i;
break;
}
return line;
}
/* =========================================================== */
/*
* Misc Utils
*/
/* =========================================================== */
// --------------------------------------------------------------------------------------------
{
}
// --------------------------------------------------------------------------------------------
{
}
// --------------------------------------------------------------------------------------------
{
}
// --------------------------------------------------------------------------------------------
{
}
/* =========================================================== */
/*
* These functions where ripped from Kevin's rombios.c
*/
/* =========================================================== */
// --------------------------------------------------------------------------------------------
static Bit8u
{
}
// --------------------------------------------------------------------------------------------
static Bit16u
{
}
// --------------------------------------------------------------------------------------------
static void
{
}
// --------------------------------------------------------------------------------------------
static void
{
}
// --------------------------------------------------------------------------------------------
{
}
{
}
// --------------------------------------------------------------------------------------------
void
{
}
// --------------------------------------------------------------------------------------------
void
{
}
{
}
#ifdef DEBUG
void unimplemented()
{
printf("--> Unimplemented\n");
}
void unknown()
{
printf("--> Unknown int10\n");
}
#endif
// --------------------------------------------------------------------------------------------
void printf(s)
Bit8u *s;
{
#ifdef VBE
Bit8u c, format_char;
unsigned format_width, i;
arg_ptr = &s;
in_format = 0;
format_width = 0;
while (c = read_byte(0xc000, s)) {
if ( c == '%' ) {
in_format = 1;
format_width = 0;
}
else if (in_format) {
if ( (c>='0') && (c<='9') ) {
}
else if (c == 'x') {
arg_ptr++; // increment to next arg
if (format_width == 0)
format_width = 4;
i = 0;
for (i=0; i<format_width; i++) {
if (nibble <= 9)
else
digit--;
}
in_format = 0;
}
//else if (c == 'd') {
// in_format = 0;
// }
}
else {
outb(VBE_PRINTF_PORT, c);
}
s ++;
}
#endif
}
#ifdef VBE
#include "vbe.c"
#endif
#ifdef CIRRUS
#include "clext.c"
#endif
// --------------------------------------------------------------------------------------------
.ascii "vgabios ends here"
.byte 0x00
.byte 0xCB