Sign in to follow this  

Mode 13h - :( = :) (Solved Thnx)

This topic is 4730 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

Hi all, I'm using the turbo c++ 3 compiler and have run into a slight problem while trying to start learning bout mode 13h programming. Here's my rather fruitless first attempt at writing such a program... #include <mem.h> #include <dos.h> void setmode13h() { struct REGS regs; regs.x.ax = 0x013; int86(0x10,®s,®s); } void setmode3h() { struct REGS regs; regs.x.ax = 0x03; int86(0x10,®s,®s); } void main() { setmode13h(); } Well, the problem is that after getting into mode 13h , the background is littered with pixels of various colors (Shudn't the output be just a plain black screen..??). Also, when I try to clear the screen with this : _fmemset(MK_FP(0xa000,0),Color,0xffff); The remaining portion of the screen is set to the color I want it to but the pixels remain. I would appreciate any help (is it simply that i am committing a grossly unpardonable error - read a newbie mistake ;) or is there something more deeper to this ??). Also if someone could point me to where I could get the c++ ports(by Christopher Mann/anyone else) of the Denthor's Tutorial Series -- I've got parts 1 to 10 in c++ and of course the Denthor's Series is up in the articles section but that's --unless I'm very much mistaken -- only in Pascal. Thank's ... Thankx everbody I seem to have finally solved the problem...(see lower posts) [Edited by - Darth_Vader on December 31, 2004 3:43:18 AM]

Share this post


Link to post
Share on other sites
My question to you is, why are you learning mode 13h ? its never used anymore, learn a 3d API, get hardware acceleration, and get modern :-D, seriously though, unless its simply for joy/learning, theres no reason to learn it, it has no value today

-Dan

Share this post


Link to post
Share on other sites
Dan :
Lol...ur right definitely. But I've just finished C++ in my school and it was geared towards text based programming and the boring standard functions(duh..) . It's just that I think that this will be a logical extension to something I've learnt and (hopefully ;)) with time, I'll also learn a 3d API.

Share this post


Link to post
Share on other sites
Quote:
Original post by Darth_Vader


Well, the problem is that after getting into mode 13h , the background is littered with pixels of various colors (Shudn't the output be just a plain black screen..??). Also, when I try to clear the screen with this :
_fmemset(MK_FP(0xa000,0),Color,0xffff);
The remaining portion of the screen is set to the color I want it to but the pixels remain. I would appreciate any help (is it simply that i am committing a grossly unpardonable error - read a newbie mistake ;) or is there something more deeper to this ??).


Try using memset(screen_address,color,319*199);

Quote:

Also if someone could point me to where I could get the c++ ports(by Christopher Mann/anyone else) of the Denthor's Tutorial Series -- I've got parts 1 to 10 in c++ and of course the Denthor's Series is up in the articles section but that's --unless I'm very much mistaken -- only in Pascal.


Thank's ...


That's true,only upto part 10 has been converted to C++ by Snowman I belive.I did manage to find some other stuff which had some ports for 15,16,17,19 or something like that in C++ but I never managed to get them compiled :(

Hey why not try these links:
http://www.brackeen.com/home/vga/
http://www.daniweb.com/tutorials/tutorial8439.html


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by FireNet
Try using memset(screen_address,color,319*199);


you of course meant
memset (screen_address, color, 320*200 - 1);

Share this post


Link to post
Share on other sites
Thanks a lot guys esp Firenet .... finally figured out what was wrong .. As I hadn't used getch() and I'd not returned to text mode, what I was viewing was the post output screen (I don't know how to explain this exactly...suffice to say... I've got it to work..yay!!)

@Firenet : Thnx a lot 4 ur cool links...I'll surely have a look at them.

Share this post


Link to post
Share on other sites

This topic is 4730 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this