mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-21 18:29:45 +00:00
CPU execution with bursts
This commit is contained in:
parent
a3f69bc01d
commit
81c77c7700
11
apple2.go
11
apple2.go
@ -33,7 +33,10 @@ const (
|
||||
cpuClockEuroMhz = 14.238 / 14
|
||||
)
|
||||
|
||||
const maxWaitDuration = 100 * time.Millisecond
|
||||
const (
|
||||
maxWaitDuration = 100 * time.Millisecond
|
||||
cpuSpinLoops = 100
|
||||
)
|
||||
|
||||
// Run starts the Apple2 emulation
|
||||
func (a *Apple2) Run() {
|
||||
@ -47,8 +50,10 @@ func (a *Apple2) Run() {
|
||||
for {
|
||||
// Run a 6502 step
|
||||
if !a.paused {
|
||||
a.cpu.ExecuteInstruction()
|
||||
a.executionTrace()
|
||||
for i := 0; i < cpuSpinLoops; i++ {
|
||||
a.cpu.ExecuteInstruction()
|
||||
a.executionTrace()
|
||||
}
|
||||
} else {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user