[Vm-dev] VM Maker: VMMaker.oscog-tpr.949.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 21 03:31:45 UTC 2014


tim Rowledge uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-tpr.949.mcz

==================== Summary ====================

Name: VMMaker.oscog-tpr.949
Author: tpr
Time: 20 November 2014, 7:28:47.525 pm
UUID: f88be574-4771-44fb-a08e-f1312faaec73
Ancestors: VMMaker.oscog-eem.948

Add the correct init code for the fast bitblt extensions (its in the plain interp but got left out of the cog code) and add a new bitblt prim to compare two forms for pixel color state; useful for sprite touches sprite type tests and very common in Scratch.

=============== Diff against VMMaker.oscog-eem.948 ===============

Item was changed:
  ----- Method: BitBltSimulation>>initialiseModule (in category 'initialize-release') -----
  initialiseModule
  	<export: true>
  	self initBBOpTable.
  	self initDither8Lookup.
+ 	self cppIf: #'ENABLE_FAST_BLT'
+ 		ifTrue:[self initialiseCopyBits].
  	^true!

Item was added:
+ ----- Method: BitBltSimulation>>primitiveCompareColorA:to:test: (in category 'primitives') -----
+ primitiveCompareColorA: colorA to: colorB test: testID 
+ 	"Invoke the pixel color comparing primitive.Only applicable if compiling
+ 	with ENABLE_FAST_BLT"
+ 	| rcvr val |
+ 	<export: true>
+ 	rcvr := self
+ 				primitive: 'primitiveCompareColors'
+ 				parameters: #(#SmallInteger #SmallInteger #SmallInteger )
+ 				receiver: #Oop.
+ 	self
+ 		cppIf: #'ENABLE_FAST_BLT'
+ 		ifTrue: [(self loadBitBltFrom: rcvr)
+ 					ifFalse: [^ interpreterProxy primitiveFail].
+ 			self clipRange.
+ 			(bbW <= 0 or: [bbH <= 0])
+ 				ifTrue: ["zero width or height; noop"
+ 					^ interpreterProxy primitiveFail].
+ 			self cCode: '
+ 	compare_operation_t op;
+ 	op.matchRule = testID & 3;
+ 	op.tally = testID & (1u<<3);
+ 	op.srcA.bits = (void *) sourceBits;
+ 	op.srcA.pitch = sourcePitch;
+ 	op.srcA.depth = sourceDepth;
+ 	op.srcA.msb = sourceMSB;
+ 	op.srcA.x = sx;
+ 	op.srcA.y = sy;
+ 	op.srcB.bits = (void *) destBits;
+ 	op.srcB.pitch = destPitch;
+ 	op.srcB.depth = destDepth;
+ 	op.srcB.msb = destMSB;
+ 	op.srcB.x = dx;
+ 	op.srcB.y = dy;
+ 	op.width = bbW;
+ 	op.height = bbH;
+ 	op.colorA = colorA;
+ 	op.colorB = colorB;
+ 
+ 	val = compareColorsDispatch(&op);'.
+ 	^val asPositiveIntegerObj]
+ 		ifFalse: [interpreterProxy primitiveFail]!



More information about the Vm-dev mailing list