Hi,
i want to set a 90x60 textmode
i wrote to the register to enable this mode: it work
but the font should be 8x8 instead 8x16 and i dont know how to set this font... could you help me please
i use asm, the os work in pmode
thank
help with vga textmode
For 80x50 in DexOS, I do this:
In realmode before moving to pmode, you can probly do it in Pmode see here:
http://bos.asmhackers.net/docs/vga_without_bios/
Code: Select all
;----------------------------------------------------;
; Resizes text. ;
;----------------------------------------------------;
TextReSize:
pushad
mov ax,1112h ; Set 80x50 mode
mov bl,0
int 10h
call ReProgamFonts
popad
ret
;----------------------------------------------------;
; Reprogram fonts. ;
;----------------------------------------------------;
ReProgamFonts:
push es
mov ax,ds
mov es,ax
mov bp,DexFont
mov cx,00FFh
xor dx,dx
mov bx,0800h
mov ax,1100h
int 10h ; ReProgams Fonts
pop es
ret
http://bos.asmhackers.net/docs/vga_without_bios/
- Attachments
-
- DexFonts.asm
- These are the fonts, to go with the above code
- (12.54 KiB) Downloaded 72 times
For initializing 90x60 I dunno, but here you go for 80x50:
(Its a copy-and-paste, but it should work.)
Then, immediately after that, you should set proper palette and load a 80x50 font, which isn't described in the code.
You see, you are at mercy of BIOS interrupts
Code: Select all
STATUS_ADDR EQU 03DAH
MISC_ADDR EQU 03C2H
SEQ_ADDR EQU 03C4H
GRACON_ADDR EQU 03CEH
CRTC_ADDR EQU 03D4H
ATTRCON_ADDR EQU 03C0H
MODEK DB 63H, 00H, 03H,01H,03H,00H,02H
DB 5FH,4FH,50H,82H,55H,81H,0BFH,1FH,00H,47H,06H,07H,00H,00H,00H
DB 00H,9CH,8EH,8FH,28H,1FH,96H,0B9H,0A3H,0FFH
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
DB 00H,01H,02H,03H,04H,05H,14H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH
DB 0CH,00H,0FH,00H,00H
SETMODE:
; Send MISC regs
MOV DX,MISC_ADDR
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
MOV DX,STATUS_ADDR
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
; Send SEQ regs
MOV CX,0
REG_LOOP:
MOV DX,SEQ_ADDR
MOV AL,CL
OUT DX,AL
JMP $+2
MOV DX,SEQ_ADDR
INC DX
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
INC CX
CMP CL,5
JL REG_LOOP
; Clear Protection bits
MOV AH,0EH
MOV AL,11H
AND AH,7FH
MOV DX,CRTC_ADDR
OUT DX,AX
JMP $+2
; Send CRTC regs
MOV CX,0
REG_LOOP2:
MOV DX,CRTC_ADDR
MOV AL,CL
OUT DX,AL
JMP $+2
MOV DX,CRTC_ADDR
INC DX
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
INC CX
CMP CL,25
JL REG_LOOP2
; Send GRAPHICS regs
MOV CX,0
REG_LOOP3:
MOV DX,GRACON_ADDR
MOV AL,CL
OUT DX,AL
JMP $+2
MOV DX,GRACON_ADDR
INC DX
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
INC CX
CMP CL,9
JL REG_LOOP3
MOV DX,STATUS_ADDR
IN AL,DX
JMP $+2
; Send ATTRCON regs
MOV CX,0
REG_LOOP4:
MOV DX,ATTRCON_ADDR
IN AX,DX
MOV AL,CL
OUT DX,AL
JMP $+2
MOV AL,[SI]
OUT DX,AL
JMP $+2
INC SI
INC CX
CMP CL,21
JL REG_LOOP4
MOV AL,20H
OUT DX,AL
JMP $+2
RET
...
YOURCODE:
MOV SI,OFFSET MODEK
CALL SETMODE
Then, immediately after that, you should set proper palette and load a 80x50 font, which isn't described in the code.
You see, you are at mercy of BIOS interrupts
-
- Member
- Posts: 391
- Joined: Wed Jul 25, 2007 8:45 am
- Libera.chat IRC: aejsmith
- Location: London, UK
- Contact:
There's some good info and code in here: http://my.execpc.com/CE/AC/geezer/osd/graphics/modes.c
It contains 8x8 and 8x16 fonts and has code to set them, as well as the text mode.
It contains 8x8 and 8x16 fonts and has code to set them, as well as the text mode.
I don't use 90x60 text mode, as in it too small size of symbol matrix. But I'm using 80x30 text mode. It like 90x60 by values placed in vga registers:
Code: Select all
mor: 0xE7
sync: 0x03, 0x00, 0x03, 0x00, 0x02
crt: 0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0x0B, 0x3E, 0x00, 0x4F, 0x0D (0x0E), 0x0E (0x0F)
0x00 (pagedisph), 0x00 (pagedispl), 0x00 (superposh), 0x00 (superposl), 0xEA, 0x8C (0x0C)
0xDF, 0x28, 0x1F, 0xE7, 0x04, 0xA3, 0xFF
graph: 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF
attr: 0x00-0x0F, 0x04 (0x0C - blink), 0x00, 0x0F, 0x08, 0x00
dac(0-15): see palcga.bin
- Attachments
-
- palcga.zip
- (148 Bytes) Downloaded 57 times