2019-02-16 19:15:41 +00:00
|
|
|
package apple2
|
|
|
|
|
|
|
|
import "go6502/core6502"
|
|
|
|
|
|
|
|
// Run instantiates an apple2 and start emulation
|
|
|
|
func Run(romFile string, log bool) {
|
2019-02-23 23:41:32 +00:00
|
|
|
mmu := newAddressSpace(romFile)
|
2019-02-28 22:54:38 +00:00
|
|
|
s := core6502.NewNMOS6502(mmu)
|
2019-02-24 22:54:13 +00:00
|
|
|
fe := newAnsiConsoleFrontend(mmu)
|
2019-02-25 22:28:26 +00:00
|
|
|
mmu.ioPage.setKeyboardProvider(fe)
|
2019-02-28 22:54:38 +00:00
|
|
|
|
2019-02-25 22:28:26 +00:00
|
|
|
go fe.textModeGoRoutine()
|
2019-02-20 22:51:47 +00:00
|
|
|
|
2019-02-16 19:15:41 +00:00
|
|
|
// Start the processor
|
2019-02-28 22:54:38 +00:00
|
|
|
s.Reset()
|
2019-02-17 23:00:39 +00:00
|
|
|
for {
|
2019-02-28 22:54:38 +00:00
|
|
|
s.ExecuteInstruction(log)
|
2019-02-16 19:15:41 +00:00
|
|
|
}
|
|
|
|
}
|