From: notaz Date: Sun, 27 Aug 2023 14:39:54 +0000 (+0300) Subject: psxbios: unbreak bcopy X-Git-Tag: r24l~219 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12742a5c7b839a9fad2ef87c1bd681b09ab86906;p=pcsx_rearmed.git psxbios: unbreak bcopy wasn't paying attention --- diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index d2c7793d..9e3f13fe 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -935,8 +935,23 @@ static void do_memcpy(u32 dst, u32 src, s32 len) static void psxBios_memcpy(); -static void psxBios_bcopy() { // 0x27 - psxBios_memcpy(); // identical +static void psxBios_bcopy() { // 0x27 - memcpy with args swapped + //PSXBIOS_LOG("psxBios_%s %x %x %x\n", biosA0n[0x27], a0, a1, a2); + u32 ret = a0, cycles = 0; + if (a0 == 0) // ...but it checks src this time + { + mips_return_c(0, 4); + return; + } + v1 = a0; + if ((s32)a2 > 0) { + do_memcpy(a1, a0, a2); + cycles = a2 * 6; + a0 += a2; + a1 += a2; + a2 = 0; + } + mips_return_c(ret, cycles + 5); } static void psxBios_bzero() { // 0x28