Exemplo n.º 1
0
void RestoreConfig(void)
{
   unsigned char t = Menu[CurrentMenu].Sub;    // preserve active menu option
   unsigned short i;
   
   if ((F_Buff[0] == 0x30) && (F_Buff[1] == 0x00)) {
      Erase_Sensitivity();
      memcpy(Item_Index, F_Buff + 2, sizeof(Item_Index));
      memcpy(Hide_Index, F_Buff + 64, sizeof(Hide_Index));
      for (i = 0; i < 9; i ++)
        Menu[i].Sub = CheckSub(Menu[i].Sub,F_Buff[2 + 96 + i]);
      Menu[CurrentMenu].Sub = t;  // restore active menu
   }
   ApplyConfig();
}
Exemplo n.º 2
0
Arquivo: font.cpp Projeto: tkochi/xm8
//
// CheckROM()
// check rom files
//
bool Font::CheckROM()
{
	// PC88.ROM contains N88/N80/Sub/Extend ROMs
	if (CheckSub(PC88_FILE, false) == true) {
		// save rom version
		rom_version[0] = kanji_rom[ROM_VER_ADDR1 + 0x16000];
		rom_version[1] = kanji_rom[ROM_VER_ADDR2 + 0x00000];
		rom_version[2] = kanji_rom[ROM_VER_ADDR3 + 0x00000];
		rom_version[3] = kanji_rom[ROM_VER_ADDR4 + 0x14000];

		// PC88.ROM is OK
		if (CheckSub(N80_FILE, false) == true) {
			rom_version[0] = kanji_rom[ROM_VER_ADDR1];
		}
		if (CheckSub(N88_FILE, false) == true) {
			rom_version[1] = kanji_rom[ROM_VER_ADDR2];
			rom_version[2] = kanji_rom[ROM_VER_ADDR3];
		}
		if (CheckSub(DISK_FILE, false) == true) {
			rom_version[3] = kanji_rom[ROM_VER_ADDR4];
		}
	}
	else {
		// PC88.ROM is not found
		if (CheckSub(N80_FILE, true) == false) {
			return false;
		}
		rom_version[0] = kanji_rom[ROM_VER_ADDR1];

		if (CheckSub(N88_FILE, true) == false) {
			return false;
		}
		rom_version[1] = kanji_rom[ROM_VER_ADDR2];
		rom_version[2] = kanji_rom[ROM_VER_ADDR3];

		if (CheckSub(DISK_FILE, true) == false) {
			return false;
		}
		rom_version[3] = kanji_rom[ROM_VER_ADDR4];

		if (CheckSub(N88EXT0_FILE, true) == false) {
			return false;
		}

		if (CheckSub(N88EXT1_FILE, true) == false) {
			return false;
		}

		if (CheckSub(N88EXT2_FILE, true) == false) {
			return false;
		}

		if (CheckSub(N88EXT3_FILE, true) == false) {
			return false;
		}
	}

	// KANJI1.ROM is mandatory to display menu
	if (CheckSub(KANJI1_FILE, true) == false) {
		return false;
	}

	return true;
}