| | |
Initialising Video Modes
![]() |
•
•
•
•
How can I initialise different video modes... like SVGA 800x600 mode, EGA 640x350 mode, et cetera using interrupts... what exactly must I do? Could you demonstrate an example or two for EGA 640x350 and how I can then write to the memory? Thank you.
and to change the video mode, use
int10h F : 0 interrupt
a simple code for you...
void set_video_mode(int vmode) { union REGS regs; regs.h.ah = 0; regs.h.al = vmode; int86(0x10, ®s, ®s); } int main(void) { set_video_mode(1); printf(“hello world!\n”); getch(); return 0; }
•
•
•
•
Yes, very well.. I already knew this much. Say I set vmode to 10....
How can I now write to the video memory, displaying a pixel somewhere??
void writep(int row, int col, int color) { union REGS regs; regs.h.ah = 0x0c; regs.h.al = color; regs.h.bh = 0; regs.x.dx = row; regs.x.cx = col; int86(0x10, ®s, ®s); } int main(void) { set_video_mode(16); writep(100, 100, WHITE); getch(); set_video_mode(3); return 0; }
writing to video ram is easy as writing to any other ram -- just set a pointer to 0xA0000:0000 and write to it. But be warned that it will be ungodly sloooooow. Here is a link to some more useful information
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Missing logon screen???!?!?!?!?! (Windows NT / 2000 / XP)
- Computer won't start (Windows NT / 2000 / XP)
- Startup problems with windows XP: PLEASE HELP! (Windows NT / 2000 / XP)
- Display problems (Monitors, Displays and Video Cards)
Other Threads in the C Forum
- Previous Thread: Averaging and grading program in C
- Next Thread: Doubt re: interface LED with TMS320F2812 ?? Newbie question
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






