@@ -7,7 +7,7 @@ pub struct AddressBus {
7
7
/// This channel is used to ask the CPU to send data through the mmio_read channel
8
8
pub mmio_req : ( crossbeam_channel:: Sender < ( u16 , u16 ) > , crossbeam_channel:: Receiver < ( u16 , u16 ) > ) ,
9
9
/// This channel is used for RAM reading by MMIO peripherals
10
- pub mmio_read : ( crossbeam_channel:: Sender < ( u16 , Vec < u8 > ) > , crossbeam_channel:: Receiver < ( u16 , Vec < u8 > ) > ) ,
10
+ pub mmio_read : ( crossbeam_channel:: Sender < Vec < u8 > > , crossbeam_channel:: Receiver < Vec < u8 > > ) ,
11
11
/// This channel is used for RAM writing by MMIO peripherals
12
12
pub mmio_write : ( crossbeam_channel:: Sender < ( u16 , u8 ) > , crossbeam_channel:: Receiver < ( u16 , u8 ) > ) ,
13
13
/// This channel is used for non memory-mapped IO (OUT : CPU -> peripherals)
@@ -49,13 +49,13 @@ impl AddressBus {
49
49
}
50
50
51
51
/// Send a vec of bytes of the address space via the read channel. Typical use : transfer VRAM data.
52
- pub fn mmio_send ( & self , start : u16 , len : u16 ) -> Result < ( ) , crate :: crossbeam_channel:: TrySendError < ( u16 , Vec < u8 > ) > > {
52
+ pub fn mmio_send ( & self , start : u16 , len : u16 ) -> Result < ( ) , crate :: crossbeam_channel:: TrySendError < Vec < u8 > > > {
53
53
if ( start + len) as usize > self . address_space . len ( ) { panic ! ( "Read operation after the end of address space !" ) }
54
54
let mut d: Vec < u8 > = Vec :: new ( ) ;
55
55
for i in 0 ..len {
56
56
d. push ( self . address_space [ usize:: from ( start + i) ] ) ;
57
57
}
58
- self . mmio_read . 0 . try_send ( ( start as u16 , d ) ) ?;
58
+ self . mmio_read . 0 . try_send ( d ) ?;
59
59
Ok ( ( ) )
60
60
}
61
61
0 commit comments