Exemplo n.º 1
0
		private void LoadRom(string fileName)
		{
			FileInfo fileInfo = new FileInfo(fileName);

			// Open only existing rom files
			if (!fileInfo.Exists)
				throw new FileNotFoundException();
			// Limit the rom size to 4 Mb
			if (fileInfo.Length > 4 * 1024 * 1024)
				throw new FileTooLongException();
			rom = MemoryUtility.ReadFile(fileInfo);
			memory = new FlexibleGameBoyMemory(rom);
			disassemblyView.Memory = memory;
			codeMap = new CodeMap(rom);
		}
Exemplo n.º 2
0
        private void LoadRom(string fileName)
        {
            FileInfo fileInfo = new FileInfo(fileName);

            // Open only existing rom files
            if (!fileInfo.Exists)
            {
                throw new FileNotFoundException();
            }
            // Limit the rom size to 8 Mb
            if (fileInfo.Length > 8 * 1024 * 1024)
            {
                throw new FileTooLongException();
            }
            rom    = MemoryUtility.ReadFile(fileInfo, true);
            memory = new FlexibleGameBoyMemory(rom);
            disassemblyView.Memory = memory;
            codeMap = new CodeMap(rom);
        }