Solved

Pascal question

Posted on 1997-06-11
13
283 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
  • 6
  • 3
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:slp
Comment Utility
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
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:slp
Comment Utility
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
 

Author Comment

by:jgarvin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jgarvin
Comment Utility
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
Comment Utility
Adjusted points to 300
0
 
LVL 4

Expert Comment

by:erajoj
Comment Utility
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
Comment Utility
Edited text of question
0
 

Author Comment

by:jgarvin
Comment Utility
Edited text of question
0
 
LVL 3

Expert Comment

by:mheacock
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now