From fa7ac6c9a2ac61841e19002212ee4b5a7ab20e6f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 23 May 2016 10:20:05 +0200 Subject: [PATCH] build/sim/dut_tb: add bottom line on surface to show frame count --- litex/build/sim/dut_tb.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litex/build/sim/dut_tb.cpp b/litex/build/sim/dut_tb.cpp index e5bf8b1fd..8d0791bef 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