X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxbios.c;h=3671af5a0f0406841282658570b11524677920fd;hb=0b988c8ba4cccb1cd52aeb13f10a122dec1cd54f;hp=432b0e2c163aef7f52ca627dcfe52f7a3d0dab92;hpb=65722e0455a2a42eece5e67ce2e92bfac03e1368;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 432b0e2c..3671af5a 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -36,7 +36,7 @@ #include "sio.h" #include "psxhle.h" #include "psxinterpreter.h" -#include "new_dynarec/events.h" +#include "psxevents.h" #include #ifndef PSXBIOS_LOG @@ -1479,13 +1479,15 @@ void psxBios_printf() { // 0x3f } static void psxBios_cd() { // 0x40 - const char *p, *dir = castRam8ptr(a0); + const char *p, *dir = Ra0; PSXBIOS_LOG("psxBios_%s %x(%s)\n", biosB0n[0x40], a0, dir); - if ((p = strchr(dir, ':'))) - dir = ++p; - if (*dir == '\\') - dir++; - snprintf(cdir, sizeof(cdir), "%s", dir); + if (dir != INVALID_PTR) { + if ((p = strchr(dir, ':'))) + dir = ++p; + if (*dir == '\\') + dir++; + snprintf(cdir, sizeof(cdir), "%s", dir); + } mips_return_c(1, 100); } @@ -2566,7 +2568,7 @@ void psxBios_puts() { // 3e/3f } static void bufile(const u8 *mcd_data, u32 dir_) { - struct DIRENTRY *dir = (struct DIRENTRY *)castRam8ptr(dir_); + struct DIRENTRY *dir = (struct DIRENTRY *)PSXM(dir_); const char *pfile = ffile + 5; const u8 *data = mcd_data; int i = 0, match = 0; @@ -2574,6 +2576,9 @@ static void bufile(const u8 *mcd_data, u32 dir_) { u32 head = 0; v0 = 0; + if (dir == INVALID_PTR) + return; + for (; nfile <= 15 && !match; nfile++) { const char *name; @@ -2627,11 +2632,12 @@ static void bufile(const u8 *mcd_data, u32 dir_) { */ static void psxBios_firstfile() { // 42 - char *pa0 = castRam8ptr(a0); + char *pa0 = Ra0; PSXBIOS_LOG("psxBios_%s %s %x\n", biosB0n[0x42], pa0, a1); v0 = 0; + if (pa0 != INVALID_PTR) { snprintf(ffile, sizeof(ffile), "%s", pa0); if (ffile[5] == 0) @@ -3316,7 +3322,6 @@ void psxBiosSetupBootState(void) GPU_writeStatus(gpu_ctl_def[i]); for (i = 0; i < sizeof(gpu_data_def) / sizeof(gpu_data_def[0]); i++) GPU_writeData(gpu_data_def[i]); - HW_GPU_STATUS |= SWAP32(PSXGPU_nBUSY); // spu for (i = 0x1f801d80; i < sizeof(spu_config) / sizeof(spu_config[0]); i++)