Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pascal question

Posted on 1997-06-11
13
Medium Priority
?
295 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

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 600 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
Let's take a look into the basics of ransomware—how it spreads, how it can hurt us, and why a disaster recovery plan is important.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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