From cdc4625b124f725fbc9462d5592d1d3be2aa613a Mon Sep 17 00:00:00 2001 From: Leo C Date: Mon, 11 May 2015 08:32:57 +0200 Subject: phys. address 0x00040 points to fifo_list --- avr/z180-serv.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'avr') diff --git a/avr/z180-serv.c b/avr/z180-serv.c index ce264ae..9860175 100644 --- a/avr/z180-serv.c +++ b/avr/z180-serv.c @@ -210,14 +210,23 @@ int msg_handling(int state) if (pending) { switch (state) { case 0: /* need init */ + /* Get address of fifo_list */ z80_bus_cmd(Request); - uint32_t addr = z80_read(0x40) + + uint32_t fifo_list = z80_read(0x40) + ((uint16_t) z80_read(0x41) << 8) + ((uint32_t) z80_read(0x42) << 16); z80_bus_cmd(Release); - if (addr != 0) { - z80_memfifo_init(fifo_msgin, addr); - state = 1; + if (fifo_list != 0) { + /* Get address of fifo 0 */ + z80_bus_cmd(Request); + uint32_t fifo_addr = z80_read(fifo_list) + + ((uint16_t) z80_read(fifo_list+1) << 8) + + ((uint32_t) z80_read(fifo_list+2) << 16); + z80_bus_cmd(Release); + if (fifo_addr != 0) { + z80_memfifo_init(fifo_msgin, fifo_addr); + state = 1; + } } break; case 1: /* awaiting messages */ -- cgit v1.2.3