Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6

    Converting FROM TurboC 3.1


    The last time I programmed in C, it was with the 3.1 IDE. Although learning K&R C, it is this method that was used primarily. My question is: Will anyone help me to convert this piece of code so that I can use it in a newer C IDE (' DEV-C++).
    Not knowing if the code would cause this site problems let me give a web link to a of the actual code.
    File in question.

    The piece that I need to exclude is the
    " registerbgidriver(EGAVGA_driver);
    registerbgidriver(Herc_driver);
    if(initGraphics())
    "
    portion belonging to Borland.

    If further is needed to help me in this endeavor, I will be glad to clarify.

    Thank yo for any and all aid in this endeavor.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,181
    Rep Power
    2222
    That's from the BGI, Borland Graphics Interface, which was a library of proprietary Borland extensions.

    You will need to find a third-party library that supports it and that you can use with MinGW gcc (the compiler that Dev-C++ uses). I don't have, but it sticks in my mind that I had stumbled across such a library, though I forget which of my non-Borland compilers it was for. Google around for BGI and other keywords and see what you can find. You might also rummage around bloodshed, because they might offer something.

    Otherwise, your option might be to resort to the free Borland 5.5 download, though I understand that's only the command-line tools and no help files.

    Good luck in your search.


    PS
    Well duh! If all you want to do is compile that code, then why not locate an old Borland IDE? I'm sure they're still out there for free download, because we keep getting newbies here who saddle themselves with it (though to fair, in many cases it's their school that forces it on them).

    Of course, that won't help you if your intention is to migrate your code. For that, I'm pretty sure that there's a BGI DLL out there.
    Last edited by dwise1_aol; August 15th, 2009 at 06:15 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6

    Thank you very mucmorh


    Your post is very much appreciated. Yes it is my intention to migrate my old code. I still have a copy of TurboC 3.1 and it is installed on an old Win98 machine.
    Poking around with some of the C files contained with the distribution I have I found that I may be able to just use one of the templates there and add my old code into it. I placed another file on the site:
    a 3D fern
    It occurs to me that I may just have to find the syntax use in the new compiler; such as randomize()/random() and putpixel()

    again TY it is a start in the right direction.

    p.s. is it just my imagination, but it seems to me that with a minor rewrite on variable usage that c can be rewritten as PHP very easily?
    Last edited by MyKel_D; August 15th, 2009 at 07:14 PM. Reason: more info
  6. #4
  7. Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jun 2005
    Posts
    5,964
    Rep Power
    4852
    You may be missing a salient point. That compiler was designed for a machine running in real mode (and maybe one level of protected mode). The only way you could use it on a modern machine would be on a VM that simulated such a system (or know enough to bypass the OS and bring your system up under such primitive conditions).

    One also wonders why so many people are still using Dev-Cpp. It hasn't been maintained in years. It boggles the mind when "progressive" programmers decide to get daring and switch from Turbo C to Dev-Cpp. Makes me wanna sell 'em an 8080 and an ADM-3 terminal.
    Write no code whose complexity leaves you wondering what the hell you did.
    Politically Incorrect DaWei on Pointers Grumpy on Exceptions
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6
    Some of us like to play in the past, while changing the future. I am an old coder from the late '70s and 80s' and am trying to learn the new world. :)
    Got a question. Do you think that an Amiga 4000 with a Video Toaster is a obsolete piece of junk?
    Let me explain me; please.
    I hand write vrml 97 using PROTO and EXTERNPROTO alot and post it on a Apache 2.2 server, am currently building and hosting a 3D website around it. I enjoy coding as I am an old schooler. Humans like Jerry Houston, Steve Rimmer, Jerry Pournel, Steve Ciarcia are my heros when it comes to programming, I learned tons from them. JAVA makes my head spin, Bill Gates convinced the world that Y comes before X in his ROW/COLUMN way of doing BASIC graphics. What takes me 3 lines of code to do, the new world need 6 pages. All I want to do is put a colored pixel on the screen, use nested loops to move it across the screen, and not write a novel to do so. Things were much easier in the world before mice. I curently have an Apple IIe, an Apple IIgs, several 8088s, et. al. I love to write code on them, then translate it to the new world. Pardon me but the past is why the future exist in the first place. Not giving it due respect, insults the hard work of us that "file shared" and did it over BBS.
    Last edited by MyKel_D; August 15th, 2009 at 07:48 PM. Reason: upset at the last poster
  10. #6
  11. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,181
    Rep Power
    2222
    Oh, dude! I was so busy replying on another forum, I forgot about this one!

    My intro to computers was through the US Air Force computer repairman course, 30547 course at Keesler AFB, MS. From there, I went through the computer science curriculum at the University of North Dakota, Grand Forks.

    Dude! I feel your pain! I suffered through those same days when 8K of RAM cost us a whopping $240!

    Ain't it a fracking pain that everything just keeps changing on us?

    Computer tech keeps changing. That is a given. What we need to do to maintain our kung fu is to be able to keep up with those changes. While at the same time remembering how we used to have to do things.


    Dude! (which I feel is justified, since my friend has just completed a "surfer girl" course). Just what the frak are you trying to accomplish?

    If your goal is to run your program with old tech, then you'ver accomplished that!

    If your goal is to run old tech with new tech, then do that!

    The BGI used the old video graphics tech to accomplish its goals. If you want to use new tech to do the same things, then you need to map the old function calls to the new graphics functions.

    Dude! To put it in that universal language, Yiddish: Nu?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6

    A most appreciative thank you


    :D 'Tiz nice to know that there is more like me out there.
    It IS my goal to update my old code to the new graphics routines, as stated it is just a matter of finding the replacement calls, I did manage to find random() and rand(), but I may have to go back to the ROM routines (i.e. WDOT) and make my own funtion. But somehow I feel that this too has been changed to something different.
    Oh and of course I may have to write outtext() and outtextxy(), if I cannot find a good replacment call. Mayhaps OpenGL is my answer. :winkgrins
    Again I apreciate your comments.
  14. #8
  15. Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jun 2005
    Posts
    5,964
    Rep Power
    4852
    Actually, you're blathering. Pournelle can't code for poot and was the first to admit it back in his Byte heyday. Ciarcia is mainly a hardware type of guy. Row/column predates Gates. The Apple ][ was a piece of junk.

    I know old. I once spent three weeks hacking 7 bytes out of a piece of code. At that time it was the economical thing to do. Expensive non-recurring cost to avoid even more expensive recurring costs.

    I decry fat, bloated code as much as anyone and more than most, I expect. I cursed the folly of IBM/Intel/MS winning a market with a machine built like no competent pro would have built it.

    If your hobby is playing with buggy whips and whiffle trees, have at it. I understand and respect that. I made the mistake of thinking you were asking a serious question for a useful purpose.
    Write no code whose complexity leaves you wondering what the hell you did.
    Politically Incorrect DaWei on Pointers Grumpy on Exceptions
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6

    Hmmm curious


    :tntworth:
    And I thought this was a help site NOT a flame the student site. If you have anything that will help replace the old BGI calls then post it, if not stay out of this thread, K. :chomp:
  18. #10
  19. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,641
    Rep Power
    4247
    Yep. Just use the WinBGIM project. Just google for "Dev C++ winbgim" and you should get everything you need. The WinBGIM library provides the same function names as the old borland BGI library, so it should be easy to port your code over.

    One of these days, I should buck up and finish my linux port of the BGI functions :).
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6
    OMG TY- will look into it this day. Let you know how it turns out. :trockon:
  22. #12
  23. Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jun 2005
    Posts
    5,964
    Rep Power
    4852
    You thought that was a flame? You've reinforced the opinion that you might actually be demented. I was trying to avoid that conclusion. Silly me.
    Write no code whose complexity leaves you wondering what the hell you did.
    Politically Incorrect DaWei on Pointers Grumpy on Exceptions
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6

    New Question


    ok, one down am gettting console proggies. Now I have some old .obj code. Noticed that it will not add to a project. Is there a way to convert these old object codes to the new world, without the original source code ( I do have the TASM file).
  26. #14
  27. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,641
    Rep Power
    4247
    Not very likely, especially if the obj file is compiled for 16-bit. You can try compiling the ASM file if you have it though.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    50
    Rep Power
    6
    It was 32 bit- afraid I'll have to rewrite all the routines (as the asm code is corrupt and cannot even be used in the old TC compiler). this is not really hard, I did it the first time, just time consuming. Thank you all for your input and help. at least my BGI stuff that don't use my object code works. Am currently changing all the BGI calls to OpenGL now that I have to ablity to run it in the new compiler.
    If someone happens to run across a file named "myk.lib" I'd appreciate a holler.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo