From 6a3b3d865c8115ab9d14484df2633ee8b105609a Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 2 Dec 2023 01:05:10 +0200 Subject: [PATCH] an alt hack for Judge Dredd --- libpcsxcore/database.c | 9 +++++++-- libpcsxcore/psxcommon.h | 1 + libpcsxcore/psxdma.c | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index ad2a1845..023d5385 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -57,6 +57,12 @@ static const char * const gpu_centering_hack_db[] = "SLPM86009", }; +static const char * const dualshock_timing1024_hack_db[] = +{ + /* Judge Dredd - could also be poor cdrom+mdec+dma timing */ + "SLUS00630", "SLES00755", +}; + static const char * const dualshock_init_analog_hack_db[] = { /* Formula 1 Championship Edition */ @@ -79,6 +85,7 @@ hack_db[] = HACK_ENTRY(gpu_slow_list_walking, gpu_slow_llist_db), HACK_ENTRY(gpu_busy, gpu_busy_hack_db), HACK_ENTRY(gpu_centering, gpu_centering_hack_db), + HACK_ENTRY(gpu_timing1024, dualshock_timing1024_hack_db), HACK_ENTRY(dualshock_init_analog, dualshock_init_analog_hack_db), }; @@ -103,8 +110,6 @@ cycle_multiplier_overrides[] = #endif /* Discworld Noir - audio skips if CPU runs too fast */ { 222, { "SLES01549", "SLES02063", "SLES02064" } }, - /* Judge Dredd - could also be poor MDEC timing */ - { 128, { "SLUS00630", "SLES00755" } }, /* Digimon World */ { 153, { "SLUS01032", "SLES02914" } }, /* Syphon Filter - reportedly hangs under unknown conditions */ diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index 01b2a9aa..dce4f41e 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -153,6 +153,7 @@ typedef struct { boolean gpu_busy; boolean gpu_centering; boolean dualshock_init_analog; + boolean gpu_timing1024; } hacks; } PcsxConfig; diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index e3655b5e..a7c438e3 100644 --- a/libpcsxcore/psxdma.c +++ b/libpcsxcore/psxdma.c @@ -191,7 +191,7 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU madr_next = 0xffffff; do_walking = Config.GpuListWalking; - if (do_walking < 0) + if (do_walking < 0 || Config.hacks.gpu_timing1024) do_walking = Config.hacks.gpu_slow_list_walking; madr_next_p = do_walking ? &madr_next : NULL; @@ -201,10 +201,10 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU HW_DMA2_MADR = SWAPu32(madr_next); - // Tekken 3 = use 1.0 only (not 1.5x) + // a hack for Judge Dredd which is annoyingly sensitive to timing + if (Config.hacks.gpu_timing1024) + size = 1024; - // Einhander = parse linked list in pieces (todo) - // Rebel Assault 2 = parse linked list in pieces (todo) psxRegs.gpuIdleAfter = psxRegs.cycle + size + 16; set_event(PSXINT_GPUDMA, size); return; -- 2.39.5