diff --git a/src/armv5te/asmcode_aarch64.S b/src/armv5te/asmcode_aarch64.S index bb92d83..0d20b78 100644 --- a/src/armv5te/asmcode_aarch64.S +++ b/src/armv5te/asmcode_aarch64.S @@ -67,7 +67,7 @@ translation_next_enter: ldr w23, [x23] cbnz w23, save_return // if(cpu_events) goto save_return; - mov x21, #65*1024*1024 + mov x21, #80*1024*1024 ldr w21, [x0, x21] // w21 = RAM_FLAGS(x0) tbz w21, #5, save_return // if((RAM_FLAGS(x0) & RF_CODE_TRANSLATED) == 0) goto save_return; lsr w21, w21, #9 // w21 = w21 >> RFS_TRANSLATION_INDEX diff --git a/src/armv5te/asmcode_arm.S b/src/armv5te/asmcode_arm.S index dd1afe4..8fa5b3a 100644 --- a/src/armv5te/asmcode_arm.S +++ b/src/armv5te/asmcode_arm.S @@ -91,7 +91,7 @@ translation_enter: .global translation_enter mov r0, r4 - add r1, r0, #65*1024*1024 // r1 = &(RAM_FLAGS(r0)) + add r1, r0, #80*1024*1024 // r1 = &(RAM_FLAGS(r0)) ldr r1, [r1] loadsym r10, arm // r10 is a pointer to the global arm_state @@ -111,7 +111,7 @@ translation_next: .global translation_next beq save_return translation_jmp_ptr: .global translation_jmp_ptr - add r1, r0, #65*1024*1024 // r1 = &(RAM_FLAGS(r0)) + add r1, r0, #80*1024*1024 // r1 = &(RAM_FLAGS(r0)) ldr r1, [r1] tst r1, #RF_CODE_TRANSLATED beq save_return // not translated diff --git a/src/armv5te/asmcode_x86.S b/src/armv5te/asmcode_x86.S index 19e4c0a..b658cf9 100644 --- a/src/armv5te/asmcode_x86.S +++ b/src/armv5te/asmcode_x86.S @@ -8,7 +8,7 @@ #define TRANS_JUMP_TABLE 4 #define TRANS_END_PTR 12 -#define RAM_FLAGS (70*1024*1024) // = MEM_MAXSIZE +#define RAM_FLAGS (80*1024*1024) // = MEM_MAXSIZE #define RF_READ_BREAKPOINT 1 #define RF_WRITE_BREAKPOINT 2 #define RF_EXEC_BREAKPOINT 4 diff --git a/src/armv5te/asmcode_x86_64.S b/src/armv5te/asmcode_x86_64.S index 26e2845..10907f7 100644 --- a/src/armv5te/asmcode_x86_64.S +++ b/src/armv5te/asmcode_x86_64.S @@ -10,7 +10,7 @@ #define TRANS_END_PTR 0x18 // RAM_FLAGS used to have "// = MEM_MAXSIZE" at the end but the clang assembler copys the "//" into the macro, commenting out the arguments of the opcodes that use it -#define RAM_FLAGS (70*1024*1024) +#define RAM_FLAGS (80*1024*1024) #define RF_READ_BREAKPOINT 1 #define RF_WRITE_BREAKPOINT 2 #define RF_EXEC_BREAKPOINT 4 diff --git a/src/armv5te/mem.h b/src/armv5te/mem.h index 25a5213..b5b9005 100644 --- a/src/armv5te/mem.h +++ b/src/armv5te/mem.h @@ -11,7 +11,7 @@ extern "C" { #endif -#define MEM_MAXSIZE (70*1024*1024) // also defined as RAM_FLAGS in asmcode.S +#define MEM_MAXSIZE (80*1024*1024) // also defined as RAM_FLAGS in asmcode.S extern uint8_t (*read_byte_map[64])(uint32_t addr); extern uint16_t (*read_half_map[64])(uint32_t addr); diff --git a/src/emulator.c b/src/emulator.c index 9dc4e58..c06e194 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -131,6 +131,7 @@ uint32_t emulatorInit(uint8_t* palmRomData, uint32_t palmRomSize, uint8_t* palmB palmFramebufferHeight = 480; palmMisc.batteryLevel = 100; palmCycleCounter = 0.0; + palmClockMultiplier = 1.00 - TUNGSTEN_T3_CPU_PERCENT_WAITING; //initialize components, I dont think theres much in a Tungsten T3 pxa260Framebuffer = palmFramebuffer; @@ -179,6 +180,7 @@ uint32_t emulatorInit(uint8_t* palmRomData, uint32_t palmRomSize, uint8_t* palmB palmFramebufferHeight = 220; palmMisc.batteryLevel = 100; palmCycleCounter = 0.0; + palmClockMultiplier = 1.00 - DBVZ_CPU_PERCENT_WAITING; sed1376Framebuffer = palmFramebuffer; //initialize components @@ -244,7 +246,6 @@ void emulatorSoftReset(void){ //equivalent to pushing the reset button on the back of the device #if defined(EMU_SUPPORT_PALM_OS5) if(palmEmulatingTungstenT3){ - palmClockMultiplier = 1.00 - TUNGSTEN_T3_CPU_PERCENT_WAITING; pxa260Reset(); tps65010Reset(); tsc2101Reset(true); @@ -253,7 +254,6 @@ void emulatorSoftReset(void){ } else{ #endif - palmClockMultiplier = 1.00 - DBVZ_CPU_PERCENT_WAITING; sed1376Reset(); ads7846Reset(); pdiUsbD12Reset(); diff --git a/src/pxa260/pxa260.c b/src/pxa260/pxa260.c index 223cbb2..d8c55d5 100644 --- a/src/pxa260/pxa260.c +++ b/src/pxa260/pxa260.c @@ -19,6 +19,7 @@ #include "../armv5te/cpu.h" #include "../armv5te/emu.h" #include "../armv5te/mem.h" +#include "../armv5te/mmu.h" #include "../armv5te/os/os.h" #include "../armv5te/translate.h" #include "../tungstenT3Bus.h" @@ -197,6 +198,7 @@ void pxa260Reset(void){ cycle_count_delta = 0; cpu_events = 0; //cpu_events &= EVENT_DEBUG_STEP; + addr_cache_flush();//SIGSEGVs on reset without this because the MMU needs to be turned off //PC starts at 0x00000000, the first opcode for Palm OS 5 is a jump } diff --git a/src/tungstenT3Bus.h b/src/tungstenT3Bus.h index 4904ae3..78ea464 100644 --- a/src/tungstenT3Bus.h +++ b/src/tungstenT3Bus.h @@ -14,7 +14,7 @@ #define TUNGSTEN_T3_W86L488_START_ADDRESS 0x08000000 #define PXA260_PCMCIA0_START_ADDRESS 0x20000000 #define PXA260_PCMCIA1_START_ADDRESS 0x30000000 -#define TUNGSTEN_T3_ROM_SIZE (10 * 0x100000)//10mb ROM +#define TUNGSTEN_T3_ROM_SIZE (16 * 0x100000)//16mb ROM #define TUNGSTEN_T3_RAM_SIZE (64 * 0x100000)//64mb RAM #define TUNGSTEN_T3_W86L488_SIZE 0x04000000 #define PXA260_PCMCIA0_SIZE 0x10000000