DOS Question...

Started by
4 comments, last by Elwren 22 years, 9 months ago
Hey, I''m programming a Text-RPG game in DOS and I was wondering if there was anyway I could have a certain section of the screen be reserved for like a text-box. To be more specific, have a small portion of the top right corner continually display a box with stats in it, and all other text would just wrap around it. Currently, the text on the DOS screen just scrolls up as more text is entered than the window can contain. If anyone has any ideas on how to do/imitate this, then please help Thanks
Advertisement
Don''t write your game for DOS or your won''t be able to run it in few year!

You should search a text-mode/RPG API or use a standard graphic lib to implement your game...
quote:Original post by bobatefrei
Don''t write your game for DOS or your won''t be able to run it in few year!

You should search a text-mode/RPG API or use a standard graphic lib to implement your game...
Not necessarily , thats the beauty of emulators , otherwise I wouldnt be able to run commodore games I made 15yrs ago

I was influenced by the Ghetto you ruined.
I''m not sure if I got the idea...

For DOS text mode there were special functions in Turbo Pascal
to set a "window", in witch the text would be displayed.
Somethin'' like :
Window(X1, Y1, X2, Y2);

If you''re not coding in pascal, you might investigate what these functions realy do (in some tutorials or something) and port it to yout language. I think there were some 10h interrupt BIOS functions but I never used such procs.

For the text mode - it is best to set (50 lines) x (80 cols)...
Chars are smaller and more text fits on the screen.
At memory address b800:0000 there are 4000 bytes of data that make up what is displayed on the screen in text mode. Just write to them directly and you can make your own functions that write directly to the screen. I think this only works in normal 80x25 text mode. To write the letter A for example, to anywhere in the screen, you would do something like

text_ptr[y * 160 + x * 2] = ''A''

where text_ptr points to b800:0000

If you are using a 16-bit compiler, making a pointer like this is easy. If you are using a 32-bit one, it''ll be a bit tricky, but as long as you are in DOS and not in a Win32 console app, it is possible. If you want more info about it, I can give it to you, but at present I don''t remember it and I''d have to find where it was written and do a little experimentation first. Hope that helps!
Look up the functions window and _settextwindow if you are programming in C. They don''t wrap around as such but they limit text to stay in the window you define.

This topic is closed to new replies.

Advertisement