Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!rex!ames!ncar!hsdndev!rice!uupsi!sunic!fuug!clinet!dix From: dix@clinet.fi (Risto Kaivola) Newsgroups: comp.sys.amiga.hardware Subject: Re: HELP! (please!) on OS... Message-ID: <1991May26.185945.24811@clinet.fi> Date: 26 May 91 18:59:45 GMT Article-I.D.: clinet.1991May26.185945.24811 References: <1991May24.212123.11386@lynx.CS.ORST.EDU> Organization: City Lines Oy, Helsinki, Finland Lines: 38 rudolpe@urubu.CS.ORST.EDU (RUDOLPh ERIC) writes: >HELP! I'm trying to do a little program in assembly that sets up a viewport and >displays it. However, I can't seem to restore the original Workbench display. >I know this: >I must call LoadView() while passing a pointer to the View Structure in a1. >However, I can't seem to find the original View Structure. My manual says to >find it in the offset ActiView in the GfxBase structure. My book says the >offset is 2. I don't believe it. It looks wrong, the the program immediately >Gurus, with no Guru number, because the display is frozen. According to "Amiga ROM Kernel Reference Manual: Includes & Autodocs (revised and updated)", i.e., the book that contains listings of all the standard include files provided by Commodore, struct GfxBase is as follows: [p D-38] struct GfxBase { struct Library LibNode; struct View *ActiView; ... That is, the pointer to the active view cannot be in the offset 2 for the first *member* in the structure is a structure, the size of which is 34 bytes. The second element in GfxBase is a pointer to a View. In other words, the view pointer is in the offset 34, calculated from the beginning of the GfxBase structure. You seem to be using assembly language, and this C'ish explanation is not perhaps a very clarifying one, but I hope this helps. When I had a problem of the same sort, I solved it using either RemakeDisplay() or WBenchToFron() [can't remember it off hand, sorry]. BTW, if you are programming the WB environment, I recommend using some high-level language, like C or C++. It can save you a lot of hair :-). >Anyone who could shed some light on this would have my infinite gratitude, and >many profuse thanks! >rudolpe@jacobs.cs.orst.edu -- Risto Kaivola (dix@clinet.fi) or (Risto.Kaivola@f123.n220.z2.FIDONET.ORG)