[zxspectrum] Re: ZXMMC+

  • From: "Alessandro" <alessandro.poppi@xxxxxxxxx>
  • To: <zxspectrum@xxxxxxxxxxxxx>
  • Date: Thu, 4 Jun 2009 21:12:43 +0200

On Thursday, June 04, 2009 5:24 PM [GMT+1],
Luca Bisti <lucbisti@xxxxxx> wrote:

Per quanto riguarda la programmazione, mi piacerebbe cercare di
modificare qualche ROM tipo quella della DISCiPLE per vedere di farne
una versione operante su ZXMMC, similmente a quanto hanno fatto con i
firmware della DivIDE (+DivIDE). Mi rendo conto che probabilmente ci
saranno problemi con i trap degli indirizzi e mi pare di capire che la
Xilinx sia già bella farcita di suo per farci stare altra logica. Il
TRDOS poi sarebbe un vero colpaccio ma temo che sia ancora piu' fuori
portata.

E' vero, la cpld della zxmmc+ e' quasi completamente utilizzata. L'aggiunta della logica per il network IF1 (in cui occorre asserire il WAIT per sincronizzare perfettamente la comunicazione, ovvero si ottiene una precisione che va oltre la durata di una istruzione) ha dato il colpo di grazia.

C'e' pero' da dire che tu hai i poteri per sorvolare il trap. :-)

Mi spiego meglio: il trap e' uno stratagemma, una 'pezza' che serve quando c'e' di mezzo una rom interna difficilmente modificabile.

Qui tu avresti a disposizione 512K di flash, attivabile in 32 banchi da 16K ciascuno nell'area 0 - $3FFF, con cui eseguire i salti fra banchi in software scrivendo nel registro di paging ($7F). Puoi mettere una rom 'standard' in un banco, con le opportune modifiche per saltare dove vuoi.

Accessibili allo stesso modo ci sono 512K di ram, puoi anche scrivere del codice automodificante dopo averlo copiato dalla rom :-)

La cpld e' in grado di catturare un OUT $7FFD e settare il bit meno significativo del numero di banco in base al valore di D4, cosa che consente il perfetto funzionamento di una coppia di ROM 0/1 dello spectrum 128K.

Allego uno stralcio di documentazione inerente al registro di paging, preso dal sito della zxmmc+

---------
The PAGING Control Register:

This RD/WR register, built into the CPLD, works exactly as on the ZX-Badaloc clone. The I/O address on ZXMMC+ is $7F and it's bit layout is as follows:

D7         RAM WR Enable
D6         PAGE-IN Enable
D5         RAM/ROM Select
D4:D0    Page number (0 - 31)

D7: This is a stand-alone bit. When SET, the RAM Chip is WRITE ENABLED, no matter what is enabled on READ. For example, a simple BASIC program may copy the Sinclair ROM to one RAM bank by just setting this bit then performing a FOR/NEXT loop which POKEs back what is read by PEEK on the 0 - 16383 address space. The PEEK will read the Sinclair ROM, while the POKE will write in RAM. When the loop completes, the RAM can be enabled in READ mode in place of the internal ROM. Being a separate bit, D7 allows write-only operation as well as write protection, turning the nonvolatile RAM into some kind of fast ROM. This is the key feature used by ResiDOS to work. NOTE: Sinclair basic uses to alter a few locations of the "ROM", if the zxmmc+ ram is left write-enabled. If the above basic example is tried, it is advisable to write-protect the ram bank prior to returning to the basic "prompt" (i.e. by including the OUT instruction in the command, after a colon).

D6: When SET, this bit activates the PAGE IN on READ cycles. The internal ROM is disabled and one bank from RAM or ROM is accessed instead.

D5: When LOW, the RAM chip is selected for PAGE IN function. When HIGH, the ROM (FLASH) is selected.

D4:D0 These 5 bits are used to select one of 32 banks, 16KB each, from RAM or ROM (depending on D5). Their state directly affects the logic level on the 5 upper address lines of bot the RAM and FLASH chips, who are provided by the CPLD.

The power-on status of D5 and D6 is user-selectable by means of dip switch n. 3 and 4 respectively. When PAGING is OFF, the internal ROM will show up when the system is powered or reset. If RAM paging is enabled and ResiDOS was previously installed into nonvolatile ram, then ResiDOS will start on power-on. If ROM paging is enabled, then ROM BANK 0 will be selected at power-on.

128K Compatibility:

The CPLD detects the OUT $7FFD instruction and captures data bit D4 to the lower address line of the bank page. This means that a complete 128K Spectrum ROM SET can be programmed and will work in flashrom, enabling the creation of NMI-patched rom for snapshot purposes. This feature is disabled when zxmmc+ RAM is paged-in, to avoid problems when running ResiDOS or bootrom firmware.
------------

Ciao!
Alessandro


Other related posts: