MinGWC:\fbasrc>make >log.txtsrc/burn/neogeo/neo_run.cpp: In function `int LoadRoms(NeoGameInfo*)':src/burn/neogeo/neo_run.cpp:547: warning: ISO C++ forbids variable-size array ` buffer'src/burn/neogeo/neo_decrypt.cpp:448: warning: ISO C++ forbids declaration of ` NeoExtractSData' with no typesrc/burn/neogeo/neo_decrypt.cpp: In function `int NeoExtractSData(unsigned char*, unsigned char*, int, int)':src/burn/neogeo/neo_decrypt.cpp:448: new declaration `int NeoExtractSData(unsigned char*, unsigned char*, int, int)'src/burn/neogeo/neogeo.h:115: ambiguates old declaration `void NeoExtractSData(unsigned char*, unsigned char*, int, int)'src/burn/neogeo/neo_decrypt.cpp: In function `int NeoExtractSData(unsigned char*, unsigned char*, int, int)':src/burn/neogeo/neo_decrypt.cpp:481: `BITSWAP08' undeclared (first use this function)src/burn/neogeo/neo_decrypt.cpp:481: (Each undeclared identifier is reported only once for each function it appears in.)src/burn/neogeo/neo_decrypt.cpp:484: warning: no return statement in function returning non-voidC:\MINGW\BIN\MAKE.EXE: *** [neo_decrypt.o] Error 1MinGWC:\fbasrc>exit
And here's the P rom decryption code for these P roms (svcplus):Code: [Select] {"svc-p1p.bin", 0x200000, 0xA194D842, 0x10}, // 0 68K code {"svc-p2p.bin", 0x200000, 0x50C0E2B7, 0x10}, // 1 {"svc-p3p.bin", 0x200000, 0x58CDC293, 0x10}, // 2Code: [Select]// Analyzed by HalRIN - http://www52.tok2.com/home/foge/static void svcplus_px_decrypt(){ int sec[] = {0x00, 0x03, 0x02, 0x05, 0x04, 0x01}; unsigned char *src = Neo68KROM01; int i,ofst,rom_size = 0x600000; unsigned char *dst = (unsigned char*)malloc( rom_size ); memcpy( dst, src, rom_size ); for( i = 0; i < rom_size / 2; i++ ){ ofst = BITSWAP24( (i & 0xfffff), 0x17, 0x16, 0x15, 0x14, 0x13, 0x00, 0x01, 0x02, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x10, 0x11, 0x12 ); ofst ^= 0x0f0007; ofst += (i & 0xff00000); memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 ); } memcpy( dst, src, rom_size ); for( i = 0; i < 6; i++ ){ memcpy( &src[ i << 20 ], &dst[ sec[ i ] << 20 ], (1 << 20) ); } free( dst ); *((unsigned short*)(Neo68KROM01 + 0xF8016)) = 0x33c1; // Patch protected address}
{"svc-p1p.bin", 0x200000, 0xA194D842, 0x10}, // 0 68K code {"svc-p2p.bin", 0x200000, 0x50C0E2B7, 0x10}, // 1 {"svc-p3p.bin", 0x200000, 0x58CDC293, 0x10}, // 2
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/static void svcplus_px_decrypt(){ int sec[] = {0x00, 0x03, 0x02, 0x05, 0x04, 0x01}; unsigned char *src = Neo68KROM01; int i,ofst,rom_size = 0x600000; unsigned char *dst = (unsigned char*)malloc( rom_size ); memcpy( dst, src, rom_size ); for( i = 0; i < rom_size / 2; i++ ){ ofst = BITSWAP24( (i & 0xfffff), 0x17, 0x16, 0x15, 0x14, 0x13, 0x00, 0x01, 0x02, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x10, 0x11, 0x12 ); ofst ^= 0x0f0007; ofst += (i & 0xff00000); memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 ); } memcpy( dst, src, rom_size ); for( i = 0; i < 6; i++ ){ memcpy( &src[ i << 20 ], &dst[ sec[ i ] << 20 ], (1 << 20) ); } free( dst ); *((unsigned short*)(Neo68KROM01 + 0xF8016)) = 0x33c1; // Patch protected address}
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/void NeoExtractSData(unsigned char* rom, unsigned char* sdata, int rom_size, int sdata_size){ int i; if (sdata_size == 0x100000) { unsigned char *src = rom + rom_size - 0x1000000 - 0x80000; unsigned char *dst = sdata; // This extracts the first 512k of S data for( i = 0; i < sdata_size / 2; i++ ) { dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ]; } src = rom + rom_size - 0x80000; dst = sdata + 0x80000; // This extracts the second 512k of S data for( i = 0; i < sdata_size / 2; i++ ) { dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ]; } // This descrambles the S data (kof2003) dst = sdata; for( i = 0; i < sdata_size; i++ ) { dst[ i ] = BITSWAP08( dst[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 ); } } else { /* the S data comes from the end fo the C data */ rom += rom_size - sdata_size; for ( i = 0; i < sdata_size; i++) { sdata[i] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)]; } }}
#include "bitswap.h"
// Original code by HalRIN -- http://www52.tok2.com/home/foge/static void svcchaos_px_decrypt( void ){ const unsigned char xor1[ 0x20 ] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f, }; const unsigned char xor2[ 0x20 ] = { 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4, 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26, }; int i; int ofst; unsigned char *rom, *buf; rom = Neo68KROM01; for( i = 0; i < 0x100000; i++ ){ rom[ i ] ^= xor1[ (i % 0x20) ]; } for( i = 0x100000; i < 0x800000; i++ ){ rom[ i ] ^= xor2[ (i % 0x20) ]; } for( i = 0x100000; i < 0x800000; i += 4 ){ UINT16 *rom16 = (UINT16*)&rom[ i + 1 ]; *rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 ); } buf = (unsigned char*)malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); for( i = 0; i < 0x0100000 / 0x10000; i++ ){ ofst = (i & 0xf0) + BITSWAP08( (i & 0x0f), 7, 6, 5, 4, 2, 3, 0, 1 ); memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 ); } for( i = 0x100000; i < 0x800000; i += 0x100 ){ ofst = (i & 0xf000ff) + ((i & 0x000f00) ^ 0x00a00) + (BITSWAP08( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) << 12); memcpy( &rom[ i ], &buf[ ofst ], 0x100 ); } free( buf ); buf = (unsigned char*)malloc( 0x800000 ); memcpy( buf, rom, 0x800000 ); memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 ); memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 ); free( buf );}
i got the NeoExtractSData code to compile but i still cant get the text data to work properly for svcnd. do i need to add HARDWARE_SNK_ALTERNATE_TEXT and/or set the nTextBankSwitch?
srom = NeoTextROM+0x20000; (int i=0;i srom[i]=BITSWAP08(srom[i]^0xd2,4,0,7,2,5,1,6,3 );
also, will it work for kof2003 8x8 C ROMs?
sorry for asking like a n00b to this but i havent followed this driver scene for a while now
if (nTextBankswitch == 1) { unsigned char* dst = (unsigned char*)malloc(0x20000); unsigned char* roms1 = NeoTextROM+0x20000; if ( dst ) { memcpy(dst,roms1,0x20000); for ( int j=0;j<0x20000 ; j+=0x000010) { memcpy( roms1+j, dst+j+0x000008,8); memcpy( roms1+j+0x000008, dst+j,8); } } free( dst ); }if (nTextBankswitch == 2) { unsigned char* srom = NeoTextROM+0x20000; unsigned char* dst2 = (unsigned char*)malloc(0x80000); memcpy( dst2+0x00000, srom+0x60000, 0x20000 ); memcpy( dst2+0x20000, srom+0x40000, 0x20000 ); memcpy( dst2+0x40000, srom+0x20000, 0x20000 ); memcpy( dst2+0x60000, srom+0x00000, 0x20000 ); memcpy( srom, dst2, 0x80000 ); free(dst2);}
src/burn/neogeo/neo_run.cpp: In function `int LoadRoms(NeoGameInfo*)':src/burn/neogeo/neo_run.cpp:460: parse error before `=' tokensrc/burn/neogeo/neo_run.cpp:459: warning: unused variable `unsigned char*srom'src/burn/neogeo/neo_run.cpp:553: warning: ISO C++ forbids variable-size array ` buffer'C:\MINGW\BIN\MAKE.EXE: *** [neo_run.o] Error 1