Solved

Pascal question

Posted on 1997-06-11
13
289 Views
Last Modified: 2010-04-16
Does anyone have any leads on automated or semi-automated tools that can convert High-res Turbo Pascal grapics routines to Windows (preferabaly C++) graphics routines?

The current routines use high resolution EGA graphics that only run in full-screen under Windows.  To clarify what the graphics routines are, they do use BGI as a basis, with overlayed routines.

They need to co-exist and operate with other windows programs.  I need to convert these to something that acts like a native Windows (NT) program. Of course the current version can be viewed in a window, but only with the program frozen.

I have applications that I need to port, but would like to avoid complete re-writes.

Additional Info:

This is not a game, and to a certain extent, speed on any platform is not of the essence, as the application will be running under NT 4.0 with a Dual 200 MHz Pentium Pro PC and 128 Meg of RAM (though a great deal is already used for system control).  The graphics mode is 640x350 (some newer graphics cards do not like this mode).  About 70% of the screen is a window with rendered CAD graphics.  A smaller window using half of the remaining space represents a variable zoomed area of the larger graphic region.

Our graphics mode is 1280x1024 on a 21" monitor. This application must coexist (both viewable at the same time) with a window that is nominally 550x600 pixels.
0
Comment
Question by:jgarvin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:slp
ID: 1215345
When you say "High-Res TP Graphics routines"; are we talking about BGI? Or some other grahics library (or something else entirely?).
0
 

Author Comment

by:jgarvin
ID: 1215346
Edited text of question
0
 
LVL 1

Expert Comment

by:slp
ID: 1215347
I can't say I'm totally familiar with BGI, but from what I recall most of the calls map pretty much one-to-one with Windows GDI calls; so writing a wrapper unit that your code would call that would, in turn, call GDI would be one possibility; if you're not doing anything too fancy.   I'd be willing to give a hand on creating such a unit if you like.

I also seem to recall from a few years back a commecially available library that was a BGI interface to GDI. This might still be available, though I don't recall seeing it advertized recently.  I can try to track down info on that if that sounds like a solution for you.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:jgarvin
ID: 1215348
The answer at this time is not quite precise enough as to my options. The response skirts the issue a bit, though I greatly appreciate the offer of additional help.  Let me review and ponder the response before I close the question.

Sorry, I have to rate it "poor" for now or it gets closed automatically.
0
 
LVL 1

Expert Comment

by:slp
ID: 1215349
Forgive me for being a bit miffed, but what were you expecting? A response like: All you have to do is call "Foo;" at the beginning of your original code and everything will transport cleanly from DOS Real-mode direct screen graphics into Windows Protected-mode Windowed graphics?  Sorry, ain't no such critter.  

I offered to find information on a commercial solution and to provide assistance with rolling your own, 200 points is a lot, but not enough to warrant my just freely posting what amounts to at least several hours work on an interface library.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1215350
Holy smokes...SLP...don't get all crazy.

I'm sure jgarvin will be more than happy to have you submit
another 'fuller' answer.

I would have rejected your answer too.  It is kind of vague.
And a promise of help does not warrant a grade...perhaps
jgarvin wants to see some help first.
0
 

Author Comment

by:jgarvin
ID: 1215351
SLP:  My apologies if my response sounded too critical, I did not mean to discount the help you offered.  I am not doing the actual coding for this project, but am trying to facilitate it.  

The answer had minimal specifics and was a bit "qualified" for me to provide an unqualified "thanks." Not that it is an excuse, but I also was burned 200 points on a non-answer in the past, so I just want to be careful.  

And yes, I did have unrealistic hope that there might be some "tool" that would make it fairly easy, or an interpreter/translator that might be able to take chunks of the code and port them to Borland or the other C++.  That's why I am here asking the question.  I also had no intention of asking for original research.  I was hoping to leverage off of something that someone else has used or done before.

Thanks for listening.
0
 

Author Comment

by:jgarvin
ID: 1215352
Adjusted points to 300
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1215353
What performances are you looking for?
The GDI without Direct... is too slow for games and such.
I know you only want the BGI translated, but there are many ways.
What resolutions do you want?
Any other statistics will be useful.

/// John


0
 

Author Comment

by:jgarvin
ID: 1215354
Edited text of question
0
 

Author Comment

by:jgarvin
ID: 1215355
Edited text of question
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1215356
I'm not too familiar with BGI...

But are these just line, circle, pixel commands wer're
talking about??

If so, I think it would be pretty straight forward to just
convert by hand the drawing commands and the associated
algorithms...

Unless we're talking about thousands of lines of code...
0
 

Accepted Solution

by:
s_mind earned 300 total points
ID: 1215357
Use int10 func 0x0C to out the pixels instead of the built in bgi functions and the program will most probably run fine windowed

some sourcecode for ya:
procedure outpixel(x,y : word;color : byte);assembler;
asm
   mov ah,0Ch
   mov bh,pagenum {probably 0 so you could replace with
                   "xor bh,bh" to increese speed to some degree}
   mov al,color
   mov cx,x
   mov dx,y
   int 10h
end;

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
Changing a few Outlook Options can help keep you organized!
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question