示例#1
0
void freeze()
{
	int i;
	// store custom chips
	store_mem[0xd300] = *atari_portb;
	{
		//backup last value written to custom chip regs
		//gtia
		memcp8(custom_mirror,store_mem,0xd000,0x20);
		//pokey1/2
		memcp8(custom_mirror,store_mem,0xd200,0x20);
		//antic
		memcp8(custom_mirror,store_mem,0xd400,0x10);

		// Write 0 to custom chip regs
		memset8(atari_base+0xd000,0,0x20);
		memset8(atari_base+0xd200,0,0x20);
		memset8(atari_base+0xd400,0,0x10);
	}

	*atari_portb = 0xff;

	// Copy 64k ram to sdram
	// Atari screen memory...
	memcp8(atari_base,store_mem,0,0xd000);
	memcp8(atari_base,store_mem,0xd800,0x2800);

	//Clear, except dl (first 0x40 bytes)
	clearscreen();

	// Put custom chips in a safe state
	// write a display list at 0600
	memcp8(dl,atari_base+0x600,0,sizeof(dl));

	// point antic at my display list
	*atari_dlisth = 0x06;
	*atari_dlistl = 0x00;

	*atari_colbk = 0x00;
	*atari_colpf0 = 0x2f;
	*atari_colpf1 = 0x3f;
	*atari_colpf2 = 0x00;
	*atari_colpf3 = 0x1f;
	*atari_prior = 0x00;
	*atari_chbase = 0xe0;
	*atari_dmactl = 0x22;
	*atari_skctl = 0x3;
	*atari_chactl = 0x2;
}
示例#2
0
void test_temperature(){
	// draw a generic, no-name rainbow
	static uint8_t starthue = 0;

	for(uint8_t col = 0; col < 10; col++){		
		if(col%2 == 0) {
			fill_rainbow( &leds[XY(col,0)], HEIGHT, starthue, 20);		
		} else {
			fill_rainbow_reverse( &leds[XY(col,HEIGHT-1)], HEIGHT, starthue, 20);	
		}		
	}	
	--starthue;

	// Choose which 'color temperature' profile to enable.
	uint8_t secs = (millis() / 1000) % (DISPLAYTIME * 2);
	if( secs < DISPLAYTIME) {
		FastLED.setTemperature( TEMPERATURE_1 ); // first temperature
		leds[0] = TEMPERATURE_1; // show indicator pixel
	} else {
		FastLED.setTemperature( TEMPERATURE_2 ); // second temperature
		leds[0] = TEMPERATURE_2; // show indicator pixel
	}

	// Black out the LEDs for a few secnds between color changes
	// to let the eyes and brains adjust
	if( (secs % DISPLAYTIME) < BLACKTIME) {
		memset8( leds, 0, NUM_LEDS * sizeof(CRGB));
	}

	FastLED.show();
	FastLED.delay(20);
}
示例#3
0
void CFastSPI_LED2::clear(boolean includeLedData) { 
	showColor(CRGB(0,0,0), 0);
	if(includeLedData) { 
		for(int i = 0; i < m_nControllers; i++) { 
			if(m_Controllers[i].pLedData != NULL) { 
				memset8((void*)m_Controllers[i].pLedData, 0, sizeof(struct CRGB) * m_Controllers[i].nLeds);
			} else {
				return;
			}
		}
	}
}
示例#4
0
////////////////////////////////////////////////////////////////////////////////
// fillbootp
// PURPOSE: Fills in a bootp request.
// PARAMS:  (IN) u8 *start  - Start of memory to use. Assumes that enough space
//                            is available.
//          (IN) u16 *mymac - Ethernet address of this host. Assumed to be 6
//                            bytes long.
//          (IN) u32 stamp  - Unique identifier for this transaction
////////////////////////////////////////////////////////////////////////////////
static void
fillbootp(u8 *start,
          u16 const *mymac,
          u32 stamp)
{
   u8 *curpos = start;
   u16 secs = 0;

   memset8(start, 0, BOOTP_PACKET_SIZE);

   *curpos++ = BOOTP_REQ;
   *curpos++ = BOOTP_HATYPE_ETH;
   *curpos++ = BOOTP_HALENGTH_ETH;
   curpos++;

   //this might not be aligned
   *curpos++ = (stamp & 0xFF000000) >> 24;
   *curpos++ = (stamp & 0x00FF0000) >> 16;
   *curpos++ = (stamp & 0x0000FF00) >> 8;
   *curpos++ = (stamp & 0x000000FF);

   *(u16 *)curpos = secs;
   //skip unused portion aswell
   curpos += sizeof(u32);

   curpos = start + BOOTP_CHADDR_OFFSET;
   itc_memcpy(curpos, (u8 *)mymac, sizeof(u16) * 3);
   curpos += sizeof(u32) * 4;

   //skip the servername field
   curpos += 64;
   //skip the bootfile field
   curpos += 128;

   //set the magic cookie
   *curpos++ = DHCP_MAGIC1;
   *curpos++ = DHCP_MAGIC2;
   *curpos++ = DHCP_MAGIC3;
   *curpos++ = DHCP_MAGIC4;

   //specifically ask the DHCP server to tell us what the gateway address and
   //subnet mask are.
   *curpos++ = DHCP_OPTION_REQPARAM;
   *curpos++ = 2; //the number of parameters we are requesting
   *curpos++ = DHCP_OPTION_ROUTER;
   *curpos++ = DHCP_OPTION_SMASK;

   // End of options
   *curpos++ = DHCP_OPTION_END;
}
示例#5
0
CFastSPI_LED2::CFastSPI_LED2() { 
	// clear out the array of led controllers
	m_nControllers = NUM_CONTROLLERS;
	m_nScale = 255;
	memset8(m_Controllers, 0, m_nControllers * sizeof(CControllerInfo));
}
示例#6
0
void arm_memset( void* dst, unsigned char val, int size )
{
	memset8( dst, val, size );
}