Reicast-emulator: Fix DOA2 LE crashes/NBA 2K crashes. [$105]

Created on 10 Jun 2018  Â·  13Comments  Â·  Source: reicast/reicast-emulator

The goal of this bounty is to get these games working. DOA2 LE can crash when selecting a character in Time Attack mode or Survival. This does not happen with the older DOA2 US version.

EDIT: This is the bountysource URL - seems the integration still does not work right -
https://www.bountysource.com/issues/59487065-edge-cases-in-ta-parameter-parsing-nfl-2k-doa2-le


Did you help close this issue? Go claim the $105 bounty on Bountysource.

Help Wanted Bounty Granted

All 13 comments

This is also SMC. It is also what breaks shenmue and all.

On Sun, 10 Jun 2018 at 16:37, Twinaphex notifications@github.com wrote:

Apparently redream fixed several games such as Dead or Alive 2 Limited
Edition (Shokai Genteiban) and NFL 2K by addressing this.

The goal of this bounty is to get these games working. DOA2 LE can crash
when selecting a character in Time Attack mode or Survival. This does not
happen with the older DOA2 US version.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/reicast/reicast-emulator/issues/1168, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAYAMiGHOI0pKS2GVS4A4dabTAMlkkhvks5t7S8jgaJpZM4UhvVB
.

>

~skmp

Just to be clear, is this about making the dynarec more accurate, or is it about game-specific hacks?

I chipped in $50 anyway.

It’s to make it more accurate. SMC detection was removed in 2008 to fit in
the psp feature set - nulldc has a full impl of it

On Sun, 10 Jun 2018 at 17:52, anothername99 notifications@github.com
wrote:

Just to be clear, is this about making the dynarec more accurate, or is it
about game-specific hacks?

I chipped in $50 anyway.

—
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/reicast/reicast-emulator/issues/1168#issuecomment-396059700,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYAMqK6y_BNPtkm5_ffWJNcP56n4wKJks5t7UC7gaJpZM4UhvVB
.

>

~skmp

Looks like this crash is not related to SMC afterall, it is a ta staging buffer overflow. doa2le also crashes because of smc, but that is after the loading screen.

doa2le has a bug on the loading screen where it actually overflows the ta/pvr parameter storage area. The first frame fails to render, but then the game ignores that and moves on.

Reicast atm has a 2mb max size for TA parameters, without a size check, which when overflown leads to crashes.

We could add a size check and support multiple buffers. I wonder what kind of perf hit that would have?

Meanwhile, a workaround is to increase the buffer size from 2 to 8 megs.

diff --git a/core/hw/pvr/ta_ctx.h b/core/hw/pvr/ta_ctx.h
index cbc7e1f4..832f656f 100644
--- a/core/hw/pvr/ta_ctx.h
+++ b/core/hw/pvr/ta_ctx.h
@@ -157,7 +157,7 @@ struct TA_context
        }
        void Alloc()
        {
-               tad.Reset((u8*)OS_aligned_malloc(32, 2*1024*1024));
+               tad.Reset((u8*)OS_aligned_malloc(32, 8*1024*1024));

                rend.verts.InitBytes(1024*1024,&rend.Overrun); //up to 1 mb of vtx data/frame = ~ 38k vtx/frame
                rend.idx.Init(60*1024,&rend.Overrun);                   //up to 60K indexes ( idx have stripification overhead )

@twinaphex is NBA part of this ticket? Can we split to to a separate one, preferably in the gamedb tracker?

@skmp Hmm, I will have to test NBA to see if there is actually a problem there. Sorry for mentioning it here when I wasn't being sure.

Also, as promised, here is one half of the $50 I promised I would add to this issue. The other half is coming as soon as I transfer some funds around. Let's see if the page actually self-updates with the new amount.

I just tested NBA 2K (USA version). After the FMV copyright/intro screens there is no picture. With cable type set to TV (RGB) it just displays a blue screen, with cable type set to VGA (RGB) it displays a black screen. You can hear the sound and it will react to button input.

Anyway, if you prefer it, we can split this up into a separate ticket, whatever you prefer.

I feel satisfied about this and would be willing to close the issue and let you collect the bounty. Both games are working on my end.

Alrighty.

This is fixed for DOA2LE, but might break again if some game uses more than the new allocation size (= unlikely).

The SMC task was in another issue afair.

we should split off from here

  • [x] Somehow implement variable size support for TA staging buffers (low priority / easy workaround if it reappears)

(Follow up ticket created, workaround merged to master)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RinMaru picture RinMaru  Â·  4Comments

spielvan picture spielvan  Â·  3Comments

ZacharyFoxx picture ZacharyFoxx  Â·  3Comments

hooby3dfx picture hooby3dfx  Â·  7Comments

skmp picture skmp  Â·  5Comments