Announcement

Collapse
No announcement yet.

Remember the DOS graphics modes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remember the DOS graphics modes?

    Hello,

    I am looking for a way to use PB to write a program that will run
    under DOS 6.22 for some old equipment that we inherited. Some of these
    computers have Win95 on them; and "Yes, I'd like to be able to put
    new (read Win98 or XP) equipment in, but I just can't make that
    solution fly."

    Specifically, I need to be able to use graphics (PSET, CIRCLE, LINE,
    etc.) to draw a display.

    I have PB Windows v7.0., and would consider purchasing other
    products to do this with.

    Any Suggestions?

    Sincerely,

    Ken




    ------------------
    Ken S. Elvehjem
    [email protected]

  • #2
    Screen 12 will get you 80x25 graphics.

    Other screen modes are in the book.

    ------------------


    [This message has been edited by Mel Bishop (edited October 14, 2002).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      Depending on what you are trying to do, you may find someone has already done it for you years ago.

      You'll probably have to dig around on the web a bit to find old graphics routines; here's a good place to start:
      http://www.basicguru.com/links/powerbasic.html

      ------------------

      Comment


      • #4
        Ken,
        I'm not sure why Lance hasn't jumped in with a reply to get a sale.. but PB3.5 (PB/DOS) probably does exactly what you want. I use it in DOS6.2, Win3.1, Win95, Win98 to do simple (very simple!) graphics such as plotting points and drawing lines.

        Download the trial version of PB/DOS from this site (I think it's called trypb32.zip) and see if it does what you want before buying the latest version.

        PB Windows v7.0 will never run under DOS, but PB/DOS programs will run fine under DOS and Windows.

        Paul.




        ------------------

        Comment


        • #5
          Ken --

          If only some of the computers will have Windows 95 on them, it seems like your only solution would be a DOS programming language like PB/DOS. None of the PowerBASIC For Windows compilers (PB/Win, PB/DLL, and PB/CC) can produce executables that will run on a DOS system. They all require Windows 95 or above.

          If you can install Windows on all of the computers then either PB/Win or PB/CC can produce programs that will work for you. But neither of those languages include built-in graphics functions.

          You could use the Windows API to perform your drawing operations, but that would require a relatively advanced level of programming skill. It would be especially difficult with the PB/CC compiler. For some simple graphics code for the PB/Win compiler, check out the Source Code forum of this BBS. Or...

          My company's Graphics Tools package was designed to make graphics much easier to produce in PB/Win and PB/CC programs. For a PB/Win program, all you would need would be Graphics Tools. For a PB/CC program you would need both Graphics Tools and Console Tools.

          For more information, click on one of the links below.

          -- Eric Pearson, Perfect Sync Software




          ------------------
          Perfect Sync Development Tools
          Perfect Sync Web Site
          Contact Us: mailto:[email protected][email protected]om</A>
          "Not my circus, not my monkeys."

          Comment


          • #6
            Originally posted by Paul Dixon:
            I'm not sure why Lance hasn't jumped in with a reply to get a sale.. but PB3.5 (PB/DOS) probably does exactly what you want.
            heh. I'm not here 24 hrs a day guys, although it might sometimes seem like it!

            However, you (and Eric) are dead right with your suggestions... PB/DOS would be the best solution here. There is a TON of code for PB/DOS available (take a wander through the FILES section at http://www.powerbasic.com/files/pub/ and other sites such as www.allbasiccode.com



            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment


            • #7
              My thanks to the folks who responded.

              I did download the tryPB32 package, and ran some test code through
              it.

              Did I understand Eric correctly about the PBCC? That is, if I use the
              PBCC product along with the graphics tools package from Perfect Sync,
              do I get the same end results with grapics capabilities as the
              PB32 DOS product? (goal here is to use the PB IDE to edit my code --
              nothing against the PB32 IDE, but I am used to the Windows one )

              Ken

              ------------------
              Ken S. Elvehjem
              [email protected]

              Comment


              • #8
                PB/CC's IDE and the PB/CC compiler are both Windows applications... so you'll need at least Windows 95 in order to use them, [b]AND]/b] to run the app's you create with PB/CC. If you want to work in plain DOS, you'll need to use a DOS compiler such as PB/DOS or FirstBasic.

                You can create a GUI window that contains graphics with just PB/CC (create a GUI window and a callback function, and draw in it with Windows GDI graphics functions in response to %WM_PAINT messages) - see COOL.BAS and KOOL.BAS that ship with PB/CC for examples of this kind of code.

                Graphics Tools simplifies this kind of code dramatically by taking care of a lot of the low-level GDI (Windows Graphics) functions for you, and providing you with a rich set of functions to draw your graphics with (and no worries about refreshing/redrawing your screen if the window needs updating).

                However, I don't believe you can do full-screen graphics that way unless you really get involved with the Windows API functions (or maybe resort to using more complex libraries, such as the OpenGL library).

                Conversely, full-screen graphics in PB/DOS is dead-easy... use SCREEN 12 to get 640 by 640 VGA, etc, and start drawing with the LINE statement, etc.

                DOS graphics is MUCH simpler than Windows graphics, no doubt about it.

                From the PB/DOS 3.5 help file on the SCREEN statement:
                SCREEN statement
                ================
                Purpose: Sets the screen display mode.

                Syntax: SCREEN [mode] [,[colorflag]] [,[apage]] [,[vpage]]

                'mode' is an integer expression from 0 to 12 describing the screen mode:
                0 = text mode, 1 = medium resolution 320x200 CGA, 2 = high resolution
                640x200 CGA, 3 = no longer supported, 7 = medium resolution 320x200 EGA,
                8 = high resolution 640x200 EGA, 9 = enhanced high resolution 640x350
                EGA, 10 = high resolution 640x350 monochrome EGA, 11 = high resolution
                640x480 monochrome VGA or MCGA, 12 = high resolution 640x480 color VGA.
                'colorflag' controls whether color information will be passed to
                composite monitors that are connected to the composite video port of a
                CGA card. In text mode, a logical FALSE (zero) value turns off color.
                In medium resolution graphics mode, a FALSE value turns on color.
                'apage' is an integer expression from 0 to 7 that controls which text
                page is written to when PRINT and other output statements are executed.
                'vpage' selects which of the possible screens (0..7) is actually
                displayed.
                ------------------
                Lance
                PowerBASIC Support
                mailto:[email protected][email protected]</A>
                Lance
                mailto:[email protected]

                Comment


                • #9
                  Ken --

                  > if I use the PBCC product along with the
                  > graphics tools package from Perfect Sync,
                  > do I get the same end results with grapics
                  > capabilities as the PB32 DOS product?

                  No, not exactly. You can produce virutally identical images, but there are a number of differences "on the way there".

                  First, Graphics Tools does not provide function-for-function replacements for the PB/DOS graphics commands that you are used to using. Instead of LINE you would use a function called DrawLine, or a combination of functions called DrawFrom and DrawTo. Instead of CIRCLE you would use DrawCircle, DrawEllipse, DrawEllipseRotated, DrawPie, DrawArc, DrawChord, DrawWedge, and so on. Well over 100 different drawing functions are provided by Graphics Tools, and I am not aware of any PB/DOS drawing functions that are not (in some way) emulated.

                  The use of GET and PUT for graphics (using arrays) is not directly supported by Graphics Tools. However, you can copy rectangular image-portions from one drawing window to another. A common technique is to use a hidden drawing window as a source for GET/PUT-like operations. You end up with the same ability as DOS -- to save/restore/copy/move/etc. portions of images -- but it is done in a different way.

                  Also, you should note that when you use a DOS graphics mode you are provided with screens with pre-defined resolutions. For example, SCREEN 2 provides 640x200 pixels. With the combination of PB/CC, Console Tools, and Graphics Tools, you can create a graphics window that "overlays" the Windows console window, no matter how big it is. The number of pixels that the graphics window contains will depend on 1) the size of the console window (which is dependent on other factors), 2) the current Windows desktop resolution, and 3) the number of console rows/columns that you choose to use for graphics.

                  All that being said, your programs do NOT have to worry about the size of the image when performing drawing operations. Graphics Tools uses an internal "scaling" system, so you simply tell it "pretend that the graphics window has 640x200 pixels" -- or any other scale that you choose -- and Graphics Tools will scale your drawing operations to fit the current actual size of the drawing window. You can use any integer-based coordinate system you like.

                  It should also be noted that Graphics Tools cannot operate in the "fullscreen console" mode -- aka the Alt-Enter mode -- which provides a text-based screen that looks like DOS. Windows does not allow non-DOS programs to use that mode. So Graphics Tools can operate only in the "window mode" where the console window has a caption bar, a window border, and so on. It is possible to use Console Tools to create a console window with a size/location that fills the entire screen and thereby simulate a fullscreen console, but it's not quite the same thing as a true fullscreen console window. (This does not require the use of API functions. Console Tools handles all of the messy details for you.)

                  Off the top of my head, I think that covers the primary differences between DOS graphics and Windows graphics that you are likely to encounter. All in all, Windows graphics provide a much richer and more sophisticated drawing environment than DOS.

                  If you have any other questions, just ask!

                  -- Eric Pearson, Perfect Sync Software

                  P.S. I see that Lance responded while I was composing this. It should be noted that COOL.BAS creates a graphics window that is not "connected" to the console, which creates (among other things) problems with mouse and keyboard events. For example, if the user clicks the graphics window the focus will be taken from the console, so INKEY$ will no longer work. Console Tools actually connects the graphics window to the console window, so they act as a single unit when it comes to keyboard and mouse events.

                  P.P.S It is important to note that in order to use Graphics Tools with the PB/CC Console Compiler, you must also use Console Tools. Console Tools provides the all-important link between the Graphics Tools graphics window and the console window.

                  ------------------
                  Perfect Sync Development Tools
                  Perfect Sync Web Site
                  Contact Us: mailto:[email protected][email protected]</A>



                  [This message has been edited by Eric Pearson (edited October 16, 2002).]
                  "Not my circus, not my monkeys."

                  Comment


                  • #10
                    Well, thanks once again for the responses.

                    It looks like my best bet for the machines that are still running
                    DOS 6.22 is the PB version in the TryPB32 package -- that way everyone
                    can have the same software version, at least.

                    Sincerely,

                    Ken S. Elvehjem

                    ------------------
                    Ken S. Elvehjem
                    [email protected]

                    Comment


                    • #11
                      I have one final point, based on your last comment, Ken:

                      The trial edition of PB/DOS 3.2 is licensed for evaluating purposes only - you may not distribute applications created with the trial edition.

                      Therefore, once you proceed beyond trialing the compiler, you will need to obtain an appropriate license which allows you to write applications that can be distributed. This is as simple as purchasing PB/DOS, and you can do so at https://www.powerbasic.com/shop

                      BTW, the current version of PB/DOS is v3.5, and it offers a fair number of advanced features that 3.2 did not contain (for example, VIRTUAL arrays in EMS memory of up to 32Mb each!), but there is one minor difference in the graphics functionality: v3.5 no longer supports the hercules/mono graphics mode (SCREEN 3).


                      ------------------
                      Lance
                      PowerBASIC Support
                      mailto:[email protected][email protected]</A>
                      Lance
                      mailto:[email protected]

                      Comment

                      Working...
                      X