コード例 #1
0
ファイル: ti57cpu_dasm.cpp プロジェクト: pockemul/PockEmul
UINT32 Cdebug_ti57cpu::DisAsm_1(UINT32 oldpc)
//void *z80disasm(char *str, uint8 *mem)
{
    //return (oldpc);
    Buffer[0] = '\0';
    char *str = Buffer;

    oldpc &= 0xffff;
    DasmAdr = oldpc;
    UINT32 pc=oldpc;
    quint8 op = pCPU->pPC->Get_8(pc);

    Buffer[0] = '\0';
    char LocBuffer[200];
    LocBuffer[0] = '\0';
    int len =1;

    TI57regs r;
    r.PC = pc;
    r.OP = pCPU->pPC->Get_16(r.PC<<1);

//    sprintf(Buffer," %06X:%02X",pc,op);
    QString t = Tracing(&r);

//    qWarning()<<"**"<<t<<"**";

    sprintf(Buffer,"%s",t.toLatin1().data());
    DasmAdr = oldpc;
    NextDasmAdr = oldpc+len;
    debugged = true;
    return NextDasmAdr;
}
コード例 #2
0
ファイル: caribbean2.cpp プロジェクト: nguyentruc/DSA_ass2
void Tracing(nodeTree *root, nodeTree *traceRoot, queue *&rear, int key, bool &same)
{
	if (root == NULL) return;
	Tracing(root->pLeft, traceRoot->pLeft, rear, key, same);
	if (traceRoot->key == key)
	{
		rear->next = new queue;
		rear = rear->next;
		rear->next = NULL;
		rear->key = root->key;
		if (traceRoot->pLeft != NULL && traceRoot->pRight != NULL)
			if ((traceRoot->pLeft->key == traceRoot->pRight->key)
					&& ( traceRoot->pLeft->key == key)) same = 1;
	}
	Tracing(root->pRight, traceRoot->pRight, rear, key, same);
}
コード例 #3
0
ファイル: main.cpp プロジェクト: linyufly/AsyncTracer
int main() {
	// Test the system
	SystemTest();

	// Read the configure file
	ReadConfFile();

	// Load all the frames
	LoadFrames();

	// Put both topological and geometrical data into arrays
	GetTopologyAndGeometry();

	// Get the global bounding box
	GetGlobalBoundingBox();

	// Calculate the number of blocks in X, Y and Z
	CalculateNumOfBlocksInXYZ();

	// Divide the flow domain into blocks
	//Division();

	InitializationForNaiveTracing();

	// Initially locate global tetrahedral cells for interesting Cartesian grid points
	InitialCellLocation();

	//int xRes = configure->GetBoundingBoxXRes();
	//int yRes = configure->GetBoundingBoxYRes();
	//int zRes = configure->GetBoundingBoxZRes();
	//int numOfGridPoints = (xRes + 1) * (yRes + 1) * (zRes + 1);

	//// Evaluate the device usage
	//int need = SizeOfDeviceArrays(globalNumOfPoints, globalNumOfCells, numOfGridPoints, numOfInitialActiveParticles, numOfQueries,
	//	       	   startOffsetInPoint[numOfInterestingBlocks], startOffsetInCell[numOfInterestingBlocks],
	//		   numOfInterestingBlocks);

	//printf("need = %d bytes\n", need);

	///// Check the natural coordinates of some points
	//CheckNaturalCoordinates();

	///// DEBUG ///
	////return 0;

	// Main Tracing Process
	Tracing();

	// Get final positions for initial active particles
	GetFinalPositions();

	return 0;
}
コード例 #4
0
ファイル: caribbean2.cpp プロジェクト: nguyentruc/DSA_ass2
void Hades()
{
	nodeTree *traceRoot = NULL;

	traceRoot = makeTrace(myTree->root, 0);
	traceRoot->key = processTraceKey(traceRoot);

	if (traceRoot->key % 13 == 0)
	{
		isJack = 1;
		queue *front = new queue;
		queue *rear = front;
		rear->next = NULL;
		bool same = 0;
		Tracing(myTree->root, traceRoot, rear, traceRoot->key, same);
		if (same == 0)
		{
			while (front != NULL)
			{
				queue *del = front;
				front = front->next;
				delete del;
			}
			int key = traceRoot->key;
			front = new queue;
			rear = new queue;
			front->next = rear;
			rear->next = NULL;
			rear->key = myTree->root->key;

			nodeTree *root = myTree->root;
			while (traceRoot->pLeft != NULL || traceRoot->pRight != NULL)
			{
				if (traceRoot->pLeft != NULL)
					if (traceRoot->pLeft->key == key)
					{
						traceRoot = traceRoot->pLeft;
						root = root->pLeft;
						rear->next = new queue;
						rear = rear->next;
						rear->next=NULL;
						rear->key = root->key;
						continue;
					}

				if (traceRoot->pRight != NULL)
					if (traceRoot->pRight->key == key)
					{
						traceRoot = traceRoot->pRight;
						root = root->pRight;
						rear->next = new queue;
						rear = rear->next;
						rear->next=NULL;
						rear->key = root->key;
						continue;
					}
			}
		}

		while (front->next != NULL)
		{
			queue *del = front;
			if (front->next->key == 888)
			{
				isBlackBeard = 0;
				isAVL = 0;
			}
			//num = front->next->ptr->key;
			delNode(front->next->key);
			front = front->next;
			delete del;
		}
		delete front;
	}
	else
	{
		deleteMyTree(myTree->root);
	}

	deleteMyTree(traceRoot);
}