Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Offscreen G worlds

DescoladaDescolada Posts: 21Member
I'm trying to make an offscreen Graphics world in a program I'm using macintosh think pascal to write. I've copied the code straight from the demo program of chapter thirteen from the macintoshpascal tutorial, but it doesn't work. As best I can figure it's not working because it can't make a Gworld, or it at least can't make a pointer to it. Does anyone have experience with this?

Comments

  • DescoladaDescolada Posts: 21Member
    It's been a week now, but there still haven't been any replies. Come on, I could really use some help, there must be someone out there who knows what to do. I'm even less sure why the problems are occurring now than before, this is so confusing. Any suggestions would be useful.
  • Phat NatPhat Nat Posts: 757Member
    : It's been a week now, but there still haven't been any replies. Come on, I could really use some help, there must be someone out there who knows what to do. I'm even less sure why the problems are occurring now than before, this is so confusing. Any suggestions would be useful.
    :


    The problem is (I think) that most people here use the DOS version of Pascal. (Correct me if I'm wrong)

    Phat Nat

  • ManningManning Posts: 1,621Member
    : : It's been a week now, but there still haven't been any replies. Come on, I could really use some help, there must be someone out there who knows what to do. I'm even less sure why the problems are occurring now than before, this is so confusing. Any suggestions would be useful.
    : :
    :
    :
    : The problem is (I think) that most people here use the DOS version of Pascal. (Correct me if I'm wrong)

    You're wrong, I use the Windows version :-)
  • Phat NatPhat Nat Posts: 757Member
    : I'm trying to make an offscreen Graphics world in a program I'm using macintosh think pascal to write. I've copied the code straight from the demo program of chapter thirteen from the macintoshpascal tutorial, but it doesn't work. As best I can figure it's not working because it can't make a Gworld, or it at least can't make a pointer to it. Does anyone have experience with this?
    :

    Tell you what. I don't have a MacIntosh, but I do know Pascal, so if you want to send me the code (or post it on the board here), I will look it over for you and see if I can find the problem.

    Phat Nat

  • DescoladaDescolada Posts: 21Member
    : : I'm trying to make an offscreen Graphics world in a program I'm using macintosh think pascal to write. I've copied the code straight from the demo program of chapter thirteen from the macintoshpascal tutorial, but it doesn't work. As best I can figure it's not working because it can't make a Gworld, or it at least can't make a pointer to it. Does anyone have experience with this?
    : :
    :
    : Tell you what. I don't have a MacIntosh, but I do know Pascal, so if you want to send me the code (or post it on the board here), I will look it over for you and see if I can find the problem.
    :
    : Phat Nat
    :
    :

    I DID IT!!!!!! . I spent three hours changing, and rewriting stuff, and finally I got lucky, and it worked, although I'm not exactly sure why. For some reason it won't work if I use global variables, they need to be locals, that's what really screwed me up. My problem now is that it goes too slowly. The process of copying the image from the offscreen G world, to the window takes so long that I can only get 1-2 frames a second. I can speed it up slightly by using a smaller pixel depth, but only slightly, and I would like to keep that where it is. I'm using the CopyBits procedure. Is there another faster way to put the image drawn offscreen into a window?

  • Phat NatPhat Nat Posts: 757Member
    : : : I'm trying to make an offscreen Graphics world in a program I'm using macintosh think pascal to write. I've copied the code straight from the demo program of chapter thirteen from the macintoshpascal tutorial, but it doesn't work. As best I can figure it's not working because it can't make a Gworld, or it at least can't make a pointer to it. Does anyone have experience with this?
    : : :
    : :
    : : Tell you what. I don't have a MacIntosh, but I do know Pascal, so if you want to send me the code (or post it on the board here), I will look it over for you and see if I can find the problem.
    : :
    : : Phat Nat
    :
    : I DID IT!!!!!! . I spent three hours changing, and rewriting stuff, and finally I got lucky, and it worked, although I'm not exactly sure why. For some reason it won't work if I use global variables, they need to be locals, that's what really screwed me up. My problem now is that it goes too slowly. The process of copying the image from the offscreen G world, to the window takes so long that I can only get 1-2 frames a second. I can speed it up slightly by using a smaller pixel depth, but only slightly, and I would like to keep that where it is. I'm using the CopyBits procedure. Is there another faster way to put the image drawn offscreen into a window?
    :

    All depends on your code. What is taking up all the time? The screen copying procedure or the calculations that you are doing? Again I can't help you out alot because of the platform differences. What does the copybits procedure do? Copy pixel-by-pixel or a whole chunk of memory at once?

    Phat Nat

  • DescoladaDescolada Posts: 21Member
    : : : : I'm trying to make an offscreen Graphics world in a program I'm using macintosh think pascal to write. I've copied the code straight from the demo program of chapter thirteen from the macintoshpascal tutorial, but it doesn't work. As best I can figure it's not working because it can't make a Gworld, or it at least can't make a pointer to it. Does anyone have experience with this?
    : : : :
    : : :
    : : : Tell you what. I don't have a MacIntosh, but I do know Pascal, so if you want to send me the code (or post it on the board here), I will look it over for you and see if I can find the problem.
    : : :
    : : : Phat Nat
    : :
    : : I DID IT!!!!!! . I spent three hours changing, and rewriting stuff, and finally I got lucky, and it worked, although I'm not exactly sure why. For some reason it won't work if I use global variables, they need to be locals, that's what really screwed me up. My problem now is that it goes too slowly. The process of copying the image from the offscreen G world, to the window takes so long that I can only get 1-2 frames a second. I can speed it up slightly by using a smaller pixel depth, but only slightly, and I would like to keep that where it is. I'm using the CopyBits procedure. Is there another faster way to put the image drawn offscreen into a window?
    : :
    :
    : All depends on your code. What is taking up all the time? The screen copying procedure or the calculations that you are doing? Again I can't help you out alot because of the platform differences. What does the copybits procedure do? Copy pixel-by-pixel or a whole chunk of memory at once?
    :
    : Phat Nat
    :
    :
    I believe pixel by pixel, a procedure that could take the entire variable at ounce would solve my problem, but can't find any. For more information about the copybits procedure look at http://developer.apple.com/techpubs/mac/QuickDraw/QuickDraw-166.html thanks

  • ManningManning Posts: 1,621Member
    : I believe pixel by pixel, a procedure that could take the entire variable at ounce would solve my problem, but can't find any. For more information about the copybits procedure look at http://developer.apple.com/techpubs/mac/QuickDraw/QuickDraw-166.html thanks

    Looks like CopyBits can do it pixel by pixel or all at once, depending on how you call it. So that begs the question, how do you call it? :-)
  • Phat NatPhat Nat Posts: 757Member
    : : I believe pixel by pixel, a procedure that could take the entire variable at ounce would solve my problem, but can't find any. For more information about the copybits procedure look at http://developer.apple.com/techpubs/mac/QuickDraw/QuickDraw-166.html thanks
    :
    : Looks like CopyBits can do it pixel by pixel or all at once, depending on how you call it. So that begs the question, how do you call it? :-)
    :

    Maybe... It looks like it's pixel-by-pixel, in which case it's going to be slow.
    Do you happen to know how the Mac writes to the screen? I think it's along the same lines as the IBM (a memory location that displays on the screen) although I am not sure. If this is the case, you just need to do a memory copy from your Array or whatever onto the memory location of the screen. For IBM the memory location is at $A000.
    I just did a search of the Net and came up with this site:
    [b]http://www.mactech.com/articles/mactech/Vol.01/01.09/MemoryExamined/[/b]

    It states the following:
    [b]There are actually two screen buffers in RAM. The main buffer located at $7A700 ($1A700 in a 128K Mac), and an alternate buffer located at $72700 ($12700). Port A bit 6 of the 6522 VIA (Versatile Interface Adapter) is factored into the address decoding logic for the screen RAM and determines which buffer will be displayed. Figure 2 graphically describes the memory map and Figure 3 is a table showing the address location and effect on the memory map of VIA Port A.[/b]

    Therefore, if you do a memory copy to $72700 (or maybe $12700) you should see it appear on screen. Hope this helps.

    Phat Nat

Sign In or Register to comment.