rem BMP Window BIG ... Rev 6.0 rem ======================== rem A J Tooth // Wholly re-written July 2007 rem================================================================= rem This program allows a second .bmp to be viewed through a fuzzy rem window in the first one. rem================================================================= rem ==================================================================== on error if (err=17) then quit *FLOAT64 himem=lomem + 100000000 install @lib$+"MyUtils.bbc" install @lib$+"BMP_Utils.bbc" rem ==================================================================== rem Set up proc_setup rem Get two pictures proc_TwoPics rem Second setup proc_setup2 : cls : mouse on rem Display Picture with Floating Image on top m&=0 : xo%=-1 : yo%=-1 rem mouse to xscreen%,yscreen% mouse off *REFRESH OFF mouse rectangle 360,360,2*xscreen%-720,2*yscreen%-720 repeat rem Mouse debounce repeat mouse x%,y%,m& until m&=0 repeat mouse x%,y%,m& sys "Sleep",10 until m&<>0 or abs(x%-xo%)>1 or abs(y%-yo%)>1 rem Move the window proc_moveit(x%/2,y%/2) xo%=x% : yo%=y% until m&<>0 *REFRESH ON quit rem End of Program ++++++++++++++++++++++++++++++++++++++++++++ rem =========================================================== rem Set up def proc_setup rem Maximise display proc_maxim(xscreen%,yscreen%) : colour 132,50,0,0 : colour 132 : cls rem Introductory page proc_intro rem Go to fullscreen proc_fullscreen(xscreen%,yscreen%) : colour 132,50,0,0 : colour 132 : cls endproc rem =========================================================== rem Second setup def proc_setup2 dim wind% 2000, itmp% 3, ftmp% 7 rem Set up a small bitmap proc_BMP_Set(360,360,smlpic%,SWlim%,Slgth%) rem Compile Assembly Routines for pass&=0 to 2 step 2 proc_wind(pass&) next pass& endproc rem =========================================================== rem Choose two pictures to combine def proc_TwoPics local ho%,ve%,bt% rem First picture proc_pichooseSZ(Name$,FulName$,Pre$,wdth%,hght%,lgth%) pic1$=Name$ fil1$=FulName$ proc_gendisp(1,FulName$,0,0,wdth%,hght%,pf1%,lgth%) proc_event(a$,b&) : rem Wait for a mouse click rem Second picture proc_pichooseSZ(Name$,FulName$,Pre$,wdth%,hght%,lgth%) pic2$=Name$ fil2$=FulName$ proc_gendisp(1,FulName$,0,0,wdth%,hght%,pf2%,lgth%) Wlim%=((wdth%*3+3)and-4) proc_event(a$,b&) : rem Wait for a mouse click endproc rem ==================================================================== rem Introduction def proc_intro colour 8,100,200,100 msg$="\8The WINDOW" proc_msg("Matisse ITC",72,"B",fn_adapt(1,350),fn_adapt(1,1400),msg$) msg$="\10This program takes \112 pictures of your choice \10and enables you to see \n\none picture through a window in the other, moved by the mouse." proc_msg("Matisse ITC",16,"",fn_adapt(1,200),fn_adapt(1,1000),msg$) msg$="\10Press -\9ESC\10- at any time to \9QUIT" proc_msg("Matisse ITC",16,"",fn_adapt(1,200),fn_adapt(1,800),msg$) proc_event(a$,b&) endproc rem ==================================================================== rem Move the window def proc_moveit(Xx%,Yy%) rem Display the "top" picture proc_BMP_DispB(xscreen%,yscreen%,pf1%) Xst%=Xx%-180 : Yst%=Yy%-180 call wind% proc_BMP_Disp(360,360,smlpic%,Xst%,Yst%) *REFRESH endproc rem ==================================================================== rem Window creation - FP Assembly Routine def proc_wind(opt&) P%=wind% [opt opt& mov edx,0 mov [^k%],edx .kloop mov edx,0 mov [^j%],edx .jloop mov eax,[^k%] imul eax,[^SWlim%] add eax,[^j%] add eax,[^j%] add eax,[^j%] add eax,54 mov [^Dref%],eax mov eax,[^Yst%] add eax,[^k%] imul eax,[^Wlim%] mov ebx,[^Xst%] add ebx,[^j%] add eax,ebx add eax,ebx add eax,ebx add eax,54 mov [^Sref%],eax mov ebx,[^Dref%] finit fild dword [^k%] fild dword [i180%] fsubp st1,st0 fmul st0,st0 fild dword [i32400%] fdivp st1,st0 fild dword [^j%] fild dword [i180%] fsubp st1,st0 fmul st0,st0 fild dword [i32400%] fdivp st1,st0 faddp st1,st0 fst qword [ftmp%] fld1 fcompp fstsw ax and ah,1 cmp ah,1 je much fld qword [ftmp%] fmul st0,st0 jmp ward .much fld1 .ward fstp qword [^lam] mov ecx,0 mov eax,[^Sref%] fld qword [^lam] mov cl,pf1%[eax] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 fld1 fld qword [^lam] fsubp st1,st0 mov cl,pf2%[eax] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 faddp st1,st0 fistp dword [itmp%] mov cl,[itmp%] mov [^Bb&],cl mov ecx,0 fld qword [^lam] mov cl,pf1%[eax+1] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 fld1 fld qword [^lam] fsubp st1,st0 mov cl,pf2%[eax+1] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 faddp st1,st0 fistp dword [itmp%] mov cl,[itmp%] mov [^Gg&],cl mov ecx,0 fld qword [^lam] mov cl,pf1%[eax+2] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 fld1 fld qword [^lam] fsubp st1,st0 mov cl,pf2%[eax+2] mov [itmp%],ecx fild dword [itmp%] fmulp st1,st0 faddp st1,st0 fistp dword [itmp%] mov cl,[itmp%] mov [^Rr&],cl mov cl,[^Bb&] mov smlpic%[ebx],cl mov cl,[^Gg&] mov smlpic%[ebx+1],cl mov cl,[^Rr&] mov smlpic%[ebx+2],cl .nogo inc dword [^j%] mov edx,[^j%] cmp edx,360 jl near jloop inc dword [^k%] mov edx,[^k%] cmp edx,360 jl near kloop jmp fin .i180% DD 180 .i32400% DD 32400 .fin ret ] endproc rem ====================================================================