;------------------------------------------------ ; Doors picture viewer 1.0 ; Copyright 1998 ; The Doors Team ;------------------------------------------------ xdef _main xdef _comment include graphlib.h include tios.h include userlib.h _main bra.s debut handle dc.w 0 ;var where doors puts the handle of the pic to view debut move.w handle,d0 tst.w d0 ;if handle = 0 beq \fin ;then exit jsr graphlib::clr_scr ;clears the screen tios::DEREF d0,a0 ;get the adress of the pic move.w (a0)+,d0 ;size in d0 cmp.b #$DF,-1(a0,d0.w);is a PIC var ? bne \fin ;no -> exit move.w 2(a0),d1 ;gets the width of the picture move.l d1,d6 ;saves it in d6 lsr.w #3,d1 ;divides it by 8(param of put_sprite_mask) move.w d6,d0 ;d0 = width and.w #7,d0 ;look at three bits tst.w d0 ;if =0 beq \OK ;then jump addq.l #1,d1 ;else add #1 to the width \OK move.w d1,2(a0) ;puts width/8 in 2(a0) for put_sprite function clr.l d0 ;x = 0 clr.l d1 ;y = 0 move.b #$FF,d3 ;the mask for the picture is %11111111 jsr graphlib::put_sprite_mask ;displays the picture move.w d6,2(a0) ;restores the width of the picture in the variable jsr userlib::idle_hot ;waits for a key \fin rts ;exits ! _comment dc.b "Doors viewer",0 end