Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

OoMMMoO

Easy Dos graphics problem

This topic is 6925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive been learning to program dos games for about 2 days and am reading the book "The black art of 3d game programming" There is a function in there to draw horizontal lines the code is: #include ///The include files are not in the code #include #include unsigned char far* videomem=(unsigned char far*)0xA0000000L; void lineh(int x1, int x2, int y, unsigned char color) { char far* start=(videomem+((y<<8)+(y<<6))+x); int width=x2-x1; _fmemset(start,color,width); } When I do this my compiler (turbo borland c++) gives me an error saying _fmemset() needs a prototype I have also tried fmemset()and memset() and it gives me the same response. I also tried including memory.h and that did not work. Can someone help me?

Share this post


Link to post
Share on other sites
Advertisement
I''m sorry to say this, but there is no point in learning how to make dos games any more. DirectX is too easy. Noone wants to play dos games anymore (too much messing about to set up, being asked for the IRQ of your sound card, freeing up 2K of memory just to make a game start etc.). There is not really a point.

However, if you choose not to listen to my opinion, that''s fine. Not that I''d know much.

Share this post


Link to post
Share on other sites
I know but I think dos is really good for learning how to game program and I just want to get the basic of how games work before I move to directx.

Share this post


Link to post
Share on other sites
Have you tried just plain memset()? I can''t remember if the parameters are the same, right off the top of my head, but I''m sure they''re close.

Incidentally, I don''t know what compiler you''re using, but you could check out www.delorie.com/djgpp and look at the C Library Reference. It is VERY handy.

Share this post


Link to post
Share on other sites
The _ in front is a Microsoft thing, so if its a microsoft compiler it should work (Yes, Microsoft made a DOS compiler a while back, though its not still available). For the books, when i had Borland''s Turbo C++ (for DOS), i didn''t have any of the far memory functions, only the near memory functions. I would look in the help docs to see what header file memset() and/or fmemset() is in.

PCMCIA - People Can't Memorize Computer Industry Acronyms
ISDN - It Still Does Nothing
APPLE - Arrogance Produces Profit-Losing Entity
SCSI - System Can't See It
DOS - Defunct Operating System
BASIC - Bill's Attempt to Seize Industry Control
IBM - I Blame Microsoft
DEC - Do Expect Cuts
CD-ROM - Consumer Device, Rendered Obsolete in Months
OS/2 - Obsolete Soon, Too.
WWW - World Wide Wait
MACINTOSH - Most Applications Crash; If Not, The Operating System Hangs

Share this post


Link to post
Share on other sites
Zipster, LOL with that signature, man

I know it wasn''t the original question, but.....I reckon that DOS is a lot better to learn basic game development stuff rather than Win95 and DirectX, since you don''t have to worry about handling windows messages and such like.

George.

"Who says computer games affect kids, imagine if PacMan affected us as kids, we'd all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"

Share this post


Link to post
Share on other sites
DOS is good to learn system internals, assembler, and all the funky ways things can go wrong when writing bad code, but the thing is, these days you hardly need that anymore unless you REALLY go to the metal with Windows code - there are not a lot of people ( even professionally )who do that.

#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**

Share this post


Link to post
Share on other sites
Dos programming is good for making portable programs, as long as you stick with ANSI C++ and avoid stuff like assembler, graphics programming, and the "system internals" that MadKeithV describes. But beware: You''re not going to get far with DOS! I recommend you find a portable graphical enviroment like GTK, or if you are going to make 3D games, OpenGL. Trust me, going to an graphical environment that people actually use will be worth it. Don''t become too dependent on Windows programming, though: To be honest, nobody knows what their future is right now, and Linux is still growing.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!