OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [trunk/] [soc/] [bios/] [vgabios.c] - Diff between revs 43 and 45

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 43 Rev 45
Line 24... Line 24...
 
 
static void biosfn_set_video_mode();
static void biosfn_set_video_mode();
static void biosfn_set_cursor_pos();
static void biosfn_set_cursor_pos();
static void biosfn_get_cursor_pos();
static void biosfn_get_cursor_pos();
static void biosfn_scroll();
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_teletype();
static void biosfn_write_teletype();
static void biosfn_load_text_8_16_pat();
static void biosfn_load_text_8_16_pat();
static void biosfn_write_string();
static void biosfn_write_string();
extern Bit8u video_save_pointer_table[];
extern Bit8u video_save_pointer_table[];
 
 
Line 171... Line 174...
  push cx
  push cx
  push dx
  push dx
  push bx
  push bx
  push sp
  push sp
  mov  bx, sp
  mov  bx, sp
 
  sseg
  add  [bx], #10
  add  [bx], #10
 
  sseg
  mov  bx, [bx+2]
  mov  bx, [bx+2]
  push bp
  push bp
  push si
  push si
  push di
  push di
 
 
Line 232... Line 237...
;  inc  sp
;  inc  sp
  ret
  ret
 
 
#if defined(USE_BX_INFO) || defined(DEBUG)
#if defined(USE_BX_INFO) || defined(DEBUG)
msg_vga_init:
msg_vga_init:
.ascii "VGABios $Id: vgabios.c,v 1.7 2009-02-06 03:48:27 zeus Exp $"
.ascii "VGABios $Id: vgabios.c,v 1.8 2009-03-02 01:02:33 zeus Exp $"
.byte 0x0d,0x0a,0x00
.byte 0x0d,0x0a,0x00
#endif
#endif
ASM_END
ASM_END
 
 
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
Line 414... Line 419...
     biosfn_scroll(GET_AL(),GET_BH(),GET_CH(),GET_CL(),GET_DH(),GET_DL(),0xFF,SCROLL_UP);
     biosfn_scroll(GET_AL(),GET_BH(),GET_CH(),GET_CL(),GET_DH(),GET_DL(),0xFF,SCROLL_UP);
     break;
     break;
   case 0x07:
   case 0x07:
     biosfn_scroll(GET_AL(),GET_BH(),GET_CH(),GET_CL(),GET_DH(),GET_DL(),0xFF,SCROLL_DOWN);
     biosfn_scroll(GET_AL(),GET_BH(),GET_CH(),GET_CL(),GET_DH(),GET_DL(),0xFF,SCROLL_DOWN);
     break;
     break;
 
   case 0x08:
 
     biosfn_read_char_attr(GET_BH(),&AX);
 
     break;
 
   case 0x09:
 
     biosfn_write_char_attr(GET_AL(),GET_BH(),GET_BL(),CX);
 
     break;
 
   case 0x0A:
 
     biosfn_write_char_only(GET_AL(),GET_BH(),GET_BL(),CX);
 
     break;
   case 0x0E:
   case 0x0E:
     // Ralf Brown Interrupt list is WRONG on bh(page)
     // Ralf Brown Interrupt list is WRONG on bh(page)
     // We do output only on the current page !
     // We do output only on the current page !
     biosfn_write_teletype(GET_AL(),0xff,GET_BL(),NO_ATTR);
     biosfn_write_teletype(GET_AL(),0xff,GET_BL(),NO_ATTR);
     break;
     break;
Line 736... Line 750...
    }
    }
  }
  }
}
}
 
 
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
 
static void biosfn_read_char_attr (page,car)
 
Bit8u page;Bit16u *car;
 
{Bit16u ss=get_SS();
 
 Bit8u xcurs,ycurs,mode,line;
 
 Bit16u nbcols,nbrows,address;
 
 Bit16u cursor,dummy;
 
 
 
 // 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);
 
 
 
 // Compute the address
 
 address=SCREEN_MEM_START(nbcols,nbrows,page)+(xcurs+ycurs*nbcols)*2;
 
 
 
 write_word(ss,car,read_word(vga_modes[line].sstart,address));
 
}
 
 
 
// --------------------------------------------------------------------------------------------
 
static void biosfn_write_char_attr (car,page,attr,count)
 
Bit8u car;Bit8u page;Bit8u attr;Bit16u count;
 
{
 
 Bit8u cheight,xcurs,ycurs,mode,line,bpp;
 
 Bit16u nbcols,nbrows,address;
 
 Bit16u cursor,dummy;
 
 
 
 // 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);
 
 
 
 // Compute the address
 
 address=SCREEN_MEM_START(nbcols,nbrows,page)+(xcurs+ycurs*nbcols)*2;
 
 
 
 dummy=((Bit16u)attr<<8)+car;
 
 memsetw(vga_modes[line].sstart,address,dummy,count);
 
}
 
 
 
// --------------------------------------------------------------------------------------------
 
static void biosfn_write_char_only (car,page,attr,count)
 
Bit8u car;Bit8u page;Bit8u attr;Bit16u count;
 
{
 
 Bit8u cheight,xcurs,ycurs,mode,line,bpp;
 
 Bit16u nbcols,nbrows,address;
 
 Bit16u cursor,dummy;
 
 
 
 // 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);
 
 
 
 // Compute the address
 
 address=SCREEN_MEM_START(nbcols,nbrows,page)+(xcurs+ycurs*nbcols)*2;
 
 
 
 while(count-->0)
 
  {write_byte(vga_modes[line].sstart,address,car);
 
   address+=2;
 
  }
 
}
 
 
 
// --------------------------------------------------------------------------------------------
static void biosfn_write_teletype (car, page, attr, flag)
static void biosfn_write_teletype (car, page, attr, flag)
Bit8u car;Bit8u page;Bit8u attr;Bit8u flag;
Bit8u car;Bit8u page;Bit8u attr;Bit8u flag;
{// flag = WITH_ATTR / NO_ATTR
{// flag = WITH_ATTR / NO_ATTR
 
 
 Bit8u cheight,xcurs,ycurs,mode,line,bpp;
 Bit8u cheight,xcurs,ycurs,mode,line,bpp;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.