Path: utzoo!attcan!uunet!van-bc! From: lphillips@lpami.wimsey.bc.ca (Larry Phillips) Newsgroups: comp.sys.amiga Subject: Re: Help changing custom screen's palette Keywords: Assembly, LOADRGB4 Message-ID: <1135@lpami.wimsey.bc.ca> Date: 12 Feb 90 00:28:10 GMT Lines: 38 Return-Path: To: van-bc!rnews In <2300@ucqais.uc.edu>, rbatra@ucqais.uc.edu (pri=2 Rajesh Batra) writes: > 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. I used the library call LOADRGB4. Would someone >please tell me what I am doing wrong? Here is some of the source: > > [ code deleted ] > > move.l 44(a0),a0 ;Loads screen's viewport into register a0. > > [code deleted > >---------------- > If you think the error is so obvious that you would rather spare >me the embarrassment please email me the solution to: I don't think you have to be too embarrassed. What you have done in the abover excerpted line is to load up a pointer to the _next_ ViewPort. This is because a ViewPort structure is contained in the Screen struct, rather than a pointer to a ViewPort. The operation you want is: add.l #sc_ViewPort,a0 ; ( or add.l #44,a0 to use your terms ) Since the pointer to the Screen struct is in a0, adding 44 to it will make it a pointer to the ViewPort. Your line moved the contents of the first longword in the ViewPort struct to a0, which pointed you at the next ViewPort. -larry -- Gallium Arsenide is the technology of the future; always has been, always will be. +-----------------------------------------------------------------------+ | // Larry Phillips | | \X/ lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips | | COMPUSERVE: 76703,4322 -or- 76703.4322@compuserve.com | +-----------------------------------------------------------------------+