1 `define ADDR_IF 16'hFF0F
2 `define ADDR_IE 16'hFFFF
18 wire [7:0] iflag = {3'b0,buttons,serial,tovf,lcdc,vblank};
19 reg [7:0] imask = 16'hFFFF;
21 wire [7:0] imasked = ihold & imask;
24 (addr == `ADDR_IF) ? ihold :
25 (addr == `ADDR_IE) ? imask :
29 assign master = (imasked) != 0;
31 assign jaddr = imasked[0] ? 8'h40 :
35 imasked[4] ? 8'h60 : 8'h00;
37 always @ (negedge clk)
41 `ADDR_IF : ihold <= iflag | data;
42 `ADDR_IE : imask <= data;
47 ihold <= ihold | iflag;