Code: Select all
always @(posedge clk) begin
if (lineCS && cpuAB == 5'b00000) //variables for line generator
x0t <= cpuDO;
if (lineCS && cpuAB == 5'b00001)
y0t <= cpuDO;
if (lineCS && cpuAB == 5'b00010)
x1t <= cpuDO;
if (lineCS && cpuAB == 5'b00011)
y1t <= cpuDO;
if (lineCS && cpuAB == 5'b00100) //variables for circle generator
xc <= cpuDO;
if (lineCS && cpuAB == 5'b00101)
yc <= cpuDO;
if (lineCS && cpuAB == 5'b00110)
rad <= cpuDO;
if (lineCS && cpuAB == 5'b00111) //color variable
color <= cpuDO;
if (lineCS && cpuAB == 5'b01000) //X length of blitter
bXlen <= cpuDO;
if (lineCS && cpuAB == 5'b01001) //Y length of blitter
bYlen <= cpuDO;
if (lineCS && cpuAB == 5'b01010) //X start copy
bXc <= cpuDO;
if (lineCS && cpuAB == 5'b01011) //Y start copy
bYc <= cpuDO;
if (lineCS && cpuAB == 5'b01100) //X start paste
bXp <= cpuDO;
if (lineCS && cpuAB == 5'b01101) //Y start paste
bYp <= cpuDO;
if (lineCS && cpuAB == 5'b01110) //border color
border <= cpuDO;
if (lineCS && cpuAB == 5'b10000) //horizontal offset
hoffset <= cpuDO;
if (lineCS && cpuAB == 5'b10001) //vertical offset
voffset <= cpuDO;
endCode: Select all
// Register addresses
always @(posedge clk)
if ( lineCS )
case ( cpuAB [4:0] )
5'b00000: x0t <= cpuDO; //variables for line generator
5'b00001: y0t <= cpuDO;
5'b00010: x1t <= cpuDO;
5'b00011: y1t <= cpuDO;
5'b00100: xc <= cpuDO; //variables for circle generator
5'b00101: yc <= cpuDO;
5'b00110: rad <= cpuDO;
5'b00111: color <= cpuDO; //pixel color variable
5'b01000: bXlen <= cpuDO; //X length of blitter
5'b01001: bYlen <= cpuDO; //Y length of blitter
5'b01010: bXc <= cpuDO; //X start copy
5'b01011: bYc <= cpuDO; //Y start copy
5'b01100: bXp <= cpuDO; //X start paste
5'b01101: bYp <= cpuDO; //Y start paste
5'b01110: border <= cpuDO; //border color
endcase