' ' Sprite example with Blitter ' by ggn / Paradize ' ' Use at your own risk! ' ' *.NEO picture shall contain a 32x32 sprite in the upper left corner ' FILESELECT "\*.neo","",f$ ' f$="C:1.neo" ' DIM x%(8032) s%=V:x%(0) BLOAD f$,s% ADD s%,4 FOR i=0 TO 32 a$=a$+CHR$(PEEK(s%+i)) NEXT i ~XBIOS(5,L:-1,L:-1,0) ~XBIOS(6,L:V:a$) ADD s%,124 ' xb=XBIOS(2) ' s_x_inc=&HFF8A20 s_y_inc=&HFF8A22 s_hw=&HFF8A24 s_lw=&HFF8A26 end_1=&HFF8A28 end_2=&HFF8A2A end_3=&HFF8A2C d_x_inc=&HFF8A2E d_y_inc=&HFF8A30 d_hw=&HFF8A32 d_lw=&HFF8A34 x_cnt=&HFF8A36 y_cnt=&HFF8A38 hop=&HFF8A3A !Byte op=&HFF8A3B ! >> skew=&HFF8A3D ! >> blit=&HFF8A3C ' PBOX 0,0,50,50 SDPOKE x_cnt,3 SDPOKE s_x_inc,8 SDPOKE s_y_inc,144 SDPOKE d_x_inc,8 SDPOKE d_y_inc,144 ' ' Create mask ' SDPOKE end_1,&HFFFF !endmasks SDPOKE end_2,&HFFFF SDPOKE end_3,&HFFFF SPOKE skew,0 !no shift SPOKE hop,2 !hog mode SPOKE op,15 !fill with 1s destination addr SLPOKE s_hw,s% !source - irrelevant SLPOKE d_hw,s%+32 !dest - mask addr SDPOKE y_cnt,32 !32 scan lines SPOKE blit,192 !go baby go! SPOKE op,4 !not src and dest - make mask ;) FOR i=0 TO 6 STEP 2 SLPOKE s_hw,s%+i SLPOKE d_hw,s%+32 SDPOKE y_cnt,32 SPOKE blit,192 NEXT i DO VSYNC j=STICK(1) IF BTST(j,1) AND y1<169 ADD y1,1 ENDIF IF BTST(j,0) AND y1>0 SUB y1,1 ENDIF IF BTST(j,3) AND x1<289 ADD x1,1 ENDIF IF BTST(j,2) AND x1>0 SUB x1,1 ENDIF x=x1 MOD 16 y=y1*160+(x1\16)*8 SDPOKE end_1,SHR(&HFFFF,x) SDPOKE end_2,&HFFFF SDPOKE end_3,NOT SHR(&HFFFF,x) SPOKE skew,x SPOKE hop,2 SPOKE op,1 !AND the mask FOR i=0 TO 6 STEP 2 SLPOKE s_hw,s%+32 SLPOKE d_hw,xb+i+y SDPOKE y_cnt,32 SPOKE blit,192 NEXT i SPOKE op,7 !OR the sprite data FOR i=0 TO 6 STEP 2 SLPOKE s_hw,s%+i SLPOKE d_hw,xb+i+y SDPOKE y_cnt,32 SPOKE blit,192 NEXT i LOOP UNTIL MOUSEK OR INKEY$<>""