mirror of
https://github.com/romychs/Ocean-240.2-Emulator.git
synced 2026-04-21 11:03:21 +03:00
adjust freq params for win11
This commit is contained in:
parent
fdaaa5ed8b
commit
9d8f413614
16
src/main.go
16
src/main.go
@ -29,11 +29,11 @@ var BuildTime = "2026-04-02"
|
|||||||
const defaultTimerClkPeriod = 433
|
const defaultTimerClkPeriod = 433
|
||||||
const defaultCpuClkPeriod = 310
|
const defaultCpuClkPeriod = 310
|
||||||
|
|
||||||
const windowsTimerClkPeriod = 397
|
const windowsTimerClkPeriod = 400
|
||||||
const windowsCpuClkPeriod = 298
|
const windowsCpuClkPeriod = 300
|
||||||
|
|
||||||
const maxDelta = 5
|
const maxDelta = 3
|
||||||
const diffScale = 50.0
|
const diffScale = 15.0
|
||||||
|
|
||||||
////go:embed hex/m80.hex
|
////go:embed hex/m80.hex
|
||||||
//var serialBytes []byte
|
//var serialBytes []byte
|
||||||
@ -111,19 +111,21 @@ func screen(ctx context.Context, computer *okean240.ComputerType, raster *canvas
|
|||||||
// redraw screen here
|
// redraw screen here
|
||||||
fyne.Do(func() {
|
fyne.Do(func() {
|
||||||
// status for every 50 frames
|
// status for every 50 frames
|
||||||
if frame%50 == 0 {
|
if frame%10 == 0 {
|
||||||
timeElapsed := hrtime.Since(timeStart)
|
timeElapsed := hrtime.Since(timeStart)
|
||||||
period := float64(timeElapsed.Nanoseconds()) / 1_000_000.0
|
period := float64(timeElapsed.Nanoseconds()) / 1_000_000.0
|
||||||
|
|
||||||
//cpuFreq = math.Round(float64(computer.Cycles()-pre)/period) / 1000.0
|
//cpuFreq = math.Round(float64(computer.Cycles()-pre)/period) / 1000.0
|
||||||
cpuFreq = math.Round(float64(cpuTicks.Load()-pre)/period) / 1000.0
|
cpuFreq = math.Round(float64(cpuTicks.Load()-pre)/period) / 1000.0
|
||||||
timerFreq = math.Round(float64(timerTicks.Load()-preTim)/period) / 1000.0
|
timerFreq = math.Round(float64(timerTicks.Load()-preTim)/period) / 1000.0
|
||||||
label.SetText(formatLabel(computer, cpuFreq, timerFreq, cpuClkPeriod.Load(), timerClkPeriod.Load()))
|
|
||||||
|
|
||||||
adjustPeriods(computer, cpuFreq, timerFreq)
|
adjustPeriods(computer, cpuFreq, timerFreq)
|
||||||
|
|
||||||
log.Debugf("Cpu clk period: %d, Timer clock period: %d, frame time: %1.3fms", cpuClkPeriod.Load(), timerClkPeriod.Load(), period/50.0)
|
if frame%50 == 0 {
|
||||||
|
label.SetText(formatLabel(computer, cpuFreq, timerFreq, cpuClkPeriod.Load(), timerClkPeriod.Load()))
|
||||||
|
log.Debugf("Cpu clk period: %d, Timer clock period: %d, frame time: %1.3fms", cpuClkPeriod.Load(), timerClkPeriod.Load(), period/5.0)
|
||||||
logger.FlushLogs()
|
logger.FlushLogs()
|
||||||
|
}
|
||||||
//pre = computer.Cycles()
|
//pre = computer.Cycles()
|
||||||
pre = cpuTicks.Load()
|
pre = cpuTicks.Load()
|
||||||
preTim = timerTicks.Load()
|
preTim = timerTicks.Load()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user