vector<MemoryBlock> Server::createMemoryBlock(unsigned char *ptr,int size) { if(blocks.size()==293) { //throw emu_fatalerror("OOPS"); } vector<MemoryBlock> retval; const int BYTES_IN_MB=1024*1024; if(size>BYTES_IN_MB) { for(int a=0;;a+=BYTES_IN_MB) { if(a+BYTES_IN_MB>=size) { vector<MemoryBlock> tmp = createMemoryBlock(ptr+a,size-a); retval.insert(retval.end(),tmp.begin(),tmp.end()); break; } else { vector<MemoryBlock> tmp = createMemoryBlock(ptr+a,BYTES_IN_MB); retval.insert(retval.end(),tmp.begin(),tmp.end()); } } return retval; } //printf("Creating memory block at %X with size %d\n",ptr,size); blocks.push_back(MemoryBlock(ptr,size)); staleBlocks.push_back(MemoryBlock(size)); initialBlocks.push_back(MemoryBlock(size)); retval.push_back(blocks.back()); return retval; }
void setUp(void) { instantiateCPU(); // Set the ramMemory occupy the memoryTable from 0000 to FFFF, for testing purpose (FFFF / 100 = FF) ramBlock = createMemoryBlock(0x0000 , 0xFFFF); setMemoryTable( ramMemory , 0 , 0xFFFF); }
void setUp(void) { instantiateCPU(); // Set the ramMemory occupy the memoryTable from 0000 to FFFF, for testing purpose (FFFF / 100 = FF) ramBlock = createMemoryBlock(RAM_START_ADDR, 0xFFFF); setMemoryTable( ramMemory , 0 , 0xFFFF); inputSP = 0x1122; inputSP_DEC = inputSP - 1; SET_SP(inputSP); }
void setUp(void) { instantiateCPU(); // Set the ramMemory occupy the memoryTable from 0000 to FFFF, for testing purpose ramBlock = createMemoryBlock(0x0000 , 0xFFFF); setMemoryTable( ramMemory , 0 , 0xFFFF); inputSP = 0x1122; sp_minus1 = inputSP - 1; sp_minus2 = inputSP - 2; SET_SP(inputSP); pcToLoad = malloc(sizeof(uint32_t)); *pcToLoad = 0; }
void setUp(void) { instantiateCPU(); // Set the ramMemory occupy the memoryTable from 0000 to FFFF, for testing purpose (FFFF / 100 = FF) ramBlock = createMemoryBlock(0, 0xFFFF); setMemoryTable( ramMemory , 0 , 0xFFFF); A = 0x01; C = 0; // default carry is 0 SET_X(0X0040); SET_Y(0x1170); SET_SP(0x2290); MEM_WRITE_BYTE( X , 0x07); MEM_WRITE_BYTE( Y , 0x08); MEM_WRITE_BYTE( SP , 0x09); }
void setUp(void) { instantiateCPU(); A = 0x9D; src = 0xAE; /** 0x9D 1001 1101 * & 0xAE 1010 1110 *-------------------------- * 0x8C 1000 1100 *-------------------------- */ // Set the ramMemory occupy the memoryTable from 0000 to FFFF, for testing purpose (FFFF / 100 = FF) ramBlock = createMemoryBlock(0x0000 , 0xFFFF); setMemoryTable( ramMemory , 0 , 0xFFFF); }