🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.amiga.tech
2 messages
2 total messages Started by Kurt Koller Wed, 02 Jan 1991 12:45
Assembly confusion
#7761
Author: Kurt Koller
Date: Wed, 02 Jan 1991 12:45
82 lines
3645 bytes
 
Well, guys, I have two questions...  First of all, I am just learning the
"intuition" side of assembly programming.  I have a program that moves a
palette to a custom screen.  The part in question looks like this:
 

                movea.l #KolePalette,a2         ;beginning of palette
palloop
                movea.l (GraphicsPtr),a6        ;*graphics.library in a6
                movea.l (KSViewPort),a0         ;*viewport in a0
                move.b  (a2),d0
                cmp.b   #$ff,d0                 ;If $ff then end-of-palette
                beq     endpal
                move.b  (a2)+,d0
                move.b  (a2)+,d1                ;Move colors
                move.b  (a2)+,d2
                move.b  (a2)+,d3
                jsr     (_LVOSetRGB4,a6)
                bra     palloop
 
endpal
 
 
 
        ***********
        * Palette *
        ************************
        *       COL  R   G   B *
        ************************
 
KolePalette
        dc.b    $00,$0b,$09,$07         ;Color 0
        dc.b    $01,$00,$00,$00         ;Color 1
        dc.b    $02,$0e,$0e,$0e         ;Color 2
        dc.b    $03,$00,$09,$0d         ;Color 3
        dc.b    $04,$0e,$0e,$00         ;Color 4
        dc.b    $05,$0e,$00,$00         ;Color 5
        dc.b    $06,$0f,$0f,$0f         ;Color 6
        dc.b    $07,$0e,$0e,$0e         ;Color 7
        dc.b    $08,$0c,$0c,$0c         ;Color 8
        dc.b    $09,$0b,$0b,$0b         ;Color 9
        dc.b    $0a,$0a,$0a,$0a         ;Color 10
        dc.b    $0b,$09,$09,$09         ;Color 11
        dc.b    $0c,$08,$08,$08         ;Color 12
        dc.b    $0d,$06,$06,$06         ;Color 13
        dc.b    $0e,$05,$05,$05         ;Color 14
        dc.b    $0f,$04,$04,$04         ;Color 15
        dc.b    $ff                     ;End of Table
        even
 
 
Now, the problem is after the palette is there.  All of the colors move. 
Sometimes the background color remains that of my workbench.  Sometimes it is
right, but when I move the screen it changes to the workbench background. 
It's always JUST the background.  This is driving me nuts.  I hope it's
something really stupid.
 
 
And for the second question...
 
I have this:
                movea.l (KWPtr),a0              ;Pointer to window's user
                movea.l (wd_UserPort,a0),a0     ;  port goes in a0
                move.b  (MP_SIGBIT,a0),d1       ;window's signal bits
                moveq.l #1,d0                   ;Convert bit number in mask
                lsl.l   d1,d0                   ;  and place result in d0
                SYSCALL Wait                    ;Wait for closegadget
 
 
And I'm waiting for a MENUPICK.  This is the only thing I am waiting for, not
a closegadget.  It used to be a closegadget.  Anyhow, what do I do next?  All
of the RKM examples on this are in C, and I am having a difficult time with
this one.  CAn someone maybe mail me an example of how to figure out what
menuitem was chosen, etc?  MAybe mail me an example (in assembly, please)...
 
Thanks, any help is appreciateed, etc...
Koleman

Kurt "Koleman" Koller
UUCP: {crash tcnet}!orbit!pnet51!koleman
INET: koleman@pnet51.orb.mn.org
Re: Assembly confusion
#7798
Author: John Veldthuis
Date: Fri, 04 Jan 1991 03:32
31 lines
1820 bytes
Quoted from <3735@orbit.cts.com> by koleman@pnet51.orb.mn.org (Kurt Koller):

[stuff deleted]

>  
> And for the second question...
>  
> I have this:
>                 movea.l (KWPtr),a0              ;Pointer to window's user
>                 movea.l (wd_UserPort,a0),a0     ;  port goes in a0

Make sure that d1 has been zeroed as only the lower 8 bits are effected by
this instruction and old data may be still in there
add a moveq #0,d1 to zero out d1

>                 move.b  (MP_SIGBIT,a0),d1       ;window's signal bits
>                 moveq.l #1,d0                   ;Convert bit number in mask
>                 lsl.l   d1,d0                   ;  and place result in d0
>                 SYSCALL Wait                    ;Wait for closegadget
>  
>  
> And I'm waiting for a MENUPICK.  This is the only thing I am waiting for, not
> a closegadget.  It used to be a closegadget.  Anyhow, what do I do next?  All
> of the RKM examples on this are in C, and I am having a difficult time with
> this one.  CAn someone maybe mail me an example of how to figure out what
> menuitem was chosen, etc?  MAybe mail me an example (in assembly, please)...

Once the Wait call returns you have to call GetMsg() untill it returns a
NULL and process each of these messages.
--
*** John Veldthuis, NZAmigaUG.         johnv@tower.actrix.gen.nz       ***
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads