My STM Neolithic works (will/should work, if I ever get around to smearing solder paste through the stencil and finishing the software) by faking instructions to the processor so that a series of lda #xx, sta $yyyy instructions are used to copy code - nominally the boot code but it can work to any memory location - by overriding the address and data bus using an external STM32 arm chip to control the clock and reset. Once running, the intent is to use the STM as a UART communicating by SPI with the 6502 and offloading the management of the serial data to the STM.
My Romless Neo requires that the code be transferred from a host computer after every start. Minor issues include not having indicators or a way of resetting without reloading (solvable in hardware) and the slow load, about 1k/second, constrained by the serial parts. That said, I'm really happy with it.
But I'm wondering about a more complex system, which uses am STM not only as the initial boot loader and comms but also, e.g. a keyboard controller (possibly USB) and definitely a translator for a DOS-formatted (FAT32) microSD card. The STM communicates by reading/writing a small defined area of shared memory, and effectively operates as a DMA controller.
A quarter SVGA display, mono, individual pixels in the 6502's memory space: 400x300 pixels gives a handy 48x25 characters (strictly 50 across but it's convenient to use 48) using a 7x10 font in an 8 by 12 cell. That would require 14,400 (0x3840) bytes for the screen memory and 1280 (0x500) bytes for a 128-deep font table. This would need a 20MHz dot clock; a simple approach would just divide by 8 for a 2.5MHz system clock though a faster system could arrange things at twice that speed or even, with care, a 20MHz system though I'm not chasing speed here... I need to draw some timing diagrams.
But that display could fit along with a space for the reset vector and around 256 bytes of I/O space and a further 256 bytes of DMA space in the top quarter of the 6502 memory space:
Code:
0xfffa-0xffff - vectors
0xff00-0xfff9 - I/O, probably one to three 65c22
0xfe00-0xfeff - DMA transient area
0xfd40-0xfdff - control data buffer
0xf840-0xfd40 - font table
0xc000-0xf83f - video ram, first row at 0xc000, next 0xc030 etc
0x0000-0xbfff - program ram - video ram is on same chip(s)
So far so good. But here's the sneaky bit... since the 65c02 can be stopped on either clock phase as a fully static part, and the clock and other controls are under the control of the STM, and the STM also drives the address and data lines if the 6502 isn't do so, then the STM can stop the clock, read or write from the DMA and/or control data buffer, and turn the clock on again, and to the 6502 it's all just travelled in time. For a longer process, like an SD card read, you'd probably want to trigger the read and then carry on doing stuff until you get an interrupt to say it's happened. Some sort of interrupt to the STM, probably.
I think the only tricky bit is to ensure that the video clock - which will of course be reading video ram on the off-phase - carries on as normal during all the shenanigans. And I don't think it's too tricky...
Doing things this way means that I can make something working vaguely along the lines of CP/M; loading programs as and when required from an external microSD without having to fill several k with the handling code.
I feel it has possibilities...
Neil