characters mapping ???

Can anybody tell me how are characters mapped
I mean ... how the hardware know how A looks like or some other character.
I gues there must be some hardware component (matrix) that mapps the characters ....
Can this mapping be changed ... for example if I whant to print CYRILIC in lowlevel kerenl mode or something ...

TXH.

Comments

  • : Can anybody tell me how are characters mapped
    : I mean ... how the hardware know how A looks like or some other character.
    : I gues there must be some hardware component (matrix) that mapps the characters ....
    : Can this mapping be changed ... for example if I whant to print CYRILIC in lowlevel kerenl mode or something ...
    :
    : TXH.
    :
    :
    Please don't double post.

    In some old computer's this was done with a ROM memmory,
    but in the new one's it ofthen uses font files stored
    on harddrive.
    [b]===============================[/b]
    El PROgrammador [b]Niklas Ulvinge[/b]

  • : : Can anybody tell me how are characters mapped
    : : I mean ... how the hardware know how A looks like or some other character.
    : : I gues there must be some hardware component (matrix) that mapps the characters ....
    : : Can this mapping be changed ... for example if I whant to print CYRILIC in lowlevel kerenl mode or something ...
    : :
    : : TXH.
    : :
    : :
    : Please don't double post.
    :
    : In some old computer's this was done with a ROM memmory,
    : but in the new one's it ofthen uses font files stored
    : on harddrive.
    : [b]===============================[/b]
    : El PROgrammador [b]Niklas Ulvinge[/b]
    :
    :
    In DOS you can do this by accessing ports, or in assembly(it's risky). Here are some reasonable Pascal code if you are interested in.
    [code]
    program UpsideDown;
    uses
    CRT;
    var
    newcharset, oldcharset : array[0..255,1..16] of byte;

    procedure getoldcharset;
    var
    b:byte;
    w:word;
    begin
    for b := 0 to 255 do begin
    w := b * 32;
    inline($FA);
    PortW[$3C4] := $0402;
    PortW[$3C4] := $0704;
    PortW[$3CE] := $0204;
    PortW[$3CE] := $0005;
    PortW[$3CE] := $0006;
    Move(Ptr($A000, w)^, oldcharset[b,1], 16);
    PortW[$3C4] := $0302;
    PortW[$3C4] := $0304;
    PortW[$3CE] := $0004;
    PortW[$3CE] := $1005;
    PortW[$3CE] := $0E06;
    inline($FB);
    end;
    end;

    procedure restoreoldcharset;
    var
    b:byte;
    w:word;
    begin
    for b := 0 to 255 do begin
    w := b * 32;
    inline($FA);
    PortW[$3C4] := $0402;
    PortW[$3C4] := $0704;
    PortW[$3CE] := $0204;
    PortW[$3CE] := $0005;
    PortW[$3CE] := $0006;
    Move(oldcharset[b,1], Ptr($A000, w)^, 16);
    PortW[$3C4] := $0302;
    PortW[$3C4] := $0304;
    PortW[$3CE] := $0004;
    PortW[$3CE] := $1005;
    PortW[$3CE] := $0E06;
    inline($FB);
    end;
    end;

    procedure setasciichar(charnum : byte; var data);
    var
    offset : Word;
    begin
    offset := charNum * 32;
    inline($FA);
    PortW[$3C4] := $0402;
    PortW[$3C4] := $0704;
    PortW[$3CE] := $0204;
    PortW[$3CE] := $0005;
    PortW[$3CE] := $0006;
    Move(data, Ptr($A000, offset)^, 16);
    PortW[$3C4] := $0302;
    PortW[$3C4] := $0304;
    PortW[$3CE] := $0004;
    PortW[$3CE] := $1005;
    PortW[$3CE] := $0E06;
    inline($FB);
    end;

    var
    b,c:byte;

    begin
    textmode(c80);
    getoldcharset;
    for b := 0 to 255 do
    for c := 1 to 16 do newcharset[b, c] := oldcharset[b,(17-c)];
    for b := 0 to 255 do setasciichar(b,newcharset[b,1]);
    readln;
    restoreoldcharset;
    end.
    [/code]

    ****************
    Any questions? Just ask!

    :-) [b][blue]GAASHIUS[/blue][/b] :-)


  • THX
    I'm doing some realmode programing and I practise on a virtual machine, so It's nothing risky :))))
    Ok I'll try to port the code from PASCAL to ASM
    THX any way

    regards
    PC-SandMan^^
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories