Page 1 of 1

8 bit graphics mode - how?

Posted: Fri Jan 19, 2007 1:09 am
by xyz1
I try to switch to 8-bit screen mode, but without any success. I am using int functiions 0x4f00;0x4f01;0x4f02;0x4f08;0x4f09; / 0x10. In other hands, 32 bit modes work OK.
Some more info, about my experiments. Worked modes are for example 0x112 and 0x115, and it's type is "Direct" (No 6). Non working are "Packed" (No 4).
Can you give me some more information, and some working (source) code, which I can start from (boot) floppy. I found this
http://alumni.imsa.edu/~stendahl/comp/txt/vesasvga.txt
but it does not working.

Posted: Fri Jan 19, 2007 2:59 am
by Combuster
have you tried anything in the lines of

Code: Select all

org 0x7c00

; go to 8-bit video mode
mov ax, 0x0013
int 0x10

; fill the screen with some random color
mov ax, 0xb800
mov es, ax
xor di, di
mov al, 0x07
mov cx, 0xffff
rep stosb

; wait for keypress
xor ax, ax
int 0x16

; change to text mode
mov ax, 0x0003
int 0x10

; reboot (sortof)
int 0x19
(untested)

Posted: Fri Jan 19, 2007 3:42 am
by xyz1
I am not tried this, but I need some more advanced VESA modes. Mode "13h" is VGA. Can you tell me some DOS programme, which is small (less than 100K) and to be possible to test the graphics modes.

Posted: Fri Jan 19, 2007 9:57 am
by xyz1
Do you know some small OS, in wich such 8-mode has been implemented? For example mode 101h.

Posted: Fri Jan 19, 2007 11:25 am
by Dex
Try this:

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                           ;;
;; fasm example.By Craig Bamford (Dex) 2002. ;;
;; 640*480 8bpp (256 colors) vesa1           ;;
;; C:\fasm vesa1.asm vesa1.com               ;;
;;                                           ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ORG    100h

Start:
        mov ax,4f02h
        mov bx,101h
        int 10h

        mov dx,0xa000
        mov es,dx
        call window

StartAgain:
        xor dx,dx
        mov [color],0	   
MainLoop:
        push dx
        call window
        xor bx,bx
        inc [color]
        mov al,[color]
        call static

        pop dx
        cmp dx,4
        je StartAgain
        inc dx  ;<** here is box number
        mov ah,01h
        int 16h
        jz MainLoop
        mov ah,00h
        int 16h
        mov ax,0003h
        int 10h

        ret

window:
        mov ax,4f05h
        mov bx,0
        int 10h
        xor bx,bx
        ret

static:         
        stosb
        inc bx
        cmp bx,0x00000
        jne static
        ret




color    db         0
Row      db         0
I have also done some vesa tuts that may help (all with fasm code).
This demos set up vesa and goes to pmode and switch modes in pmode.
http://www.dex4u.com/tuts/DemoVesa.zip
This is the same, but demos displaying a high-res bmp image using vesa from pmode.
http://www.dex4u.com/tuts/BmpView.zip
Also see my CdPod as the code in that may help.
A mini pmode OS with vesa support, thats less than 512bytes
http://board.flatassembler.net/topic.ph ... 4&start=60