flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Displaying Text In Video Mode? |
Author |
|
System86 07 Mar 2008, 22:50
If in text mode, write the characters into the text buffer (0xB800 for most text modes, 0xB000 for monochrome modes). If in graphics mode, you have to set the pixels to represent the character yourself. If you want windows, you have to keep track of the window coordinates and put the text into the write window by finding the coordinates of the window and writing the text using those coordinates.
|
|||
07 Mar 2008, 22:50 |
|
edfed 07 Mar 2008, 23:10
you have many methods to put chars in graph modes.
the simpler is to build a bitmap or image font, with fixed or variable size, and then, you can dispaly chars in graph mode. or you can build a vector font, same as the previous, but with good zoom capabilities. there are topics on this just there. not so far. if you are a beginner in low level asm coding, you should at least build one font and method alone. it is a good exercice. |
|||
07 Mar 2008, 23:10 |
|
DOS386 08 Mar 2008, 00:35
> Ok, so how would one go about displaying text in video mode?
As said, convert the font into pixels yourself You can read the 8x8 or 8x16 font from the BIOS (do NOT use the 8x14 font this way) or use your own font. > or you can build a vector font > if you are a beginner in low Then you should NOT attempt to deal with "vector" fonts, but put up with a bitmap based one |
|||
08 Mar 2008, 00:35 |
|
edfed 08 Mar 2008, 00:48
a way to build a bitmap font with fasm:
Code: font: ... .A: db 00000000b db 00011000b db 00110100b db 01100010b db 11000001b db 11111111b db 11000001b db 11000000b db 11100000b db 00000000b .b: ... and for vetor fonts, it is very more complex: Code: font: dd ....,.A,.B,... .A: db @f-$-1 ;;; X+, Y+, trace? db 0,10,0 db 0,-5,1 db 2,-2,1 db 1,0,1 db 2,2,1 db 0,5,1 db 0,-3,0 db -5,0,1 @@: ;;; x+,y+ db 7,0 i don't know how to represent a vectorial font, the one with bezier curves.. it is too much hard. |
|||
08 Mar 2008, 00:48 |
|
Dark Dude 08 Mar 2008, 01:35
Ah, thanks a lot, that's answered my question, and edfed showed me even more than I needed, thanks for that also ^^
|
|||
08 Mar 2008, 01:35 |
|
Dex4u 08 Mar 2008, 04:16
Here's one of my pmode vesa demos, that also demos vesa fonts.
http://www.dex4u.com/demos/VesaTxtDemo.zip |
|||
08 Mar 2008, 04:16 |
|
f0dder 08 Mar 2008, 11:21
|
|||
08 Mar 2008, 11:21 |
|
Daedalus 08 Mar 2008, 20:59
Maybe a bit unorthodox and not good, but when you're in mode 13h, output to the screen should still work as normal. At least it does here, hahaha. It's a bit bigger, but it works.
|
|||
08 Mar 2008, 20:59 |
|
edfed 08 Mar 2008, 21:03
yes you can outup string with bios and dos interrupts. but in pure asm, you should build your own text render function.
pseudo Code: ;to diplay a A, Green (2) on Blue (1). mov fs,0b800h ;; text segment di = (x + y*80)*2 mov byte[fs:di],'A' mov byte [fs:di+1],21h pseudo for vesa, it's exactlly the same as mode 13h, just byte_per_pixel and byte_per_scan_line change, and it is not easy with real mode. you need to be able to write in all memory. |
|||
08 Mar 2008, 21:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.