]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - System.v
Fix ADD HL,xx.
[fpgaboy.git] / System.v
index 931e90029c7c2c438fed2c2a7c6726baf7e4c008..02b424cf54b03a366359019648aff429c90243e7 100644 (file)
--- a/System.v
+++ b/System.v
@@ -114,7 +114,7 @@ module CellularRAM(
        reg [8:0] rombank = 1;
        
        assign cr_nOE = decode ? ~rdlatch : 1;
-       assign cr_nWE = (decode && ((addrlatch == ADDR_PROGDATA) || (mbc_emul[6:0] == 0))) ? ~wrlatch : 1;
+       assign cr_nWE = (decode && ((addrlatch == ADDR_PROGDATA) || (mbc_emul[6:0] == 0) || (addrlatch[15:13] == 3'b101))) ? ~wrlatch : 1;
        
        assign cr_DQ = (~cr_nOE) ? 16'bzzzzzzzzzzzzzzzz : {8'b0, datalatch};
        assign cr_A = (addrlatch[15:14] == 2'b00) ? /* extrom, home bank */ {9'b0,addrlatch[13:0]} :
@@ -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,6 +257,7 @@ 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];
@@ -348,16 +350,32 @@ 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]),
@@ -365,7 +383,11 @@ module CoreTop(
                .wr(wr[0]),
                .rd(rd[0]),
                .int(btnirq),
+       `ifdef isim
                .buttons(switches)
+       `else
+               .buttons(ps2buttons)
+       `endif
                );
 
        AddrMon amon(
This page took 0.028773 seconds and 4 git commands to generate.