'=========================================================================== ' Subject: FAST CLIP PUTTING Date: 10-14-96 (16:25) ' Author: Joshua Dickerson Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB ClipPut (x%, y%, BitMap%()) DEFINT A-Z SCREEN 13 DEF SEG = &HA000 FOR i = 0 TO 63 OUT &H3C8, i OUT &H3C9, i OUT &H3C9, i OUT &H3C9, i NEXT DIM a(4097) a(0) = 63 a(1) = 63 FOR y = 0 TO a(1) FOR x = 0 TO a(0) a(y * (a(0) + 1) + x + 2) = (x * y) MOD 64 NEXT NEXT t! = TIMER FOR x = -30 TO 320 ClipPut x, 0, a() NEXT PRINT (350) / (TIMER - t!) a$ = INPUT$(1) SUB ClipPut (x, y, BitMap()) tX = x + BitMap(0) tY = y + BitMap(1) IF 0 < tX AND x <= 319 AND 0 < tY AND y <= 199 THEN IF x < 0 THEN MnClipX = -x IF tX > 319 THEN MxClipX = 319 - x ELSE MxClipX = BitMap(0) IF y < 0 THEN MnClipY = -y IF tY > 199 THEN MxClipY = 199 - y ELSE MxClipY = BitMap(1) Index = (BitMap(0) + 1) * MnClipY + 2 sM& = 320& * (y + MnClipY) + x FOR bY = MnClipY TO MxClipY FOR bX = MnClipX TO MxClipX c = BitMap(Index + bX) IF c > 0 THEN POKE sM& + bX, c NEXT Index = Index + BitMap(0) + 1 sM& = sM& + 320 NEXT END IF END SUB ' This is meant to be compiled, but I will convert this to ASM complete with 'a basic loader which will put it in an array to be CALLed.. It is slightly 'faster than the routine employed by Eric Carr.. (Which was pretty darn fast.. ':-) )