fix accidental frequency doubling

This commit is contained in:
meepingsnesroms
2018-03-22 09:43:18 -07:00
parent 49a61965c8
commit 96ed33958c
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ void emulatorInit(uint8_t* palmRomDump){
memcpy(palmRom, palmRomDump, ROM_SIZE);
memcpy(palmRam, palmRom, 256);//copy ROM header
initHwRegisters();
palmCrystalCycles = 2 * (14 * (71 + 1) + 3 + 1);
palmCrystalCycles = 14 * (71 + 1) + 3 + 1;
palmCpuFrequency = palmCrystalCycles * 32768;
palmCycleCounter = 0;

View File

@@ -56,7 +56,7 @@ void setPllfsr16(unsigned int value){
registerArrayWrite16(PLLFSR, value & 0x4FFF);
uint32_t p = value & 0x00FF;
uint32_t q = (value & 0x0F00) >> 8;
uint32_t newCrystalCycles = 2 * (14 * (p + 1) + q + 1);
uint32_t newCrystalCycles = 14 * (p + 1) + q + 1;
uint32_t newFrequency = newCrystalCycles * 32768;
printf("New CPU frequency of:%d cycles per second.\n", newFrequency);
printf("New clk32 cycle count of :%d.\n", newCrystalCycles);