summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorLeo C2015-05-11 08:32:57 +0200
committerLeo C2015-05-11 08:32:57 +0200
commitcdc4625b124f725fbc9462d5592d1d3be2aa613a (patch)
treeb53936e854446c3aa4403c351cf24ca08359ecef /avr
parente4c4b148ced1347935dff6200380e90cb3bfcde3 (diff)
downloadz180-stamp-cdc4625b124f725fbc9462d5592d1d3be2aa613a.zip
phys. address 0x00040 points to fifo_list
Diffstat (limited to 'avr')
-rw-r--r--avr/z180-serv.c17
1 files changed, 13 insertions, 4 deletions
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 */