mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-21 18:29:45 +00:00
E2E tests working with DMA
This commit is contained in:
parent
1baddad56e
commit
c89aa36f1d
11
apple2Run.go
11
apple2Run.go
@ -34,27 +34,30 @@ func (a *Apple2) Start(paused bool) {
|
||||
a.paused = paused
|
||||
|
||||
for {
|
||||
// Run 6502 steps
|
||||
// Run cpu steps
|
||||
if !a.paused {
|
||||
if !a.dmaActive {
|
||||
spinStartCycles := a.cpu.GetCycles()
|
||||
// 6502 is running
|
||||
for i := 0; i < cpuSpinLoops && !a.dmaActive; i++ {
|
||||
// Conditional tracing
|
||||
// pc, _ := a.cpu.GetPCAndSP()
|
||||
// a.cpu.SetTrace(pc >= 0xc700 && pc < 0xc800)
|
||||
|
||||
// Execution
|
||||
startCycles := a.cpu.GetCycles()
|
||||
a.cpu.ExecuteInstruction()
|
||||
a.cycles += a.cpu.GetCycles() - startCycles
|
||||
|
||||
// Special tracing
|
||||
a.executionTrace()
|
||||
}
|
||||
a.cycles += a.cpu.GetCycles() - spinStartCycles
|
||||
} else {
|
||||
// a card, like the Z80 Softcard, is running
|
||||
card := a.cards[a.dmaSlot]
|
||||
for i := 0; i < cpuSpinLoops && a.dmaActive; i++ {
|
||||
card.runDMACycle()
|
||||
a.cycles++
|
||||
|
||||
a.executionTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,10 @@ func (t *traceApplecorn) connect(a *Apple2) {
|
||||
}
|
||||
|
||||
func (t *traceApplecorn) inspect() {
|
||||
if t.a.dmaActive {
|
||||
return
|
||||
}
|
||||
|
||||
if !t.a.mmu.altMainRAMActiveRead {
|
||||
// We want to trace only the activity on the Acorn memory space
|
||||
return
|
||||
|
@ -29,6 +29,10 @@ func (t *traceCpm65) connect(a *Apple2) {
|
||||
}
|
||||
|
||||
func (t *traceCpm65) inspect() {
|
||||
if t.a.dmaActive {
|
||||
return
|
||||
}
|
||||
|
||||
pc, _ := t.a.cpu.GetPCAndSP()
|
||||
if pc == cpm65BdosEntrypoint {
|
||||
regA, regX, regY, _ := t.a.cpu.GetAXYP()
|
||||
|
@ -31,6 +31,10 @@ See:
|
||||
Experimental. Not sure the paramters for DREAD and DWRITE are correct.
|
||||
*/
|
||||
func (t *tracePascal) inspect() {
|
||||
if t.a.dmaActive {
|
||||
return
|
||||
}
|
||||
|
||||
bios := uint16(t.a.mmu.physicalMainRAM.peek(pascalJvabfoldL)) +
|
||||
uint16(t.a.mmu.physicalMainRAM.peek(pascalJvabfoldH))<<8
|
||||
pc, _ := t.a.cpu.GetPCAndSP()
|
||||
|
@ -37,6 +37,10 @@ func (t *traceProDOS) connect(a *Apple2) {
|
||||
}
|
||||
|
||||
func (t *traceProDOS) inspect() {
|
||||
if t.a.dmaActive {
|
||||
return
|
||||
}
|
||||
|
||||
pc, _ := t.a.cpu.GetPCAndSP()
|
||||
if pc == mliAddress {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user