Skip to content

Commit

Permalink
Update unstable examples with display filters (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpookyIluha authored Sep 6, 2023
1 parent c556e71 commit b04d8cc
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/brew-volley/main.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ int main()
debug_init_isviewer();
debug_init_usblog();

display_init(RESOLUTION_640x480, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE_FETCH_ALWAYS);
display_init(RESOLUTION_640x480, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_DEDITHER);

controller_init();
timer_init();
Expand Down
2 changes: 1 addition & 1 deletion examples/fontdemo/fontdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main()
controller_init();

dfs_init(DFS_DEFAULT_LOCATION);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_RESAMPLE);
rdpq_init();
// rdpq_debug_start();
// rdpq_debug_log(true);
Expand Down
4 changes: 3 additions & 1 deletion examples/gldemo/gldemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ void setup()
glFogf(GL_FOG_END, 20);
glFogfv(GL_FOG_COLOR, environment_color);

glEnable(GL_MULTISAMPLE_ARB);

glGenTextures(4, textures);

#if 0
Expand Down Expand Up @@ -204,7 +206,7 @@ int main()

dfs_init(DFS_DEFAULT_LOCATION);

display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE_FETCH_ALWAYS);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_RESAMPLE_ANTIALIAS_DEDITHER);

rdpq_init();
gl_init();
Expand Down
2 changes: 1 addition & 1 deletion examples/overlays/actor/overlays_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main()
debug_init_isviewer();
debug_init_usblog();
//Init rendering
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_RESAMPLE);
rdpq_init();
rdpq_debug_start();
scr_width = display_get_width();
Expand Down
2 changes: 1 addition & 1 deletion examples/overlays/scene/overlays_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int main()
debug_init_isviewer();
debug_init_usblog();
//Init rendering
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_RESAMPLE);
rdpq_init();
rdpq_debug_start();
//Init miscellaneous system
Expand Down
2 changes: 1 addition & 1 deletion examples/pixelshader/pixelshader.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void rsp_blend_process_line(surface_t *dest, int x0, int y0, int numlines) {
int main(void) {
debug_init_isviewer();
debug_init_usblog();
display_init(RESOLUTION_640x480, DEPTH_16_BPP, 2, GAMMA_NONE, ANTIALIAS_RESAMPLE);
display_init(RESOLUTION_640x480, DEPTH_16_BPP, 2, GAMMA_NONE, FILTERS_RESAMPLE);
dfs_init(DFS_DEFAULT_LOCATION);
controller_init();
rdpq_init();
Expand Down
2 changes: 1 addition & 1 deletion examples/rdpqdemo/rdpqdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int main()
debug_init_isviewer();
debug_init_usblog();

display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, ANTIALIAS_RESAMPLE);
display_init(RESOLUTION_320x240, DEPTH_16_BPP, 3, GAMMA_NONE, FILTERS_RESAMPLE);

controller_init();
timer_init();
Expand Down
2 changes: 1 addition & 1 deletion examples/videoplayer/videoplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(void) {
debug_init_isviewer();
debug_init_usblog();

display_init(RESOLUTION_320x240, DEPTH_32_BPP, NUM_DISPLAY, GAMMA_NONE, ANTIALIAS_OFF);
display_init(RESOLUTION_320x240, DEPTH_32_BPP, NUM_DISPLAY, GAMMA_NONE, FILTERS_DISABLED);
dfs_init(DFS_DEFAULT_LOCATION);
rdpq_init();

Expand Down
11 changes: 4 additions & 7 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,12 @@ void display_init( resolution_t res, bitdepth_t bit, uint32_t num_buffers, gamma
/* Minimum is two buffers. */
__buffers = MAX(1, MIN(NUM_BUFFERS, num_buffers));


if( res.interlaced != INTERLACE_OFF )
{
/* Serrate on to stop vertical jitter */
control |= VI_CTRL_SERRATE;
}
bool serrate = res.interlaced != INTERLACE_OFF;
/* Serrate on to stop vertical jitter */
if(serrate) control |= VI_CTRL_SERRATE;

/* Copy over extra initializations */
vi_write_config(&vi_config_presets[res.interlaced][tv_type]);
vi_write_config(&vi_config_presets[serrate][tv_type]);

/* Figure out control register based on input given */
switch( bit )
Expand Down

0 comments on commit b04d8cc

Please sign in to comment.