an alt hack for Judge Dredd
authornotaz <notasas@gmail.com>
Fri, 1 Dec 2023 23:05:10 +0000 (01:05 +0200)
committernotaz <notasas@gmail.com>
Fri, 1 Dec 2023 23:23:02 +0000 (01:23 +0200)
libpcsxcore/database.c
libpcsxcore/psxcommon.h
libpcsxcore/psxdma.c

index ad2a184..023d538 100644 (file)
@@ -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 */
index 01b2a9a..dce4f41 100644 (file)
@@ -153,6 +153,7 @@ typedef struct {
                boolean gpu_busy;
                boolean gpu_centering;
                boolean dualshock_init_analog;
+               boolean gpu_timing1024;
        } hacks;
 } PcsxConfig;
 
index e3655b5..a7c438e 100644 (file)
@@ -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;