Valid HTML5/CSS3
Notepad - MAIN.C
void GameLoop()
{
	int i;
	char b[256];
	ClearBG1();
	distance = 0;
	CpuFastArrayCopy(driveTiles, MEM_VRAM + 0x8000);
	CpuFastArrayCopy(drivePal, MEM_PAL);
	CpuFastArrayCopy(driveMap, MEM_VRAM + 0xF800);
	CpuFastCopy(busTiles[chosenBus], MEM_VRAM_OBJ, 6400);
	CpuFastCopy(busPal[chosenBus], MEM_PAL_OBJ, 16);
	CpuFastClear(0xF080F080, BG1 + 0x180, 64);
	CpuFastClear(0xF081F081, BG1 + 0x1A0, 64);
	for (i = 0; i < 4; i++)
	{
		OamBak[i].CharNo = i * 4;
		OamBak[i].VPos = 48;
		OamBak[i].Size = 2;
		OamBak[i + 4].CharNo = 128 + (i * 4);
		OamBak[i + 4].VPos = 48 + 32;
		OamBak[i + 4].Size = 2;
		OamBak[i + 4].Shape = 1;
		OamBak[i].HPos = ((distance - 256) / 2) + (i * 32);
		OamBak[i + 4].HPos = ((distance - 256) / 2) + (i * 32);
	}
	Write("==**CrazyBus Advance 0.5**==", 1, 16);
	sprintf(b, "Distance: %d  ", distance);
	Write(b, 1, 1);
	FadeIn();
	while(1)
	{
		for (i = 0; i < 4; i++)
		{
			OamBak[i].HPos = ((distance - 256) / 2) + (i * 32);
			OamBak[i + 4].HPos = ((distance - 256) / 2) + (i * 32);
		}
		sprintf(b, "Distance: %d  ", distance);
		Write(b, 1, 1);
		DoVBlank();
		KeyRead();
		if (Cont & R_KEY)
		{
			distance++;
			DrivingNoise();
		}
		else if (Cont & L_KEY)
		{
			distance--;
			DrivingNoise();
		}
		else if (Trg & START_BUTTON)
		{
			FadeOut();
			DmaArrayClear(160, OamBak);
			return;
		}
		if (Trg & A_BUTTON)
		{
			ClaxonNoise();
 		}
	}
}
Twitter
Paypal
Old stuff
EliteMap EliteMap on GitHub Sappy Sappy on GitHub
Index
Noxico The Pile Window sitters Logo Pending ChelsieBound Starbound mods Starbound JSON Lab Felinese SCI OpenPoké MLPFIM Color Guide The State of SNES Emulation series mirror

The Helmeted Rodent

Program Manager