Created
December 20, 2020 13:04
-
-
Save mkvenkit/dd50ed6123cd57cd805181e3e8cd1fa7 to your computer and use it in GitHub Desktop.
Here are the highlights from the frame buffer display logic in dot88.v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| always @ (posedge clk) | |
| begin | |
| // initialise | |
| if (!resetn) | |
| begin | |
| pcounter <= 0; | |
| d88_counter <= 0; | |
| xp <= 0; | |
| yp <= 0; | |
| end | |
| d88_counter <= d88_counter + 1; | |
| if (!d88_counter) | |
| begin | |
| pcounter <= pcounter + 1; | |
| // calculate position | |
| xp <= pcounter/8; | |
| yp <= pcounter - 8*(pcounter/8); | |
| // update row/col | |
| c <= fb[pcounter-1] ? (8'd1 << (7 - xp)) : 8'd0; | |
| r <= ~(8'd1 << (7 - yp)); | |
| end | |
| end | |
| assign {row, col} = {r, c}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment