Hi banedon,
If you consider to use a second GAL then I would suggest that you make some design changes.
I always have a global /WR and /RD signal that are qualified with PHI2 to create a global output and write enable signals thus I take advantage of the fact the output enable access time of memory is faster than the chip enable access time and the fact that write enable pulse is not required to be as long as the chip enable pulse.
Code:
RD = RW * PHI2
WR = /RW * PHI2
These signals then go to the /OE and /WE of the memory chips. And if you want they can be used to support chips which really require a /WR and /RD as the SC26C92 et.al.
Instead of having individual select signals for the 65xx peripheral chips I would create a special 65xx IO signal that is asserted with a special pattern for A4,A5,A6,A7 so you can take advantage of the two chip select available on the 6522 and 6551
Code:
IO65XX = A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * /A7 * /A6 * /A5 * A4 ; $801x VIA1
+ A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * /A7 * /A6 * A5 * /A4 ; $802x VIA2
+ A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * /A7 * A6 * /A5 * /A4 ; $804x VIA3
+ A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * A7 * /A6 * /A5 * /A4 ; $808x ACIA
this signal is connected to /CS2 of the VIA and the /CS1 of the ACIA
A4 is connected to the CS1 of VIA1
A5 is connected to the CS1 of VIA2
A6 is connected to the CS1 of VIA3
A7 is connected to the CS0 of ACIA
with this you save some pins on the GAL and at the same time the IO65XX makes sure that only one 65xx peripheral is active, regardless of accidental access outside the IO65xx range.
For the other peripherals, i.e. the two 74HCT259 you then can fill the gaps not used by the above ranges and another IO SEL for future expansions that covers the range from $80C0 to $80FF
Code:
LE1 = A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * /A7 * A6 * /A5 * /A4 * PHI2 ; $8050 1st 74HCT259
LE2 = A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * /A7 * A6 * A5 * /A4 * PHI2 ; $8060 2nd 74HCT259
IOSEL = A15 * /A14 * /A13 * /A12 * /A11 * /A10 * /A9 * /A8 * A7 * A6
Note that the LE signals are qualified with PHI2. I would not put a critical IO to the addresses right after the RAM, so that's why I omit the range $800x. This is because when you run a memory test that looks for the top of RAM he will probably try to read/write to $8000. For example many basic interpreters do that at a cold start.
So your first GAL would look like
Code:
+---\/---+
RW [ ] VCC
| |
PHI2 [ ] /RD
| |
A15 [ ] /WR
| |
A14 [ ] /IO65XX
| |
A13 [ ] /LE1
| |
A12 [ ] /LE2
| |
A11 [ ] /IOSEL
| |
A10 [ ] /RAM
| |
A9 [ ] /ROM
| |
A8 [ ] A4
| |
A7 [ ] A5
| |
GND [ ] A6
+--------+
In this way you have grouped all time-critical signals into one GAL. All signals where different delays could be a problem into one GAL. The other GAL would be like the following grouping the other signals.
Code:
+---\/---+
RW [ ] VCC
| |
A15 [ ] /IRQOUT
| |
A14 [ ]
| |
A13 [ ]
| |
A12 [ ]
| |
/IRQ1[ ]
| |
/IRQ2[ ]
| |
/IRQ3[ ]
| |
/IRQ4[ ] SRAMA16
| |
SBR0[ ] SRAMA15
| |
SBR1[ ] SBW1
| |
GND [ ] SBW0
+--------+
The difference in delay to /RAM and the delay to /SRAMA15+6 is not critical it is only important that they are stable before the leading edge of PHI2.
Note I used the normal GAL/PAL syntax that is used by most assemblers for the binary operations which is different to #&! used in WinCUPL.
cheers
Peter