Buenas.
Está hecho ya en Linux en C y en Windows en C#, puedo dar el código completo pero no lo haré y funciona.
Cada uno lo puede hacer como quiera, cada persona tiene su forma de pensar y hacer programas internamente diferente aunque en apariencia sean ideánticas, solo que cada uno usa optimizaciones o no.
Para que se hagan una idea. Aquí en
este enlace dice:
Native Sony Format
Internally, a PlayStation memory card has a single 1-megabit EEPROM chip. This chip can store a total of 128 kilobytes of data, divided into sixteen blocks. Each block, in turn, contains 64 frames, each of which is 128 bytes. While this arrangement may appear strange, it's primarily an optimisation measure, since the hardware reads and writes the card in one kilobit or 128 byte chunks.
The first thing most people say when they hear that a memory card has 16 blocks is generally "you mean FIFTEEN blocks". No, sixteen; the first block contains a directory of the other fifteen blocks. Each directory entry consumes one of the 64 frames in this block, and takes the following format.
FRAME 0: Identification frame, used to determine whether the data is a valid PlayStation memory card.
FRAMES 1 - 15: Directory frame, detailing the nature of the save data in the appropriate block.
FRAMES 16 - 35: Reserved. Formatted as per normal directory frames, with the "reserved" block type and all implied data.
FRAMES 36 - 62: Unused. All bytes in this region are set to 0xFF.
FRAME 63: Write test. If it is desired to do a "test write" of data, this frame can be used without damaging the memory card.
The identification frame is constant, and always contains the following data. If the data differs from this, the card has not yet been formatted.
The two characters "MC".
125 NUL bytes (0x00).
The XOR byte (0x0E).
The XOR byte needs a little clarification. This byte is calculated through an XOR of the preceding 127 bytes; one simply loops through from byte to byte as follows:
char xor=0;
for(int x=0;x<127;x++) xor^=frame
frame[127]=xor;
Since any number XORed with itself is 0, you can verify this byte with the following code:
char xor=0;
for(int x=0;x<128;x++) xor^=frame
if(xor==0) return 1; // XOR code correct
return 0; // XOR code incorrect
En español traducido por google.
https://translate.google.com/translate?hl=es&sl=en&tl=es&u=https%3A%2F%2Fweb.archive.org%2Fweb%2F20100123200342%2Fhttp%3A%2F%2Fwww.darklock.com%2Fthps%2Fdexdrive.htmlVamos por parte, el código lo hice en C# en modo consola.
using System;
namespace DexDrive_for_prueba
{
class Program
{
static void Main(string[] args)
{
sbyte[] frame = new sbyte[128];
frame[0] = (sbyte)'M';
frame[1] = (sbyte)'C';
for (int k = 2; k < frame.Length - 1; k++) frame[k] = 0;
frame[127] = 0x0E;
sbyte xor = 0;
for (int x = 0; x < 128; x++) xor ^= frame[x];
// Muestra 1.
Console.WriteLine(xor == 0 ? "FRAME 0 formateado" : "XOR code incorrect");
// Muestra 2.
if (xor == 0)
{
Console.WriteLine("FRAME 0 formateado");
}
else
{
Console.WriteLine("XOR code incorrect");
}
Console.ReadKey();
}
}
}
Así se empieza poco a poco.
Saludos 2016.
PD:
Pues si, como mejora se puede poner dibujos en los botones.