36500 rem Routine to display a single image bob in the correct place on the 36505 rem logical (background) screen, ready for the screen swap later in the 36510 rem program. STOS sprites could be used instead of bobs. The routine assumes 36515 rem a 24 pixel status bar exists at the top of the screen. MR(N) is an array 36520 rem of bob numbers, S14 is the address of the work screen, S7 is the address 36525 rem of the bob bank. MX2 and MY2 are arrays of x and y co-ords. You'll need 36530 rem the STE Blitter extension and the missing link extension, of course, and 36535 rem it'll only work with machines with blitters, (obviously). The sprites to 36537 rem be displayed are 32x32 pixels in size. 36540 rem 36555 rem ***** display sprite ***** 36560 if blitter=1 then goto 36566 : rem Use blitter if one exists 36561 rem No blitter 36563 bob logic,S7,MR(N),MX2(N),MY2(N),0 : rem display pre-shifted sprite 36564 return 36565 rem ***** use blitter ***** 36566 BLL=boundary(MX2(N)) : if MX2(N)<0 then SCL=MX2(N) else SCL=MX2(N)-BLL : rem find how far to pre-shift the b/g 36567 BLL=max(0,BLL) : BLL=min(319,BLL) : rem keep l/h co-ords on-screen 36568 BLR=BLL+48 : BLR=min(319,BLR) : BLR=max(0,BLR) : rem same for r/h co-ords. 36570 BLT=max(24,MY2(N)) : BLT=min(199,BLT) : rem same for top 36572 if MY2(N)<24 then SCL2=MY2(N)-24 else SCL2=0 36574 BLB=BLT+48 : BLB=min(199,BLB) : BLB=max(BLB,24) : rem same for bottom 36575 rem ***** copy pre-shifted background to spare bit of work screen. (bottom right in this case) ***** 36576 blit copy logic,BLL,BLT,BLR,BLB,S14,(192-SCL),(136-SCL2),3 36578 BLX=min(319,MX2(N)) : BLX=max(0,BLX) : BLY=min(199,MY2(N)) : BLY=max(24,BLY) 36584 bob S14,S7,MR(N),192,136,0 : rem display bob on 16 pixel boundary 36585 rem ***** copy sprite/background to logical screen ***** 36587 if MX2(N)<0 then SCL=0-MX2(N) else SCL=0 : rem left clip co-ords 36588 if MY2(N)<24 then SCL2=24-MY2(N) else SCL2=0 : rem top clip co-ords 36590 if SCL>0 or SCL2>0 then blit copy S14,192,136,192+32,136+32,S14,192-SCL,136-SCL2,3 36592 rem BLR=BLX+32 : if BLR>319 then SCL=BLR-319 : rem right clip sprite (if nec.) 36594 blit copy S14,192,136,224-SCL,168-SCL2,logic,BLX,BLY,3 : rem finally copy to logical screen 36599 return