[NEW] Inclos un mode de pantalla en que s'actualitze al instant en compte de segons el retraç del crt, per a debuggar que se pinta
This commit is contained in:
+18
-8
@@ -20,6 +20,7 @@ namespace zxscreen
|
||||
|
||||
uint8_t zoom = 1;
|
||||
bool fullscreen = false;
|
||||
bool full_refresh = true;
|
||||
int fullscreen_scale = 1;
|
||||
SDL_Rect dest_rect;
|
||||
|
||||
@@ -194,7 +195,6 @@ namespace zxscreen
|
||||
if (color_addr[t_screen] == 1) {
|
||||
*(ptr_pixel++) = border_color;
|
||||
*(ptr_pixel++) = border_color;
|
||||
//pixels_draw+=2;
|
||||
} else {
|
||||
uint8_t color = memory[color_addr[t_screen]];
|
||||
uint8_t c1 = color&0x7, c2 = (color>>3)&0x7;
|
||||
@@ -210,20 +210,13 @@ namespace zxscreen
|
||||
pixels_draw+=2;
|
||||
}
|
||||
t_screen++;
|
||||
/*if (pixels_draw>352*296)
|
||||
{
|
||||
printf("PIXELS OVERFLOW: %i\n", pixels_draw);
|
||||
}*/
|
||||
if (t_screen>=69888) {
|
||||
//printf("PIXELS DRAWN: %i\n", pixels_draw);
|
||||
pixels_draw=0;
|
||||
t_flash++;
|
||||
if (t_flash==16) { t_flash=0; flash = !flash; }
|
||||
t_screen=0;
|
||||
ptr_pixel = zx_pixels;
|
||||
redraw();
|
||||
//while (SDL_GetTicks()-time < 20) {}
|
||||
//time = SDL_GetTicks();
|
||||
z80::interrupt();
|
||||
}
|
||||
}
|
||||
@@ -232,9 +225,15 @@ namespace zxscreen
|
||||
void fullrefresh()
|
||||
{
|
||||
t_screen = 0;
|
||||
ptr_pixel = zx_pixels;
|
||||
refresh(69888);
|
||||
}
|
||||
|
||||
void debugrefresh(const uint32_t dt)
|
||||
{
|
||||
if (full_refresh) fullrefresh(); else refresh(dt);
|
||||
}
|
||||
|
||||
void redraw(const bool present)
|
||||
{
|
||||
if (zx_tape::getplaying() && zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD)) return;
|
||||
@@ -316,6 +315,17 @@ namespace zxscreen
|
||||
return fullscreen;
|
||||
}
|
||||
|
||||
void toggleFullRefresh()
|
||||
{
|
||||
full_refresh = !full_refresh;
|
||||
}
|
||||
|
||||
const bool getFullRefresh()
|
||||
{
|
||||
return full_refresh;
|
||||
}
|
||||
|
||||
|
||||
SDL_Renderer *getrenderer()
|
||||
{
|
||||
return ren;
|
||||
|
||||
Reference in New Issue
Block a user