Skip to content

Commit

Permalink
ui: Blank screen when VGA SCREEN_OFF is set
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson authored Jun 14, 2023
1 parent af3f832 commit 129c48d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions hw/xbox/nv2a/nv2a.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ int nv2a_get_framebuffer_surface(void);
void nv2a_set_surface_scale_factor(unsigned int scale);
unsigned int nv2a_get_surface_scale_factor(void);
const uint8_t *nv2a_get_dac_palette(void);
int nv2a_get_screen_off(void);

#endif
5 changes: 5 additions & 0 deletions hw/xbox/nv2a/pgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -5350,6 +5350,11 @@ const uint8_t *nv2a_get_dac_palette(void)
return g_nv2a->puserdac.palette;
}

int nv2a_get_screen_off(void)
{
return g_nv2a->vga.sr[VGA_SEQ_CLOCK_MODE] & VGA_SR01_SCREEN_OFF;
}

int nv2a_get_framebuffer_surface(void)
{
NV2AState *d = g_nv2a;
Expand Down
5 changes: 4 additions & 1 deletion ui/xui/gl-helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@ void RenderFramebuffer(GLint tex, int width, int height, bool flip, float scale[

glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_INT, NULL);

if (!nv2a_get_screen_off()) {
glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_INT, NULL);
}
}

void RenderFramebuffer(GLint tex, int width, int height, bool flip)
Expand Down

0 comments on commit 129c48d

Please sign in to comment.