]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - System.v
Move the core to core/
[fpgaboy.git] / System.v
index c2e892bd1a4029a85cf603b84a6b4fbcee8df331..37ca872bdecb246d1e34f40394c565039b2eaff2 100644 (file)
--- a/System.v
+++ b/System.v
@@ -232,6 +232,7 @@ module CoreTop(
        output wire cr_nADV, cr_nCE, cr_nOE, cr_nWE, cr_CRE, cr_nLB, cr_nUB, cr_CLK,
        output wire [22:0] cr_A,
        inout [15:0] cr_DQ,
+       input ps2c, ps2d,
 `endif
        output wire hs, vs,
        output wire [2:0] r, g,
@@ -256,15 +257,17 @@ module CoreTop(
        IBUFG iclkbuf(.O(xtalb), .I(xtal));
        CPUDCM dcm (.CLKIN_IN(xtalb), .CLKFX_OUT(clk));
        pixDCM pixdcm (.CLKIN_IN(xtalb), .CLKFX_OUT(vgaclk));
+       wire [7:0] ps2buttons;
 `endif
 
        wire [15:0] addr [1:0];
        wire [7:0] data [1:0];
        wire wr [1:0], rd [1:0];
        
-       wire irq, tmrirq, lcdcirq, vblankirq;
+       wire irq, tmrirq, lcdcirq, vblankirq, btnirq;
        wire [7:0] jaddr;
        wire [1:0] state;
+       wire ack;
        
        GBZ80Core core(
                .clk(clk),
@@ -277,6 +280,7 @@ module CoreTop(
                .bus1wr(wr[1]),
                .bus1rd(rd[1]),
                .irq(irq),
+               .irqack(ack),
                .jaddr(jaddr),
                .state(state));
        
@@ -346,15 +350,45 @@ module CoreTop(
                .vgag(g),
                .vgab(b));
 
+       wire [7:0] sleds;
+`ifdef isim
+       assign leds = sleds;
+`else
+       assign leds = sleds | ps2buttons;
+`endif
        Switches sw(
                .clk(clk),
                .address(addr[0]),
                .data(data[0]),
                .wr(wr[0]),
                .rd(rd[0]),
-               .ledout(leds),
+               .ledout(sleds),
                .switches(switches)
                );
+       
+`ifdef isim
+`else
+       PS2Button ps2(
+               .clk(clk),
+               .inclk(ps2c),
+               .indata(ps2d),
+               .buttons(ps2buttons)
+               );
+`endif
+       
+       Buttons ass(
+               .core_clk(clk),
+               .addr(addr[0]),
+               .data(data[0]),
+               .wr(wr[0]),
+               .rd(rd[0]),
+               .int(btnirq),
+       `ifdef isim
+               .buttons(switches)
+       `else
+               .buttons(ps2buttons)
+       `endif
+               );
 
        AddrMon amon(
                .clk(clk), 
@@ -413,8 +447,9 @@ module CoreTop(
                .lcdc(lcdcirq),
                .tovf(tmrirq),
                .serial(1'b0),
-               .buttons(1'b0),
+               .buttons(btnirq),
                .master(irq),
+               .ack(ack),
                .jaddr(jaddr));
        
        Soundcore sound(
This page took 0.029229 seconds and 4 git commands to generate.