Welcome!

Final Burn Neo => FBN Development => Topic started by: manliodp on March 20, 2012, 04:04:54 PM

Title: CPS1: Question about CpsDrawSpritesInReverse
Post by: manliodp on March 20, 2012, 04:04:54 PM
Hi devs,
I have a question/doubt about the variable CpsDrawSpritesInReverse and its use in the file cps_run.cpp, Cps1Frame() function:

Code: [Select]
..
if (!CpsDrawSpritesInReverse) {
CpsObjGet(); // Get objects
}


for (i = 0; i < 4; i++) {
nNext = ((i + 1) * nCpsCycles) >> 2; // find out next cycle count to run to

if (SekTotalCycles() < nDisplayEnd && nNext > nDisplayEnd) {

SekRun(nNext - nDisplayEnd); // run 68K

memcpy(CpsSaveReg[0], CpsReg, 0x100); // Registers correct now

if (CpsDrawSpritesInReverse) {
if (i == 3) CpsObjGet();    // Get objects
}

SekSetIRQLine(2, SEK_IRQSTATUS_AUTO); // Trigger VBlank interrupt
}
..


I see that this variable, that's set to 1 for some drivers, is used to determine if the function CpsObjGet() needs to be called before that for cycle or inside it, just before the vblank interrupt.
My question/doubt is, shouldn't the CpsObjGet() function be called ALWAYS just before the vblank?
Could you give me some details about the CpsDrawSpritesInReverse variable?
I hope it's clear, sorry to bother you with stupid questions :)


Thank you very much!


Manlio
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: Barry Harris on March 20, 2012, 05:08:49 PM
Drawing sprites in reverse order is for some of the bootleg/hacks, originally I added it way back for the sf2yyc and sf2koryu sets. When I get chance, I'll check into the timing of the CpsGetObj call, it's a good number of years since I added this! :)
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: Barry Harris on March 20, 2012, 05:15:36 PM
Ok, reverting the timing to normal doesn't cause any issues, so all games now call CpsGetObj at the right time.
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: manliodp on March 20, 2012, 05:30:12 PM
Ok, reverting the timing to normal doesn't cause any issues, so all games now call CpsGetObj at the right time.

So it will be called just before the vblank interrupt, right?
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: Barry Harris on March 20, 2012, 05:42:00 PM
No, its called at the beginning of the frame as it always was. Only the reverse games called it just before the vblank.
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: KaNyErO on March 20, 2012, 07:20:15 PM
One question. What makes ghouls and ghost be different at sprite manipulation level from other cps1 games?

It's the only cps1 game that has problems with the native cps1 emulator in dingoo a-320.

I wonder if there is a way to sort the sprite data the same way other romsets in this board are stored, so i could finally convert the rom to be used in dingoo without problems.

Thanks!
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: Barry Harris on March 21, 2012, 04:35:50 PM
One question. What makes ghouls and ghost be different at sprite manipulation level from other cps1 games?

It's the only cps1 game that has problems with the native cps1 emulator in dingoo a-320.

I wonder if there is a way to sort the sprite data the same way other romsets in this board are stored, so i could finally convert the rom to be used in dingoo without problems.

Thanks!

The only thing I can think of is that the palette initialisation in Ghouls & Ghosts is a little bit different when it first starts. Other than that I can't think of anything radically different about it.
Title: Re: CPS1: Question about CpsDrawSpritesInReverse
Post by: KaNyErO on March 21, 2012, 07:49:52 PM
umm it could be, people reports green/white sprites and missing tiles. Could the program rom be patched to init the palette the same than other cps1 games?

Thanks!