public void ReadHeader() { MemoryTool.memcpy(nesm, 0x00, dataArray, 0x00, sizeof(Byte) * 5); version = GetByte(0x05); musicNum = GetByte(0x06); startMusicNumber = GetByte(0x07); loadAddress = GetWord(0x08); initAddress = GetWord(0x0A); startAddress = GetWord(0x0C); MemoryTool.memcpy(title, 0x00, dataArray, 0x0E, sizeof(Byte) * 32); MemoryTool.memcpy(artist, 0x00, dataArray, 0x2E, sizeof(Byte) * 32); MemoryTool.memcpy(maker, 0x00, dataArray, 0x4E, sizeof(Byte) * 32); frequency = GetWord(0x6E); bank0 = GetByte(0x70); bank1 = GetByte(0x71); bank2 = GetByte(0x72); bank3 = GetByte(0x73); bank4 = GetByte(0x74); bank5 = GetByte(0x75); bank6 = GetByte(0x76); bank7 = GetByte(0x77); frequencyPal = GetWord(0x78); mode = GetByte(0x7A); expectFlag = GetByte(0x7B); if (nesm[0] != 'N' || nesm[1] != 'E' || nesm[2] != 'S' || nesm[3] != 'M') { // To Be Fixed. //MessageBox( NULL, TEXT( "?T?|?[?g???????????t?@?C???????B" ), TEXT( "?G???[" ), MB_OK ); //exit( 1 ); } }
public MusicNsf(Stream aStream) { Byte[] lDataArray = new Byte[aStream.Length]; aStream.Read(lDataArray, 0, lDataArray.Length); dataSize = lDataArray.Length - 0x80; if (dataSize >= 0x8000) { Logger.LogError("?T?|?[?g???????????t?@?C???????B"); // To Be Fixed. //MessageBox( NULL, TEXT( "?T?|?[?g???????????t?@?C???????B" ), TEXT( "?G???[" ), MB_OK ); //exit( 1 ); } header = new CNsfHeader(lDataArray); dataArray = new Byte[0x10000]; MemoryTool.memcpy(dataArray, 0x00, lDataArray, 0x80, dataSize); musicNumber = ( char )(header.GetStartMusicNumber() - 1); Logger.LogNormal("%d????????\n" + ( int )(musicNumber + 1)); }
public void ReadHeader() { nes = new Byte[4]; MemoryTool.memcpy(nes, 0x00, dataArray, 0x00, sizeof(Byte) * 4); prgBanks = GetByte(0x04); // PRG-ROM?y?[?W?? chrBanks = GetByte(0x05); // CHR0ROM?y?[?W?? controll1 = GetByte(0x06); // ?R???g???[???o?C?g1 controll2 = GetByte(0x07); // ?R???g???[???o?C?g2 zero1 = GetByte(0x08); // 00 zero2 = GetByte(0x09); // 00 mode = GetByte(0x0A); // NTCS/PAL zero4 = GetByte(0x0B); // 00 zero5 = GetByte(0x0C); // 00 zero6 = GetByte(0x0D); // 00 zero7 = GetByte(0x0E); // 00 zero8 = GetByte(0x0F); // 00 if (nes[0] != 'N' || nes[1] != 'E' || nes[2] != 'S') { // To Be Fixed. //MessageBox( NULL, TEXT( "?T?|?[?g???????????t?@?C???????B" ), TEXT( "?G???[" ), MB_OK ); //exit( 1 ); } }
private Byte expectFlag; // ?g???t???O 0x7B public CNsfHeader(Byte[] aDataArray) { dataArray = new Byte[0x80]; MemoryTool.memcpy(dataArray, 0x00, aDataArray, 0x00, 0x80); // nsf?w?b?_?????????? ReadHeader(); // nsf?w?b?_???\?? PrintHeader(); }
public NesRom(Byte[] aDataArray) { dataSize = aDataArray.Length - 0x10; if (dataSize >= 0x10000) { // To Be Fixed. //MessageBox( NULL, TEXT( "?T?|?[?g???????????t?@?C???????B" ), TEXT( "?G???[" ), MB_OK ); //exit( 1 ); } header = new CNesHeader(aDataArray); dataArray = new Byte[0x10000]; MemoryTool.memcpy(dataArray, 0x00, aDataArray, 0x10, dataSize); }
public CVram(NesRom rom) { MemoryTool.memcpy(data, 0x00, rom.GetDataArray(), 0x8000, sizeof(Byte) * 0x2000); }
public NesMemory(MusicNsf nsf) { Logger.LogNormal(nsf.GetHeader().GetLoadAddress()); Logger.LogNormal(nsf.GetDataSize()); MemoryTool.memcpy(data, nsf.GetHeader().GetLoadAddress(), nsf.GetDataPoint(), 0x00, sizeof(Byte) * ( UInt16 )nsf.GetDataSize()); }