van Thielen
van Thielen

Reputation: 19

Drawing a line in a 1024-lines mode

I am trying to get a line drawn in video mode 105h using int 10h.

When I try:

mov cx, 10  ;col
mov dx, 10  ;row
mov ah, 0ch ; put pixel

nothing is displayed on screen.

The mode I try is 1024x768.
I understand that I need to create a font file to get text on the screen.
But that won’t be a problem when I get the line or a pixel working.

BITS 16
ORG 100h
mov ax, ds
mov es, ax 
;Set video mode
mov ax, 4f02h
mov bx, 105h
int 10h
;Wait for key
xor ax, ax
int 16h
;Restore DOS text mode
mov ax, 0003h
int 10h
;Exit
mov ax, 4c00h
int 21h
modeInfo    TIMES 256 db 0

Upvotes: 1

Views: 181

Answers (1)

Sep Roland
Sep Roland

Reputation: 39676

The video mode 105h is a 1024x768 256-color VESA defined video mode.

Although you clearly have read MagaretBloom's answer, not every BIOS will work for these extended video modes!
The BIOS.WritePixel function 0Ch normally only operates on the LEGACY video modes. Those are the video modes whose number ranges from 0 to 19.

Your best choices are to setup the 640x480 16-color video mode (number 18), or the 320x200 256-color video mode (number 19).

For the VESA modes, you'll have to write your own output routines... Take a look here
I have written lots of code like this and maybe one day I will decide to post about it. Sadly that day has not yet arrived. :-(

Upvotes: 1

Related Questions