Exemplo n.º 1
0
//-------------------------------------------------------------------------------------------------
// Clears characters generator area of display RAM memory
//-------------------------------------------------------------------------------------------------
void T6963::clearCG(){
  unsigned int i=((_sizeMem/2)-1)*0x800;
  SetAddressPointer(i);
  for(i = 0; i < 256 * 8; i++){
    WriteDisplayData(0);
  }
}
Exemplo n.º 2
0
//-------------------------------------------------------------------------------------------------
// Writes single char pattern to character generator area of display RAM memory
//-------------------------------------------------------------------------------------------------
void T6963::DefineCharacter(byte charCode, unsigned char * defChar){
  unsigned int address=((_sizeMem/2)-1)*0x800;
  SetAddressPointer(address);
  for(byte i = 0; i < 8 ; i++){
    WriteDisplayData(*(defChar + i));
  }
}
Exemplo n.º 3
0
//-------------------------------------------------------------------------------------------------
// Set (if color==1) or clear (if color==0) pixel on screen
//-------------------------------------------------------------------------------------------------
void T6963::writePixel(byte x, byte y, byte color){
  unsigned char tmp;
  unsigned int address;
  address = _GH + (x / _FW) + (_GA * y);
  SetAddressPointer(address);
  writeCommand(T6963_DATA_READ_AND_NONVARIABLE);
  tmp = ReadData();
  if(color){
    tmp |= (1 <<  (_FW - 1 - (x % _FW)));
  }
  else{
    tmp &= ~(1 <<  (_FW - 1 - (x % _FW)));
  }
  WriteDisplayData(tmp);
}
	void saveDisplayStatus(StaticFunctionTag*, TESObjectREFR* pObject, bool addContributor = true)
	{
		Json::Value jsonDisplayList = ReadDisplayData();

		const char * playerName = nullptr;

		TESFullName* pPlayerName = DYNAMIC_CAST((*g_thePlayer)->baseForm, TESForm, TESFullName);
		if (pPlayerName)
			playerName = pPlayerName->name.data;
		
		if (!saveDisplayStatus(jsonDisplayList, pObject, addContributor ? playerName : nullptr))
			_WARNING("Problem saving Display with FormID %08x", pObject->formID);

		WriteDisplayData(jsonDisplayList);
	}
	void deleteContributor(StaticFunctionTag*, BSFixedString characterName)
	{
		Json::Value jsonDisplayList = ReadDisplayData();
		
		for (auto & jsonDisplay : jsonDisplayList.getMemberNames())
		{
			Json::Value jsonDisplayData = jsonDisplayList[jsonDisplay.c_str()];
			Json::Value jsonContributors;
			if (jsonDisplayData.isMember("contributors"))
				jsonContributors = jsonDisplayData["contributors"];
			
			//Remove this character as a contributor
			for (int index = 0; index < jsonContributors.size(); ++index)
			{
				if (jsonContributors[index].asString() == characterName.data)
				{
					_MESSAGE("Removing %s from list of contributors.", characterName.data);
					Json::Value removed;
					jsonContributors.removeIndex(index, &removed);
					index--; //duplicate names shouldn't be a thing, but you never know
					jsonDisplayData["contributors"] = jsonContributors;
				}
			}

			//If this character was the only contributor, remove the entry entirely
			if (!jsonDisplayData.isMember("contributors") || (jsonDisplayData.isMember("contributors") && !jsonContributors.size()))
			{
				_MESSAGE("Last contributor was removed, deleting entry for %s!", jsonDisplay.c_str());
				jsonDisplayList.removeMember(jsonDisplay.c_str());
			}
			else {
				jsonDisplayList[jsonDisplay.c_str()] = jsonDisplayData;
			}
		}
		WriteDisplayData(jsonDisplayList);
	}
Exemplo n.º 6
0
//-------------------------------------------------------------------------------------------------
// Writes a single character (ASCII code) to display RAM memory
//-------------------------------------------------------------------------------------------------
void T6963::WriteChar(char charCode)
{
  WriteDisplayData(charCode - 32);
}
Exemplo n.º 7
0
//-------------------------------------------------------------------------------------------------
// Clears graphics area of display RAM memory
//-------------------------------------------------------------------------------------------------
void T6963::clearGraphic(){
  SetAddressPointer(_GH);
  for(unsigned int i = 0; i < sizeGA; i++){
    WriteDisplayData(0x00);
  }
}
Exemplo n.º 8
0
//-------------------------------------------------------------------------------------------------
//
// Clears text area of display RAM memory
//
//-------------------------------------------------------------------------------------------------
void T6963::clearText(){
  SetAddressPointer(_TH);
  for(int i = 0; i < sizeTA; i++){
    WriteDisplayData(0);
  }
}