mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2024-06-02 20:18:20 -04:00
moved coprocessor interface/types from mapper to coprocessor package
there could be more work to do here to make this more readable
This commit is contained in:
parent
9b86b88440
commit
2d02764e60
|
@ -13,7 +13,7 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Gopher2600. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package mapper
|
||||
package coprocessor
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -20,13 +20,13 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/breakpoints"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/callstack"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/dwarf"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/faults"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/yield"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/coords"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
|
@ -40,7 +40,7 @@ type TV interface {
|
|||
|
||||
// Cartridge defines the interface to the cartridge required by the developer package
|
||||
type Cartridge interface {
|
||||
GetCoProc() mapper.CartCoProc
|
||||
GetCoProc() coprocessor.CartCoProc
|
||||
PushFunction(func())
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ type Developer struct {
|
|||
breakAddress uint32
|
||||
|
||||
// profiler instance. measures cycles counts for executed address
|
||||
profiler mapper.CartCoProcProfiler
|
||||
profiler coprocessor.CartCoProcProfiler
|
||||
|
||||
// slow down rate of NewFrame()
|
||||
framesSinceLastUpdate int
|
||||
|
@ -121,8 +121,8 @@ func (dev *Developer) AttachCartridge(cart Cartridge, romFile string, elfFile st
|
|||
|
||||
dev.framesSinceLastUpdate = 0
|
||||
|
||||
dev.profiler = mapper.CartCoProcProfiler{
|
||||
Entries: make([]mapper.CartCoProcProfileEntry, 0, 1000),
|
||||
dev.profiler = coprocessor.CartCoProcProfiler{
|
||||
Entries: make([]coprocessor.CartCoProcProfileEntry, 0, 1000),
|
||||
}
|
||||
|
||||
if cart == nil || cart.GetCoProc() == nil {
|
||||
|
@ -159,7 +159,7 @@ func (dev *Developer) AttachCartridge(cart Cartridge, romFile string, elfFile st
|
|||
|
||||
}
|
||||
|
||||
// HighAddress implements the mapper.CartCoProcDeveloper interface.
|
||||
// HighAddress implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) HighAddress() uint32 {
|
||||
if dev.source == nil {
|
||||
return 0
|
||||
|
@ -171,7 +171,7 @@ func (dev *Developer) HighAddress() uint32 {
|
|||
return uint32(dev.source.HighAddress)
|
||||
}
|
||||
|
||||
// CheckBreakpoint implements the mapper.CartCoProcDeveloper interface.
|
||||
// CheckBreakpoint implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) CheckBreakpoint(addr uint32) bool {
|
||||
if dev.source == nil {
|
||||
return false
|
||||
|
@ -232,8 +232,8 @@ func (dev *Developer) NewFrame(frameInfo television.FrameInfo) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// OnYield implements the mapper.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) OnYield(addr uint32, yield mapper.CoProcYield) {
|
||||
// OnYield implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) OnYield(addr uint32, yield coprocessor.CoProcYield) {
|
||||
dev.yieldStateLock.Lock()
|
||||
defer dev.yieldStateLock.Unlock()
|
||||
|
||||
|
@ -241,7 +241,7 @@ func (dev *Developer) OnYield(addr uint32, yield mapper.CoProcYield) {
|
|||
dev.yieldState.Reason = yield.Type
|
||||
dev.yieldState.LocalVariables = dev.yieldState.LocalVariables[:0]
|
||||
|
||||
if yield.Type == mapper.YieldSyncWithVCS {
|
||||
if yield.Type == coprocessor.YieldSyncWithVCS {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ func (dev *Developer) OnYield(addr uint32, yield mapper.CoProcYield) {
|
|||
})
|
||||
}
|
||||
|
||||
// MemoryFault implements the mapper.CartCoProcDeveloper interface.
|
||||
// MemoryFault implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) MemoryFault(event string, explanation faults.Category,
|
||||
instructionAddr uint32, accessAddr uint32) string {
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import (
|
|||
"math"
|
||||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
||||
|
@ -534,7 +534,7 @@ func (bld *build) resolveVariableDeclaration(v *dwarf.Entry, src *Source) (*Sour
|
|||
// buildVariables populates variables map in the *Source tree. local variables
|
||||
// will need to be relocated for relocatable ELF files
|
||||
func (bld *build) buildVariables(src *Source, ef *elf.File,
|
||||
relocatable mapper.CartCoProcRelocatable, executableOrigin uint64) error {
|
||||
relocatable coprocessor.CartCoProcRelocatable, executableOrigin uint64) error {
|
||||
|
||||
// keep track of the lexical range as we walk through the DWARF data in
|
||||
// order. if we need to add a variable to the list of locals and the DWARF
|
||||
|
|
|
@ -28,9 +28,9 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/profiling"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
||||
|
@ -40,7 +40,7 @@ var UnsupportedDWARF = errors.New("unsupported DWARF")
|
|||
|
||||
// Cartridge defines the interface to the cartridge required by the source package
|
||||
type Cartridge interface {
|
||||
GetCoProc() mapper.CartCoProc
|
||||
GetCoProc() coprocessor.CartCoProc
|
||||
}
|
||||
|
||||
// compile units are made up of many children. for convenience/speed we keep
|
||||
|
@ -286,7 +286,7 @@ func NewSource(romFile string, cart Cartridge, elfFile string) (*Source, error)
|
|||
// acquire origin addresses and debugging sections according to whether the
|
||||
// cartridge is relocatable or not
|
||||
if relocatable {
|
||||
c, ok := coproc.(mapper.CartCoProcRelocatable)
|
||||
c, ok := coproc.(coprocessor.CartCoProcRelocatable)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("dwarf: ELF file is reloctable but the cartridge mapper does not support that")
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ func NewSource(romFile string, cart Cartridge, elfFile string) (*Source, error)
|
|||
logger.Logf("dwarf", err.Error())
|
||||
}
|
||||
} else {
|
||||
if c, ok := coproc.(mapper.CartCoProcRelocate); ok {
|
||||
if c, ok := coproc.(coprocessor.CartCoProcRelocate); ok {
|
||||
relocate = true
|
||||
executableOrigin = uint64(c.ExecutableOrigin())
|
||||
logger.Logf("dwarf", "found non-relocatable origin: %08x", executableOrigin)
|
||||
|
@ -525,7 +525,7 @@ func NewSource(romFile string, cart Cartridge, elfFile string) (*Source, error)
|
|||
}
|
||||
|
||||
// build variables
|
||||
if relocatable, ok := coproc.(mapper.CartCoProcRelocatable); ok {
|
||||
if relocatable, ok := coproc.(coprocessor.CartCoProcRelocatable); ok {
|
||||
err = bld.buildVariables(src, ef, relocatable, executableOrigin)
|
||||
} else {
|
||||
err = bld.buildVariables(src, ef, nil, executableOrigin)
|
||||
|
|
|
@ -19,8 +19,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/profiling"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
)
|
||||
|
||||
// SourceFileContent lists the lines in a source file
|
||||
|
@ -70,7 +70,7 @@ type SourceInstruction struct {
|
|||
|
||||
// the disassembly entry from the cartridge dissassembly. we don't deal with
|
||||
// the details of this type in the coprocessor.developer package
|
||||
Disasm mapper.CartCoProcDisasmEntry
|
||||
Disasm coprocessor.CartCoProcDisasmEntry
|
||||
|
||||
// the line of source code this diassembly entry is associated with
|
||||
Line *SourceLine
|
||||
|
|
|
@ -18,19 +18,19 @@ package developer
|
|||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/profiling"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
)
|
||||
|
||||
// Profiling implements the mapper.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) Profiling() *mapper.CartCoProcProfiler {
|
||||
// Profiling implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) Profiling() *coprocessor.CartCoProcProfiler {
|
||||
if dev.source == nil {
|
||||
return nil
|
||||
}
|
||||
return &dev.profiler
|
||||
}
|
||||
|
||||
// StartProfiling implements the mapper.CartCoProcDeveloper interface.
|
||||
// StartProfiling implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) StartProfiling() {
|
||||
if dev.source == nil {
|
||||
return
|
||||
|
@ -42,7 +42,7 @@ func (dev *Developer) StartProfiling() {
|
|||
dev.yieldStateLock.Lock()
|
||||
defer dev.yieldStateLock.Unlock()
|
||||
|
||||
if dev.yieldState.Reason != mapper.YieldProgramEnded {
|
||||
if dev.yieldState.Reason != coprocessor.YieldProgramEnded {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ func (dev *Developer) StartProfiling() {
|
|||
dev.callstack.Stack = append(dev.callstack.Stack, dev.source.DriverSourceLine)
|
||||
}
|
||||
|
||||
// ProcessProfiling implements the mapper.CartCoProcDeveloper interface.
|
||||
// ProcessProfiling implements the coprocessor.CartCoProcDeveloper interface.
|
||||
func (dev *Developer) ProcessProfiling() {
|
||||
if dev.source == nil {
|
||||
return
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
package yield
|
||||
|
||||
import (
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/dwarf"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
)
|
||||
|
||||
// State records the most recent yield
|
||||
type State struct {
|
||||
Addr uint32
|
||||
Reason mapper.CoProcYieldType
|
||||
Reason coprocessor.CoProcYieldType
|
||||
LocalVariables []*dwarf.SourceVariableLocal
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import (
|
|||
"sort"
|
||||
"sync"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/coords"
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ type TV interface {
|
|||
// CartCoProcDisassembly defines the interface to the cartridge required by the
|
||||
// coprocessor disassembly pacakge
|
||||
type CartCoProcDisassembly interface {
|
||||
GetCoProc() mapper.CartCoProc
|
||||
GetCoProc() coprocessor.CartCoProc
|
||||
}
|
||||
|
||||
// Disassembly is used to handle the disassembly of instructions from an
|
||||
|
@ -52,11 +52,11 @@ type Disassembly struct {
|
|||
type DisasmEntries struct {
|
||||
Enabled bool
|
||||
|
||||
Entries map[string]mapper.CartCoProcDisasmEntry
|
||||
Entries map[string]coprocessor.CartCoProcDisasmEntry
|
||||
Keys []string // sorted keys into the disasm map
|
||||
|
||||
LastExecution []mapper.CartCoProcDisasmEntry
|
||||
LastExecutionSummary mapper.CartCoProcDisasmSummary
|
||||
LastExecution []coprocessor.CartCoProcDisasmEntry
|
||||
LastExecutionSummary coprocessor.CartCoProcDisasmSummary
|
||||
|
||||
LastStart coords.TelevisionCoords
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ func (dsm *Disassembly) AttachCartridge(cart CartCoProcDisassembly) {
|
|||
dsm.cart = nil
|
||||
|
||||
dsm.disasm = DisasmEntries{
|
||||
LastExecution: make([]mapper.CartCoProcDisasmEntry, 0, 1024),
|
||||
Entries: make(map[string]mapper.CartCoProcDisasmEntry),
|
||||
LastExecution: make([]coprocessor.CartCoProcDisasmEntry, 0, 1024),
|
||||
Entries: make(map[string]coprocessor.CartCoProcDisasmEntry),
|
||||
Keys: make([]string, 0, 1024),
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ func (dsm *Disassembly) Start() {
|
|||
}
|
||||
|
||||
// Step implements the CartCoProcDisassembler interface.
|
||||
func (dsm *Disassembly) Step(entry mapper.CartCoProcDisasmEntry) {
|
||||
func (dsm *Disassembly) Step(entry coprocessor.CartCoProcDisasmEntry) {
|
||||
dsm.crit.Lock()
|
||||
defer dsm.crit.Unlock()
|
||||
|
||||
|
@ -166,7 +166,7 @@ func (dsm *Disassembly) Step(entry mapper.CartCoProcDisasmEntry) {
|
|||
}
|
||||
|
||||
// End implements the CartCoProcDisassembler interface.
|
||||
func (dsm *Disassembly) End(summary mapper.CartCoProcDisasmSummary) {
|
||||
func (dsm *Disassembly) End(summary coprocessor.CartCoProcDisasmSummary) {
|
||||
dsm.crit.Lock()
|
||||
defer dsm.crit.Unlock()
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
package debugger
|
||||
|
||||
import "github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
import "github.com/jetsetilly/gopher2600/coprocessor"
|
||||
|
||||
// the coproc shim is a convenient way of retreiving corprocessor interfaces
|
||||
// without exposing too much of the emulation
|
||||
|
@ -28,7 +28,7 @@ type coprocShim struct {
|
|||
|
||||
// GetCoProc implements the CartCoProcDeveloper interface in the coprocessor
|
||||
// developer package
|
||||
func (shim coprocShim) GetCoProc() mapper.CartCoProc {
|
||||
func (shim coprocShim) GetCoProc() coprocessor.CartCoProc {
|
||||
return shim.dbg.vcs.Mem.Cart.GetCoProc()
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import (
|
|||
"github.com/jetsetilly/gopher2600/bots/wrangler"
|
||||
"github.com/jetsetilly/gopher2600/cartridgeloader"
|
||||
"github.com/jetsetilly/gopher2600/comparison"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
coprocDev "github.com/jetsetilly/gopher2600/coprocessor/developer"
|
||||
coprocDWARF "github.com/jetsetilly/gopher2600/coprocessor/developer/dwarf"
|
||||
coprocDisasm "github.com/jetsetilly/gopher2600/coprocessor/disassembly"
|
||||
|
@ -844,29 +845,29 @@ func (dbg *Debugger) StartInPlayMode(filename string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// CartYield implements the mapper.CartYieldHook interface.
|
||||
func (dbg *Debugger) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookResponse {
|
||||
// CartYield implements the coprocessor.CartYieldHook interface.
|
||||
func (dbg *Debugger) CartYield(yield coprocessor.CoProcYieldType) coprocessor.YieldHookResponse {
|
||||
// if the emulator wants to quit we need to return true to instruct the
|
||||
// cartridge to return to the main loop immediately
|
||||
if !dbg.running {
|
||||
return mapper.YieldHookEnd
|
||||
return coprocessor.YieldHookEnd
|
||||
}
|
||||
|
||||
// resolve deferred yield
|
||||
if dbg.halting.deferredCartridgeYield {
|
||||
dbg.halting.deferredCartridgeYield = false
|
||||
dbg.halting.cartridgeYield = true
|
||||
return mapper.YieldHookEnd
|
||||
return coprocessor.YieldHookEnd
|
||||
}
|
||||
|
||||
switch yield {
|
||||
case mapper.YieldProgramEnded:
|
||||
case coprocessor.YieldProgramEnded:
|
||||
// expected reason for CDF and DPC+ cartridges
|
||||
return mapper.YieldHookContinue
|
||||
return coprocessor.YieldHookContinue
|
||||
|
||||
case mapper.YieldSyncWithVCS:
|
||||
case coprocessor.YieldSyncWithVCS:
|
||||
// expected reason for ACE and ELF cartridges
|
||||
return mapper.YieldHookContinue
|
||||
return coprocessor.YieldHookContinue
|
||||
}
|
||||
|
||||
// if emulation is in itialisation state then we cause coprocessor execution
|
||||
|
@ -879,7 +880,7 @@ func (dbg *Debugger) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookRes
|
|||
// a deferred YeildHookEnd might be a better option
|
||||
if dbg.State() == govern.Initialising {
|
||||
dbg.halting.deferredCartridgeYield = true
|
||||
return mapper.YieldHookContinue
|
||||
return coprocessor.YieldHookContinue
|
||||
}
|
||||
|
||||
dbg.halting.cartridgeYield = true
|
||||
|
@ -894,7 +895,7 @@ func (dbg *Debugger) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookRes
|
|||
dbg.inputLoop(dbg.term, true)
|
||||
}
|
||||
|
||||
return mapper.YieldHookEnd
|
||||
return coprocessor.YieldHookEnd
|
||||
}
|
||||
|
||||
func (dbg *Debugger) run() error {
|
||||
|
|
|
@ -18,7 +18,7 @@ package terminal
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
)
|
||||
|
||||
// Prompt specifies the prompt text and the prompt style. For CPUStep
|
||||
|
@ -28,7 +28,7 @@ type Prompt struct {
|
|||
Type PromptType
|
||||
|
||||
Content string
|
||||
Yield mapper.CoProcYield
|
||||
Yield coprocessor.CoProcYield
|
||||
|
||||
Recording bool
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package lazyvalues
|
|||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/plusrom"
|
||||
)
|
||||
|
@ -45,7 +46,7 @@ type LazyCart struct {
|
|||
tapeBus atomic.Value // mapper.CartTapeBus (in continer)
|
||||
tapeState atomic.Value // mapper.CartTapeState (in container)
|
||||
|
||||
coProcBus atomic.Value // mapper.CartCoProc (in container)
|
||||
coProcBus atomic.Value // coprocessor.CartCoProc (in container)
|
||||
coprocID atomic.Value // string
|
||||
coprocPC atomic.Value // uint32
|
||||
|
||||
|
@ -232,7 +233,7 @@ func (lz *LazyCart) update() {
|
|||
lz.PlusROMSendState, _ = lz.plusROMSendState.Load().(plusrom.SendState)
|
||||
}
|
||||
|
||||
_, lz.HasCoProcBus = lz.coProcBus.Load().(container).v.(mapper.CartCoProc)
|
||||
_, lz.HasCoProcBus = lz.coProcBus.Load().(container).v.(coprocessor.CartCoProc)
|
||||
if lz.HasCoProcBus {
|
||||
lz.CoProcID, _ = lz.coprocID.Load().(string)
|
||||
lz.CoProcPC, _ = lz.coprocPC.Load().(uint32)
|
||||
|
@ -250,7 +251,7 @@ func (lz *LazyCart) fastPush() {
|
|||
}
|
||||
|
||||
func (lz *LazyCart) fastUpdate() {
|
||||
_, lz.HasCoProcBus = lz.coProcBus.Load().(container).v.(mapper.CartCoProc)
|
||||
_, lz.HasCoProcBus = lz.coProcBus.Load().(container).v.(coprocessor.CartCoProc)
|
||||
if lz.HasCoProcBus {
|
||||
lz.CoProcID, _ = lz.coprocID.Load().(string)
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ import (
|
|||
"image/color"
|
||||
"sync"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/signal"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/specification"
|
||||
|
@ -624,13 +624,13 @@ func (scr *screen) reflectionColor(ref *reflection.ReflectedVideoStep) color.RGB
|
|||
}
|
||||
case reflection.OverlayLabels[reflection.OverlayCoproc]:
|
||||
switch ref.CoProcSync {
|
||||
case mapper.CoProcIdle:
|
||||
case coprocessor.CoProcIdle:
|
||||
return reflectionColors[reflection.CoProcInactive]
|
||||
case mapper.CoProcNOPFeed:
|
||||
case coprocessor.CoProcNOPFeed:
|
||||
return reflectionColors[reflection.CoProcActive]
|
||||
case mapper.CoProcStrongARMFeed:
|
||||
case coprocessor.CoProcStrongARMFeed:
|
||||
return reflectionColors[reflection.CoProcInactive]
|
||||
case mapper.CoProcParallel:
|
||||
case coprocessor.CoProcParallel:
|
||||
return reflectionColors[reflection.CoProcActive]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ import (
|
|||
"sync/atomic"
|
||||
|
||||
"github.com/inkyblackness/imgui-go/v4"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/dwarf"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/profiling"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/gui/fonts"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/specification"
|
||||
)
|
||||
|
@ -314,13 +314,13 @@ func (win *winCoProcProfiling) draw() {
|
|||
}
|
||||
|
||||
func (win *winCoProcProfiling) drawFrameStats() {
|
||||
accumulate := func(s mapper.CoProcSynchronisation) int {
|
||||
accumulate := func(s coprocessor.CoProcSynchronisation) int {
|
||||
switch s {
|
||||
case mapper.CoProcIdle:
|
||||
case mapper.CoProcNOPFeed:
|
||||
case coprocessor.CoProcIdle:
|
||||
case coprocessor.CoProcNOPFeed:
|
||||
return 1
|
||||
case mapper.CoProcStrongARMFeed:
|
||||
case mapper.CoProcParallel:
|
||||
case coprocessor.CoProcStrongARMFeed:
|
||||
case coprocessor.CoProcParallel:
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
|
|
|
@ -21,13 +21,13 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/inkyblackness/imgui-go/v4"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/breakpoints"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/dwarf"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/yield"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/gui/fonts"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
"github.com/jetsetilly/gopher2600/resources/unique"
|
||||
)
|
||||
|
@ -121,7 +121,7 @@ func (win *winCoProcSource) debuggerDraw() bool {
|
|||
win.yieldState = yld
|
||||
|
||||
// open window and focus on yield line if the yield is a breakpoint
|
||||
if yld.Reason != mapper.YieldSyncWithVCS && yld.Reason != mapper.YieldProgramEnded {
|
||||
if yld.Reason != coprocessor.YieldSyncWithVCS && yld.Reason != coprocessor.YieldProgramEnded {
|
||||
win.debuggerOpen = true
|
||||
win.focusYieldLine = true
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ import (
|
|||
|
||||
"github.com/go-gl/gl/v3.2-core/gl"
|
||||
"github.com/inkyblackness/imgui-go/v4"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/disassembly"
|
||||
"github.com/jetsetilly/gopher2600/gui/fonts"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/vcs"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/coords"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/signal"
|
||||
|
@ -735,13 +735,13 @@ func (win *winDbgScr) drawReflectionTooltip() {
|
|||
case reflection.OverlayLabels[reflection.OverlayCoproc]:
|
||||
imguiSeparator()
|
||||
switch ref.CoProcSync {
|
||||
case mapper.CoProcIdle:
|
||||
case coprocessor.CoProcIdle:
|
||||
imgui.Text(fmt.Sprintf("%s is idle", win.img.lz.Cart.CoProcID))
|
||||
case mapper.CoProcNOPFeed:
|
||||
case coprocessor.CoProcNOPFeed:
|
||||
imgui.Text(fmt.Sprintf("%s is feeding NOPs", win.img.lz.Cart.CoProcID))
|
||||
case mapper.CoProcStrongARMFeed:
|
||||
case coprocessor.CoProcStrongARMFeed:
|
||||
imgui.Text(fmt.Sprintf("%s feeding 6507", win.img.lz.Cart.CoProcID))
|
||||
case mapper.CoProcParallel:
|
||||
case coprocessor.CoProcParallel:
|
||||
imgui.Text(fmt.Sprintf("%s and 6507 running in parallel", win.img.lz.Cart.CoProcID))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package ace
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/environment"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -28,13 +29,13 @@ import (
|
|||
// Ace implements the mapper.CartMapper interface.
|
||||
type Ace struct {
|
||||
env *environment.Environment
|
||||
dev mapper.CartCoProcDeveloper
|
||||
dev coprocessor.CartCoProcDeveloper
|
||||
|
||||
arm *arm.ARM
|
||||
mem *aceMemory
|
||||
|
||||
// the hook that handles cartridge yields
|
||||
yieldHook mapper.CartYieldHook
|
||||
yieldHook coprocessor.CartYieldHook
|
||||
|
||||
// armState is a copy of the ARM's state at the moment of the most recent
|
||||
// Snapshot. it's used only suring a Plumb() operation
|
||||
|
@ -45,7 +46,7 @@ type Ace struct {
|
|||
func NewAce(env *environment.Environment, data []byte) (mapper.CartMapper, error) {
|
||||
cart := &Ace{
|
||||
env: env,
|
||||
yieldHook: mapper.StubCartYieldHook{},
|
||||
yieldHook: coprocessor.StubCartYieldHook{},
|
||||
}
|
||||
|
||||
var err error
|
||||
|
@ -102,7 +103,7 @@ func (cart *Ace) PlumbFromDifferentEmulation(env *environment.Environment) {
|
|||
cart.mem.Plumb(cart.arm)
|
||||
cart.arm.Plumb(cart.armState, cart.mem, cart)
|
||||
cart.armState = nil
|
||||
cart.yieldHook = mapper.StubCartYieldHook{}
|
||||
cart.yieldHook = coprocessor.StubCartYieldHook{}
|
||||
}
|
||||
|
||||
// Plumb implements the mapper.CartMapper interface.
|
||||
|
@ -155,11 +156,11 @@ func (cart *Ace) runARM() bool {
|
|||
cart.mem.cycles += cycles
|
||||
|
||||
// keep calling runArm() for as long as program does not need to sync with the VCS
|
||||
for cart.mem.yield.Type != mapper.YieldSyncWithVCS {
|
||||
for cart.mem.yield.Type != coprocessor.YieldSyncWithVCS {
|
||||
switch cart.yieldHook.CartYield(cart.mem.yield.Type) {
|
||||
case mapper.YieldHookEnd:
|
||||
case coprocessor.YieldHookEnd:
|
||||
return false
|
||||
case mapper.YieldHookContinue:
|
||||
case coprocessor.YieldHookContinue:
|
||||
cart.mem.yield, cycles = cart.arm.Run()
|
||||
cart.mem.cycles += cycles
|
||||
}
|
||||
|
@ -231,67 +232,67 @@ func (cart *Ace) BusStuff() (uint8, bool) {
|
|||
return 0, false
|
||||
}
|
||||
|
||||
// CoProcID implements the mapper.CartCoProc interface.
|
||||
// CoProcID implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcID() string {
|
||||
return cart.arm.CoProcID()
|
||||
}
|
||||
|
||||
// SetDisassembler implements the mapper.CartCoProc interface.
|
||||
func (cart *Ace) SetDisassembler(disasm mapper.CartCoProcDisassembler) {
|
||||
// SetDisassembler implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) SetDisassembler(disasm coprocessor.CartCoProcDisassembler) {
|
||||
cart.arm.SetDisassembler(disasm)
|
||||
}
|
||||
|
||||
// SetDeveloper implements the mapper.CartCoProc interface.
|
||||
func (cart *Ace) SetDeveloper(dev mapper.CartCoProcDeveloper) {
|
||||
// SetDeveloper implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) SetDeveloper(dev coprocessor.CartCoProcDeveloper) {
|
||||
cart.dev = dev
|
||||
cart.arm.SetDeveloper(dev)
|
||||
}
|
||||
|
||||
// ExecutableOrigin implements the mapper.CartCoProcRelocatable interface.
|
||||
// ExecutableOrigin implements the coprocessor.CartCoProcRelocatable interface.
|
||||
func (cart *Ace) ExecutableOrigin() uint32 {
|
||||
return cart.mem.flashARMOrigin
|
||||
}
|
||||
|
||||
// CoProcExecutionState implements the mapper.CartCoProc interface.
|
||||
func (cart *Ace) CoProcExecutionState() mapper.CoProcExecutionState {
|
||||
// CoProcExecutionState implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcExecutionState() coprocessor.CoProcExecutionState {
|
||||
if cart.mem.parallelARM {
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcParallel,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcParallel,
|
||||
Yield: cart.mem.yield,
|
||||
}
|
||||
}
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcStrongARMFeed,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcStrongARMFeed,
|
||||
Yield: cart.mem.yield,
|
||||
}
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcRegister(n int) (uint32, bool) {
|
||||
return cart.arm.Register(n)
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcRegisterSet(n int, value uint32) bool {
|
||||
return cart.arm.SetRegister(n, value)
|
||||
}
|
||||
|
||||
// CoProcStackFrame implements the mapper.CartCoProc interface.
|
||||
// CoProcStackFrame implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcStackFrame() uint32 {
|
||||
return cart.arm.StackFrame()
|
||||
}
|
||||
|
||||
// CoProcPeek implements the mapper.CartCoProc interface.
|
||||
// CoProcPeek implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) CoProcPeek(addr uint32) (uint32, bool) {
|
||||
return cart.mem.Read32bit(addr)
|
||||
}
|
||||
|
||||
// BreakpointsEnable implements the mapper.CartCoProc interface.
|
||||
// BreakpointsEnable implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) BreakpointsEnable(enable bool) {
|
||||
cart.arm.BreakpointsEnable(enable)
|
||||
}
|
||||
|
||||
// SetYieldHook implements the mapper.CartCoProc interface.
|
||||
func (cart *Ace) SetYieldHook(hook mapper.CartYieldHook) {
|
||||
// SetYieldHook implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Ace) SetYieldHook(hook coprocessor.CartYieldHook) {
|
||||
cart.yieldHook = hook
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package ace
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/architecture"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/preferences"
|
||||
|
@ -92,7 +93,7 @@ type aceMemory struct {
|
|||
parallelARM bool
|
||||
|
||||
// most recent yield from the coprocessor
|
||||
yield mapper.CoProcYield
|
||||
yield coprocessor.CoProcYield
|
||||
|
||||
// count of cycles accumulated
|
||||
cycles float32
|
||||
|
|
|
@ -23,10 +23,10 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/architecture"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/fpu"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/peripherals"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/preferences"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
@ -111,7 +111,7 @@ type ARMState struct {
|
|||
stackFrame uint32
|
||||
|
||||
// the yield reason explains the reason for why the ARM execution ended
|
||||
yield mapper.CoProcYield
|
||||
yield coprocessor.CoProcYield
|
||||
|
||||
// the area the PC covers. once assigned we'll assume that the program
|
||||
// never reads outside this area. the value is assigned on reset()
|
||||
|
@ -244,7 +244,7 @@ type ARM struct {
|
|||
decodeOnly bool
|
||||
|
||||
// interface to an optional disassembler
|
||||
disasm mapper.CartCoProcDisassembler
|
||||
disasm coprocessor.CartCoProcDisassembler
|
||||
|
||||
// cache of disassembled entries
|
||||
disasmCache map[uint32]DisasmEntry
|
||||
|
@ -257,7 +257,7 @@ type ARM struct {
|
|||
disasmSummary DisasmSummary
|
||||
|
||||
// interface to an option development package
|
||||
dev mapper.CartCoProcDeveloper
|
||||
dev coprocessor.CartCoProcDeveloper
|
||||
|
||||
// whether cycle count or not. set from ARM.prefs at the start of every arm.Run()
|
||||
//
|
||||
|
@ -277,7 +277,7 @@ type ARM struct {
|
|||
Ncycle func(bus busAccess, addr uint32)
|
||||
|
||||
// profiler for executed instructions. measures cycles counts
|
||||
profiler *mapper.CartCoProcProfiler
|
||||
profiler *coprocessor.CartCoProcProfiler
|
||||
|
||||
// enable breakpoint checking
|
||||
breakpointsEnabled bool
|
||||
|
@ -303,7 +303,7 @@ func NewARM(mmap architecture.Map, prefs *preferences.ARMPreferences, mem Shared
|
|||
|
||||
// disassembly printed to stdout
|
||||
if disassembleToStdout {
|
||||
arm.disasm = &mapper.CartCoProcDisassemblerStdout{}
|
||||
arm.disasm = &coprocessor.CartCoProcDisassemblerStdout{}
|
||||
}
|
||||
|
||||
// slow prefs update by 100ms
|
||||
|
@ -324,7 +324,7 @@ func NewARM(mmap architecture.Map, prefs *preferences.ARMPreferences, mem Shared
|
|||
arm.state.timer2 = peripherals.NewTimer2(arm.mmap)
|
||||
|
||||
// by definition the ARM starts in a program ended state
|
||||
arm.state.yield.Type = mapper.YieldProgramEnded
|
||||
arm.state.yield.Type = coprocessor.YieldProgramEnded
|
||||
|
||||
// clklen for flash based on flash latency setting
|
||||
latencyInMhz := (1 / (arm.mmap.FlashLatency / 1000000000)) / 1000000
|
||||
|
@ -343,10 +343,10 @@ func (arm *ARM) SetByteOrder(o binary.ByteOrder) {
|
|||
arm.byteOrder = o
|
||||
}
|
||||
|
||||
// CoProcID implements the mapper.CartCoProc interface.
|
||||
// CoProcID implements the coprocessor.CartCoProc interface.
|
||||
//
|
||||
// CoProcID is the ID returned by the ARM type. This const value can be used
|
||||
// for comparison purposes to check if a mapper.CartCoProc instance is of
|
||||
// for comparison purposes to check if a coprocessor.CartCoProc instance is of
|
||||
// the ARM type.
|
||||
func (arm *ARM) CoProcID() string {
|
||||
return string(arm.mmap.ARMArchitecture)
|
||||
|
@ -358,13 +358,13 @@ func (arm *ARM) ImmediateMode() bool {
|
|||
return arm.immediateMode
|
||||
}
|
||||
|
||||
// SetDisassembler implements the mapper.CartCoProc interface.
|
||||
func (arm *ARM) SetDisassembler(disasm mapper.CartCoProcDisassembler) {
|
||||
// SetDisassembler implements the coprocessor.CartCoProc interface.
|
||||
func (arm *ARM) SetDisassembler(disasm coprocessor.CartCoProcDisassembler) {
|
||||
arm.disasm = disasm
|
||||
}
|
||||
|
||||
// SetDeveloper implements the mapper.CartCoProc interface.
|
||||
func (arm *ARM) SetDeveloper(dev mapper.CartCoProcDeveloper) {
|
||||
// SetDeveloper implements the coprocessor.CartCoProc interface.
|
||||
func (arm *ARM) SetDeveloper(dev coprocessor.CartCoProcDeveloper) {
|
||||
arm.dev = dev
|
||||
}
|
||||
|
||||
|
@ -566,7 +566,7 @@ func (arm *ARM) SetInitialRegisters(args ...uint32) error {
|
|||
|
||||
// making sure that yield is not of type YieldProgramEnded. that would cause
|
||||
// the registers to be immediately reset on the next call to Run()
|
||||
arm.state.yield.Type = mapper.YieldSyncWithVCS
|
||||
arm.state.yield.Type = coprocessor.YieldSyncWithVCS
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -575,11 +575,11 @@ func (arm *ARM) SetInitialRegisters(args ...uint32) error {
|
|||
// previous execution ran to completion (ie. was uninterrupted).
|
||||
//
|
||||
// Returns the yield reason, the number of ARM cycles consumed.
|
||||
func (arm *ARM) Run() (mapper.CoProcYield, float32) {
|
||||
func (arm *ARM) Run() (coprocessor.CoProcYield, float32) {
|
||||
if arm.dev != nil {
|
||||
defer func() {
|
||||
arm.logYield()
|
||||
if arm.state.yield.Type != mapper.YieldBreakpoint {
|
||||
if arm.state.yield.Type != coprocessor.YieldBreakpoint {
|
||||
arm.dev.OnYield(arm.state.registers[rPC], arm.state.yield)
|
||||
}
|
||||
}()
|
||||
|
@ -587,7 +587,7 @@ func (arm *ARM) Run() (mapper.CoProcYield, float32) {
|
|||
|
||||
// only reset registers if the previous yield was one that indicated the end
|
||||
// of the program execution
|
||||
if arm.state.yield.Type == mapper.YieldProgramEnded {
|
||||
if arm.state.yield.Type == coprocessor.YieldProgramEnded {
|
||||
arm.resetRegisters()
|
||||
}
|
||||
|
||||
|
@ -604,18 +604,18 @@ func (arm *ARM) Run() (mapper.CoProcYield, float32) {
|
|||
}
|
||||
|
||||
// fill pipeline cannot happen immediately after resetRegisters()
|
||||
if arm.state.yield.Type == mapper.YieldProgramEnded {
|
||||
if arm.state.yield.Type == coprocessor.YieldProgramEnded {
|
||||
arm.state.registers[rPC] += 2
|
||||
}
|
||||
|
||||
// reset yield
|
||||
arm.state.yield.Type = mapper.YieldRunning
|
||||
arm.state.yield.Type = coprocessor.YieldRunning
|
||||
arm.state.yield.Error = nil
|
||||
arm.state.yield.Detail = arm.state.yield.Detail[:0]
|
||||
|
||||
// make sure program memory is correct
|
||||
arm.checkProgramMemory(false)
|
||||
if arm.state.yield.Type != mapper.YieldRunning {
|
||||
if arm.state.yield.Type != coprocessor.YieldRunning {
|
||||
return arm.state.yield, 0
|
||||
}
|
||||
|
||||
|
@ -626,7 +626,7 @@ func (arm *ARM) Run() (mapper.CoProcYield, float32) {
|
|||
// instruction has been executed. The ARM will then yield with the reson
|
||||
// YieldSyncWithVCS.
|
||||
func (arm *ARM) Interrupt() {
|
||||
arm.state.yield.Type = mapper.YieldSyncWithVCS
|
||||
arm.state.yield.Type = coprocessor.YieldSyncWithVCS
|
||||
}
|
||||
|
||||
// Registers returns a copy of the current values in the general ARM registers.
|
||||
|
@ -708,14 +708,14 @@ func (arm *ARM) checkProgramMemory(force bool) {
|
|||
var origin uint32
|
||||
arm.state.programMemory, origin = arm.mem.MapAddress(addr, false)
|
||||
if arm.state.programMemory == nil {
|
||||
arm.state.yield.Type = mapper.YieldMemoryAccessError
|
||||
arm.state.yield.Type = coprocessor.YieldMemoryAccessError
|
||||
arm.state.yield.Error = fmt.Errorf("can't find program memory (PC %08x)", addr)
|
||||
return
|
||||
}
|
||||
|
||||
if !arm.mem.IsExecutable(addr) {
|
||||
arm.state.programMemory = nil
|
||||
arm.state.yield.Type = mapper.YieldMemoryAccessError
|
||||
arm.state.yield.Type = coprocessor.YieldMemoryAccessError
|
||||
arm.state.yield.Error = fmt.Errorf("program memory is not executable (PC %08x)", addr)
|
||||
return
|
||||
}
|
||||
|
@ -733,7 +733,7 @@ func (arm *ARM) checkProgramMemory(force bool) {
|
|||
arm.stackProtectCheckProgramMemory()
|
||||
}
|
||||
|
||||
func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
||||
func (arm *ARM) run() (coprocessor.CoProcYield, float32) {
|
||||
select {
|
||||
case <-arm.prefsPulse.C:
|
||||
arm.updatePrefs()
|
||||
|
@ -767,7 +767,7 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
var iterations int
|
||||
|
||||
// loop through instructions until we reach an exit condition
|
||||
for arm.state.yield.Type == mapper.YieldRunning {
|
||||
for arm.state.yield.Type == coprocessor.YieldRunning {
|
||||
// program counter to execute:
|
||||
//
|
||||
// from "7.6 Data Operations" in "ARM7TDMI-S Technical Reference Manual r4p1", page 1-2
|
||||
|
@ -778,11 +778,11 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
arm.state.executingPC = arm.state.registers[rPC] - 2
|
||||
|
||||
arm.checkBreakpoints()
|
||||
if arm.state.yield.Type == mapper.YieldRunning {
|
||||
if arm.state.yield.Type == coprocessor.YieldRunning {
|
||||
|
||||
// check program memory and continue if it's fine
|
||||
arm.checkProgramMemory(false)
|
||||
if arm.state.yield.Type == mapper.YieldRunning {
|
||||
if arm.state.yield.Type == coprocessor.YieldRunning {
|
||||
memIdx := int(arm.state.executingPC - arm.state.programMemoryOrigin)
|
||||
|
||||
// opcode for executed instruction
|
||||
|
@ -893,7 +893,7 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
arm.disasm.Step(entry)
|
||||
|
||||
// print additional information output for stdout
|
||||
if _, ok := arm.disasm.(*mapper.CartCoProcDisassemblerStdout); ok {
|
||||
if _, ok := arm.disasm.(*coprocessor.CartCoProcDisassemblerStdout); ok {
|
||||
fmt.Println(arm.disasmVerbose(entry))
|
||||
}
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
|
||||
// accumulate cycle counts for profiling
|
||||
if arm.profiler != nil {
|
||||
arm.profiler.Entries = append(arm.profiler.Entries, mapper.CartCoProcProfileEntry{
|
||||
arm.profiler.Entries = append(arm.profiler.Entries, coprocessor.CartCoProcProfileEntry{
|
||||
Addr: arm.state.instructionPC,
|
||||
Cycles: arm.state.stretchedCycles,
|
||||
})
|
||||
|
@ -933,11 +933,11 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
}
|
||||
|
||||
// check for stack errors
|
||||
if arm.state.yield.Type == mapper.YieldStackError {
|
||||
if arm.state.yield.Type == coprocessor.YieldStackError {
|
||||
arm.extendedMemoryErrorLogging(opcode)
|
||||
if !arm.abortOnMemoryFault {
|
||||
arm.logYield()
|
||||
arm.state.yield.Type = mapper.YieldRunning
|
||||
arm.state.yield.Type = coprocessor.YieldRunning
|
||||
arm.state.yield.Error = nil
|
||||
arm.state.yield.Detail = arm.state.yield.Detail[:0]
|
||||
}
|
||||
|
@ -945,11 +945,11 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
if !arm.state.yield.Type.Normal() {
|
||||
if arm.state.registers[rSP] != expectedSP {
|
||||
arm.stackProtectCheckSP()
|
||||
if arm.state.yield.Type == mapper.YieldStackError {
|
||||
if arm.state.yield.Type == coprocessor.YieldStackError {
|
||||
arm.extendedMemoryErrorLogging(opcode)
|
||||
if !arm.abortOnMemoryFault {
|
||||
arm.logYield()
|
||||
arm.state.yield.Type = mapper.YieldRunning
|
||||
arm.state.yield.Type = coprocessor.YieldRunning
|
||||
arm.state.yield.Error = nil
|
||||
arm.state.yield.Detail = arm.state.yield.Detail[:0]
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
|
||||
// handle memory access yields. we don't these want these to bleed out
|
||||
// of the ARM unless the abort preference is set
|
||||
if arm.state.yield.Type == mapper.YieldMemoryAccessError {
|
||||
if arm.state.yield.Type == coprocessor.YieldMemoryAccessError {
|
||||
// add extended memory logging to yield detail
|
||||
arm.extendedMemoryErrorLogging(opcode)
|
||||
|
||||
|
@ -968,7 +968,7 @@ func (arm *ARM) run() (mapper.CoProcYield, float32) {
|
|||
// yield information now before reset the yield type
|
||||
if !arm.abortOnMemoryFault {
|
||||
arm.logYield()
|
||||
arm.state.yield.Type = mapper.YieldRunning
|
||||
arm.state.yield.Type = coprocessor.YieldRunning
|
||||
arm.state.yield.Error = nil
|
||||
arm.state.yield.Detail = arm.state.yield.Detail[:0]
|
||||
}
|
||||
|
@ -993,7 +993,7 @@ func (arm *ARM) checkBreakpoints() {
|
|||
}
|
||||
|
||||
if arm.dev.CheckBreakpoint(addr) {
|
||||
arm.state.yield.Type = mapper.YieldBreakpoint
|
||||
arm.state.yield.Type = coprocessor.YieldBreakpoint
|
||||
arm.state.yield.Error = fmt.Errorf("%08x", addr)
|
||||
arm.dev.OnYield(addr, arm.state.yield)
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ type StaticDisassembleConfig struct {
|
|||
// StaticDisassemble is used to statically disassemble a block of memory. It is
|
||||
// assumed that there is a valid instruction at the start of the block
|
||||
//
|
||||
// For disassemblies of executed code see the mapper.CartCoProcDisassembler interface
|
||||
// For disassemblies of executed code see the coprocessor.CartCoProcDisassembler interface
|
||||
func StaticDisassemble(config StaticDisassembleConfig) error {
|
||||
arm := &ARM{
|
||||
state: &ARMState{
|
||||
|
|
|
@ -19,8 +19,8 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/faults"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
||||
|
@ -29,7 +29,7 @@ func (arm *ARM) illegalAccess(event string, addr uint32) {
|
|||
return
|
||||
}
|
||||
|
||||
arm.state.yield.Type = mapper.YieldMemoryAccessError
|
||||
arm.state.yield.Type = coprocessor.YieldMemoryAccessError
|
||||
arm.state.yield.Error = fmt.Errorf("%s: unrecognised address %08x (PC: %08x)", event, addr, arm.state.instructionPC)
|
||||
|
||||
if arm.dev == nil {
|
||||
|
@ -44,7 +44,7 @@ func (arm *ARM) illegalAccess(event string, addr uint32) {
|
|||
|
||||
// nullAccess is a special condition of illegalAccess()
|
||||
func (arm *ARM) nullAccess(event string, addr uint32) {
|
||||
arm.state.yield.Type = mapper.YieldMemoryAccessError
|
||||
arm.state.yield.Type = coprocessor.YieldMemoryAccessError
|
||||
arm.state.yield.Error = fmt.Errorf("%s: probable null pointer dereference of %08x (PC: %08x)", event, addr, arm.state.instructionPC)
|
||||
|
||||
if arm.dev == nil {
|
||||
|
|
|
@ -19,8 +19,8 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor/developer/faults"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
)
|
||||
|
||||
func (arm *ARM) stackProtectCheckSP() {
|
||||
|
@ -33,11 +33,11 @@ func (arm *ARM) stackProtectCheckSP() {
|
|||
stackMemory, stackOrigin := arm.mem.MapAddress(arm.state.registers[rSP], true)
|
||||
|
||||
if stackMemory == nil {
|
||||
arm.state.yield.Type = mapper.YieldStackError
|
||||
arm.state.yield.Type = coprocessor.YieldStackError
|
||||
arm.state.yield.Error = fmt.Errorf("SP is not pointing to a valid address")
|
||||
|
||||
} else if stackMemory == arm.state.programMemory {
|
||||
arm.state.yield.Type = mapper.YieldStackError
|
||||
arm.state.yield.Type = coprocessor.YieldStackError
|
||||
arm.state.yield.Error = fmt.Errorf("SP is pointing to program memory")
|
||||
|
||||
} else if arm.state.protectVariableMemTop {
|
||||
|
@ -53,7 +53,7 @@ func (arm *ARM) stackProtectCheckSP() {
|
|||
}
|
||||
|
||||
// set yield type
|
||||
arm.state.yield.Type = mapper.YieldStackError
|
||||
arm.state.yield.Type = coprocessor.YieldStackError
|
||||
arm.state.yield.Error = fmt.Errorf("stack collision (SP %08x) with variables (top %08x) ",
|
||||
arm.state.registers[rSP], arm.state.variableMemtop)
|
||||
} else {
|
||||
|
@ -79,7 +79,7 @@ func (arm *ARM) stackProtectCheckProgramMemory() {
|
|||
|
||||
stackMemory, _ := arm.mem.MapAddress(arm.state.registers[rSP], true)
|
||||
if stackMemory == arm.state.programMemory {
|
||||
arm.state.yield.Type = mapper.YieldStackError
|
||||
arm.state.yield.Type = coprocessor.YieldStackError
|
||||
arm.state.yield.Error = fmt.Errorf("SP is pointing to program memory")
|
||||
arm.state.stackHasCollided = true
|
||||
} else {
|
||||
|
|
|
@ -20,8 +20,8 @@ import (
|
|||
"fmt"
|
||||
"math/bits"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/architecture"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
||||
|
@ -918,7 +918,7 @@ func (arm *ARM) decodeThumbHiRegisterOps(opcode uint16) *DisasmEntry {
|
|||
arm.state.registers[rLR] = nextPC | 0x01
|
||||
if target&0x01 == 0x00 {
|
||||
// cannot switch to ARM mode in the ARMv7-M architecture
|
||||
arm.state.yield.Type = mapper.YieldUndefinedBehaviour
|
||||
arm.state.yield.Type = coprocessor.YieldUndefinedBehaviour
|
||||
arm.state.yield.Error = errors.New("cannot switch to ARM mode in ARMv7-M architecture")
|
||||
}
|
||||
arm.state.registers[rPC] = (target + 2) & 0xfffffffe
|
||||
|
@ -927,7 +927,7 @@ func (arm *ARM) decodeThumbHiRegisterOps(opcode uint16) *DisasmEntry {
|
|||
target := arm.state.registers[srcReg]
|
||||
if target&0x01 == 0x00 {
|
||||
// cannot switch to ARM mode in the ARMv7-M architecture
|
||||
arm.state.yield.Type = mapper.YieldUndefinedBehaviour
|
||||
arm.state.yield.Type = coprocessor.YieldUndefinedBehaviour
|
||||
arm.state.yield.Error = errors.New("cannot switch to ARM mode in ARMv7-M architecture")
|
||||
}
|
||||
arm.state.registers[rPC] = (target + 2) & 0xfffffffe
|
||||
|
@ -972,7 +972,7 @@ func (arm *ARM) decodeThumbHiRegisterOps(opcode uint16) *DisasmEntry {
|
|||
// switch to ARM mode. emulate function call.
|
||||
res, err := arm.hook.ARMinterrupt(arm.state.registers[rPC]-4, arm.state.registers[2], arm.state.registers[3])
|
||||
if err != nil {
|
||||
arm.state.yield.Type = mapper.YieldExecutionError
|
||||
arm.state.yield.Type = coprocessor.YieldExecutionError
|
||||
arm.state.yield.Error = err
|
||||
return nil
|
||||
}
|
||||
|
@ -992,7 +992,7 @@ func (arm *ARM) decodeThumbHiRegisterOps(opcode uint16) *DisasmEntry {
|
|||
// we can assume that the main() function call is done and we
|
||||
// can return to the VCS emulation.
|
||||
if !res.InterruptServiced {
|
||||
arm.state.yield.Type = mapper.YieldProgramEnded
|
||||
arm.state.yield.Type = coprocessor.YieldProgramEnded
|
||||
arm.state.yield.Error = nil
|
||||
// "7.6 Data Operations" in "ARM7TDMI-S Technical Reference Manual r4p3"
|
||||
// - interrupted
|
||||
|
|
|
@ -32,7 +32,7 @@ package arm
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/logger"
|
||||
)
|
||||
|
||||
|
@ -147,7 +147,7 @@ func (arm *ARM) decodeThumb2Miscellaneous(opcode uint16) decodeFunction {
|
|||
if opcode&0xff00 == 0xbe00 {
|
||||
// software breakpoint
|
||||
return func(_ uint16) *DisasmEntry {
|
||||
arm.state.yield.Type = mapper.YieldSyncWithVCS
|
||||
arm.state.yield.Type = coprocessor.YieldSyncWithVCS
|
||||
arm.state.yield.Error = nil
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/cartridgeloader"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/environment"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/ace"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/cdf"
|
||||
|
@ -54,7 +55,7 @@ type Cartridge struct {
|
|||
hasBusStuff bool
|
||||
busStuff mapper.CartBusStuff
|
||||
hasCoProc bool
|
||||
coproc mapper.CartCoProc
|
||||
coproc coprocessor.CartCoProc
|
||||
}
|
||||
|
||||
// sentinal error returned if operation is on the ejected cartridge type.
|
||||
|
@ -85,7 +86,7 @@ func (cart *Cartridge) Snapshot() *Cartridge {
|
|||
func (cart *Cartridge) Plumb(env *environment.Environment, fromDifferentEmulation bool) {
|
||||
cart.env = env
|
||||
cart.busStuff, cart.hasBusStuff = cart.mapper.(mapper.CartBusStuff)
|
||||
cart.coproc, cart.hasCoProc = cart.mapper.(mapper.CartCoProc)
|
||||
cart.coproc, cart.hasCoProc = cart.mapper.(coprocessor.CartCoProc)
|
||||
|
||||
if fromDifferentEmulation {
|
||||
if m, ok := cart.mapper.(mapper.PlumbFromDifferentEmulation); ok {
|
||||
|
@ -207,7 +208,7 @@ func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error {
|
|||
|
||||
// get busstuff and coproc interfaces
|
||||
cart.busStuff, cart.hasBusStuff = cart.mapper.(mapper.CartBusStuff)
|
||||
cart.coproc, cart.hasCoProc = cart.mapper.(mapper.CartCoProc)
|
||||
cart.coproc, cart.hasCoProc = cart.mapper.(coprocessor.CartCoProc)
|
||||
|
||||
if _, ok := cart.mapper.(*ejected); !ok {
|
||||
logger.Logf("cartridge", "inserted %s", cart.mapper.ID())
|
||||
|
@ -485,7 +486,7 @@ func (cart *Cartridge) GetCartHotspotsBus() mapper.CartHotspotsBus {
|
|||
|
||||
// GetCoProc returns interface to the coprocessor interface or nil if no
|
||||
// coprocessor is available on the cartridge.
|
||||
func (cart *Cartridge) GetCoProc() mapper.CartCoProc {
|
||||
func (cart *Cartridge) GetCoProc() coprocessor.CartCoProc {
|
||||
if cart.hasCoProc {
|
||||
return cart.coproc
|
||||
}
|
||||
|
@ -519,29 +520,29 @@ func (cart *Cartridge) ROMDump() (string, error) {
|
|||
return "", fmt.Errorf("cartridge: %s does not support ROM dumping", cart.mapper.ID())
|
||||
}
|
||||
|
||||
// BreakpointsEnable implements the mapper.CartCoProc interface.
|
||||
// BreakpointsEnable implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Cartridge) BreakpointsEnable(enable bool) {
|
||||
if cart.hasCoProc {
|
||||
cart.coproc.BreakpointsEnable(enable)
|
||||
}
|
||||
}
|
||||
|
||||
// SetYieldHook implements the mapper.CartCoProc interface.
|
||||
func (cart *Cartridge) SetYieldHook(hook mapper.CartYieldHook) {
|
||||
// SetYieldHook implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Cartridge) SetYieldHook(hook coprocessor.CartYieldHook) {
|
||||
if cart.hasCoProc {
|
||||
cart.coproc.SetYieldHook(hook)
|
||||
}
|
||||
}
|
||||
|
||||
// CoProcExecutionState implements the mapper.CartCoProc interface
|
||||
// CoProcExecutionState implements the coprocessor.CartCoProc interface
|
||||
//
|
||||
// If cartridge does not have a coprocessor then an empty instance of
|
||||
// mapper.CoProcExecutionState is returned
|
||||
func (cart *Cartridge) CoProcExecutionState() mapper.CoProcExecutionState {
|
||||
func (cart *Cartridge) CoProcExecutionState() coprocessor.CoProcExecutionState {
|
||||
if cart.hasCoProc {
|
||||
return cart.coproc.CoProcExecutionState()
|
||||
}
|
||||
return mapper.CoProcExecutionState{}
|
||||
return coprocessor.CoProcExecutionState{}
|
||||
}
|
||||
|
||||
// BusStuff implements the mapper.CartBusStuff interface.
|
||||
|
|
|
@ -18,6 +18,7 @@ package cdf
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/environment"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -27,14 +28,14 @@ import (
|
|||
// cdf implements the mapper.CartMapper interface.
|
||||
type cdf struct {
|
||||
env *environment.Environment
|
||||
dev mapper.CartCoProcDeveloper
|
||||
dev coprocessor.CartCoProcDeveloper
|
||||
mappingID string
|
||||
|
||||
// additional CPU - used by some ROMs
|
||||
arm *arm.ARM
|
||||
|
||||
// the hook that handles cartridge yields
|
||||
yieldHook mapper.CartYieldHook
|
||||
yieldHook coprocessor.CartYieldHook
|
||||
|
||||
// cdf comes in several different versions
|
||||
version version
|
||||
|
@ -76,7 +77,7 @@ func NewCDF(env *environment.Environment, version string, data []byte) (mapper.C
|
|||
mappingID: "CDF",
|
||||
bankSize: 4096,
|
||||
state: newCDFstate(),
|
||||
yieldHook: mapper.StubCartYieldHook{},
|
||||
yieldHook: coprocessor.StubCartYieldHook{},
|
||||
}
|
||||
|
||||
var err error
|
||||
|
@ -124,18 +125,18 @@ func (cart *cdf) MappedBanks() string {
|
|||
return fmt.Sprintf("Bank: %d", cart.state.bank)
|
||||
}
|
||||
|
||||
// CoProcID implements the mapper.CartCoProc interface.
|
||||
// CoProcID implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcID() string {
|
||||
return cart.arm.CoProcID()
|
||||
}
|
||||
|
||||
// SetDisassembler implements the mapper.CartCoProc interface.
|
||||
func (cart *cdf) SetDisassembler(disasm mapper.CartCoProcDisassembler) {
|
||||
// SetDisassembler implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) SetDisassembler(disasm coprocessor.CartCoProcDisassembler) {
|
||||
cart.arm.SetDisassembler(disasm)
|
||||
}
|
||||
|
||||
// SetDeveloper implements the mapper.CartCoProc interface.
|
||||
func (cart *cdf) SetDeveloper(dev mapper.CartCoProcDeveloper) {
|
||||
// SetDeveloper implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) SetDeveloper(dev coprocessor.CartCoProcDeveloper) {
|
||||
cart.dev = dev
|
||||
cart.arm.SetDeveloper(dev)
|
||||
}
|
||||
|
@ -162,7 +163,7 @@ func (cart *cdf) Plumb(env *environment.Environment) {
|
|||
func (cart *cdf) PlumbFromDifferentEmulation(env *environment.Environment) {
|
||||
cart.env = env
|
||||
cart.arm = arm.NewARM(cart.version.mmap, cart.env.Prefs.ARM, cart.state.static, cart)
|
||||
cart.yieldHook = &mapper.StubCartYieldHook{}
|
||||
cart.yieldHook = &coprocessor.StubCartYieldHook{}
|
||||
}
|
||||
|
||||
// Reset implements the mapper.CartMapper interface.
|
||||
|
@ -379,8 +380,8 @@ func (cart *cdf) AccessVolatile(addr uint16, data uint8, poke bool) error {
|
|||
|
||||
// keep calling runArm() for as long as program has not ended
|
||||
runArm()
|
||||
for cart.state.yield.Type != mapper.YieldProgramEnded {
|
||||
if cart.yieldHook.CartYield(cart.state.yield.Type) == mapper.YieldHookEnd {
|
||||
for cart.state.yield.Type != coprocessor.YieldProgramEnded {
|
||||
if cart.yieldHook.CartYield(cart.state.yield.Type) == coprocessor.YieldHookEnd {
|
||||
break
|
||||
}
|
||||
runArm()
|
||||
|
@ -660,51 +661,51 @@ func (cart *cdf) HotLoad(data []byte) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// CoProcExecutionState implements the mapper.CartCoProc interface.
|
||||
func (cart *cdf) CoProcExecutionState() mapper.CoProcExecutionState {
|
||||
// CoProcExecutionState implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcExecutionState() coprocessor.CoProcExecutionState {
|
||||
if cart.state.callfn.IsActive() {
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcNOPFeed,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcNOPFeed,
|
||||
Yield: cart.state.yield,
|
||||
}
|
||||
}
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcIdle,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcIdle,
|
||||
Yield: cart.state.yield,
|
||||
}
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcRegister(n int) (uint32, bool) {
|
||||
return cart.arm.Register(n)
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcRegisterSet(n int, value uint32) bool {
|
||||
return cart.arm.SetRegister(n, value)
|
||||
}
|
||||
|
||||
// CoProcStackFrame implements the mapper.CartCoProc interface.
|
||||
// CoProcStackFrame implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcStackFrame() uint32 {
|
||||
return cart.arm.StackFrame()
|
||||
}
|
||||
|
||||
// CoProcPeek implements the mapper.CartCoProc interface.
|
||||
// CoProcPeek implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) CoProcPeek(addr uint32) (uint32, bool) {
|
||||
return cart.state.static.Read32bit(addr)
|
||||
}
|
||||
|
||||
// BreakpointsEnable implements the mapper.CartCoProc interface.
|
||||
// BreakpointsEnable implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) BreakpointsEnable(enable bool) {
|
||||
cart.arm.BreakpointsEnable(enable)
|
||||
}
|
||||
|
||||
// SetYieldHook implements the mapper.CartCoProc interface.
|
||||
func (cart *cdf) SetYieldHook(hook mapper.CartYieldHook) {
|
||||
// SetYieldHook implements the coprocessor.CartCoProc interface.
|
||||
func (cart *cdf) SetYieldHook(hook coprocessor.CartYieldHook) {
|
||||
cart.yieldHook = hook
|
||||
}
|
||||
|
||||
func (cart *cdf) runArm() mapper.CoProcYield {
|
||||
func (cart *cdf) runArm() coprocessor.CoProcYield {
|
||||
yld, cycles := cart.arm.Run()
|
||||
|
||||
cart.state.callfn.Accumulate(cycles)
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
package cdf
|
||||
|
||||
import (
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/callfn"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
)
|
||||
|
||||
type State struct {
|
||||
|
@ -47,7 +47,7 @@ type State struct {
|
|||
callfn callfn.CallFn
|
||||
|
||||
// most recent yield from the coprocessor
|
||||
yield mapper.CoProcYield
|
||||
yield coprocessor.CoProcYield
|
||||
}
|
||||
|
||||
// initialise should be called as soon as convenient.
|
||||
|
|
|
@ -18,6 +18,7 @@ package dpcplus
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/environment"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -32,14 +33,14 @@ import (
|
|||
// https://atariage.com/forums/blogs/entry/11811-dpcarm-part-6-dpc-cartridge-layout/
|
||||
type dpcPlus struct {
|
||||
env *environment.Environment
|
||||
dev mapper.CartCoProcDeveloper
|
||||
dev coprocessor.CartCoProcDeveloper
|
||||
mappingID string
|
||||
|
||||
// additional CPU - used by some ROMs
|
||||
arm *arm.ARM
|
||||
|
||||
// the hook that handles cartridge yields
|
||||
yieldHook mapper.CartYieldHook
|
||||
yieldHook coprocessor.CartYieldHook
|
||||
|
||||
// there is only one version of DPC+ currently but this method of
|
||||
// specifying addresses mirrors how we do it in the CDF type
|
||||
|
@ -68,7 +69,7 @@ func NewDPCplus(env *environment.Environment, data []byte) (mapper.CartMapper, e
|
|||
mappingID: "DPC+",
|
||||
bankSize: 4096,
|
||||
state: newDPCPlusState(),
|
||||
yieldHook: mapper.StubCartYieldHook{},
|
||||
yieldHook: coprocessor.StubCartYieldHook{},
|
||||
}
|
||||
|
||||
var err error
|
||||
|
@ -115,18 +116,18 @@ func (cart *dpcPlus) MappedBanks() string {
|
|||
return fmt.Sprintf("Bank: %d", cart.state.bank)
|
||||
}
|
||||
|
||||
// CoProcID implements the mapper.CartCoProc interface.
|
||||
// CoProcID implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcID() string {
|
||||
return cart.arm.CoProcID()
|
||||
}
|
||||
|
||||
// SetDisassembler implements the mapper.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetDisassembler(disasm mapper.CartCoProcDisassembler) {
|
||||
// SetDisassembler implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetDisassembler(disasm coprocessor.CartCoProcDisassembler) {
|
||||
cart.arm.SetDisassembler(disasm)
|
||||
}
|
||||
|
||||
// SetDeveloper implements the mapper.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetDeveloper(dev mapper.CartCoProcDeveloper) {
|
||||
// SetDeveloper implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetDeveloper(dev coprocessor.CartCoProcDeveloper) {
|
||||
cart.dev = dev
|
||||
cart.arm.SetDeveloper(dev)
|
||||
}
|
||||
|
@ -153,7 +154,7 @@ func (cart *dpcPlus) Plumb(env *environment.Environment) {
|
|||
func (cart *dpcPlus) PlumbFromDifferentEmulation(env *environment.Environment) {
|
||||
cart.env = env
|
||||
cart.arm = arm.NewARM(cart.version.mmap, cart.env.Prefs.ARM, cart.state.static, cart)
|
||||
cart.yieldHook = &mapper.StubCartYieldHook{}
|
||||
cart.yieldHook = &coprocessor.StubCartYieldHook{}
|
||||
}
|
||||
|
||||
// Reset implements the mapper.CartMapper interface.
|
||||
|
@ -514,8 +515,8 @@ func (cart *dpcPlus) AccessVolatile(addr uint16, data uint8, poke bool) error {
|
|||
|
||||
// keep calling runArm() for as long as program has not ended
|
||||
runArm()
|
||||
for cart.state.yield.Type != mapper.YieldProgramEnded {
|
||||
if cart.yieldHook.CartYield(cart.state.yield.Type) == mapper.YieldHookEnd {
|
||||
for cart.state.yield.Type != coprocessor.YieldProgramEnded {
|
||||
if cart.yieldHook.CartYield(cart.state.yield.Type) == coprocessor.YieldHookEnd {
|
||||
break
|
||||
}
|
||||
runArm()
|
||||
|
@ -920,51 +921,51 @@ func (cart *dpcPlus) ARMinterrupt(addr uint32, val1 uint32, val2 uint32) (arm.AR
|
|||
return arm.ARMinterruptReturn{}, nil
|
||||
}
|
||||
|
||||
// CoProcExecutionState implements the mapper.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcExecutionState() mapper.CoProcExecutionState {
|
||||
// CoProcExecutionState implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcExecutionState() coprocessor.CoProcExecutionState {
|
||||
if cart.state.callfn.IsActive() {
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcNOPFeed,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcNOPFeed,
|
||||
Yield: cart.state.yield,
|
||||
}
|
||||
}
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcIdle,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcIdle,
|
||||
Yield: cart.state.yield,
|
||||
}
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcRegister(n int) (uint32, bool) {
|
||||
return cart.arm.Register(n)
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcRegisterSet(n int, value uint32) bool {
|
||||
return cart.arm.SetRegister(n, value)
|
||||
}
|
||||
|
||||
// CoProcStackFrame implements the mapper.CartCoProc interface.
|
||||
// CoProcStackFrame implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcStackFrame() uint32 {
|
||||
return cart.arm.StackFrame()
|
||||
}
|
||||
|
||||
// CoProcRead32bit implements the mapper.CartCoProc interface.
|
||||
// CoProcRead32bit implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) CoProcPeek(addr uint32) (uint32, bool) {
|
||||
return cart.state.static.Read32bit(addr)
|
||||
}
|
||||
|
||||
// BreakpointsEnable implements the mapper.CartCoProc interface.
|
||||
// BreakpointsEnable implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) BreakpointsEnable(enable bool) {
|
||||
cart.arm.BreakpointsEnable(enable)
|
||||
}
|
||||
|
||||
// SetYieldHook implements the mapper.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetYieldHook(hook mapper.CartYieldHook) {
|
||||
// SetYieldHook implements the coprocessor.CartCoProc interface.
|
||||
func (cart *dpcPlus) SetYieldHook(hook coprocessor.CartYieldHook) {
|
||||
cart.yieldHook = hook
|
||||
}
|
||||
|
||||
func (cart *dpcPlus) runArm() mapper.CoProcYield {
|
||||
func (cart *dpcPlus) runArm() coprocessor.CoProcYield {
|
||||
yld, cycles := cart.arm.Run()
|
||||
cart.state.callfn.Accumulate(cycles)
|
||||
return yld
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
package dpcplus
|
||||
|
||||
import (
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/callfn"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/random"
|
||||
)
|
||||
|
||||
|
@ -45,7 +45,7 @@ type State struct {
|
|||
callfn callfn.CallFn
|
||||
|
||||
// most recent yield from the coprocessor
|
||||
yield mapper.CoProcYield
|
||||
yield coprocessor.CoProcYield
|
||||
}
|
||||
|
||||
func newDPCPlusState() *State {
|
||||
|
|
|
@ -22,6 +22,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/environment"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -32,7 +33,7 @@ import (
|
|||
// Elf implements the mapper.CartMapper interface.
|
||||
type Elf struct {
|
||||
env *environment.Environment
|
||||
dev mapper.CartCoProcDeveloper
|
||||
dev coprocessor.CartCoProcDeveloper
|
||||
|
||||
version string
|
||||
pathToROM string
|
||||
|
@ -41,7 +42,7 @@ type Elf struct {
|
|||
mem *elfMemory
|
||||
|
||||
// the hook that handles cartridge yields
|
||||
yieldHook mapper.CartYieldHook
|
||||
yieldHook coprocessor.CartYieldHook
|
||||
|
||||
// armState is a copy of the ARM's state at the moment of the most recent
|
||||
// Snapshot. it's used only suring a Plumb() operation
|
||||
|
@ -133,7 +134,7 @@ func NewElf(env *environment.Environment, pathToROM string, inACE bool) (mapper.
|
|||
cart := &Elf{
|
||||
env: env,
|
||||
pathToROM: pathToROM,
|
||||
yieldHook: mapper.StubCartYieldHook{},
|
||||
yieldHook: coprocessor.StubCartYieldHook{},
|
||||
}
|
||||
|
||||
cart.mem = newElfMemory()
|
||||
|
@ -190,7 +191,7 @@ func (cart *Elf) PlumbFromDifferentEmulation(env *environment.Environment) {
|
|||
cart.mem.Plumb(cart.arm)
|
||||
cart.arm.Plumb(cart.armState, cart.mem, cart)
|
||||
cart.armState = nil
|
||||
cart.yieldHook = &mapper.StubCartYieldHook{}
|
||||
cart.yieldHook = &coprocessor.StubCartYieldHook{}
|
||||
}
|
||||
|
||||
// Plumb implements the mapper.CartMapper interface.
|
||||
|
@ -258,12 +259,12 @@ func (cart *Elf) runARM() bool {
|
|||
cart.mem.yield, _ = cart.arm.Run()
|
||||
|
||||
// keep calling runArm() for as long as program does not need to sync with the VCS...
|
||||
for cart.mem.yield.Type != mapper.YieldSyncWithVCS {
|
||||
for cart.mem.yield.Type != coprocessor.YieldSyncWithVCS {
|
||||
// ... or if the yield hook says to return to the VCS immediately
|
||||
switch cart.yieldHook.CartYield(cart.mem.yield.Type) {
|
||||
case mapper.YieldHookEnd:
|
||||
case coprocessor.YieldHookEnd:
|
||||
return false
|
||||
case mapper.YieldHookContinue:
|
||||
case coprocessor.YieldHookContinue:
|
||||
cart.mem.yield, _ = cart.arm.Run()
|
||||
}
|
||||
cart.mem.yield, _ = cart.arm.Run()
|
||||
|
@ -381,23 +382,23 @@ func (cart *Elf) BusStuff() (uint8, bool) {
|
|||
return cart.mem.busStuffData, cart.mem.busStuff
|
||||
}
|
||||
|
||||
// CoProcID implements the mapper.CartCoProc interface.
|
||||
// CoProcID implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcID() string {
|
||||
return cart.arm.CoProcID()
|
||||
}
|
||||
|
||||
// SetDisassembler implements the mapper.CartCoProc interface.
|
||||
func (cart *Elf) SetDisassembler(disasm mapper.CartCoProcDisassembler) {
|
||||
// SetDisassembler implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) SetDisassembler(disasm coprocessor.CartCoProcDisassembler) {
|
||||
cart.arm.SetDisassembler(disasm)
|
||||
}
|
||||
|
||||
// SetDeveloper implements the mapper.CartCoProc interface.
|
||||
func (cart *Elf) SetDeveloper(dev mapper.CartCoProcDeveloper) {
|
||||
// SetDeveloper implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) SetDeveloper(dev coprocessor.CartCoProcDeveloper) {
|
||||
cart.dev = dev
|
||||
cart.arm.SetDeveloper(dev)
|
||||
}
|
||||
|
||||
// ELFSection implements the mapper.CartCoProcELF interface.
|
||||
// ELFSection implements the coprocessor.CartCoProcELF interface.
|
||||
func (cart *Elf) ELFSection(name string) ([]uint8, uint32, bool) {
|
||||
if idx, ok := cart.mem.sectionsByName[name]; ok {
|
||||
s := cart.mem.sections[idx]
|
||||
|
@ -406,47 +407,47 @@ func (cart *Elf) ELFSection(name string) ([]uint8, uint32, bool) {
|
|||
return nil, 0, false
|
||||
}
|
||||
|
||||
// CoProcExecutionState implements the mapper.CartCoProc interface.
|
||||
func (cart *Elf) CoProcExecutionState() mapper.CoProcExecutionState {
|
||||
// CoProcExecutionState implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcExecutionState() coprocessor.CoProcExecutionState {
|
||||
if cart.mem.parallelARM {
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcParallel,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcParallel,
|
||||
Yield: cart.mem.yield,
|
||||
}
|
||||
}
|
||||
return mapper.CoProcExecutionState{
|
||||
Sync: mapper.CoProcStrongARMFeed,
|
||||
return coprocessor.CoProcExecutionState{
|
||||
Sync: coprocessor.CoProcStrongARMFeed,
|
||||
Yield: cart.mem.yield,
|
||||
}
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcRegister(n int) (uint32, bool) {
|
||||
return cart.arm.Register(n)
|
||||
}
|
||||
|
||||
// CoProcRegister implements the mapper.CartCoProc interface.
|
||||
// CoProcRegister implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcRegisterSet(n int, value uint32) bool {
|
||||
return cart.arm.SetRegister(n, value)
|
||||
}
|
||||
|
||||
// CoProcStackFrame implements the mapper.CartCoProc interface.
|
||||
// CoProcStackFrame implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcStackFrame() uint32 {
|
||||
return cart.arm.StackFrame()
|
||||
}
|
||||
|
||||
// CoProcPeek implements the mapper.CartCoProc interface.
|
||||
// CoProcPeek implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) CoProcPeek(addr uint32) (uint32, bool) {
|
||||
return cart.mem.Read32bit(addr)
|
||||
}
|
||||
|
||||
// BreakpointsEnable implements the mapper.CartCoProc interface.
|
||||
// BreakpointsEnable implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) BreakpointsEnable(enable bool) {
|
||||
cart.arm.BreakpointsEnable(enable)
|
||||
}
|
||||
|
||||
// SetYieldHook implements the mapper.CartCoProc interface.
|
||||
func (cart *Elf) SetYieldHook(hook mapper.CartYieldHook) {
|
||||
// SetYieldHook implements the coprocessor.CartCoProc interface.
|
||||
func (cart *Elf) SetYieldHook(hook coprocessor.CartYieldHook) {
|
||||
cart.yieldHook = hook
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/arm/architecture"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -141,7 +142,7 @@ type elfMemory struct {
|
|||
parallelARM bool
|
||||
|
||||
// most recent yield from the coprocessor
|
||||
yield mapper.CoProcYield
|
||||
yield coprocessor.CoProcYield
|
||||
}
|
||||
|
||||
func newElfMemory() *elfMemory {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
package reflection
|
||||
|
||||
import (
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/hardware/cpu/execution"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/signal"
|
||||
|
@ -59,7 +60,7 @@ type ReflectedVideoStep struct {
|
|||
VideoElement video.Element
|
||||
WSYNC bool
|
||||
IsRAM bool
|
||||
CoProcSync mapper.CoProcSynchronisation
|
||||
CoProcSync coprocessor.CoProcSynchronisation
|
||||
IsHblank bool
|
||||
RSYNCalign bool
|
||||
RSYNCreset bool
|
||||
|
|
|
@ -23,6 +23,7 @@ import (
|
|||
"sync/atomic"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/cartridgeloader"
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/hardware"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
|
@ -214,10 +215,10 @@ func (thmb *Anim) Create(cartload cartridgeloader.Loader, numFrames int) {
|
|||
}()
|
||||
}
|
||||
|
||||
// CartYield implements the mapper.CartYieldHook interface.
|
||||
func (thmb *Anim) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookResponse {
|
||||
// CartYield implements the coprocessor.CartYieldHook interface.
|
||||
func (thmb *Anim) CartYield(yield coprocessor.CoProcYieldType) coprocessor.YieldHookResponse {
|
||||
if yield.Normal() {
|
||||
return mapper.YieldHookContinue
|
||||
return coprocessor.YieldHookContinue
|
||||
}
|
||||
|
||||
// an unexpected yield type so end the thumbnail emulation
|
||||
|
@ -227,7 +228,7 @@ func (thmb *Anim) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookRespon
|
|||
}
|
||||
|
||||
// indicate that the mapper should return immediately
|
||||
return mapper.YieldHookEnd
|
||||
return coprocessor.YieldHookEnd
|
||||
}
|
||||
|
||||
// Resize implements the television.PixelRenderer interface
|
||||
|
|
|
@ -22,9 +22,9 @@ import (
|
|||
"strings"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/jetsetilly/gopher2600/coprocessor"
|
||||
"github.com/jetsetilly/gopher2600/debugger/govern"
|
||||
"github.com/jetsetilly/gopher2600/hardware"
|
||||
"github.com/jetsetilly/gopher2600/hardware/memory/cartridge/mapper"
|
||||
"github.com/jetsetilly/gopher2600/hardware/preferences"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television"
|
||||
"github.com/jetsetilly/gopher2600/hardware/television/signal"
|
||||
|
@ -161,10 +161,10 @@ func (thmb *Image) Create(state *rewind.State) {
|
|||
}
|
||||
}
|
||||
|
||||
// CartYield implements the mapper.CartYieldHook interface.
|
||||
func (thmb *Image) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookResponse {
|
||||
// CartYield implements the coprocessor.CartYieldHook interface.
|
||||
func (thmb *Image) CartYield(yield coprocessor.CoProcYieldType) coprocessor.YieldHookResponse {
|
||||
if yield.Normal() {
|
||||
return mapper.YieldHookContinue
|
||||
return coprocessor.YieldHookContinue
|
||||
}
|
||||
|
||||
// an unexpected yield type so end the thumbnail emulation
|
||||
|
@ -174,7 +174,7 @@ func (thmb *Image) CartYield(yield mapper.CoProcYieldType) mapper.YieldHookRespo
|
|||
}
|
||||
|
||||
// indicate that the mapper should return immediately
|
||||
return mapper.YieldHookEnd
|
||||
return coprocessor.YieldHookEnd
|
||||
}
|
||||
|
||||
// Resize implements the television.PixelRenderer interface
|
||||
|
|
Loading…
Reference in a new issue