Merge pull request #1528 from 86Box/tc1995
Ported the latest changes from PCem.
This commit is contained in:
@@ -296,6 +296,7 @@ typedef struct voodoo_t
|
||||
int swap_pending;
|
||||
|
||||
int bilinear_enabled;
|
||||
int dithersub_enabled;
|
||||
|
||||
int fb_size;
|
||||
uint32_t fb_mask;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -369,6 +369,7 @@ enum
|
||||
FBZ_DRAW_MASK = 0xc000,
|
||||
|
||||
FBZ_DEPTH_BIAS = (1 << 16),
|
||||
FBZ_DITHER_SUB = (1 << 19),
|
||||
|
||||
FBZ_DEPTH_SOURCE = (1 << 20),
|
||||
|
||||
@@ -689,3 +690,4 @@ enum
|
||||
#define depth_op ( (params->fbzMode >> 5) & 7)
|
||||
#define dither ( params->fbzMode & FBZ_DITHER)
|
||||
#define dither2x2 (params->fbzMode & FBZ_DITHER_2x2)
|
||||
#define dithersub (params->fbzMode & FBZ_DITHER_SUB)
|
@@ -16,6 +16,7 @@
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/hdc.h>
|
||||
@@ -73,11 +74,19 @@ xi8088_bios_128kb(void)
|
||||
static void *
|
||||
xi8088_init(const device_t *info)
|
||||
{
|
||||
/* even though the bios by default turns the turbo off when controlling by hotkeys, pcem always starts at full speed */
|
||||
xi8088.turbo = 1;
|
||||
xi8088.turbo_setting = device_get_config_int("turbo_setting");
|
||||
xi8088.bios_128kb = device_get_config_int("bios_128kb");
|
||||
|
||||
mem_set_mem_state(0x0a0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
mem_set_mem_state(0x0c0000, 0x08000, device_get_config_int("umb_c0000h_c7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0c8000, 0x08000, device_get_config_int("umb_c8000h_cffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0d0000, 0x08000, device_get_config_int("umb_d0000h_d7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0d8000, 0x08000, device_get_config_int("umb_d8000h_dffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0e0000, 0x08000, device_get_config_int("umb_e0000h_e7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0e8000, 0x08000, device_get_config_int("umb_e8000h_effff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0f0000, 0x10000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
|
||||
return &xi8088;
|
||||
}
|
||||
|
||||
@@ -95,7 +104,7 @@ static const device_config_t xi8088_config[] =
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "Hotkeys (starts off)",
|
||||
.description = "BIOS setting + Hotkeys (off during POST)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
@@ -108,16 +117,52 @@ static const device_config_t xi8088_config[] =
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "64KB",
|
||||
.description = "64KB starting from 0xF0000",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "128KB",
|
||||
.description = "128KB starting from 0xE0000 (address MSB inverted, last 64KB first)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "umb_c0000h_c7fff",
|
||||
.description = "Map 0xc0000-0xc7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_c8000h_cffff",
|
||||
.description = "Map 0xc8000-0xcffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_d0000h_d7fff",
|
||||
.description = "Map 0xd0000-0xd7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_d8000h_dffff",
|
||||
.description = "Map 0xd8000-0xdffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_e0000h_e7fff",
|
||||
.description = "Map 0xe0000-0xe7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_e8000h_effff",
|
||||
.description = "Map 0xe8000-0xeffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.type = -1
|
||||
}
|
||||
@@ -171,7 +216,6 @@ machine_xt_xi8088_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
/* TODO: set UMBs? See if PCem always sets when we have > 640KB ram and avoids conflicts when a peripheral uses the same memory space */
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
@@ -182,6 +226,7 @@ machine_xt_xi8088_init(const machine_t *model)
|
||||
device_add(&ibmat_nvr_device);
|
||||
pic2_init();
|
||||
standalone_gameport_type = &gameport_device;
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/m_xt_xi8088.h>
|
||||
|
||||
|
||||
typedef struct sst_t
|
||||
@@ -372,7 +373,7 @@ sst_init(const device_t *info)
|
||||
else if (dev->id == SST_ID_SST39SF040)
|
||||
dev->size = 0x80000;
|
||||
else
|
||||
dev->size = 0x20000;
|
||||
dev->size = ((dev->id == SST_ID_SST39SF010) && (strstr(machine_get_internal_name_ex(machine), "xi8088")) && !xi8088_bios_128kb()) ? 0x10000 : 0x20000;
|
||||
dev->mask = dev->size - 1;
|
||||
dev->page_mask = dev->mask & 0xffffff80; /* Filter out A0-A6. */
|
||||
dev->sdp = 1;
|
||||
|
@@ -908,6 +908,7 @@ void *voodoo_card_init()
|
||||
memset(voodoo, 0, sizeof(voodoo_t));
|
||||
|
||||
voodoo->bilinear_enabled = device_get_config_int("bilinear");
|
||||
voodoo->dithersub_enabled = device_get_config_int("dithersub");
|
||||
voodoo->scrfilter = device_get_config_int("dacfilter");
|
||||
voodoo->texture_size = device_get_config_int("texture_memory");
|
||||
voodoo->texture_mask = (voodoo->texture_size << 20) - 1;
|
||||
@@ -1053,6 +1054,7 @@ void *voodoo_2d3d_card_init(int type)
|
||||
memset(voodoo, 0, sizeof(voodoo_t));
|
||||
|
||||
voodoo->bilinear_enabled = device_get_config_int("bilinear");
|
||||
voodoo->dithersub_enabled = device_get_config_int("dithersub");
|
||||
voodoo->scrfilter = device_get_config_int("dacfilter");
|
||||
voodoo->render_threads = device_get_config_int("render_threads");
|
||||
voodoo->odd_even_mask = voodoo->render_threads - 1;
|
||||
@@ -1362,6 +1364,12 @@ static const device_config_t voodoo_config[] =
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dithersub",
|
||||
.description = "Dither subtraction",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dacfilter",
|
||||
.description = "Screen Filter",
|
||||
|
@@ -2622,6 +2622,12 @@ static const device_config_t banshee_sgram_config[] =
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dithersub",
|
||||
.description = "Dither subtraction",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dacfilter",
|
||||
.description = "Screen Filter",
|
||||
@@ -2673,6 +2679,12 @@ static const device_config_t banshee_sdram_config[] =
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dithersub",
|
||||
.description = "Dither subtraction",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "dacfilter",
|
||||
.description = "Screen Filter",
|
||||
|
@@ -1316,8 +1316,21 @@ static void voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, vood
|
||||
if (params->alphaMode & 1)
|
||||
ALPHA_TEST(src_a);
|
||||
|
||||
if (params->alphaMode & (1 << 4))
|
||||
if (params->alphaMode & (1 << 4)) {
|
||||
if (dithersub && !dither2x2 && voodoo->dithersub_enabled)
|
||||
{
|
||||
dest_r = dithersub_rb[dest_r][real_y & 3][x & 3];
|
||||
dest_g = dithersub_g [dest_g][real_y & 3][x & 3];
|
||||
dest_b = dithersub_rb[dest_b][real_y & 3][x & 3];
|
||||
}
|
||||
if (dithersub && dither2x2 && voodoo->dithersub_enabled)
|
||||
{
|
||||
dest_r = dithersub_rb2x2[dest_r][real_y & 1][x & 1];
|
||||
dest_g = dithersub_g2x2 [dest_g][real_y & 1][x & 1];
|
||||
dest_b = dithersub_rb2x2[dest_b][real_y & 1][x & 1];
|
||||
}
|
||||
ALPHA_BLEND(src_r, src_g, src_b, src_a);
|
||||
}
|
||||
|
||||
if (update)
|
||||
{
|
||||
|
Reference in New Issue
Block a user