@@ -40,8 +40,6 @@ pub trait z80Ctrl {
40
40
fn write_byte ( & mut self , addr : u16 , value : u8 ) ;
41
41
fn port_in ( & self , addr : u16 ) -> u8 ;
42
42
fn port_out ( & mut self , addr : u16 , value : u8 ) ;
43
- #[ cfg( test) ]
44
- fn test_finished ( & self ) -> bool ;
45
43
}
46
44
47
45
pub struct z80 {
@@ -69,6 +67,8 @@ pub struct z80 {
69
67
halted : bool ,
70
68
iff1 : bool ,
71
69
iff2 : bool ,
70
+ #[ cfg( test) ]
71
+ pub test_finished : bool ,
72
72
}
73
73
74
74
impl z80 {
@@ -115,6 +115,8 @@ impl z80 {
115
115
halted : false ,
116
116
iff1 : false ,
117
117
iff2 : false ,
118
+ #[ cfg( test) ]
119
+ test_finished : false ,
118
120
}
119
121
}
120
122
pub fn init ( & mut self ) {
@@ -141,6 +143,10 @@ impl z80 {
141
143
self . irq_pending = 0 as i32 as uint8_t ;
142
144
self . nmi_pending = 0 as i32 as uint8_t ;
143
145
self . irq_data = 0 as i32 as uint8_t ;
146
+ #[ cfg( test) ]
147
+ {
148
+ self . test_finished = false ;
149
+ }
144
150
}
145
151
pub fn step ( & mut self ) -> u32 {
146
152
unsafe { z80_step_s ( self ) }
@@ -169,87 +175,91 @@ impl z80 {
169
175
self . ctrl . port_in ( addr)
170
176
}
171
177
fn internal_port_out ( & mut self , addr : u16 , value : u8 ) {
178
+ #[ cfg( test) ]
179
+ {
180
+ self . test_finished = true ;
181
+ }
172
182
self . ctrl . port_out ( addr, value) ;
173
183
}
174
184
}
175
185
176
186
#[ derive( Copy , Clone ) ]
177
- union C2RustUnnamed_0 {
187
+ pub union C2RustUnnamed_0 {
178
188
pub c2rust_unnamed : C2RustUnnamed_1 ,
179
189
pub h_l_ : uint16_t ,
180
190
}
181
191
#[ derive( Copy , Clone ) ]
182
- struct C2RustUnnamed_1 {
192
+ pub struct C2RustUnnamed_1 {
183
193
pub l_ : uint8_t ,
184
194
pub h_ : uint8_t ,
185
195
}
186
196
#[ derive( Copy , Clone ) ]
187
- union C2RustUnnamed_2 {
197
+ pub union C2RustUnnamed_2 {
188
198
pub c2rust_unnamed : C2RustUnnamed_3 ,
189
199
pub d_e_ : uint16_t ,
190
200
}
191
201
#[ derive( Copy , Clone ) ]
192
- struct C2RustUnnamed_3 {
202
+ pub struct C2RustUnnamed_3 {
193
203
pub e_ : uint8_t ,
194
204
pub d_ : uint8_t ,
195
205
}
196
206
#[ derive( Copy , Clone ) ]
197
- union C2RustUnnamed_4 {
207
+ pub union C2RustUnnamed_4 {
198
208
pub c2rust_unnamed : C2RustUnnamed_5 ,
199
209
pub b_c_ : uint16_t ,
200
210
}
201
211
#[ derive( Copy , Clone ) ]
202
- struct C2RustUnnamed_5 {
212
+ pub struct C2RustUnnamed_5 {
203
213
pub c_ : uint8_t ,
204
214
pub b_ : uint8_t ,
205
215
}
206
216
#[ derive( Copy , Clone ) ]
207
- union C2RustUnnamed_6 {
217
+ pub union C2RustUnnamed_6 {
208
218
pub c2rust_unnamed : C2RustUnnamed_7 ,
209
219
pub a_f_ : uint16_t ,
210
220
}
211
221
#[ derive( Copy , Clone ) ]
212
- struct C2RustUnnamed_7 {
222
+ pub struct C2RustUnnamed_7 {
213
223
pub f_ : uint8_t ,
214
224
pub a_ : uint8_t ,
215
225
}
216
226
#[ derive( Copy , Clone ) ]
217
- union C2RustUnnamed_8 {
227
+ pub union C2RustUnnamed_8 {
218
228
pub c2rust_unnamed : C2RustUnnamed_9 ,
219
229
pub hl : uint16_t ,
220
230
}
221
231
#[ derive( Copy , Clone ) ]
222
- struct C2RustUnnamed_9 {
232
+ pub struct C2RustUnnamed_9 {
223
233
pub l : uint8_t ,
224
234
pub h : uint8_t ,
225
235
}
226
236
#[ derive( Copy , Clone ) ]
227
- union C2RustUnnamed_10 {
237
+ pub union C2RustUnnamed_10 {
228
238
pub c2rust_unnamed : C2RustUnnamed_11 ,
229
239
pub de : uint16_t ,
230
240
}
231
241
#[ derive( Copy , Clone ) ]
232
- struct C2RustUnnamed_11 {
242
+ pub struct C2RustUnnamed_11 {
233
243
pub e : uint8_t ,
234
244
pub d : uint8_t ,
235
245
}
236
246
#[ derive( Copy , Clone ) ]
237
- union C2RustUnnamed_12 {
247
+ pub union C2RustUnnamed_12 {
238
248
pub c2rust_unnamed : C2RustUnnamed_13 ,
239
249
pub bc : uint16_t ,
240
250
}
241
251
#[ derive( Copy , Clone ) ]
242
- struct C2RustUnnamed_13 {
252
+ pub struct C2RustUnnamed_13 {
243
253
pub c : uint8_t ,
244
254
pub b : uint8_t ,
245
255
}
246
256
#[ derive( Copy , Clone ) ]
247
- union C2RustUnnamed_14 {
257
+ pub union C2RustUnnamed_14 {
248
258
pub c2rust_unnamed : C2RustUnnamed_15 ,
249
259
pub af : uint16_t ,
250
260
}
251
261
#[ derive( Copy , Clone ) ]
252
- struct C2RustUnnamed_15 {
262
+ pub struct C2RustUnnamed_15 {
253
263
pub f : uint8_t ,
254
264
pub a : uint8_t ,
255
265
}
0 commit comments