Gigasoft wrote:First of all, you're loading the font into video RAM while in graphics mode. What would that be good for? You're just overwriting certain columns on the screen. Then you set the block specifier, which does nothing in graphics mode. Then you enable color planes 0, 1 and 2 but not 3 (why?).
Then, when printing, you retrieve the current cursor position and size and do nothing with it before you try to print the string (with DS still pointing at the video ROM and with the controller set to the wrong addressing mode after trying to load the font).
You don't need to retrieve or set any fonts to print characters using the BIOS. You only need to retrieve the font if you intend to draw characters manually without using the BIOS.
To be honest, it isn't much of your reply that makes any sense to me, Gigasoft. Maybe because I have a major headache, I don't know..
BUT, a lot of things did come to my mind reading your reply. Like how much of the code I actually wrote "without thinking about it". Firstly, I remembered that I'm in mode 13h, not mode 12h. Therefore, I don't have to use bit planes, as they're only present in mode 0dh, 0eh, 10h, and 12h. Secondly, after you stating that I didn't take use of the cursor size & position and the video mode I retrieved from the interrupts at the top of my 'printString' function, the penny finally fell. I had wrote my 'printString' function the way I usually do it in text-mode, when I was actually supposed to use function number 13h. The problem probably is I wrote this function when it was like 2:30 AM in Denmark. My bad.. anyway, with my new code the problem is that it simply doesn't print out anything.
Here's the code:
'main' routine:
Code: Select all
chooseBootingMode db "Would you like to perform a verbose boot?", 0x000d, 0x000a, 0
main:
xor ax, ax
mov ds, ax
call getFont
call mode13h
call clearScreen
mov bp, chooseBootingMode
call printString
jmp $
'getFont' & 'printString':
Code: Select all
getFont:
mov ax, 0x1130
mov bh, 0x0002
int 0x0010
push es
pop ds
mov si, bp
push cs
pop es
mov di, fontBuffer
mov cx, 256
populateBuffer:
movsw
movsw
movsw
movsw
movsw
movsw
movsw
movsw
loop populateBuffer
mov bp, fontBuffer
xor dx, dx
mov cx, 256
mov bh, 16
mov bl, 1
mov ax, 0x1100
int 0x0010
mov bx, 0x0100
mov cx, bx
shl bh, 2
or bl, bh
mov ax, 0x1103
int 0x0010
ret
printString:
mov ah, 0x000f
int 0x0010
mov ah, 0x0003
int 0x0010
mov cx, 44
mov bl, 0x0007
mov ax, 0x1301
int 0x0010
ret
fontBuffer: