Changes

FlashGordon

1,197 bytes removed, 17:50, 29 April 2020
/* Writing to flash memory */
==The ROM managers==
* The most comprehensive utility for the management of the ROMs is the [[MegaFlashROManagerROManager]] for [[FutureOS]]. It also enables For the usage of the ROMs 16-31. * The card comes with a built in ROM manager too, which provides all needed features. To help you using the additional features of FlashGordon, we provide one background ROM in slot 15. The main job of this ROM is to initialize ROMs from 31 to 16 (in this order, to match what the firmware does) so you can use them as background ROMs as well. It also provides some RSXs to use the write mode. Let's have a look at these commands native OS there are [[Roman]] and the way to use them[[MegaFlashROManager]]All of these commands will erase memory from &1800 to &6000 and the screen. Make sure any important work is saved before calling them. :|BURN - replace a ROM slot. Use this command to put data in one of the available slots.:|BURN,A "filenamebooster",n . The file is loaded, then programmed into ROM slot n. It will be available at next boot.:|HIDE . Hide one or all included in both of the ROMs.:|HIDE,n Each ROM allocates some RAM for its own use. When there are a lot of them, this is likely to increase boot time. The ROMs also take some time to initialize so you have to wait for your CPC to power up. To avoid these problems, you can use enabling the HIDE command to make some initialization of ROMs unavailable to 16-31 which are not scanned by the firmware. Use the SHOW command to get them back. If you call HIDE with no parameters, all the ROMs are hidden and your CPC boots like if there was no expansion plugged in. Remember thatr ROM 15 is the ROM manager itself. If you disable it, you'll need to use the rescue disk to enable it again.:|SHOW Undo the effect of HIDE:|SHOW,n Make a hidden ROM visible again.
==The rescue disk==
The rescue disk is one of two ways out if you mess up something with the ROMs setup. (The other way would be to use [[Roman]] or [[MegaFlashROManager]]). The rescue disc contains the following files :
* ROMTEST.BIN will print the available ROM numbers. Use it for hardware testing.
* BURN.BAS will help you programming stuff to the FlashGordon when the ROM Manager doesn't work anymore.
* BURN.BIN assembler code used by BURN.BAS
* MANAGER.ROM the ROM manager ROM file so you can repair it.
The source code for the programs provided on the rescue disk and the ROM manager itself are available on the source repository.
==Creating your own ROMs==
The memory chip used is an SST 39SF040. This is a flash memory chip that is smarter than a simple ROM or RAM. You talk to it by sending commands to exectute execute (but reading works as usual).
Also, the MegaFlash will accept write operations both in the C000-FFFF and 8000-BFFF ranges because of an hardware limitation. So, avoid reading and writing to 8000-BFFF while trying to program a ROM. We're sorry for the inconvenience, but fixing that would require an extra chip on the board, a bigger board, and more complex wiring which we tried to avoid.
 
 
The newer batch of the FlashGordon does decode A14, which is an great advantage over the MegaFlash, because you can use the stack at the place where it's usually located.
*Connect ROM number 1 and write 0xAA to address 0xD555
*Connect ROM number 2 and write 0x55 to address 0xEAAA
*At this point, the flahs flash is waiting for a command to execute. The available commands are ERASE (0x80), IDENTIFY (0x90), BYTE PROGRAM (0xA0) and RESET (0xF0)
*To erase a sector, send the ERASE command by writing 0x80 to address 0xD555 in ROM 1. Now write once again 0xAA to address 0xD555 in ROM number 1 and 0x55 to address 0xEAAA in ROM number 2. Then, write 0x30 anywhere in the sector you want to erase. Erasing will take up to 20 milliseconds, so wait to make sure the flash is ready to accept another command.
*To write a byte, write 0xA0 (BYTE PROGRAM) to address 0xD555 in ROM 1. Then, connect the ROM you want to program and write one byte at the needed address. There is a delay of 20 NOPs after a write operation, that should be no problem as you can use them to prepare the write operation for the next byte (by the time you're ready to execute the next write to the ROM, it will be ready to listen).
*If you enter identify mode, you can read two bytes to learn about the manufacturer and model of the flash chip. This can be used to identify FlashGordon versus the MegaFlash (which will return different values), a Ramcard (too late, you already corrupted some data), or a plain old romboard (all your attemps attempts to write are vain and bound to fail).
*There is also a command for a complete chip erase if you want to clear everything.
*Provide documentation for your changes so other people can improve on them as well. I spent several hours reverse engineering the ramcard from PCB to schematics, I hope I won't have to do it again for another device.
[[Category:FutureOS]]
[[Category:Peripherals]]
[[Category:Expansion ROM]]
[[Category:DIY]]
[[Category:Memory_expansions]]
2,002
edits