Final Burn Neo > FBN Development

neo_pvc code for FBA

(1/3) > >>

iq_132:
Here's the neo_pvc code for kof2003 (pcb version).
Note that you will also need the bankswitch to make this game work.


--- Code: ---// Original code by HalRIN -  http://www52.tok2.com/home/foge/
// Converted to FBA code by IQ_132 - http://neosource.1emu.net/
static void kof2003_px_decrypt()
{
interleave_pdata();

const unsigned char xor2[ 0x20 ] = {
0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa,
0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0B, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9
};

int i;
int ofst;
unsigned char *rom, *buf;

rom = Neo68KROM01;

for( i = 0x100000; i < 0x800000; i++ ){
rom[ i ] ^= xor2[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x800000; i += 4 ){
unsigned char *rom16 = (unsigned char*)&rom[ i + 1 ];
*rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 4, 5, 6, 7, 8, 9, 10, 11, 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, 1, 0, 3, 2 );
memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
}

for( i = 0x100000; i < 0x800000; i += 0x100 ){
ofst = (i & 0xf000ff) +
  ((i & 0x000f00) ^ 0x00300) +
  (BITSWAP08( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) > 12), 4, 5, 6, 7, 1, 0, 3, 2 )

iq_132:
Make sure you have one of these P interleaving codes somewhere in your d_neogeo.cpp or most of those neo_pvc codes will not compile.

Here's fataku's version (which is much nicer)

--- Code: ---// Code by fataku
static void interleave_pdata()
{
int i;
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);
for (i=0;i

Shoometsu:
wich means that now we can run the x emu kof2003 pcb rom set? :D

Vorador:

--- Quote from: Shoometsu ---wich means that now we can run the x emu kof2003 pcb rom set? :D
--- End quote ---


Nope yet. We need the bankswitch code too  :mad:

Shoometsu:
seems to be a matter of time, since we have the neo pvc code XD

Navigation

[0] Message Index

[#] Next page

Go to full version