-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiodec.gal
45 lines (39 loc) · 1.66 KB
/
iodec.gal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
GAL22V10
IODEC
/IORQ /WR NC A7 A6 A5 A4 A3 A2 A1 A0 GND
NC /SNWSEL /AYSEL /VDPEN /VDPWSEL /VDPRSEL /FF2WSEL /FF1WSEL /CRSEL /C1WSEL /C2WSEL VCC
;
; This implements I/O space address decoding for the CoPicoVision.
;
; The original ColecoVision has the following I/O space address map:
;
; $8x (w) - Enable controller scan mode 2 (number pad)
; $Ax (r/w) - VDP
; $Cx (w) - Enable controller scan mode 1 (joystick)
; $Ex (r) - Controller read
; $Ex (w) - SN76489AN sound chip
;
; The Super Game Module adds:
;
; $50 (w) - AY-3-8910 address latch
; $51 (w) - AY-3-8910 data writes
; $52 (r) - AY-3-8910 data reads
;
; $53 (w) - extended RAM enable (0b00000001) / disable (0b00000000) [default]
; $7F (w) - BIOS ROM disable (0b00001101) / enable (0b00001111) [default]
;
C2WSEL = A7 * /A6 * /A5 * IORQ * WR ; $80 writes
VDPRSEL = A7 * /A6 * A5 * IORQ * /WR ; $A0 reads
VDPWSEL = A7 * /A6 * A5 * IORQ * WR ; $A0 writes
VDPEN = A7 * /A6 * A5 * IORQ ; enable VDP transceiver
C1WSEL = A7 * A6 * /A5 * IORQ * WR ; $C0 writes
CRSEL = A7 * A6 * A5 * IORQ * /WR ; $E0 reads
SNWSEL = A7 * A6 * A5 * IORQ * WR ; $E0 writes
; Reads vs. writes are handled externally by a pair of NOR gates.
AYSEL = /A7 * A6 * /A5 * A4 * /A3 * /A2 * /A1 * /A0 * IORQ ; $50
+ /A7 * A6 * /A5 * A4 * /A3 * /A2 * /A1 * A0 * IORQ ; $51
+ /A7 * A6 * /A5 * A4 * /A3 * /A2 * A1 * /A0 * IORQ ; $52
FF1WSEL = /A7 * A6 * /A5 * A4 * /A3 * /A2 * A1 * A0 * IORQ * WR ; $53 (w)
FF2WSEL = /A7 * A6 * A5 * A4 * A3 * A2 * A1 * A0 * IORQ * WR ; $7F (w)
DESCRIPTION
This is the I/O address decoder for the CoPicoVision.