Author Topic: NeoTextROMFix code  (Read 14277 times)

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
NeoTextROMFix code
« Reply #15 on: December 13, 2004, 09:37:40 PM »
I would not worry about it The code is useless , Does not work for FBA .
IQ Forum Member

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
NeoTextROMFix code
« Reply #16 on: December 14, 2004, 11:10:39 PM »
Quote from: James33
I would not worry about it The code is useless , Does not work for FBA .

It works, the problem is that FBA is not loading the data correctly, but the descrambling is correct, i think that fataku's code is better because it works either with 128 KB version and 256, the second doesn't work correctly because the loading routine for this rom is not correct at all, test the fataku version splitting the s1 rom, you'll see that works, the other s1 probs come from the rom itself...
I hope someone can fix the 256 KB s1 rom problem :(
See ya!!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
NeoTextROMFix code
« Reply #17 on: December 14, 2004, 11:11:01 PM »
Quote from: Shoometsu
Code: [Select]


NeoTextROM = (unsigned char*)malloc(nNeoTextROMSize + 0x020000);
if (NeoTextROM == NULL) {
return 1;

                options 1 to 5 here

        } else {
// Extract data from the end of C ROMS
BurnUpdateProgress(0.0, "Gerando gráficos de texto ", 0);
NeoExtractSData(NeoSpriteROM, NeoTextROM + 0x020000, nSpriteSize, nNeoTextROMSize);

                option 6 here


 where do I insert the 7th option? with the other 5 or with the 6th in thi "if" structure?

after option 5

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline Shoometsu

  • Jr. Member
  • **
  • Posts: 66
  • Karma: +0/-0
  • I finally have an avatar XD
NeoTextROMFix code
« Reply #18 on: December 15, 2004, 03:46:52 PM »
Quote from: FerchogtX
after option 5


thkx again XD
<- Who are you?

Offline Sho

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
  • Junior Member
NeoTextROMFix code
« Reply #19 on: February 23, 2005, 06:39:21 AM »
where is the option 8

thx!

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
NeoTextROMFix code
« Reply #20 on: February 23, 2005, 12:12:08 PM »
Just use the same option you've been using for kof2003, if that's what you mean...


Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
NeoTextROMFix code
« Reply #21 on: February 23, 2005, 08:24:51 PM »
Quote from: Sho
where is the option 8

thx!


ok,this is my NeoTextROMFix code:

Code: [Select]

/* Original code from mame - converted by FerchogtX */
switch (nNeoTextROMFixType) {
unsigned char *srom, *dst;

case 1:
/* Thanks to Badzou for the info */
/* Descrambling S1 by dorriga */
srom = NeoTextROM + 0x20000;
dst = (unsigned char*)malloc(0x80000);
memcpy(dst+0x00000, srom+0x60000, 0x20000);
memcpy(dst+0x20000, srom+0x40000, 0x20000);
memcpy(dst+0x40000, srom+0x20000, 0x20000);
memcpy(dst+0x60000, srom+0x00000, 0x20000);
memcpy(srom, dst, 0x80000);
free(dst);
break;

case 3:
/* Thanks also to HappyASR for the info */
srom = NeoTextROM + 0x20000;
dst = (unsigned char *)malloc(0x20000);
memcpy(dst, srom, 0x20000);
// descrambling the S1 by dorriGa
for (int i=0; i<0x20000; i+=0x10){
memcpy(srom+i, dst+i+0x08, 0x08);
memcpy(srom+i+0x08, dst+i, 0x08);
}
free(dst);
break;

case 4:
/* Descrambling S1 by FerchogtX, based on DorriGa's code */
srom = NeoTextROM+0x20000;
dst = (unsigned char*)malloc(0x20000);
memcpy(dst+0x00000, srom+0x10000, 0x10000);
memcpy(dst+0x10000, srom+0x00000, 0x10000);
memcpy(srom, dst, 0x20000);
free(dst);
break;

case 5:
/* Original code for MAME by fataku */
/* This is for kf2k1pla */
       srom = NeoTextROM+0x20000;
       for (int i=0; i<0x20000; i++)
       srom[i]=BITSWAP08(srom[i],3,2,4,5,1,6,0,7);
break;

case 6:
/* Original code taken from MAME */
/* This is for CTHD2003 */
srom = NeoTextROM+0x20000;
dst = (unsigned char*)malloc(0x10000);
memcpy(dst+0x00000,srom+0x10000,0x08000);
memcpy(dst+0x08000,srom+0x08000,0x08000);
memcpy(srom+0x08000,dst,0x10000);
free(dst);
break;

case 7:
// Converted by Jimmy_Page (www.neofighters.com)
srom = NeoTextROM+0x20000;
for (int i=0; i<0x20000; i++)
srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);
break;

case 8:
srom = NeoTextROM+0x20000;
for (int i=0; i srom[i]=BITSWAP08(srom[i]^0xd2,4,0,7,2,5,1,6,3 );
break;

case 9:
/* thanks to dorriGa and arnoldso for analyze the scramble
Original Code by HalRIN, Converted by JiMMy_PaGe
This is for cthd2003 super plus */
srom = NeoTextROM+0x20000;
dst = (unsigned char*)malloc( 0x20000 );
int i, ofst;
memcpy( dst, srom, 0x20000 );
for( i=0; i<0x20000; i++ ){
ofst = BITSWAP24( (i & 0x1ffff),23,22,21,20,19,18,17,3,
               0,1,4,2,13,14,15,16,
               5,6,11,10,9,8,7,12 );

ofst += (i >> 17) << 17;
srom[i] = dst[ofst];
}
free( dst );
break;
}


Code: [Select]

nNeoTextROMFixType = 0;
for kof2k3bc S1,^_^
{"271-s1bc.bin", 0x080000, 0x4FB43DDF,    1}, //  2 Text layer tiles (scrambled)

==========================
nNeoTextROMFixType = 2;
for kof2k3bb S1,^_^
{"271-s1bb.bin", 0x080000, 0xB52800D8,    1}, //  2 Text layer tiles (scrambled)

Offline Sho

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
  • Junior Member
NeoTextROMFix code
« Reply #22 on: February 26, 2005, 06:00:00 PM »
thank you very much

Offline youngshare

  • Newbies
  • *
  • Posts: 17
  • Karma: +0/-0
  • Junior Member
Re: NeoTextROMFix code
« Reply #23 on: July 16, 2005, 01:21:59 AM »
Very very very Great code! :biggrin:
It helps me to get the "blending" HP of kof2003, thx!