Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tektronix!psueea!jove.cs.pdx.edu!bartonr From: bartonr@jove.cs.pdx.edu (Robert Barton) Newsgroups: comp.sys.amiga Subject: Help changing custom screen's palette Message-ID: <2374@psueea.UUCP> Date: 13 Feb 90 17:56:26 GMT Sender: news@psueea.UUCP Reply-To: bartonr@jove.cs.pdx.edu (Robert Barton) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 20 > I am trying to change the colors of a custom screen. But instead the > workbench screen's palette changes, and my custom screen's colors remain > unchanged. > > move.l intbase,a6 > lea newscreenstructure,a0 > jsr openscrn(a6) ;The above just opened a custom screen. > move.l d0,screenhd ;Saves the screen stucture for later use. You should check screenhd for a non-NULL value at this point. > move.l screenhd,a0 > move.l 44(a0),a0 ;Loads screen's viewport into register a0. This is where you have the problem. The viewport field is a substructure of the screen structure, and not a pointer. So the move.l 44(a0),a0 is putting the first longword of the viewport into a0, rather than the address of the vp. This longword just happens to be a pointer to the next viewport, which in this case is the Workbench's viewport. So that's where the new colors show up. You need to use lea 44(a0),a0.