News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Drawing Desktop

Started by Bieb, June 21, 2005, 11:18:08 PM

Previous topic - Next topic

Mark Jones

Yet Another Small Suggestion: :toothy

Start a timer with the app, and don't allow mouse detection for say, 2 seconds. That way double-clicking on the file will work more often. :) Cool app though. :bg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Rifleman

Phil,
Probably a stupid question, but I don't recognize...

invoke  crt__kbhit

Paul

Phil

Paul: crt_kbhit is in the MASM32 msvcrt C runtime library. It returns true if any key has been pressed on the keyboard. There are many other useful C related functions such as printf defined there as well. I just noticed it as well because Michael had used it in his inital response on this thread. I hadn't known about it before either!

Everyone: Thanks for your feedback. I'll get back to the coding board and see if I can get your suggestion implimented. I especially liked the timer idea so you can click on the file to launch it. I've just been using the Dos console to test so far. I think I will use the WS_POPUP and continue to write to the desktop instead of a copy of the desktop. The way it works now allows it to run in the background and let your favorite screensaver know what a quake feels like when it kicks in!


Rifleman

Phil,
In order to assemble your program, I had to add...


include \masm32\include\msvcrt.inc
includelib  \masm32\lib\msvcrt.lib


Do I have an old version of masm32rt.inc?
Paul

Phil

#19
Paul,

  I haven't made any modifications to the masm32rt.inc that was included with the service pack that I retrieved from this board. It was SP2a at http://website.masmforum.com/masm32/v82sp2a.zip ... it's a manual installation so be sure to read the directions carefully. It all worked fine for me but I certainly took the time to read and re-read every page before I installed it. I had thought the crt_kbhit was also in SP2 but I'm probably mistaken about that. Thanks for letting me know you had problems. Perhaps, in subsequent edits I will remove the include masm32rt.inc and replace it with the individual includes that are required.

  I have made a few changes and re-assembled as a windows application. Instead of adding a timer I just ignore mouse move messages until the QuakeThread starts and I added a 100 ms sleep before stepping into the loop. I also used the WS_POPUP and that makes the startup look cleaner. In the process of testing keys to see if they stopped the application properly I discovered that the PrintScrn/SysRq key doesn't stop the app but does allow you to capture the screen image on the clipboard! I'll just call that an automatic feature of Windows XP and leave it at that! Now I can capture some of the interesting 'ink blots' and save them in a file using the Paint utility if I want.

Edit:
  I replaced the include masm32rt.inc with the indiviual includes in this version. That way, it should assemble for those that have not yet installed MASM32 SP2a. Also, tidied up a bit and added a comment or two.

 



[attachment deleted by admin]

brixton

I installed SP2a and I can't see any msvcrt references anywhere..  :'(
If you love somebody, set them free.
If they return, they were always yours. If they don't, they never were..

Phil

Quote from: sp2a install.txt------------
New Examples
------------
The EXAMPLE12 directory should be copied to the "examples" directory in MASM32.

Within the EXAMPL12 direct are the two following code examples.

With the MAKECIMP directory, run the batch file MAKELIB.BAT to build the include
file and library for MSVCRT.DLL. When this is done the two files should be copied
to their respective directories in the MASM32 installation as they are now
components of the masm32 project. MAKECIMP.EXE should be copied into the MASM32
directory.
Running MAKELIB which runs MAKECIMP on msvcrt.txt to create the .inc and .lib files. These two files should be copied to \masm32\include and \masm32\lib and makecimp.exe should be copied into the \masm32 directory. You just need to take your time with the installation, dot your i's and cross your t's!

brixton

Ah.. I never thought to look in the Example code, as I'd expected to see the lib in the m32lib folder, or similar.

Thankyou for the pointer!  :P
If you love somebody, set them free.
If they return, they were always yours. If they don't, they never were..

Phil

#23
I've replaced the include masm32rt.inc with the individual includes so folks don't have to have SP2a installed to assemble the source. Also went back and did the same thing for the most recent posting of Quake.zip. I think I've finally managed to get the 'spirit' of the original 1987 melt algorithm by Stephen Coy but I included the original C source in the archive just to be complete!

There are very few differences between Quake and Melt. Basically, just the algorithm that decides what to move around on the screen. I think I was fortunate to bump into the Quake view when my attempts to produce Melt developed a bug or two! It's no wonder I imagine seeing bugs in the 'ink blots' that develop as the display starts quaking!

This one is different. I slowed it down considerably so you can more or less see what is melting into what! Check it out if you like.


[attachment deleted by admin]

Rifleman

#24
Phil,
Actually, since you are no longer invoking crt__kbhit, none of that is necessary any longer.

BTW:  Quake is nice but I really like this latest version of Melt, a very kewl effect.  :thumbu

Paul

hutch--

Works great Phil, I have not seen one of these for years. Last time was on the exit of a game in a Microsoft Entertainment Pack for Windows 3.0.  :U
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

brixton

Quote from: hutch-- on June 28, 2005, 11:39:24 AM
Works great Phil, I have not seen one of these for years. Last time was on the exit of a game in a Microsoft Entertainment Pack for Windows 3.0.  :U

I still have all of those somewhere on original CD :green2
If you love somebody, set them free.
If they return, they were always yours. If they don't, they never were..

Mark Jones

Nice, Phil. :bg

Idea, maybe you could have it "wrap around" from bottom to top? :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Phil

Yes, Mark. That's sounds like it would be neat. Maybe as things start melting to the bottom of the display I could randomly seed the top few lines with the collapsing colors near the bottom. I'm going to let it rest for a while but I'll be sure to remember that when I pick it up again. Thanks for the suggestion. Feel free to play with the source if you'd like to see what you can come up with!



hutch--

Phil,

If you have a truly perverse sense of humour, have an image below the melt of the core of a processor. I noticed that you used a grey gradient fill behind the melt so it may not be hard to superimpose a processor core image onto it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php