Let's Code MS DOS 0x03: The VGA Card

preview_player
Показать описание
In this third part of the "Let's Code MS DOS" series we explore the VGA graphics card. I will show you how to enable graphics mode, because the PC and DOS boot up in a text mode, which is backwards compatible to earlier PCs. We touch the subject of software interrupts, the API of the BIOS and DOS, as well as I/O ports to program the VGA card's palette registers.

Рекомендации по теме
Комментарии
Автор

Excellent 👍 Remember I wrote a similar program in the early 90s but used inline assembly in Turbo C for calling interrupts and manipulating the palette.
Could you please go over scrolling in mode 13 and mode X as well if you have time?
Thanks a lot and keep up the good work 👍

teslastellar
Автор

As an embedded developer, C is my daily language. However, I am used to working with way more modern compilers, back in the DOS days, I was using Turbo Pascal, so I never worked with C compilers that old. And I have to say... yikes. Those dark ages before stdint.h...😱
It may just be me, but I would probably go ahead and create my own stdint.h for this compiler and use uint8_t instead of typedefing a "byte". Probably just a matter of habits though. The result is the same of course.
And also not having the // comments would drive me nuts. (And for the pedantic folks out there, YES, they were introduced with C++, but also made their way into the C standard, so it is legal C for a modern enough compiler. 😉)

Colaholiker
Автор

Excellent tutorial. And love the sound of your mechanical keyboard!

stupossibleify
Автор

Can you share the ppts about dos programming that you show in the video?

salpuy
Автор

Wow videos like this make me happy as not a lot of people nowadays even knows what IDE to use if you program in dos

BTW: can you show TurboVision a bit? Like make an app that shows your subs count Maybe upgrade to Bordland C++

BTW2: do you know maybe what would you use instead of vector in bordland c++?

Veso
Автор

Any good resources on developing for EGA (both low-res and Hi-res 640x350) ?
I know there's a special 64 color mode (not supported by all EGA cards, and requires a multi-sync monitor also). Any good resources on this?
Reason I'm asking is VGA is/was very common, and to my understanding, also a heck of a lot easier to work with.

TheRetroRaven
Автор

Hi root42, i also want to have the documentation shown in timecode 4:27 .
What URL so i can download it?

GeoSukarno
Автор

2:15 I'm really surprised that any version of C doesn't have "byte" defined as a type by default, isn't that the most basic type of all?

Domarius
Автор

@root sorry one more question: in vga, is it possible to apply some effect for each scanline ?

LeoOno
Автор

Nice. Question: I have this old DOS based installer which uses a script to guide the installation. It has this predefined parameter that the script can use. It appears to return what kind of video card is being detected. Playing with the DOSBox settings it returned these values: 3 = VGA, 4 = EGA, 6 = Tandy, 7 = CGA/PCjr, 10 = Hercules. (decimal) Any idea what BIOS memory location or interrupt is used to get these values?

PeterSwinkels
Автор

I've been following along in Turbo C++ 3.0. First hurdle I hit was this
`Cannot convert 'void *' to 'unsigned char *'` on the malloc line in get_sky_palette()
I had to change:
`pal = malloc( NUM_COLORS * 3 ); /* RGB */`
to
`pal = (byte * )malloc( NUM_COLORS * 3 ); /* RGB */`

CaffeinatedTech
Автор

Does anyone know anything about VGA mode 12h programming? I'm trying to get into it, but I'm finding it *_horrifically_* difficult to understand. If anyone knows of any resources that explain it from the beginning in baby steps, I'd be very grateful...

bettyswunghole
Автор

Great video series; learning a lot here! Quick question if I may: you use malloc() to reserve memory; but it is never freed. Shouldn’t we free it up before program termination, because of good memory management?

countersurprise
Автор

Awesome! But the background music is making me tired...

devblognet
Автор

char s[255] is odd :D why not char [256]? then you can at least use an index going from 0 to 255...😁

shinzon
Автор

Don't tell CGA text mode is ugly ;-)

vulturius
Автор

Thats a very good introduction to system programming under DOS. I learned a lot, but I could definitely do without the crappy music. :-) It's very annoying and distracting to me. Otherwise great video

ChrisRtro
visit shbcf.ru