From: Florent Kermarrec Date: Mon, 23 May 2016 08:20:05 +0000 (+0200) Subject: build/sim/dut_tb: add bottom line on surface to show frame count X-Git-Tag: 24jan2021_ls180~1941 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa7ac6c9a2ac61841e19002212ee4b5a7ab20e6f;p=litex.git build/sim/dut_tb: add bottom line on surface to show frame count --- diff --git a/litex/build/sim/dut_tb.cpp b/litex/build/sim/dut_tb.cpp index e5bf8b1f..8d0791be 100644 --- a/litex/build/sim/dut_tb.cpp +++ b/litex/build/sim/dut_tb.cpp @@ -207,7 +207,7 @@ void vga_set_pixel(SDL_Surface *screen, int x, int y, char r, char g, char b) int vga_init(struct sim *s) { if(SDL_Init(SDL_INIT_VIDEO) < 0) return 1; - if(!(screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE))) { + if(!(screen = SDL_SetVideoMode(640, 480+1, 32, SDL_HWSURFACE))) { SDL_Quit(); return 1; } @@ -216,10 +216,12 @@ int vga_init(struct sim *s) { int x; int y; +int frame; int hsync_wait_de = 1; int vsync_wait_de = 1; void vga_service(struct sim *s) { + int i; if(VGA_HSYNC == 1 && hsync_wait_de == 0) { x = 0; y++; @@ -228,6 +230,9 @@ void vga_service(struct sim *s) { if(VGA_VSYNC == 1 && vsync_wait_de == 0) { y = 0; vsync_wait_de = 1; + for(i=0; i