summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-08-01 17:39:51 +0000
committerneonloop2021-08-01 17:39:51 +0000
commitbaeeaca5858dfae6e63cf79994b8ff2aeb830283 (patch)
treed0fe1081185ec73bedb2e741e221793bc8155068
parent8c8484e55fffa79c903c95c41a6794fca40a723b (diff)
downloadpicogpsp-baeeaca5858dfae6e63cf79994b8ff2aeb830283.tar.gz
picogpsp-baeeaca5858dfae6e63cf79994b8ff2aeb830283.tar.bz2
picogpsp-baeeaca5858dfae6e63cf79994b8ff2aeb830283.zip
Revert "Add ROM mirroring and fix mult. cycle count"HEADpico-fe
This reverts commit aafde6de7b2a28c1684c0e9fa62fee9a2a5398dd. This was causing trimmed roms to fail to load.
-rw-r--r--arm/arm_emit.h2
-rw-r--r--cpu_threaded.c13
-rw-r--r--gba_memory.c12
3 files changed, 8 insertions, 19 deletions
diff --git a/arm/arm_emit.h b/arm/arm_emit.h
index 22ca763..17ec744 100644
--- a/arm/arm_emit.h
+++ b/arm/arm_emit.h
@@ -1239,10 +1239,12 @@ u32 execute_store_cpsr_body(u32 _cpsr, u32 store_mask, u32 address)
#define emit_trace_instruction(pc) \
generate_save_flags(); \
+ ARM_LDR_IMM(0, ARMREG_SP, reg_base, 34*4); \
ARM_STMDB_WB(0, ARMREG_SP, 0x500C); \
arm_load_imm_32bit(reg_a0, pc); \
generate_function_call(trace_instruction); \
ARM_LDMIA_WB(0, ARMREG_SP, 0x500C); \
+ arm_load_imm_32bit(ARMREG_SP, (u32)reg); \
generate_restore_flags();
#define emit_trace_thumb_instruction(pc) \
emit_trace_instruction(pc)
diff --git a/cpu_threaded.c b/cpu_threaded.c
index 148fd78..cad19ec 100644
--- a/cpu_threaded.c
+++ b/cpu_threaded.c
@@ -309,7 +309,6 @@ void translate_icache_sync() {
{ \
/* MUL rd, rm, rs */ \
arm_multiply(no, no); \
- cycle_count += 2; /* variable 1..4, pick 2 as an aprox. */ \
} \
} \
else \
@@ -327,7 +326,6 @@ void translate_icache_sync() {
case 0: \
/* MULS rd, rm, rs */ \
arm_multiply(no, yes); \
- cycle_count += 2; /* variable 1..4, pick 2 as an aprox. */ \
break; \
\
case 1: \
@@ -365,7 +363,6 @@ void translate_icache_sync() {
{ \
/* MLA rd, rm, rs, rn */ \
arm_multiply(yes, no); \
- cycle_count += 3; /* variable 2..5, pick 3 as an aprox. */ \
} \
} \
else \
@@ -383,7 +380,6 @@ void translate_icache_sync() {
case 0: \
/* MLAS rd, rm, rs, rn */ \
arm_multiply(yes, yes); \
- cycle_count += 3; /* variable 2..5, pick 3 as an aprox. */ \
break; \
\
case 1: \
@@ -503,7 +499,6 @@ void translate_icache_sync() {
{ \
/* UMULL rd, rm, rs */ \
arm_multiply_long(u64, no, no); \
- cycle_count += 3; /* this is an aproximation :P */ \
} \
} \
else \
@@ -521,7 +516,6 @@ void translate_icache_sync() {
case 0: \
/* UMULLS rdlo, rdhi, rm, rs */ \
arm_multiply_long(u64, no, yes); \
- cycle_count += 3; /* this is an aproximation :P */ \
break; \
\
case 1: \
@@ -559,7 +553,6 @@ void translate_icache_sync() {
{ \
/* UMLAL rd, rm, rs */ \
arm_multiply_long(u64_add, yes, no); \
- cycle_count += 3; /* Between 2 and 5 cycles? */ \
} \
} \
else \
@@ -577,7 +570,6 @@ void translate_icache_sync() {
case 0: \
/* UMLALS rdlo, rdhi, rm, rs */ \
arm_multiply_long(u64_add, yes, yes); \
- cycle_count += 3; /* Between 2 and 5 cycles? */ \
break; \
\
case 1: \
@@ -615,7 +607,6 @@ void translate_icache_sync() {
{ \
/* SMULL rd, rm, rs */ \
arm_multiply_long(s64, no, no); \
- cycle_count += 2; /* Between 1 and 4 cycles? */ \
} \
} \
else \
@@ -633,7 +624,6 @@ void translate_icache_sync() {
case 0: \
/* SMULLS rdlo, rdhi, rm, rs */ \
arm_multiply_long(s64, no, yes); \
- cycle_count += 2; /* Between 1 and 4 cycles? */ \
break; \
\
case 1: \
@@ -671,7 +661,6 @@ void translate_icache_sync() {
{ \
/* SMLAL rd, rm, rs */ \
arm_multiply_long(s64_add, yes, no); \
- cycle_count += 3; /* Between 2 and 5 cycles? */ \
} \
} \
else \
@@ -689,7 +678,6 @@ void translate_icache_sync() {
case 0: \
/* SMLALS rdlo, rdhi, rm, rs */ \
arm_multiply_long(s64_add, yes, yes); \
- cycle_count += 3; /* Between 2 and 5 cycles? */ \
break; \
\
case 1: \
@@ -1894,7 +1882,6 @@ void translate_icache_sync() {
case 0x01: \
/* MUL rd, rs */ \
thumb_data_proc(alu_op, muls, reg, rd, rd, rs); \
- cycle_count += 2; /* Between 1 and 4 extra cycles */ \
break; \
\
case 0x02: \
diff --git a/gba_memory.c b/gba_memory.c
index f397797..b550d4a 100644
--- a/gba_memory.c
+++ b/gba_memory.c
@@ -3157,12 +3157,12 @@ static void init_memory_gamepak(void)
}
else
{
- /* Map the ROM using mirroring, not many games use it */
- unsigned numblocks = gamepak_size >> 15;
- map_region(read, 0x8000000, 0xA000000, numblocks, gamepak_rom);
- map_region(read, 0xA000000, 0xC000000, numblocks, gamepak_rom);
- map_region(read, 0xC000000, 0xD000000, numblocks, gamepak_rom);
- /* Do not map D-E regions since they are also used for FLASH */
+ map_region(read, 0x8000000, 0x8000000 + gamepak_size, 1024, gamepak_rom);
+ map_null(read, 0x8000000 + gamepak_size, 0xA000000);
+ map_region(read, 0xA000000, 0xA000000 + gamepak_size, 1024, gamepak_rom);
+ map_null(read, 0xA000000 + gamepak_size, 0xC000000);
+ map_region(read, 0xC000000, 0xC000000 + gamepak_size, 1024, gamepak_rom);
+ map_null(read, 0xC000000 + gamepak_size, 0xE000000);
}
}