font.ppi 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993,97 by the Free Pascal development team.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. var
  12. defaultfontdata : array[0..2047] of byte;
  13. function getfontpointer(b : byte):longint;
  14. begin
  15. dregs.RealSS:=0;
  16. dregs.RealSP:=0;
  17. dregs.RealEAX:=$1130;
  18. dregs.RealEBX:=longint(b shl 8);
  19. RealIntr($10,dregs);
  20. getfontpointer:=(longint(dregs.RealES) shl 4) + dregs.RealEBP and $FFFF;
  21. end;
  22. procedure getdefaultfont;
  23. var Sel : Word;
  24. linaddr : longint;
  25. begin
  26. { 8x8-Defaultfont aus BIOS laden }
  27. if isDPMI then begin
  28. SEL:=allocate_ldt_descriptors(1);
  29. linaddr:=getfontpointer(3);
  30. { I got problems because the fonts were at real mode segment $ffff
  31. so the address is above 1Mo and thus not locked !! }
  32. if linaddr+1024>$100000 then
  33. linaddr:=get_linear_addr(linaddr,1024);
  34. Set_segment_base_address(SEL,linaddr);
  35. Set_segment_limit(SEL,1024);
  36. movelong(sel,@defaultfontdata[0],$3FF);
  37. linaddr:=getfontpointer(4);
  38. if linaddr+1024>$100000 then
  39. linaddr:=get_linear_addr(linaddr,1024);
  40. Set_segment_base_address(SEL,linaddr);
  41. Set_segment_limit(SEL,1024);
  42. movelong(sel,@defaultfontdata[1024],$3FF);
  43. free_ldt_descriptor(SEL);
  44. end else begin
  45. move(pointer(getfontpointer(3)+core)^,defaultfontdata[0],1024);
  46. move(pointer(getfontpointer(4)+core)^,defaultfontdata[1024],1024);
  47. end;
  48. end;
  49. {
  50. $Log$
  51. Revision 1.1 1998-03-25 11:18:42 root
  52. Initial revision
  53. Revision 1.3 1998/01/26 11:58:02 michael
  54. + Added log at the end
  55. Working file: rtl/dos/ppi/font.ppi
  56. description:
  57. ----------------------------
  58. revision 1.2
  59. date: 1997/12/01 12:21:29; author: michael; state: Exp; lines: +14 -0
  60. + added copyright reference in header.
  61. ----------------------------
  62. revision 1.1
  63. date: 1997/11/27 08:33:51; author: michael; state: Exp;
  64. Initial revision
  65. ----------------------------
  66. revision 1.1.1.1
  67. date: 1997/11/27 08:33:51; author: michael; state: Exp; lines: +0 -0
  68. FPC RTL CVS start
  69. =============================================================================
  70. }