From: notaz Date: Tue, 1 Mar 2011 17:07:27 +0000 (+0200) Subject: drc: clear dynarec completely on CD image change X-Git-Tag: r7~3 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=dc990066a301c231e5982a346f4809b4e0247a51;hp=4f5a1b2a86d077d32086de91f487a2ee5270714d drc: clear dynarec completely on CD image change most likely only BIOS can be reused anyway, no need to stress invalidation code needlessly (even if it does it all well). --- diff --git a/frontend/menu.c b/frontend/menu.c index a7aa8b2a..87b87888 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -25,6 +25,7 @@ #include "../libpcsxcore/misc.h" #include "../libpcsxcore/cdrom.h" #include "../libpcsxcore/psemu_plugin_defs.h" +#include "../libpcsxcore/new_dynarec/new_dynarec.h" #include "../plugins/dfinput/pad.h" #include "revision.h" @@ -1349,6 +1350,8 @@ static int romsel_run(void) printf("selected file: %s\n", fname); + new_dynarec_clear_full(); + if (run_cd_image(fname) != 0) return -1; diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 1f33c756..72af92d1 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -7709,20 +7709,10 @@ void disassemble_inst(int i) } } -void new_dynarec_init() +// clear the state completely, instead of just marking +// things invalid like invalidate_all_pages() does +void new_dynarec_clear_full() { - printf("Init new dynarec\n"); - out=(u_char *)BASE_ADDR; - if (mmap (out, 1<>2; for(n=526336;n<1048576;n++) // 0x80800000 .. 0xFFFFFFFF memory_map[n]=-1; + for(n=0;n<4096;n++) ll_clear(jump_in+n); + for(n=0;n<4096;n++) ll_clear(jump_out+n); + for(n=0;n<4096;n++) ll_clear(jump_dirty+n); +} + +void new_dynarec_init() +{ + printf("Init new dynarec\n"); + out=(u_char *)BASE_ADDR; + if (mmap (out, 1<