Uploading sketches to standalone AVR through UNO board and supporting z80

I am trying to build a game console similar to the original Gameboy, but using a z80 as the CPU and a ATMEGA1284P as a memory/IO/graphics controller. On start up, I want the MEGA to copy game data from an SD card to the RAM. Then the z80 will take control of the RAM as the MEGA turns into a GPU and IO controller that sends interrupts to the z80 when a button is pressed. The question is, how should I wire the MEGA to the z80's IO lines, and can I upload a sketch to the MEGA if I wire it's UART lines to an UNO board? Do I need any special hardware?

Just found out I don't have enough pins for the MEGA to be an IO controller. I'll have two use two of them. :slightly_smiling_face:

This is pretty far outside the realm of what is considered "Arduino."
But for doing the bootloading you're essentially mimicking a front panel, and can probably set up the 1284's external memory interface directly in parallel with the Z80's memory signals, plus BUSRQ to the Z80 so that teh 1284 can take control. That leaves a fair number of pins still free. If you do all the data transfer via DMA-like cycles plus an interrupt it might be enough. Otherwise, I'm not even sure a 1284 is fast enough to be a peripheral for a Z80 class machine...