473,804 Members | 3,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Screen control functions

Hi,

This is my first message on this group. I want to ask something about
screen-drawing functions. I wrote and compiled below code succesfully
on TC IDE in Win-xp. Then i tried to work it on dos but it didn't work.
It runs but doesn't draw anything on screen. Could you say my fault? I
know far,dev and near are a bit problematic in xp but i think compiling
with Tc and running in dos might run it? [I didn't try it on linux yet]

Thanks for everything...

#include <stdio.h>
#include <conio.h>

char far *vp=(char far *)0xB0000000;
void _write(int row,int col,int ch)
{
char far *scrp=vp;
scrp+=row*160+c ol*2;
*scrp=ch;
}

int main()
{
_write(10,10,'t ');
_write(10,11,'e ');
_write(10,12,'s ');
_write(10,13,'t ');
return 0;
}

Sep 3 '06
25 4264
jacob navia wrote:
Flash Gordon wrote:
>jacob navia wrote:

<snip>
>>Contrary to what *many* people think, MSDOS is dead since more than 10
years, I do not remember exactly when was it, maybe 1995.


Incorrect. Windows95, Windows98 and even WindowsME actually had DOS
7.x underneath and in all of them (although with ME it was difficult)
you could get them to boot to a DOS prompt without loading Windows at
all.

True, but not under windows xp, the system the OP said he
was using.
Therefore what you said was false. DOS has *not* been dead for more than
10 years. If you are talking about XP specifically, that is under 10
years old so you were *still* wrong.
>In addition, you still get some stuff distributed as bootable DOS disk
images. Such as BIOS upgrades. Since this has been the case on some
new machines even after the year 2000 there are obviously still some
programs being run under DOS.

True. I used one yesterday from MAXTOR. It boots
MSDOS (Digital Research) and tests your MAXTOR hard drive.
If it is the Digital Research version then it is DRDOS *not* MSDOS.
There are other versions of DOS as well. However, this agrees with what
I said that you were *wrong* to claim that DOS is dead.

<snip>
>>The MSDOS emulation will NOT emulate the writing to screen memory,
as it seems.

Definitely not entirely true. I've run old DOS based games that did
graphics and sound using their own built in drivers under XP. It might
not really access the screen, but XP traps the attempt (when used in
the correct way) and renders the expected result inside the
applications window.

Yes, you can change the emulator behavior with the "shortcut properties"
if I remember correctly, and maybe it emulates that hacks too.
So you were wrong here as well. This is why you should direct posters to
the *correct* group. It is pure chance that a couple of us happen to
know a little more about this that you do. Enough to point out that you
were almost completely wrong and definitely completely wrong about the
points that affect the OP.
>For further discussion on this please go to a Windows group where they
will know all about the compatibility modes of XP.

AHHHH

Nostalgia is not what it used to be ...

:-)
So don't post advice about things you have forgotten (if you ever knew
them). Instead redirect people to appropriate groups where they will
find the *real* experts on the topic when it is not topical here.
--
Flash Gordon
Sep 3 '06 #21
Flash Gordon wrote:
jacob navia wrote:
>Flash Gordon wrote:
>>jacob navia wrote:

<snip>

Contrary to what *many* people think, MSDOS is dead since more than 10
years, I do not remember exactly when was it, maybe 1995.

Incorrect. Windows95, Windows98 and even WindowsME actually had DOS
7.x underneath and in all of them (although with ME it was difficult)
you could get them to boot to a DOS prompt without loading Windows at
all.


True, but not under windows xp, the system the OP said he
was using.


Therefore what you said was false. DOS has *not* been dead for more than
10 years. If you are talking about XP specifically, that is under 10
years old so you were *still* wrong.

MSDOS was dead when windows 95 came out.
Microsoft has discontinued support for it YEARS ago.
Yes, in some embedded systems it goes on, just as the
VAX is somehwere maybe still running, and I do not know if
you know this, but I can run even a PDP11 in emulation
now.

But (I hope) you will agree with me that MSDOS is quite dead since quite
a few years!!!
>>In addition, you still get some stuff distributed as bootable DOS
disk images. Such as BIOS upgrades. Since this has been the case on
some new machines even after the year 2000 there are obviously still
some programs being run under DOS.


True. I used one yesterday from MAXTOR. It boots
MSDOS (Digital Research) and tests your MAXTOR hard drive.


If it is the Digital Research version then it is DRDOS *not* MSDOS.
There are other versions of DOS as well. However, this agrees with what
I said that you were *wrong* to claim that DOS is dead.
Digital Research still distributes that stuff, and it is still used.
Besides, the PDP 11 emulator is still running, and I can emulate
an Apple ][ in the Mac. Software never dies.

But in *some* sense, the PDP 11 *is dead* !!!

<snip>
>>>The MSDOS emulation will NOT emulate the writing to screen memory,
as it seems.
Definitely not entirely true. I've run old DOS based games that did
graphics and sound using their own built in drivers under XP. It
might not really access the screen, but XP traps the attempt (when
used in the correct way) and renders the expected result inside the
application s window.


Yes, you can change the emulator behavior with the "shortcut properties"
if I remember correctly, and maybe it emulates that hacks too.


So you were wrong here as well. This is why you should direct posters to
the *correct* group. It is pure chance that a couple of us happen to
know a little more about this that you do. Enough to point out that you
were almost completely wrong and definitely completely wrong about the
points that affect the OP.
>>For further discussion on this please go to a Windows group where
they will know all about the compatibility modes of XP.


AHHHH

Nostalgia is not what it used to be ...

:-)


So don't post advice about things you have forgotten (if you ever knew
them). Instead redirect people to appropriate groups where they will
find the *real* experts on the topic when it is not topical here.

The advice I gave the OP was to get a more up-to-date system and
environment. In my first answer said
Get a better compiler
That stills tands and it is not wrong.

Sep 3 '06 #22
jacob navia <ja***@jacob.re mcomp.frwrites:
[...]
MSDOS was dead when windows 95 came out.
Microsoft has discontinued support for it YEARS ago.
[...]
Yes, in some embedded systems it goes on, just as the
VAX is somehwere maybe still running, and I do not know if
you know this, but I can run even a PDP11 in emulation
now.

But (I hope) you will agree with me that MSDOS is quite dead since
quite a few years!!!
I will neither agree nor disagree, because I do not care. The
question has nothing to do with the C programming language, and is
therefore off topic in this newsgroup.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Sep 4 '06 #23
Thanks "Bill". I got it.
jacob navia wrote:
William J. Leary Jr. wrote:
"OziRus" <ca************ @gmail.comwrote in message
news:11******** *************@h 48g2000cwc.goog legroups.com...

This might better be asked in comp.os.msdos.p rogrammer or a windows group.

But...

>I know far,dev and near are a bit problematic in xp but i think
compiling with Tc and running in dos might run it?

It should work under a Command Line session (often called a "DOS session")
under XP.

But...

>char far *vp=(char far *)0xB0000000;

B0000000 is the Monochrome Display Adapter (MDA) base address.

Some color adapters will emulate the MDA, but most won't. Of the those I've
used, only one (see below).

If you're runing this under Windows, it's going to think it's got a color
adapter of some kind*, so you need B8000000.

I've just compiled your program, as a real mode DOS .EXE, and run it under
MS-DOS 5.0, Windows ME and Windows XP. With B0000000 it only works on the
MS-DOS machine. This one explicitly emulates MDA (as per comment above). If I
use B8000000 it works as expected under all three.

- Bill
____________
* Your display adapter probably has to emulate the Color Graphics Adapter (CGA)
for this to work. The majority of adapters do or, at least, did last time I
shopped around (about six months back).

Bill (Your second names isn't Gates I presume ? :-)

You are a TRUE MSDOS HACKER (tm)

This is actually the reason!!!!

Congratulations Bill.

jacob
Sep 4 '06 #24
Keith Thompson wrote:
jacob navia <ja***@jacob.re mcomp.frwrites:
<snip>
I will neither agree nor disagree, because I do not care. The
question has nothing to do with the C programming language, and is
therefore off topic in this newsgroup.
I do care and I know, but I agree this is the wrong place for it. I've
taken it to email.
--
Flash Gordon
Sep 4 '06 #25
jacob navia wrote:
>
OziRus wrote:
[...]
char far *vp=(char far *)0xB0000000;
[...]
You have to run under MSDOS, not windows XP.

Contrary to what *many* people think, MSDOS is dead since more than 10
years, I do not remember exactly when was it, maybe 1995.
And, contrary to that, Windows 95, 98, and Me all run on top of MS-DOS,
despite what Microsoft would have liked you to believe.
Contrary to what many people think, the "DOS WINDOW" is just
an EMULATION of text mode msdos, with the same commands,
etc.

The MSDOS emulation will NOT emulate the writing to screen memory,
as it seems.
Yes it does, _if_ you are running a 16-bit MS-DOS program.

<drift mode="even further OT">

In a console window, type "debug". Then, at the debugger's "-" prompt,
type "f b800:0 l400 41 04". (Note that "l400" is "el four zero zero",
and "41" is "four one".) The first 6-1/2 lines will fill with red "A"s.
(Character 0x41, attribute 0x04.)

Also, note that the address is "b800:0000" , not "b000:0000" as the
code from the OP used. If the compiler is generating 16-bit real-mode
executables, then changing to 0xb8000000 may "fix" the problem.

</drift>

[...]

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Sep 5 '06 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
105845
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method: System.out.print((char)27 + "[2J");
8
1633
by: Kris Dugan | last post by:
I am using a Unix/Solaris 8/9 environment. I want to make a tool that will constantly read a structure of information and display that information (or "paint it") to the screen. Rather than having the information scroll by, I want a way in which the screen would be "repainted". Sample Screen: ------------------------------------------------- | foo: 6 bar: 12 | | this: 18 that: 20 |
4
4536
by: Curious Student | last post by:
I was looking at methods of clearing the screen. I remember using clrscr() in C on a Unix machine when I was at the institute learning software development. I tried using it on MS VC++ 6.0. It didn't work. I looked up the documentation. The documentation said this is a non-standard function and is included in conio.h. I had included conio.h already, and yet it couldn't link. I guess clrscr is a unix thing then? I also found this code in...
2
4579
by: Dan Sikorsky | last post by:
How do you get the x,y pixel location of a textbox so that you can position the Web Date Control popup nearby the associated textbox that will contain the date selected by the Web Date Control? -- Thank you kindly, Dan Sikorsky BAB, BScE, MSC
3
5418
by: steve | last post by:
Hi All I have textboxes within a TableLayoutpanel and I want to be able to position an independant control adjacent to a selected textbox This independent control allows selection of text to insert into the textbox I am having trouble achieving this, see code below, the x position is too far to the right and the y position is close to the bottom of the textbox and I want it to be side by side.
2
6626
by: dumbledad | last post by:
Hi All, I'm using ASP.Net web services to provide the logic required for a Flash based prototype. The Flash and the ASP .Net run together on the client machine. One of the functions I'd like to offer is public void StoreLogEntry(string tag, string description, bool screenshotRequired)
3
1433
by: peter | last post by:
I've been wrestling on and off with this problem for over a year now, without success. Basically, I am looking for a simple set of screen and keyboard manipulation commands that will run identically under Linux and Windows. Nothing fancy - just clear the screen, print a string at an arbitrary xy position and detect a keystroke. I've googled around this newsgroup and elsewhere, and come across various suggestions (and even posted my own...
5
1243
by: pilsdumps | last post by:
I have a parent and child class: parent: #!/usr/local/bin/perl -w #class clFormMaker package clFormMaker; sub new { #constructor
4
6979
by: mike | last post by:
I have the opportunity to rescue a project that uses a mouse to sense the relative position of a machine. The hardware is built...just needs to be programmed. Stop snickering!!! I didn't do it...I just gotta fix it. I need to make some calculations on the measurements and VB6 is my language. Yes, the system mouse will corrupt the measurement, but it's an auditing function and that's acceptable.
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.