Grant Smith, aka Denthor of Asphyxia

This is a discussion on Grant Smith, aka Denthor of Asphyxia within the C++ Programming forums, part of the General Programming Boards category; I just been browsing Grant Smith, aka Denthor of Asphyxia, Graphics Programming Tutorials on http://www.cprogramming.com/tutorial/tut1.html Does anyone know his email ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    2

    Grant Smith, aka Denthor of Asphyxia

    I just been browsing Grant Smith, aka Denthor of Asphyxia, Graphics Programming Tutorials on http://www.cprogramming.com/tutorial/tut1.html

    Does anyone know his email address or how I can contact him?

    I like his comparison of Pascal & C code. This is helping me to convert an old Pascal game to C++.

    However there's still some Pascal functions I need C++ equivalent off. Eg.

    addr - I think this is like C's &
    blockread
    fsearch

    getintvec - I think C equivalent is getvec?
    setintvec - I think C equivalent is setvec?

    ofs -
    seg -

    Borland dos.h has these macros but are they equivalent of ofs & seg???
    #define MK_FP(seg,ofs) ((void __seg *)(seg) + (void __near *)(ofs))
    #define FP_SEG(fp) ((unsigned)(void __seg *)(void __far *)(fp))
    #define FP_OFF(fp) ((unsigned)(fp))

    mem[ : ] - I know memset to set it, but what about get ? Maybe peek & poke?





    Let me know if these are correct translations from Pascal to C/C++.

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,467
    Addr is a Borland Pascal extension. It returns the address of its argument. In C++ the euivalent could be the & operator. However, Addr returns an untyped pointer, whereas the address operator in C++ has different semantics.

    Blockread (and blockwrite) don't have an equivalent in C++ they read and write from a file in blocks of... I-don't-remember-how-many-bytes.

    fsearch has has no equivalent. It was a DOS extension only and it was quiet valuable back then. It finds a file in a given directory.

    getintvec and setintvec were also DOS extensions. It was used to get the address of a protected-mode interrupt. There's no equivalent (and also getvec is not a C function I know of. Not at least a standard one)

    ofs and seg returned the offset and the segment of a memory address, respectively. They have no equivalent either. This was all 16-bit stuff.

    The macros were actually present on many libraries. However they were intended to search memory regions. Just a macro to avoid all that embarassing code you see. You could do a quick search on a memory region, for instance with just an MK_FP(seg,ofs) routine.

    Finally, there's a peek in C. But not a poke. That's BASIC. The equivalent of mem[] in Pascal would be memset, I think. Although their semantics are quiet different.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    > #define MK_FP(seg,ofs) ((void __seg *)(seg) + (void __near *)(ofs))
    > This is helping me to convert an old Pascal game to C++.
    Which C++ compiler are you using?

    If it isn't some old 16-bit TurboC thing, then that tutorial isn't going to do you a lot of good.
    Check the games forum for lots more info.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    2
    Yep, am converting Borland Pascal to Borland C++. Am going to use the full blown Borland C++ 4.5.

    Game forums?

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21