summaryrefslogtreecommitdiffstats
path: root/t80.diff
blob: e13adafb756e9bb431ec8e6643b81e79b65849cd (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
Only in .: CVS
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80a.vhd ./T80a.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80a.vhd	2002-11-24 05:51:28.000000000 -0800
+++ ./T80a.vhd	2003-10-04 21:40:03.000000000 -0700
@@ -83,6 +83,7 @@
 		RFSH_n		: out std_logic;
 		HALT_n		: out std_logic;
 		BUSAK_n		: out std_logic;
+		RETI_n		: out std_logic;
 		A			: out std_logic_vector(15 downto 0);
 		D			: inout std_logic_vector(7 downto 0)
 	);
@@ -156,6 +157,7 @@
 			RESET_n => Reset_s,
 			BUSRQ_n => BUSRQ_n,
 			BUSAK_n => BUSAK_n_i,
+			RETI_n => RETI_n,
 			CLK_n => CLK_n,
 			A => A_i,
 			DInst => D,
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80_MCode.vhd ./T80_MCode.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80_MCode.vhd	2002-10-20 18:33:45.000000000 -0700
+++ ./T80_MCode.vhd	2003-10-04 21:35:12.000000000 -0700
@@ -118,6 +118,7 @@
 		I_CPL			: out std_logic;
 		I_CCF			: out std_logic;
 		I_SCF			: out std_logic;
+		I_RETI			: out std_logic;
 		I_RETN			: out std_logic;
 		I_BT			: out std_logic;
 		I_BC			: out std_logic;
@@ -231,6 +232,7 @@
 		I_CPL <= '0';
 		I_CCF <= '0';
 		I_SCF <= '0';
+		I_RETI <= '0';
 		I_RETN <= '0';
 		I_BT <= '0';
 		I_BC <= '0';
@@ -615,7 +617,7 @@
 				when 3 =>
 					Jump <= '1';
 					IncDec_16 <= "0111";
-					I_RETN <= '1';
+					I_RETI <= '1';
 					SetEI <= '1';
 				when others => null;
 				end case;
@@ -1786,7 +1788,8 @@
 				when 3 =>
 					Jump <= '1';
 					IncDec_16 <= "0111";
-					I_RETN <= '1';
+					I_RETI <= IR(3);
+					I_RETN <= not IR(3);
 				when others => null;
 				end case;
 			when "01000000"|"01001000"|"01010000"|"01011000"|"01100000"|"01101000"|"01110000"|"01111000" =>
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80_Pack.vhd ./T80_Pack.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80_Pack.vhd	2002-10-20 18:33:45.000000000 -0700
+++ ./T80_Pack.vhd	2003-10-04 21:40:26.000000000 -0700
@@ -78,6 +78,7 @@
 		RFSH_n		: out std_logic;
 		HALT_n		: out std_logic;
 		BUSAK_n		: out std_logic;
+		RETI_n		: out std_logic;
 		A			: out std_logic_vector(15 downto 0);
 		DInst		: in std_logic_vector(7 downto 0);
 		DI			: in std_logic_vector(7 downto 0);
@@ -163,6 +164,7 @@
 		I_CPL			: out std_logic;
 		I_CCF			: out std_logic;
 		I_SCF			: out std_logic;
+		I_RETI			: out std_logic;
 		I_RETN			: out std_logic;
 		I_BT			: out std_logic;
 		I_BC			: out std_logic;
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80se.vhd ./T80se.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80se.vhd	2002-10-20 18:33:45.000000000 -0700
+++ ./T80se.vhd	2003-10-04 21:36:43.000000000 -0700
@@ -86,6 +86,7 @@
 		RFSH_n		: out std_logic;
 		HALT_n		: out std_logic;
 		BUSAK_n		: out std_logic;
+		RETI_n		: out std_logic;
 		A			: out std_logic_vector(15 downto 0);
 		DI			: in std_logic_vector(7 downto 0);
 		DO			: out std_logic_vector(7 downto 0)
@@ -122,6 +123,7 @@
 			RESET_n => RESET_n,
 			BUSRQ_n => BUSRQ_n,
 			BUSAK_n => BUSAK_n,
+			RETI_n => RETI_n,
 			CLK_n => CLK_n,
 			A => A,
 			DInst => DI,
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80s.vhd ./T80s.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80s.vhd	2002-10-20 18:33:45.000000000 -0700
+++ ./T80s.vhd	2003-10-04 21:32:44.000000000 -0700
@@ -91,6 +91,7 @@
 		RFSH_n		: out std_logic;
 		HALT_n		: out std_logic;
 		BUSAK_n		: out std_logic;
+		RETI_n		: out std_logic;
 		A			: out std_logic_vector(15 downto 0);
 		DI			: in std_logic_vector(7 downto 0);
 		DO			: out std_logic_vector(7 downto 0)
@@ -130,6 +131,7 @@
 			RESET_n => RESET_n,
 			BUSRQ_n => BUSRQ_n,
 			BUSAK_n => BUSAK_n,
+			RETI_n => RETI_n,
 			CLK_n => CLK_n,
 			A => A,
 			DInst => DI,
diff -ur /home/hpa/hwhacks/t80/rtl/vhdl/T80.vhd ./T80.vhd
--- /home/hpa/hwhacks/t80/rtl/vhdl/T80.vhd	2002-11-24 05:51:28.000000000 -0800
+++ ./T80.vhd	2003-10-04 21:38:52.000000000 -0700
@@ -100,6 +100,7 @@
 		RFSH_n		: out std_logic;
 		HALT_n		: out std_logic;
 		BUSAK_n		: out std_logic;
+		RETI_n		: out std_logic;
 		A			: out std_logic_vector(15 downto 0);
 		DInst		: in std_logic_vector(7 downto 0);
 		DI			: in std_logic_vector(7 downto 0);
@@ -227,6 +228,7 @@
 	signal I_CPL			: std_logic;
 	signal I_CCF			: std_logic;
 	signal I_SCF			: std_logic;
+	signal I_RETI			: std_logic;
 	signal I_RETN			: std_logic;
 	signal I_BT				: std_logic;
 	signal I_BC				: std_logic;
@@ -292,6 +294,7 @@
 			I_CPL => I_CPL,
 			I_CCF => I_CCF,
 			I_SCF => I_SCF,
+			I_RETI => I_RETI,
 			I_RETN => I_RETN,
 			I_BT => I_BT,
 			I_BC => I_BC,
@@ -974,6 +977,7 @@
 			Auto_Wait_t1 <= '0';
 			Auto_Wait_t2 <= '0';
 			M1_n <= '1';
+			RETI_n <= '1';
 		elsif CLK_n'event and CLK_n = '1' then
 			if CEN = '1' then
 			if T_Res = '1' then
@@ -981,10 +985,11 @@
 			else
 				Auto_Wait_t1 <= Auto_Wait or IORQ_i;
 			end if;
-			Auto_Wait_t2 <= Auto_Wait_t1;
+			Auto_Wait_t2 <= Auto_Wait_t1 and not T_Res;
 			No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or
 					(I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or
 					(I_BTR and (not IR(4) or F(Flag_Z)));
+			RETI_n <= not I_RETI;
 			if TState = 2 then
 				if SetEI = '1' then
 					IntE_FF1 <= '1';