why why why (mouse related question) 
Author Message
 why why why (mouse related question)

heheh...what a dramatic thread title...i've written a small progee just to play
around with the mouse, and when i debug it under ms-dos (im on win98), the
mouse pointer doesn't  obey the code...im trying to hide it using this code:

mov ax,02h
int 33h

but that only works when i change the video mode to 13h (256 color)..i haven't
tried it with other video modes

so basically when i dont have any code that deals with the video mode, just
code that initializes the mouse and then hides (hides the mouse, that is ;p ),
and when i run this under the lil window using debug it doesn't work...but if i
*do* have code that changes the video mode to 13h, the mouse gets hidden nicely

why why why?

why does this happen

thanks

--You've been here too long. Get this stuff right.



Mon, 06 Dec 2004 15:23:14 GMT  
 why why why (mouse related question)

Quote:

> heheh...what a dramatic thread title...i've written a small progee
just to play
> around with the mouse, and when i debug it under ms-dos (im on
win98), the
> mouse pointer doesn't  obey the code...im trying to hide it using
this code:

> mov ax,02h
> int 33h

> but that only works when i change the video mode to 13h (256
color)..i haven't
> tried it with other video modes

Well, when you have time, do try with other video modes because it
might reveal a pattern that explains what's going on...

Now, just to check, you're not trying to hide the Windows cursor with
a DOS function, are you? That won't work because, though they may
_look_ the same (or roughly the same :) on screen, the Windows cursor
is NOT the same cursor as you see under DOS in full screen mode (for
instance, you may have noticed that the DOS mouse cursor is just a
change in colour of a single character for text modes because, in a
text mode, it can't draw fancy graphics :)...

Perhaps what I think is going on isn't going on but one explanation
that fits what you're saying is that, basically, you've got the DOS
"hide cursor" code and are expecting the Windows cursor to
disappear...and then, when you switch to video mode 13h, DOS goes from
a window to full screen and the _DOS_ cursor does, indeed, disappear
(and when DOS is full screen, the Windows cursor disappears quite
naturally :)...

Also, of course, you must remember that DOS under Windows (even Win9x)
is a large part emulation...it traps interrupts and fields them
through to Windows...though normally very good, not everything that
would work under DOS, works 100% under a DOS box in Windows...so,
another possibility is that you've just unearthed one of the many
"compatibility" problems that exist...which is more than likely under
Windows because, to avoid there being two cursors on the screen, it
has built-in support to pass what the Windows cursor is doing through
to the DOS drivers...so that you can click on menus in a DOS program
in the DOS box using the Windows cursor and it all seems to work
okay...because it behaves ever-so-slightly differently to provide this
support, it's likely that one or two things that would work just fine
under "pure" DOS fail under a Windows DOS box to do with the mouse
cursor...

And, similarly, de{*filter*}s do sometimes much a subtle difference to the
operating environment of a program and actually effect what they're
debugging...obviously, most de{*filter*}s go out of their way never to do
this...but it's a tall order to do it perfectly and, in small subtle
ways, you find code suddenly behaving differently under a de{*filter*}
than if run by itself...the best indication of whether this is the
case is when a program does something utterly different when run under
a de{*filter*} that it doesn't do when you run it normally...

But, from your description, I'm putting my money on it being that
you're trying to make the Windows cursor disappear with a DOS
function...which doesn't work because they are completely different
cursors that just happen to be sharing the same input device (the
mouse :)...under XP, the distinction is a little more obvious because
the Windows cursor has a little shadow underneath it, which only shows
up with the Windows cursor (transparency is asking too much of the MS
DOS mouse driver ;)...although, under something like Win98, it's
forgivable to get confused because they basically use the exact same
bitmap for the standard Windows cursor as they once did for the DOS
mouse cursor (excepting that it changes scale according to the video
mode...so that the mode 13h mouse cursor is stupidly big and
chunky-looking :)...

Quote:
> so basically when i dont have any code that deals with the video
mode, just
> code that initializes the mouse and then hides (hides the mouse,
that is ;p ),
> and when i run this under the lil window using debug it doesn't
work...but if i
> *do* have code that changes the video mode to 13h, the mouse gets

hidden nicely

Yup; It's the "under the lil window" that's making me think what I'm
thinking...and, let me guess, when you change to mode 13h, Windows is
automatically forcing it into full screen? If so, try this little
test, press ALT + ENTER to force it back into a window and, lo and
behold, there is that (Windows) mouse cursor still on the screen,
refusing to hide?

If this is all sounding a little too familiar then I think I've worked
out "why why why?"...you're trying to make one cursor disappear with
the API of another cursor...the DOS and Windows cursors, despite
appearance, aren't in any way related (except that they both use the
same input device)...to make the Windows cursor disappear, you use the
Win32 API: "ShowCursor(FALSE);" (which you can only do from a Win32
program and not from DOS)...

Quote:
> why why why?

> why does this happen

If it's what I think it is, it's happening because that's what's
supposed to happen...you are making the _DOS_ cursor disappear (and
when you go full screen so that only the DOS cursor will be displayed,
it correctly isn't there :)...this, though, has absolutely no effect
on the Windows cursor, which is a separate thing (even though it
_looks_ identical and Windows goes through a lot of bother to make it
work with a DOS box so that it "seems" to be one and the same, it's
not the same cursor at all..though if you're not aware of this, it's
easy to confuse the two because the way they look and work makes them
seem like one and the same thing...they aren't and it's just Windows
trying to make them _appear_ to be the same so that users aren't
confused by having multiple mouse pointers in different places on the
screen...instead, they confuse poor little programmers instead when
the cursors don't do what we think they should do...hehehe ;)...

Under DOS, there's no (official) way to be able to switch off the
Windows mouse cursor...only Windows programs can do that...but, if you
go "full screen" so that DOS is now back in control of what appears on
the screen, then it should work as expected...

Actually, another give away here is that, using INT 33h, the mouse
cursor is not shown upon initialisation, anyway...so that you
shouldn't really need to hide the mouse cursor after initialising it
unless you've called the "show cursor" interrupt first...so, if you
are seeing a mouse cursor and all you've done is initialise it, then
you're looking at the Windows cursor and not the DOS one because the
DOS cursor (under INT 33h) _only_ appears when it's told to appear and
is hidden by default after being initialised...as another test that
I've got your problem right, try _only_ "mov ax,0;int 33h" and force
the DOS box into full screen (either ALT + ENTER or change the video
mode to 13h, which usually forces it full screen * :)...the mouse
cursor shouldn't be visible and requires a "mov ax,1; int 33h;" to
make it appear in a puff of smoke (okay, so there isn't any puff of
smoke and I made that part up...although if David Copperfield had
written Windows, you never know...he might have put in the puff of
smoke to add a bit of showmanship to it all...actually, that would be
quite a cool way to make the Windows cursor disappear in an animated
puff of smoke, she thinks mischieviously ;)...

Beth :)

--
* Even though, under Win98, it can display mode 13h in a DOS
box...but, generally, mode 13h is for games, which require fast
display and passing the graphics through Windows for it to display in
a DOS box is terribly slow (because it's all done with traps and page
faults and changing processor modes and everything...not the fastest
way to get things done ;)...so, though technically it can display DOOM
in a DOS box, Windows is actually quite sensible and forces it full
screen when mode 13h is selected because most programs that want that
mode also want fast graphics...although, you can have a good laugh by
trying to run a DOS program with complex 3D graphics (like Quake or
something) in mode 13h under a DOS box and watch how stupidly slow it
all is ;)



Mon, 06 Dec 2004 17:36:03 GMT  
 why why why (mouse related question)
ok cool...many thanks...that was the problem..trying to hide the windows cursor
with code for the dos cursor...

thanks ;p

--You've been here too long. Get this stuff right.



Tue, 07 Dec 2004 03:00:04 GMT  
 why why why (mouse related question)

Quote:

> ok cool...many thanks...that was the problem..trying to hide the
windows cursor
> with code for the dos cursor...

> thanks ;p

You're welcome...and, actually, that's cool too because, as you might
have guessed from me going "maybe", "probably", "I think it's doing
that" all the way through the post (plus offering two other
possibilities just in case I got it wrong ;), I was making a complete
stab in the dark at what your problem was...so it's quite cool that I
actually guessed correctly...

Beth :)



Tue, 07 Dec 2004 06:47:30 GMT  
 why why why (mouse related question)

Quote:

>You're welcome...and, actually, that's cool too because, as you might
>have guessed from me going "maybe", "probably", "I think it's doing
>that" all the way through the post (plus offering two other
>possibilities just in case I got it wrong ;), I was making a complete
>stab in the dark at what your problem was...so it's quite cool that I
>actually guessed correctly...

>Beth :)

yep yep ;p now see if u can help me with my psp troubles (see the other thread
i've made)...thanks!

--You've been here too long. Get this stuff right.



Tue, 07 Dec 2004 08:29:39 GMT  
 why why why (mouse related question)

Quote:

> yep yep ;p now see if u can help me with my psp troubles (see the
other thread
> i've made)...thanks!

Charming; Tries to butter me up on the one hand with thanks...and, on
the other hand, tries to shut me up...but, yes, I'll go have a
look...though I've not dealt with PSPs for a while so I don't know how
much use I could be...

Beth :)



Tue, 07 Dec 2004 10:07:26 GMT  
 why why why (mouse related question)

Quote:
>Charming; Tries to butter me up on the one hand with thanks...and, on
>the other hand, tries to shut me up...but, yes, I'll go have a
>look...though I've not dealt with PSPs for a while so I don't know how
>much use I could be...

>Beth :)

lol..i swear to god i didn't do that on purpose, sorry if it came off that way,
i love u and u know it buahahahaha ;p

j/k

--You've been here too long. Get this stuff right.



Tue, 07 Dec 2004 10:41:23 GMT  
 why why why (mouse related question)

Quote:

> >Charming; Tries to butter me up on the one hand with thanks...and,
on
> >the other hand, tries to shut me up...but, yes, I'll go have a
> >look...though I've not dealt with PSPs for a while so I don't know
how
> >much use I could be...

> lol..i swear to god i didn't do that on purpose, sorry if it came
off that way,
> i love u and u know it buahahahaha ;p

> j/k

hehehe...and you should know by now that I can never resist pulling
someone's leg...I'm not in any way distressed or upset...to be honest,
I do go on at times so even you had just said "Oh! Shut up, Beth!"
then I'd have trouble disagreeing and defending my actions...because,
it's true, I do go on and on and on...hehehe :)

Anyway, I've had a look at your PSP program and I think I've spotted
the problem...well, at least, I ran your program on my machine, got
the same wrong results, tweaked with it and now it works...so, I'd
hazard a guess that we're both looking at the same "bug" (which is
MS's fault, btw...your program is okay because I followed it all
through in Turbo De{*filter*} and it works fine...plus, my solution also
proves it's DOS's fault because you only make the most minor of
changes to the program and, suddenly, it's working :) and, therefore,
in solving it on my machine, I've solved it on yours...but I've been a
programmer too long to make the mistake of assuming that just because
I've got the same bad results as you that I "must" be looking at the
same bug as you...

The first rule of debugging: Assume _nothing_ and _prove_
everything...as your problem shows, you can't even assume something as
simple as that DOS will print every valid string it is
given...because, apparently, it doesn't...always remember what
Sherlock Holmes said (paraphrased): "Eliminate all the impossibilities
and whatever is left behind - however unlikely or unbelievable - must
be the truth" ;)

Beth :)



Tue, 07 Dec 2004 21:56:38 GMT  
 why why why (mouse related question)
Quote:

> Anyway, I've had a look at your PSP program and I think I've spotted
> the problem...well, at least, I ran your program on my machine, got
> the same wrong results, tweaked with it and now it works...so, I'd
> hazard a guess that we're both looking at the same "bug" (which is
> MS's fault, btw...your program is okay because I followed it all

[ snip ]

Ignore this bit of the post...I'd got the wrong end of the stick about
what the problem was...in fact, there's absolutely nothing wrong with
either DOS or your program...they are both working as they
should...the problem you're getting (as Johannes rightly points out :)
is that the command line finishes with a CR but not a LF...so, it
returns back to the start of the line and then proceeds to overwrite
the first part of the string with zero bytes...which leaves you seeing
nothing useful on the screen (but it actually did work...what you need
to do is re-think what you're asking the program to do :)...I
overlooked the fact that there's a CR in the string you want to print
and what effect it would have on the output to the screen...oops!
hehehe :)

Beth :)



Tue, 07 Dec 2004 22:11:03 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. why why why oh why why baby

2. Why, Why Why????

3. Why, oh why?

4. Enterprise Edition - Why/Why not???

5. Why (or why not) one module per file?

6. Why o why

7. Why TCL? Why Scripting

8. why TCL and why not TCL with JAVA

9. Why Python is like BASIC (and why this is a good thing)

10. The Smalltalk Store: Why we've been slow, and why we're getting better

11. Why is mouse handling so expensive?

12. why 3 button mice

 

 
Powered by phpBB® Forum Software