+// clear the state completely, instead of just marking
+// things invalid like invalidate_all_pages() does
+void new_dynarec_clear_full()
+{
+ int n;
+ out=(u_char *)BASE_ADDR;
+ memset(invalid_code,1,sizeof(invalid_code));
+ memset(hash_table,0xff,sizeof(hash_table));
+ memset(mini_ht,-1,sizeof(mini_ht));
+ memset(restore_candidate,0,sizeof(restore_candidate));
+ memset(shadow,0,sizeof(shadow));
+ copy=shadow;
+ expirep=16384; // Expiry pointer, +2 blocks
+ pending_exception=0;
+ literalcount=0;
+ stop_after_jal=0;
+ // TLB
+#ifndef DISABLE_TLB
+ using_tlb=0;
+#endif
+ sp_in_mirror=0;
+ for(n=0;n<524288;n++) // 0 .. 0x7FFFFFFF
+ memory_map[n]=-1;
+ for(n=524288;n<526336;n++) // 0x80000000 .. 0x807FFFFF
+ memory_map[n]=((u_int)rdram-0x80000000)>>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);
+}
+