This commit is contained in:
twinaphex 2017-07-29 19:51:06 +02:00
parent fcaff1cc08
commit cd1fcb4e82
4 changed files with 2 additions and 138 deletions

View File

@ -1,6 +1,5 @@
DEBUG = 0 DEBUG = 0
FRONTEND_SUPPORTS_RGB565 = 1 FRONTEND_SUPPORTS_RGB565 = 1
HAVE_RUST = 0
HAVE_OPENGL = 0 HAVE_OPENGL = 0
HAVE_VULKAN = 0 HAVE_VULKAN = 0
HAVE_JIT = 0 HAVE_JIT = 0
@ -397,11 +396,6 @@ FLAGS += $(INCFLAGS)
FLAGS += $(ENDIANNESS_DEFINES) -DSIZEOF_DOUBLE=8 $(WARNINGS) -DMEDNAFEN_VERSION=\"0.9.38.6\" -DPACKAGE=\"mednafen\" -DMEDNAFEN_VERSION_NUMERIC=9386 -DPSS_STYLE=1 -DMPC_FIXED_POINT $(CORE_DEFINE) -DSTDC_HEADERS -D__STDC_LIMIT_MACROS -D__LIBRETRO__ -D_LOW_ACCURACY_ $(EXTRA_INCLUDES) $(SOUND_DEFINE) -D__STDC_CONSTANT_MACROS FLAGS += $(ENDIANNESS_DEFINES) -DSIZEOF_DOUBLE=8 $(WARNINGS) -DMEDNAFEN_VERSION=\"0.9.38.6\" -DPACKAGE=\"mednafen\" -DMEDNAFEN_VERSION_NUMERIC=9386 -DPSS_STYLE=1 -DMPC_FIXED_POINT $(CORE_DEFINE) -DSTDC_HEADERS -D__STDC_LIMIT_MACROS -D__LIBRETRO__ -D_LOW_ACCURACY_ $(EXTRA_INCLUDES) $(SOUND_DEFINE) -D__STDC_CONSTANT_MACROS
ifeq ($(HAVE_RUST),1)
FLAGS += -DHAVE_RUST
LDFLAGS += -ldl -L. -lrsx
endif
ifeq ($(HAVE_VULKAN),1) ifeq ($(HAVE_VULKAN),1)
FLAGS += -DHAVE_VULKAN FLAGS += -DHAVE_VULKAN
endif endif

View File

@ -2485,9 +2485,6 @@ void retro_init(void)
check_system_specs(); check_system_specs();
#ifdef HAVE_RUST
rsx_intf_init(RSX_EXTERNAL_RUST);
#endif
#ifdef HAVE_VULKAN #ifdef HAVE_VULKAN
rsx_intf_init(RSX_VULKAN); rsx_intf_init(RSX_VULKAN);
#endif #endif
@ -3986,9 +3983,6 @@ void retro_set_controller_port_device(unsigned in_port, unsigned device)
#elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) #elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
#define FIRST_RENDERER "opengl" #define FIRST_RENDERER "opengl"
#define EXT_RENDERER "|software" #define EXT_RENDERER "|software"
#elif defined(HAVE_RUST)
#define FIRST_RENDERER "opengl-rust"
#define EXT_RENDERER "|software"
#else #else
#define FIRST_RENDERER "software" #define FIRST_RENDERER "software"
#define EXT_RENDERER "" #define EXT_RENDERER ""

View File

@ -21,9 +21,7 @@
#endif #endif
static enum rsx_renderer_type rsx_type = static enum rsx_renderer_type rsx_type =
#ifdef HAVE_RUST #if defined(HAVE_VULKAN)
RSX_EXTERNAL_RUST
#elif defined(HAVE_VULKAN)
RSX_VULKAN RSX_VULKAN
#elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) #elif defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
RSX_OPENGL RSX_OPENGL
@ -49,11 +47,6 @@ void rsx_intf_set_environment(retro_environment_t cb)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_set_environment(cb); rsx_vulkan_set_environment(cb);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_set_environment(cb);
#endif #endif
break; break;
} }
@ -74,11 +67,6 @@ void rsx_intf_set_video_refresh(retro_video_refresh_t cb)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_set_video_refresh(cb); rsx_vulkan_set_video_refresh(cb);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_set_video_refresh(cb);
#endif #endif
break; break;
} }
@ -101,37 +89,6 @@ void rsx_intf_get_system_av_info(struct retro_system_av_info *info)
rsx_vulkan_get_system_av_info(info); rsx_vulkan_get_system_av_info(info);
#endif #endif
break; break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_get_system_av_info(info);
#endif
break;
}
}
void rsx_intf_init(enum rsx_renderer_type type)
{
rsx_type = type;
switch (rsx_type)
{
case RSX_OPENGL:
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
rsx_gl_init();
#endif
break;
case RSX_VULKAN:
#if defined(HAVE_VULKAN)
rsx_vulkan_init();
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_init();
#endif
break;
default:
break;
} }
} }
@ -173,14 +130,6 @@ bool rsx_intf_open(bool is_pal)
ret = false; ret = false;
#else #else
ret = false; ret = false;
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
if (!rsx_open(is_pal))
ret = false;
#else
ret = false;
#endif #endif
break; break;
} }
@ -223,11 +172,6 @@ void rsx_intf_close(void)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_close(); rsx_vulkan_close();
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_close();
#endif #endif
break; break;
} }
@ -247,11 +191,6 @@ void rsx_intf_refresh_variables(void)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_refresh_variables(); rsx_vulkan_refresh_variables();
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_refresh_variables();
#endif #endif
break; break;
} }
@ -275,11 +214,6 @@ void rsx_intf_prepare_frame(void)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_prepare_frame(); rsx_vulkan_prepare_frame();
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_prepare_frame();
#endif #endif
break; break;
} }
@ -305,11 +239,6 @@ void rsx_intf_finalize_frame(const void *fb, unsigned width,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_finalize_frame(fb, width, height, pitch); rsx_vulkan_finalize_frame(fb, width, height, pitch);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_finalize_frame();
#endif #endif
break; break;
} }
@ -378,11 +307,6 @@ void rsx_intf_set_draw_offset(int16_t x, int16_t y)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_set_draw_offset(x, y); rsx_vulkan_set_draw_offset(x, y);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_set_draw_offset(x, y);
#endif #endif
break; break;
} }
@ -407,11 +331,6 @@ void rsx_intf_set_draw_area(uint16_t x0, uint16_t y0,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_set_draw_area(x0, y0, x1, y1); rsx_vulkan_set_draw_area(x0, y0, x1, y1);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_set_draw_area(x0, y0, x1, y1);
#endif #endif
break; break;
} }
@ -437,11 +356,6 @@ void rsx_intf_set_display_mode(uint16_t x, uint16_t y,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_set_display_mode(x, y, w, h, depth_24bpp); rsx_vulkan_set_display_mode(x, y, w, h, depth_24bpp);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_set_display_mode(x, y, w, h, depth_24bpp);
#endif #endif
break; break;
} }
@ -503,17 +417,6 @@ void rsx_intf_push_triangle(
depth_shift, depth_shift,
dither, dither,
blend_mode, mask_test != 0, set_mask != 0); blend_mode, mask_test != 0, set_mask != 0);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_push_triangle(p0x, p0y, p1x, p1y, p2x, p2y,
c0, c1, c2, t0x, t0y, t1x, t1y, t2x, t2y,
texpage_x, texpage_y, clut_x, clut_y,
texture_blend_mode,
depth_shift,
dither,
blend_mode);
#endif #endif
break; break;
} }
@ -617,11 +520,6 @@ void rsx_intf_push_line(int16_t p0x, int16_t p0y,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_push_line(p0x, p0y, p1x, p1y, c0, c1, dither, blend_mode, mask_test != 0, set_mask != 0); rsx_vulkan_push_line(p0x, p0y, p1x, p1y, c0, c1, dither, blend_mode, mask_test != 0, set_mask != 0);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_push_line(p0x, p0y, p1x, p1y, c0, c1, dither, blend_mode);
#endif #endif
break; break;
} }
@ -647,11 +545,6 @@ void rsx_intf_load_image(uint16_t x, uint16_t y,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_load_image(x, y, w, h, vram, mask_test, set_mask); rsx_vulkan_load_image(x, y, w, h, vram, mask_test, set_mask);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_load_image(x, y, w, h, vram);
#endif #endif
break; break;
} }
@ -677,11 +570,6 @@ void rsx_intf_fill_rect(uint32_t color,
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_fill_rect(color, x, y, w, h); rsx_vulkan_fill_rect(color, x, y, w, h);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_fill_rect(color, x, y, w, h);
#endif #endif
break; break;
} }
@ -709,12 +597,6 @@ void rsx_intf_copy_rect(uint16_t src_x, uint16_t src_y,
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_copy_rect(src_x, src_y, dst_x, dst_y, rsx_vulkan_copy_rect(src_x, src_y, dst_x, dst_y,
w, h, mask_test, set_mask); w, h, mask_test, set_mask);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
rsx_copy_rect(src_x, src_y, dst_x, dst_y,
w, h);
#endif #endif
break; break;
} }
@ -763,11 +645,6 @@ void rsx_intf_toggle_display(bool status)
case RSX_VULKAN: case RSX_VULKAN:
#if defined(HAVE_VULKAN) #if defined(HAVE_VULKAN)
rsx_vulkan_toggle_display(status); rsx_vulkan_toggle_display(status);
#endif
break;
case RSX_EXTERNAL_RUST:
#ifdef HAVE_RUST
puts("rsx_toggle_display: NOT IMPLEMENTED!");
#endif #endif
break; break;
} }

View File

@ -10,8 +10,7 @@ enum rsx_renderer_type
{ {
RSX_SOFTWARE = 0, RSX_SOFTWARE = 0,
RSX_OPENGL, RSX_OPENGL,
RSX_VULKAN, RSX_VULKAN
RSX_EXTERNAL_RUST
}; };
enum blending_modes enum blending_modes