2D Graphics animation

Discuss Supermodel and your favorite Model 3 games. Show off your latest threads, this is the place to see and be seen.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

2D Graphics animation

Postby Jiterdomer » Sat May 08, 2021 2:17 pm

In earlier version of Supermodel of Scud Race, the tiny car that plays tug of war with the Sega logo plays, but in the newest build, it doesn't push the Sega logo to the left of the screen and being pushed on. Daytona USA 2 has that issue as well with the transition effect where your standing shows up in the results screen.
Examples:
https://www.youtube.com/watch?v=VSMEmbPSE3I
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 627
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, California

Re: 2D Graphics animation

Postby nuexzz.. » Sat May 08, 2021 7:34 pm

m ... is it tested in all regions of the games?
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: 2D Graphics animation

Postby nuexzz.. » Sun May 09, 2021 12:34 am

you're right ... they are not present! Another thing I noticed is that if you try to enter the service mode (it is incomplete)

Image
User avatar
nuexzz..
 
Posts: 374
Joined: Sun Sep 25, 2011 3:10 pm
Location: Argentina

Re: 2D Graphics animation

Postby Bart » Sun May 09, 2021 11:08 pm

When did this break?
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: 2D Graphics animation

Postby Ian » Sun May 09, 2021 11:58 pm

Perhaps when I changed the timing code.
With the animated car. It might be interesting to debug the 2d tilegen writes. Might help us solve the issue.

Do you have a screenshot of when the animated car is supposed to appear. Does it only show up in multilayer mode?
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 2D Graphics animation

Postby Jiterdomer » Mon May 10, 2021 9:15 pm

It only appear on a second loop of the demo when the attract demo goes back to Expert Course, even on a non-linked version. Scud Race Plus seems to removed this in favor of FMV intro.
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 627
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, California

Re: 2D Graphics animation

Postby rokfpoewrkcpoqwkcp » Wed Dec 29, 2021 6:08 am

Just confirming what I think we already know. It seems it was the timing change at r779 that broke the animation.
@ r778 it's working. (BTW, if you build r778 with the old 'NEW_FRAME_TIMING' defined, that breaks it too.)

I built the latest svn (r874) with the old timing functions/methods and the animation comes back.
Both the Maclaren & Dodge get their 'cute' car animations after 1 complete attract loop.

I think the biggest clue scud is happy with the old timing is the sun glare effect comes back. (In new3d mode anyway, I don't think legacy3d ever had glare.)
On beginner, at the end of the straight as you turn into the tunnel, and then come out of the tunnel, the glare moves across the screen. It's hard to see in the picture, it's quite effective in play.

Attract glare & animation.jpg
Attract glare & animation.jpg (97.05 KiB) Viewed 224 times


In Game Glare.jpg
In Game Glare.jpg (96.91 KiB) Viewed 224 times

What's amazing is how well scud plays using old or current timing given how different they are, but it does seem to prefer the old timing.
rokfpoewrkcpoqwkcp
 
Posts: 119
Joined: Mon Nov 18, 2019 3:40 pm

Re: 2D Graphics animation

Postby Bart » Wed Dec 29, 2021 8:18 pm

What do you mean by the old timing? I am assuming you reverted CModel3::RunMainBoardFrame() back to a previous version? Can you paste what you are using here as a code block?
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: 2D Graphics animation

Postby Ian » Thu Dec 30, 2021 2:00 am

It's probably a sync issue. The 3d runs independently in it's own thread. The powerpc just queries the registers when it feels like it. The line of sight registers get automatically reset at the beginning of the frame. Just need some way of syncing them better
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 2D Graphics animation

Postby rokfpoewrkcpoqwkcp » Thu Dec 30, 2021 9:14 am

I copied, (from 778 to 874)
CModel3::RunMainBoardFrame()
CReal3D::BeginVBlank()
CReal3D::ReadRegister()

Although, as you suggested, just CModel3::RunMainBoardFrame() would of done.

I can't pretend I know what I'm doing. I just looked at commit 779,
https://sourceforge.net/p/model3emu/code/779/
and then pasted over the corresponding code from 778. :D

Here is CModel3::RunMainBoardFrame() r778
Code: Select all
void CModel3::RunMainBoardFrame(void)
{
  UINT32 start = CThread::GetTicks();

  // Compute display and VBlank timings
  unsigned ppcCycles   = m_config["PowerPCFrequency"].ValueAs<unsigned>() * 1000000;
  unsigned frameCycles = ppcCycles / 60;
  unsigned vblCycles   = (unsigned)((float) frameCycles * 2.5f/100.0f); // 2.5% vblank (ridiculously short and wrong but bigger values cause flicker in Daytona)
  unsigned dispCycles  = frameCycles - vblCycles;
 
  // For some reason, some Step 2.x games require completely different timings. The defaults can be overriden in the ROM set XML file.
  float real3DStatusBitSetAsPercentOfFrame = m_game.real3d_status_bit_set_percent_of_frame;
  if (real3DStatusBitSetAsPercentOfFrame <= 0)
  {
    if (m_game.stepping == "2.0" || m_game.stepping == "2.1")
      real3DStatusBitSetAsPercentOfFrame = 9.12f;
    else if (m_game.stepping == "1.5")
      real3DStatusBitSetAsPercentOfFrame = 5.5f;
    else
      real3DStatusBitSetAsPercentOfFrame = 48.0f;
  }
 
  // Compute timing of the Real3D status bit.  This value directly affects the speed at which all the games except Virtua Stiker 2 run.
  // Currently it is not known exactly what this bit represents nor why such wildly varying values are needed for the different step models.
  // The values below were arrived at by trial and error and clearly more investigation is required.  If it turns out that the status bit is
  // connected to the end of VBlank then the code below should be removed and the timing handled via GPU.VBlankEnd() instead. 
  unsigned statusCycles = (unsigned) ((float) frameCycles * (real3DStatusBitSetAsPercentOfFrame * 1e-2f)); 
 
  // Scale PPC timer ratio according to speed at which the PowerPC is being emulated so that the observed running frequency of the PPC timer
  // registers is more or less correct.  This is needed to get the Virtua Striker 2 series of games running at the right speed (they are
  // too slow otherwise).  Other games appear to not be affected by this ratio so much as their running speed depends more on the timing of
  // the Real3D status bit below.
  ppc_set_timer_ratio(ppc_get_bus_freq_multipler() * 2 * ppcCycles / ppc_get_cycles_per_sec());

  // VBlank
  if (gpusReady)
  {
    TileGen.BeginVBlank();
    GPU.BeginVBlank(statusCycles);
    IRQ.Assert(0x02);
    ppc_execute(vblCycles);
    //printf("PC=%08X LR=%08X\n", ppc_get_pc(), ppc_get_lr());
 
    /*
     * Sound:
     *
     * Bit 0x20 of the MIDI control port appears to enable periodic interrupts,
     * which are used to send MIDI commands. Often games will write 0x27, send
     * a series of commands, and write 0x06 to stop. Other games, like Star
     * Wars Trilogy and Sega Rally 2, will enable interrupts at the beginning
     * by writing 0x37 and will disable/enable interrupts to control command
     * output.
     */
    //printf("\t-- BEGIN (Ctrl=%02X, IRQEn=%02X, IRQPend=%02X) --\n", midiCtrlPort, IRQ.ReadIRQEnable()&0x40, IRQ.ReadIRQState());
    int irqCount = 0;
    while ((midiCtrlPort&0x20))
    //while (midiCtrlPort == 0x27)  // 27 triggers IRQ sequence, 06 stops it
    {
      // Don't waste time firing MIDI interrupts if game has disabled them
      if ((IRQ.ReadIRQEnable()&0x40) == 0)
        break;
       
      // Process MIDI interrupt
      IRQ.Assert(0x40);
      ppc_execute(200); // give PowerPC time to acknowledge IRQ
      IRQ.Deassert(0x40);
      ppc_execute(200); // acknowledge that IRQ was deasserted (TODO: is this really needed?)
      dispCycles -= 400;

      ++irqCount;
      if (irqCount > 128)
      {
        //printf("\tMIDI FIFO OVERFLOW! (IRQEn=%02X, IRQPend=%02X)\n", IRQ.ReadIRQEnable()&0x40, IRQ.ReadIRQState());
        break;
      }
    }
    //printf("\t-- END --\n");
    //printf("PC=%08X LR=%08X\n", ppc_get_pc(), ppc_get_lr());
   
    // End VBlank
    GPU.EndVBlank();
    TileGen.EndVBlank();
    IRQ.Assert(0x0D);
  }

  // Run the PowerPC for the active display part of the frame
  ppc_execute(dispCycles);
  // MAME believes 0x0C should occur on every scanline
  //for (int i = 0; i < 384; i++)
  //{
  //  ppc_execute(dispCycles / 384);
  //  IRQ.Assert(0x0C);
  //}
  //printf("PC=%08X LR=%08X\n", ppc_get_pc(), ppc_get_lr());

  timings.ppcTicks = CThread::GetTicks() - start;
}
rokfpoewrkcpoqwkcp
 
Posts: 119
Joined: Mon Nov 18, 2019 3:40 pm

Next

Return to The Catwalk

Who is online

Users browsing this forum: No registered users and 1 guest