Author Topic: CPS1: Question about CpsDrawSpritesInReverse  (Read 6102 times)

Offline manliodp

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
CPS1: Question about CpsDrawSpritesInReverse
« 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
« Last Edit: March 20, 2012, 04:12:35 PM by manliodp »

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #1 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! :)
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #2 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.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline manliodp

  • Newbies
  • *
  • Posts: 46
  • Karma: +0/-0
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #3 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?

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #4 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.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline KaNyErO

  • Member
  • ***
  • Posts: 142
  • Karma: +4/-0
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #5 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!

Offline Barry Harris

  • dontbeabarry
  • *
  • Posts: 1785
  • Karma: +0/-65535
  • I'm Barry Harris and I like to f*** people over
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #6 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.
Account of Barry Harris; the traitor.
Send me an e-mail at barry@fbalpha.com letting me know how big of a piece of sh** I am.

Offline KaNyErO

  • Member
  • ***
  • Posts: 142
  • Karma: +4/-0
Re: CPS1: Question about CpsDrawSpritesInReverse
« Reply #7 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!