Delicon, on Wed Mar 16, 2005 9:00 PM, said:
In order to program the flash, a microcontroller needs access to the full ACART.
If one starts with a flash that contains a boot loader, does one even need a separate microcontroller? I would think the Atari should be able to program itself (a routine to program a 64-byte block of flash would be copied into RIOT RAM and run from there). One wouldn't have niceties like a hardware UART and would thus likely be limitted to 19200-N-8-
2 or maybe 38400-N-8-2, but that shouldn't be a problem.
Right now I'm working on sketching out an as-cheap-as-possible design for a RAM+flash cart intended to be a platform for SALEABLE games by homebrew developers. The goal is to use one RAM, one flash, a 22V10, some resistors, and some caps. In the cheapest configuration I could envision, the cart would support 32K flash and 1.75K of RAM and would have two jumpers. With both jumpers installed, the cart could be programmed by a bootloader; with them removed, the cart would be write-protected. There would be one bank-switching method available which does not AFAIK match any other known method (though if someone could direct me to something close that might be useful).
Adding a few more jumpers would allow the use of larger RAM, though with some loss of ability to control RAM and flash addresses separately. I don't know what different programmers would want to do, so leaving such options open might be desirable.
Flash would be divided into eight 4K blocks. Removing a jumper would force A14 high, mirroring the bottom four into the top four and allowing more easily the use of more RAM with 16K or smaller programs.
In minimal configuration, RAM would be divided into eight 256-byte page, accessed at $1000-$11FF in Superchip fashion. Depending upon the status of a jumper, selecting RAM page 0 would disable the RAM and make the flash available there.
For applications requiring more RAM, jumpers would allow upper-order address banking bits from the flash to be directed to the RAM chip, allowing up to a total of 16K RAM, but with restrictions on access.
If the bootloader jumper was installed, selecting a RAM bank 4-7 would cause all accesses in the $1000-$1FFF range to be interpreted as flash writes. The bootloader would have to copy a small routine into ZP RAM, switch RAM banks (turning on write mode), do any necessary writes, switch RAM banks back, and return to running from flash.
Bank switching would be keyed on reads or writes to selected addresses in the range $0400-$0F7F. Note that Stella and/or RIOT would be mirrored here, but the addresses could be chosen that would have no effect. Note that address bits 2-7 would not be decoded but are assumed below to be '0'.
Address %0 010a **** **bc - Select RAM page abc
Address %0 1abc **** **de -- Sets flash block bits XYZ thus:
X=dX+a; Y=dY+b; Z=eY+c.
Note that it's possible to manipulate either the first two or the last bit of the flash block address without affecting the rest. This should allow for easy sharing of the register between RAM and flash addressing.
Anyone know of any bank-switching methods that are remotely similar (that would already be supported in emulators, CC, KC, etc.)?