diff --git a/CMakeLists.txt b/CMakeLists.txt index a6b50baf3..7767166af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,7 @@ cmake_dependent_option(ISAMEM_RAMPAGE "AST Rampage" cmake_dependent_option(ISAMEM_IAB "Intel Above Board" ON "DEV_BRANCH" OFF) cmake_dependent_option(ISAMEM_BRAT "BocaRAM/AT" ON "DEV_BRANCH" OFF) cmake_dependent_option(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF) +cmake_dependent_option(MGA2 "Matrox Millennium II and Productiva G100" ON "DEV_BRANCH" OFF) cmake_dependent_option(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF) cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF) cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" ON "DEV_BRANCH" OFF) diff --git a/src/include/86box/video.h b/src/include/86box/video.h index e82807a12..612d1e503 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -439,8 +439,10 @@ extern const device_t pgc_device; extern const device_t millennium_device; extern const device_t mystique_device; extern const device_t mystique_220_device; +# if defined(DEV_BRANCH) && defined(USE_MGA2) extern const device_t millennium_ii_device; extern const device_t productiva_g100_device; +# endif /* Oak OTI-0x7 */ extern const device_t oti037c_device; diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index 638837757..a11bb0a12 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -28,6 +28,10 @@ add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c vid_ibm_rgb528_ramdac.c vid_sdac_ramdac.c vid_ogc.c vid_mga.c vid_nga.c vid_tvp3026_ramdac.c vid_att2xc498_ramdac.c vid_xga.c) +if(MGA2) + target_compile_definitions(vid PRIVATE USE_MGA2) +endif() + if(VGAWONDER) target_compile_definitions(vid PRIVATE USE_VGAWONDER) endif() diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index 088085355..c8836f129 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -6541,6 +6541,7 @@ mystique_220_available(void) return rom_present(ROM_MYSTIQUE_220); } +#if defined(DEV_BRANCH) && defined(USE_MGA2) static int millennium_ii_available(void) { @@ -6552,6 +6553,7 @@ matrox_g100_available(void) { return rom_present(ROM_G100); } +#endif static void mystique_speed_changed(void *priv) @@ -6601,6 +6603,7 @@ static const device_config_t mystique_config[] = { // clang-format on }; +#if defined(DEV_BRANCH) && defined(USE_MGA2) static const device_config_t millennium_ii_config[] = { // clang-format off { @@ -6632,6 +6635,7 @@ static const device_config_t millennium_ii_config[] = { } // clang-format on }; +#endif const device_t millennium_device = { .name = "Matrox Millennium", @@ -6675,6 +6679,7 @@ const device_t mystique_220_device = { .config = mystique_config }; +#if defined(DEV_BRANCH) && defined(USE_MGA2) const device_t millennium_ii_device = { .name = "Matrox Millennium II", .internal_name = "millennium_ii", @@ -6702,3 +6707,4 @@ const device_t productiva_g100_device = { .force_redraw = mystique_force_redraw, .config = millennium_ii_config }; +#endif diff --git a/src/video/vid_table.c b/src/video/vid_table.c index d40f00e13..70e5a6359 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -208,7 +208,9 @@ video_cards[] = { { &s3_diamond_stealth_4000_pci_device }, { &s3_trio3d2x_pci_device }, { &millennium_device }, +#if defined(DEV_BRANCH) && defined(USE_MGA2) { &millennium_ii_device }, +#endif { &mystique_device }, { &mystique_220_device }, { &tgui9440_pci_device }, @@ -259,7 +261,9 @@ video_cards[] = { { &s3_virge_357_agp_device }, { &s3_diamond_stealth_4000_agp_device }, { &s3_trio3d2x_agp_device }, +#if defined(DEV_BRANCH) && defined(USE_MGA2) { &productiva_g100_device, VIDEO_FLAG_TYPE_SPECIAL }, +#endif { &velocity_100_agp_device }, { &velocity_200_agp_device }, { &voodoo_3_1000_agp_device }, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 0cf34d6c6..b889558ba 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -64,6 +64,9 @@ ifeq ($(DEV_BUILD), y) ifndef LASERXT LASERXT := y endif + ifndef MGA2 + MGA2 := y + endif ifndef OLIVETTI OLIVETTI := y endif @@ -125,6 +128,9 @@ else ifndef LASERXT LASERXT := n endif + ifndef MGA2 + MGA2 := n + endif ifndef OLIVETTI OLIVETTI := n endif @@ -490,6 +496,10 @@ ifeq ($(DEV_BRANCH), y) DEVBROBJ += m_xt_laserxt.o endif + ifeq ($(MGA2), y) + OPTS += -DUSE_MGA2 + endif + ifeq ($(OPEN_AT), y) OPTS += -DUSE_OPEN_AT endif