Author Topic: IQ's PGM WIP  (Read 322859 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
IQ
« Reply #30 on: February 23, 2009, 05:57:53 PM »
Kovsh in nebula is different? hmm... as for kovsh in mame, it's not emulated (the arm7 isn't hooked up, causing graphics issues).


Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
IQ
« Reply #31 on: February 23, 2009, 07:17:11 PM »
Yes...here info from the kovsh set i've used....

Code: [Select]
p0600.322 crc 7c78e5f3 size 4 194 304
kovsh_v100_china.asic crc f09a5c1 size 16 384
t0600.320 crc 164b3c94 size 4 194 304
a0604.rom crc 26b59fd3 size 4 194 304
b0602.rom crc c3e0b454 size 4 194 304
b0602.v200 crc 9df77934 size 1 048 576

I've noticed also that in Nebula, Elsemi has used the same kov2 ARM Asic protection rom for kov2nd and kof2106 (known as sango2.rom crc e0d7679f) and added the PGM BIOS in set kov2106 and kov2nd to get them work...

Now have tested a new kov2p set known as kov2p205 set (not the same as kov2p/kov2nd in Nebula) and works fine !!!

[see attached files]
1) kov2nd Nebula 2.25b
2 to 6) kov2p205 Nebula 2.25b
« Last Edit: February 23, 2009, 07:22:55 PM by JacKc »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
IQ's PGM WIP
« Reply #32 on: February 24, 2009, 01:26:00 AM »
Hmm... I'll take a look at that when I get home, I'm visiting my sister for the next day or two.
« Last Edit: February 24, 2009, 12:16:34 PM by iq_132 »


Offline narcissus

  • Newbies
  • *
  • Posts: 23
  • Karma: +1/-8
Re: IQ's PGM WIP
« Reply #33 on: February 25, 2009, 06:01:09 PM »
Jackc...
the correct extra rom set of kovsh in nebula 2.25b is

p0600.322 crc 7c78e5f3 size 4 194 304
kovsh_v100_china.asic crc f09a5c1 size 16 384
t0600.320 crc 164b3c94 size 4 194 304   
a0604.v200 crc 26b59fd3 size 4 194 304
b0602.v200 crc 9df77934 size 1 048 576
« Last Edit: February 25, 2009, 06:03:55 PM by narcissus »

Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: IQ's PGM WIP
« Reply #34 on: February 25, 2009, 07:42:30 PM »
Jackc...
the correct extra rom set of kovsh in nebula 2.25b is

p0600.322 crc 7c78e5f3 size 4 194 304
kovsh_v100_china.asic crc f09a5c1 size 16 384
t0600.320 crc 164b3c94 size 4 194 304   
a0604.v200 crc 26b59fd3 size 4 194 304
b0602.v200 crc 9df77934 size 1 048 576

Yes...This is the correct set...But used this set + extra ROm a0602.rom (not included in set nebula) :cool: ... And if you look, a0604.v200 and a0604.rom are the same rom (just different name but same crc and same size)
« Last Edit: February 25, 2009, 07:44:13 PM by JacKc »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: IQ's PGM WIP
« Reply #35 on: February 26, 2009, 01:19:37 AM »
In case anyone was wondering, kov2p is not encrypted the same way as kov2.  Actually, the code to decrypt it isn't even in MAME.

Anyway...

Code: [Select]
static const unsigned char kov2p_tab[256] = {
0x44, 0x47, 0xB8, 0x28, 0x03, 0xA2, 0x21, 0xBC, 0x17, 0x32, 0x4E, 0xE2, 0xDF, 0x69, 0x35, 0xC7,
0xA2, 0x06, 0xEC, 0x36, 0xD2, 0x44, 0x12, 0x6A, 0x8D, 0x51, 0x6B, 0x20, 0x69, 0x01, 0xCA, 0xF0,
0x71, 0xC4, 0x34, 0xDC, 0x6B, 0xD6, 0x42, 0x2A, 0x5D, 0xB5, 0xC7, 0x6F, 0x4F, 0xD8, 0xB3, 0xED,
0x51, 0x9E, 0x37, 0x1E, 0xC0, 0x85, 0x2A, 0x91, 0xC6, 0x9C, 0xAC, 0xF5, 0x20, 0x3B, 0x09, 0x74,
0x24, 0xF1, 0xE0, 0x42, 0x02, 0xBE, 0x84, 0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A, 0xF9, 0x66
};

void pgm_kov2p_decrypt()
{
unsigned short *rom = (unsigned short*)USER0;

for (int i = 0; i < 0x200000 / 2; i++) {
int x = kov2p_tab[(i >> 1) & 0xff] << 8;

if ((i & 0x040080) != 0x000080) x |= 0x0001;
if ((i & 0x004008) == 0x004008) x |= 0x0002;
if ((i & 0x080030) == 0x080010) x |= 0x0004;
if ((i & 0x000242) != 0x000042) x |= 0x0008;
if ((i & 0x008100) == 0x008000) x |= 0x0010;
if ((i & 0x002004) != 0x000004) x |= 0x0020;
if ((i & 0x011800) != 0x010000) x |= 0x0040;
if ((i & 0x000820) == 0x000820) x |= 0x0080;

rom[i] ^= x;
}
}

Nebula also patches the external arm7 rom with these:
Code: [Select]
static void kov2pHack()
{
unsigned char *src = USER0;

src[0x4ED8] = 0xA8;// B0
src[0x4EDC] = 0x9C;// A4
src[0x4EE0] = 0x5C;// 64
src[0x4EE4] = 0x94;// 9C
src[0x4EE8] = 0xE8;// F0
src[0x4EEC] = 0x6C;// 74
src[0x4EF0] = 0xD4;// DC
src[0x4EF4] = 0x50;// 58
src[0x4EF8] = 0x80;// 88
src[0x4EFC] = 0x9C;// A4
src[0x4F00] = 0x28;// 30
src[0x4F04] = 0x30;// 38
src[0x4F08] = 0x34;// 3C
src[0x4F0C] = 0x1C;// 24
}

Still doesn't mean it works in FBA or MAME though...
« Last Edit: February 26, 2009, 01:22:01 AM by iq_132 »


Offline Haze

  • MAME Devs
  • *****
  • Posts: 184
  • Karma: +47/-0
Re: IQ's PGM WIP
« Reply #36 on: February 27, 2009, 04:07:00 AM »
the internal rom returns the wrong ID for kov2p, so the game doesn't boot.

you can hack it to boot, but the fact remains, it's the wrong internal rom, so MAME won't do that.

there are also some hacked sets made for emus floating about...

Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: IQ's PGM WIP
« Reply #37 on: February 27, 2009, 09:36:22 AM »
Subject : background graphical Glitches in stage 2 for kov2.

Does the backround in stage 2 for kov2 is emulated as same way as Martial Masters? I'll take some snapshots and it's very strange...Maybe this background part is emulated as a sprite?

Sure this part is like a mask which as been applied to the "Real background"

1) Background graphical bug
2) Background graphical bug as disapeared for few seconds
3 to 6) no graphical glitches for background
« Last Edit: April 30, 2009, 01:17:42 PM by iq_132 »


Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: IQ's PGM WIP
« Reply #38 on: February 27, 2009, 12:42:21 PM »
Sorry for double post...I've tested all PGM Games supported by fba_029702_pgm2.

Here's the results :

* Chaos (PGM DEMO) [pgmdemo]
- Perfect graphics
Note : i was enable to "play" this demo (in the case it's playable)
- No sound (as i can't play this demo)

* Dragon World II (V110x, export) [drgw2]
- No graphical bugs
- Sounds seems to be well emulated

* Chuugokuryuu II (V110J, Japan) [drgw2j]
- No graphical bugs
- Sounds seems to be well emulated

* Zhong Guo Long II (V110C, China) [drgw2c]
- No graphical bugs
- Sounds seems to be well emulated

* Frog Feast (PGM) [pgmforg]
- No graphical bugs
- Sounds seems to be well emulated

* Knights of Valor - Sangoku Sanki (V117) [kov]
- Minor Graphical glitches (in Warning Screen and Title screen - See snaps 1 & 2)
Thoses bugs are already known by iq_132
- Sounds seems to be well emulated

* Knights of Valor - Sangoku Sanki (V100, Japenese Board) [kovj]
- No graphical bugs
- Sounds seems to be well emulated

* Knights of Valor - Sangoku Sanki (V115) [kov115]
- Minor Graphical glitches (in Warning Screen and Title screen - See snaps 3 & 4)
Same bugs as kov
- Sounds seems to be well emulated

* Knights of Valor Plus - Sangoku Sanki Plus (V119, alt) [kovplusa]
- No graphical bugs
- Sounds seems to be well emulated

* Knights of Valor Plus - Sangoku Sanki Plus (V119) [kovplus]
- No graphical bugs
- Sounds seems to be well emulated

* Knights of Valor 2 (V100) [kov2]
- Graphical bug in stage 2 (already known by iq_132)
- Sounds seems to be well emulated
Note: Maybe need to add the extra info V100 (see attached files)

* Knights of Valor 2 (V106) [kov2106]
- Game not working as second ARM7 CPU is not emulated (see attached snap)

* Martial Masters (USA, V104) [martmast]
- No graphical bugs (all previous graphical bugs have been solved by iq_132)
- Sounds seems to be well emulated

* Martial Masters (China, V101) [martmasc]
- No graphical bugs (all previous graphical bugs have been solved by iq_132)
- Sounds seems to be well emulated

* Oriental Legend - Xi Yo Gi Shi Re Zuang (V106) [orlegend]
- No graphical bugs
- Sounds seems to be well emulated

* Oriental Legend - Xi Yo Gi Shi Re Zuang (V111, Chinese Board)  [orld111c]
- No graphical bugs
- Sounds seems to be well emulated

* Oriental Legend - Xi Yo Gi Shi Re Zuang (V112) [orlegnde]
- No graphical bugs
- Sounds seems to be well emulated

* Oriental Legend - Xi Yo Gi Shi Re Zuang (V112, Chinese Board)  [orlegndc]
- No graphical bugs
- Sounds seems to be well emulated

* Oriental Legend - Xi Yo Gi Shi Re Zuang (V105, Korean Board)  [orlegndc]
- No graphical bugs
- Sounds seems to be well emulated

* P-GeMeni (060123) [pgemeni]
- Perfect graphics
Note : i was enable to "play" this demo (in the case it's playable)
- No sound (as i can't play this demo)

* Photo Y2K - Real and Fake (V104) [photo2yk]
- No graphical bugs
- Sounds seems to be well emulated

* Real and Fake - Photo Y2K (V102, Japenese Board) [raf102j]
- No graphical bugs
- Sounds seems to be well emulated

* Puzzle Star (v100MG) [puzlstar]
- No graphical bugs
- Sounds seems to be well emulated

* The Killing Blade (v104) [killbld]
- Not Working

* The Killing Blade (v109, Chinese Board) [killbldt]
- No graphical bugs
- Sounds seems to be well emulated
Notes : Unemulated protection
« Last Edit: February 27, 2009, 02:05:48 PM by JacKc »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: IQ's PGM WIP
« Reply #39 on: February 27, 2009, 12:48:45 PM »
the internal rom returns the wrong ID for kov2p, so the game doesn't boot.

you can hack it to boot, but the fact remains, it's the wrong internal rom, so MAME won't do that.

there are also some hacked sets made for emus floating about...

Hacking a game to work isn't really a problem for me.  My philosophy has always been playability first. However, I haven't managed to get kov2p to boot (in fba or MAME), with or without the patches that are applied by nebula. (Maybe I'm missing something. ^^)  Btw, thank you for your input Haze. I always appreciate it greatly. :)

Subject : background graphical Glitches in stage 2 for kov2.

Does the backround in stage 2 for kov2 is emulated as same way as Martial Masters? I'll take some snapshots and it's very strange...Maybe this background part is emulated as a sprite?

Sure this part is like a mask which as been applied to the "Real background"

1) Background graphical bug
2) Background graphical bug as disapeared for few seconds
3 to 6) no graphical glitches for background

That background glitch is directly related to priorities.  The layer of grass is actually a sprite and is drawn above the short layer of grass/ground (which is actually the background layer). Atm, there are only two sprite priorities, above and below the background layer -- I'm not sure if there should be more, or if there is a switch for the position of that back sprite layer.

In the changelog for Nebula 2.25, you see this:
2.25
Quote
   Fixed sprite priorities handling (required for kov2 & kof2nd)


Sorry for double post...I've tested all PGM Games supported by fba_029702_pgm2.

Here's the results :

* Chaos (PGM DEMO) [pgmdemo]
- Perfect graphics
Note : i was enable to "play" this demo (in the case it's playable)
- No sound (as i can't play this demo)

* Dragon World II (V110x, export) [drgw2]
- No graphical bugs
- Sounds seems to be well emulated

* Chuugokuryuu II (V110J, Japan) [drgw2j]
- No graphical bugs
- Sounds seems to be well emulated

* Zhong Guo Long II (V110C, China) [drgw2c]
- No graphical bugs
- Sounds seems to be well emulated

* Frog Feast (PGM) [pgmforg]
- No graphical bugs
- Sounds seems to be well emulated


Cool. :)
« Last Edit: February 27, 2009, 01:05:55 PM by iq_132 »


Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: IQ's PGM WIP
« Reply #40 on: February 27, 2009, 12:52:42 PM »
Sorry iq_132, i've not finish to edit my previous post :p

Check it in few minutes (i will add also a gift for all your works ;p)


Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: IQ's PGM WIP
« Reply #41 on: February 27, 2009, 01:01:55 PM »
No worries. :)

Btw, I've just fixed the graphics glitches in kov (117).


Offline JacKc

  • FBNeo Dev
  • ******
  • Posts: 1677
  • Karma: +56/-0
  • Hasta la vista, Baby !
Re: IQ's PGM WIP
« Reply #42 on: February 27, 2009, 02:11:19 PM »
previous post has been Fully edited with all my tests results...Now here the gift for Neosource :biggrin:

fba_029702_pgm2_previews.rar

« Last Edit: February 27, 2009, 02:14:14 PM by JacKc »


Offline narcissus

  • Newbies
  • *
  • Posts: 23
  • Karma: +1/-8
Re: IQ's PGM WIP
« Reply #43 on: February 27, 2009, 03:56:00 PM »
There is also a hack patch for kovsh in Nebula
and the MAME which supported olds100a also fixed sprite priorities handling in kov2 series

Offline iq_132

  • Administrator
  • *****
  • Posts: 3732
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: IQ's PGM WIP
« Reply #44 on: February 27, 2009, 04:29:20 PM »
Yeah, I knew about the kovsh hack patch. Still doesn't run in FBA though. I'm fairly certain how I'm syncing the two cpus is horrible...

Code: [Select]
PGMARMROM[0x1B0] = 0x00;// 68
PGMARMROM[0x1B1] = 0x00;// 04
PGMARMROM[0x1B2] = 0xA0;// 00
PGMARMROM[0x1B3] = 0xE1;// EB
PGMARMROM[0x1CC] = 0x00;// 99
PGMARMROM[0x1CD] = 0x00;// 04
PGMARMROM[0x1CE] = 0xA0;// 00
PGMARMROM[0x1CF] = 0xE1;// EB

As for that version of MAME, happen to have a version number/source?