Home - Features - Downloads - Schematics - I/O Registers - Memory Map - Leave a Message |
---|
ZX-Badaloc Reloaded
A Spartan-3E FPGA implementation of the ZX-Badaloc Spectrum clone Supported
I/O Registers List
ZX-Spectrum standard registers: $FE (254): Keyboard / Tape / Speaker / Border color Read: Write:
$1FFD (8189): ZX-Spectrum
128K +2A / +3 special mode register Special mode (D0 = '1'):
$7FFD (32765): ZX-Spectrum 128K Memory Control Read / Write:
ZX-Badaloc Custom Registers: $1F (31): Kempston Joystick and SD-Card chip select Read: Write:
$3F (63): SPI Interface Data Register Read: 8 bit from selected SPI device (see $1F register) $5F (95): NMI Enable on RS-232 reception, RS-232 Status Register Read: Write:
$7F (127): RS-232 (Female DB9 Connector) Data Registers Read: 8 bit RS-232 RX Register
$24DF (9439): Rom Bank / Z80 Clock Select Read / Write:
$34DF (13535): Various ZX-Badaloc control flags Read / Write: NOTE: The context switch is a special ZX-Badaloc feature which swaps-in a custom ROM when an NMI is being serviced (opcode fetch at address $66). This enables the RS-232 or sd-card snapshots and other special features.
$44DF
(17631): Register Lock Disable, FPGA BootLoader Swap Out and Address
$25 trap control Write: It also disables forever the VHDL-Coded Z80 bootloader rom from address space 0 - $3FFF and activates the standard memory (for operating mode). Starting
from V1.05, bit D0 has special meaning as it disables ('0') or enables
('1') the memory trap at address $25, the "rom services" vector (that
allows any program (even a basic program) to access bootrom functions).
This trap is now disabled by default to improve compatibility but can
be enabled at any time by writing $AB (D0 SET) to the $44DF register.
$54DF (21727): FASTPAGE control register Read / Write: NOTE:
As stated above, the FPGA version of the clone only rely on a
pseudo-static RAM chip. Hence, this register controls the access to a
1MB memory space which can be paged-in, combining the original
zx-badaloc 512K of RAM and 512K of ROM. In other words, the D5 bit is
just one more bank select address bit (so 64 banks = 1MB can be
accessed). The bootrom will copy rom images from the SPI flash onto the
'rom' banks (the upper half of the megabyte in the pseudo-static ram
chip). For compatibility reason, however, these consideration
might be taken into account: The other 512K space (the lower half of the megabyte) is used as RAM memory. The first 128K will be mapped as in the 128K spectrum and can be accessed using the RAM Bank bits in the standard $7FFD register, while the remainder is for general purpose and can only be accessed through fastpage register. ResiDOS by Garry Lancaster uses fastpaging to access the entire 512K RAM area and requires D5 to be low. If the user wants to alter a memory bank which will reflect to RAM through fastpaging, the D5 bit should be '0'.
$64DF (25823): RAM MSB address bank (was "HI-RES on the original zx-badaloc) Read / Write: This is an MSB extension of the FASTPAGE register.
When fastpaging is enabled, these additional 3 bits provide access to
8MB of RAM space. This is an MSB extension of the FASTPAGE register. When fastpaging is enabled, these additional 3 bits provide access to 8MB of RAM space.
$BF3B
(48955): ULA+ Register Port Write Only: $FF3B
(65339): ULA+ Data Port Read / Write when D7:D6 of the Register Port is "00", otherwise hidden. The color format for read/write is: D7:D5 Green intensity (8 levels) When D7:D6 of the Register Port is "01": D7:D1 Ignored The available ULA+ 64 colors are splitted into four 16-colors banks. To select the bank to be displayed on a certain 8x8 cell on the screen, two bits from the zx-spectrum's screen attribute byte are used: Flash and Brightness. When they are both '00', bank 0 is selected. When Flash is '0' and Bright is '1', bank 1 is selected, and so on. Then, the first eight colors in the selected bank are used for INK pixels and the remaining eight for PAPER pixels. Example: setting the INK color n. 2 (which is normally RED on zx-spectrum) in the first bank of ULA+ color table: OUT 48955, 2 this selects color n.
2 in the first color bank This color will be used for ink pixels when INK 2 is selected on a cell where Flash and Bright are both '0'. $FFFD
(65533): AY-3-8912 Sound Chip Address/Data register Write: Read:
$BFFD
(49149): AY-3-8912 Sound Chip Data register Write: Read:
Memory Mapped Registers: When D7:D4 in $1F register are equal to '1011' (Programmable Joystick Write Enable), 32 bytes of key-map data for the 16 joystick inputs can be written in memory at any 32 bytes boudary. Only A4:A0 are tested, so any memory write will also store data in the joystick registers. Hence, it is possible to write 'over' a ram array (to keep a copy of stored data) or write on a 'ROM' area, to avoid corrupting ram content. Each joystick input has a pair of data bytes: Byte 0 ZX-Spectrum keyboard eight
COLUMNS (on Z80 Address lines): D7:D0 = A15:A8. A bit SET means address
column PRESSED First pair of bytes stores keymap data for Joystick Input 1; second pair is for joy input 2 and so on. It is imperative to perform joystick programming with interrupts disabled and in pure assembly, to avoid any undesired write operation which would certainly corrupt joystick setting. |