# Conflicts:
#	src/cpu/cpu_table.c
This commit is contained in:
RichardG867
2020-11-18 19:57:10 -03:00
8 changed files with 51 additions and 43 deletions

View File

@@ -1858,5 +1858,5 @@ const cpu_legacy_machine_t cpu_legacy_table[] = {
{"p6bap", cputables_Celeron_Cyrix3}, {"p6bap", cputables_Celeron_Cyrix3},
{"603tcf", cputables_Celeron_Cyrix3}, {"603tcf", cputables_Celeron_Cyrix3},
{"vpc2007", cputables_PentiumIID_Celeron}, {"vpc2007", cputables_PentiumIID_Celeron},
{NULL, NULL} {NULL, {NULL}}
}; };

View File

@@ -2664,7 +2664,7 @@ s3_accel_in(uint16_t port, void *p)
wake_fifo_thread(s3); wake_fifo_thread(s3);
temp = 0; temp = 0;
if ((s3->chip >= S3_86C928) && s3_enable_fifo(s3)) { if ((s3->chip >= S3_86C928) && s3_enable_fifo(s3)) {
if (!FIFO_EMPTY || s3->busy || s3->force_busy) if (!FIFO_EMPTY || s3->force_busy)
temp |= 0x02; /*Hardware busy*/ temp |= 0x02; /*Hardware busy*/
else else
temp |= 0x04; /*FIFO empty*/ temp |= 0x04; /*FIFO empty*/

View File

@@ -139,7 +139,9 @@ void voodoo_recalc(voodoo_t *voodoo)
if (voodoo->fbiInit1 & (1 << 24)) if (voodoo->fbiInit1 & (1 << 24))
voodoo->block_width += 32; voodoo->block_width += 32;
voodoo->row_width = voodoo->block_width * 32 * 2; voodoo->row_width = voodoo->block_width * 32 * 2;
voodoo->params.row_width = voodoo->row_width;
voodoo->aux_row_width = voodoo->row_width; voodoo->aux_row_width = voodoo->row_width;
voodoo->params.aux_row_width = voodoo->aux_row_width;
} }
@@ -450,7 +452,9 @@ static void voodoo_writel(uint32_t addr, uint32_t val, void *p)
case SST_swapbufferCMD: case SST_swapbufferCMD:
voodoo->cmd_written++; voodoo->cmd_written++;
thread_wait_mutex(voodoo->swap_mutex);
voodoo->swap_count++; voodoo->swap_count++;
thread_release_mutex(voodoo->swap_mutex);
if (voodoo->fbiInit7 & FBIINIT7_CMDFIFO_ENABLE) if (voodoo->fbiInit7 & FBIINIT7_CMDFIFO_ENABLE)
return; return;
voodoo_queue_command(voodoo, addr | FIFO_WRITEL_REG, val); voodoo_queue_command(voodoo, addr | FIFO_WRITEL_REG, val);
@@ -531,7 +535,9 @@ static void voodoo_writel(uint32_t addr, uint32_t val, void *p)
if ((voodoo->fbiInit1 & FBIINIT1_VIDEO_RESET) && !(val & FBIINIT1_VIDEO_RESET)) if ((voodoo->fbiInit1 & FBIINIT1_VIDEO_RESET) && !(val & FBIINIT1_VIDEO_RESET))
{ {
voodoo->line = 0; voodoo->line = 0;
thread_wait_mutex(voodoo->swap_mutex);
voodoo->swap_count = 0; voodoo->swap_count = 0;
thread_release_mutex(voodoo->swap_mutex);
voodoo->retrace_count = 0; voodoo->retrace_count = 0;
} }
voodoo->fbiInit1 = (val & ~5) | (voodoo->fbiInit1 & 5); voodoo->fbiInit1 = (val & ~5) | (voodoo->fbiInit1 & 5);

View File

@@ -43,6 +43,9 @@
#include <86box/vid_voodoo_render.h> #include <86box/vid_voodoo_render.h>
static video_timings_t timing_banshee = {VIDEO_BUS, 2, 2, 1, 20, 20, 21};
#ifdef CLAMP #ifdef CLAMP
#undef CLAMP #undef CLAMP
#endif #endif
@@ -656,7 +659,7 @@ static void banshee_ext_outl(uint16_t addr, uint32_t val, void *p)
break; break;
case Video_hwCurLoc: case Video_hwCurLoc:
banshee->hwCurLoc = val; banshee->hwCurLoc = val;
svga->hwcursor.x = (val & 0x7ff) - 32; svga->hwcursor.x = (val & 0x7ff) - 64;
svga->hwcursor.y = ((val >> 16) & 0x7ff) - 64; svga->hwcursor.y = ((val >> 16) & 0x7ff) - 64;
if (svga->hwcursor.y < 0) if (svga->hwcursor.y < 0)
{ {
@@ -1307,7 +1310,9 @@ static void banshee_reg_writel(uint32_t addr, uint32_t val, void *p)
break; break;
case SST_swapPending: case SST_swapPending:
thread_wait_mutex(voodoo->swap_mutex);
voodoo->swap_count++; voodoo->swap_count++;
thread_release_mutex(voodoo->swap_mutex);
// voodoo->cmd_written++; // voodoo->cmd_written++;
break; break;
@@ -1602,7 +1607,7 @@ void banshee_hwcursor_draw(svga_t *svga, int displine)
/*X11 mode*/ /*X11 mode*/
for (x = 0; x < 64; x += 8) for (x = 0; x < 64; x += 8)
{ {
if (x_off > (32-8)) if (x_off > -8)
{ {
for (xx = 0; xx < 8; xx++) for (xx = 0; xx < 8; xx++)
{ {
@@ -1622,7 +1627,7 @@ void banshee_hwcursor_draw(svga_t *svga, int displine)
/*Windows mode*/ /*Windows mode*/
for (x = 0; x < 64; x += 8) for (x = 0; x < 64; x += 8)
{ {
if (x_off > (32-8)) if (x_off > -8)
{ {
for (xx = 0; xx < 8; xx++) for (xx = 0; xx < 8; xx++)
{ {
@@ -1671,10 +1676,11 @@ void banshee_hwcursor_draw(svga_t *svga, int displine)
{ \ { \
int c; \ int c; \
int wp = 0; \ int wp = 0; \
uint32_t base_addr = buf ? src_addr2 : src_addr; \
\ \
for (c = 0; c < voodoo->overlay.overlay_bytes; c += 2) \ for (c = 0; c < voodoo->overlay.overlay_bytes; c += 2) \
{ \ { \
uint16_t data = *(uint16_t *)&src[(c & 127) + (c >> 7)*128*32]; \ uint16_t data = *(uint16_t *)&svga->vram[(base_addr + (c & 127) + (c >> 7)*128*32) & svga->vram_mask]; \
int r = data & 0x1f; \ int r = data & 0x1f; \
int g = (data >> 5) & 0x3f; \ int g = (data >> 5) & 0x3f; \
int b = data >> 11; \ int b = data >> 11; \
@@ -1970,7 +1976,8 @@ static void banshee_overlay_draw(svga_t *svga, int displine)
!(banshee->vidProcCfg & VIDPROCCFG_H_SCALE_ENABLE) && !(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_4X4) && !(banshee->vidProcCfg & VIDPROCCFG_H_SCALE_ENABLE) && !(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_4X4) &&
!(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_2X2)); !(banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_DITHER_2X2));
else else
skip_filtering = ((banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_MASK) != VIDPROCCFG_FILTER_MODE_BILINEAR); skip_filtering = ((banshee->vidProcCfg & VIDPROCCFG_FILTER_MODE_MASK) != VIDPROCCFG_FILTER_MODE_BILINEAR &&
!(banshee->vidProcCfg & VIDPROCCFG_H_SCALE_ENABLE));
if (skip_filtering) if (skip_filtering)
{ {
@@ -2246,11 +2253,13 @@ static void banshee_vsync_callback(svga_t *svga)
voodoo_t *voodoo = banshee->voodoo; voodoo_t *voodoo = banshee->voodoo;
voodoo->retrace_count++; voodoo->retrace_count++;
thread_wait_mutex(voodoo->swap_mutex);
if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval)) if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval))
{ {
if (voodoo->swap_count > 0) if (voodoo->swap_count > 0)
voodoo->swap_count--; voodoo->swap_count--;
voodoo->swap_pending = 0; voodoo->swap_pending = 0;
thread_release_mutex(voodoo->swap_mutex);
memset(voodoo->dirty_line, 1, sizeof(voodoo->dirty_line)); memset(voodoo->dirty_line, 1, sizeof(voodoo->dirty_line));
voodoo->retrace_count = 0; voodoo->retrace_count = 0;
@@ -2258,6 +2267,8 @@ static void banshee_vsync_callback(svga_t *svga)
thread_set_event(voodoo->wake_fifo_thread); thread_set_event(voodoo->wake_fifo_thread);
voodoo->frame_count++; voodoo->frame_count++;
} }
else
thread_release_mutex(voodoo->swap_mutex);
voodoo->overlay.src_y = 0; voodoo->overlay.src_y = 0;
banshee->desktop_addr = banshee->vidDesktopStartAddr; banshee->desktop_addr = banshee->vidDesktopStartAddr;
@@ -2616,6 +2627,8 @@ static void *banshee_init_common(const device_t *info, wchar_t *fn, int has_sgra
ddc_init(); ddc_init();
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_banshee);
return banshee; return banshee;
} }

View File

@@ -525,7 +525,7 @@ void voodoo_callback(void *p)
if (draw_voodoo->dirty_line[draw_line]) if (draw_voodoo->dirty_line[draw_line])
{ {
uint32_t *p = &((uint32_t *)buffer32->line[voodoo->line])[32]; uint32_t *p = &buffer32->line[voodoo->line + 8][8];
uint16_t *src = (uint16_t *)&draw_voodoo->fb_mem[draw_voodoo->front_offset + draw_line*draw_voodoo->row_width]; uint16_t *src = (uint16_t *)&draw_voodoo->fb_mem[draw_voodoo->front_offset + draw_line*draw_voodoo->row_width];
int x; int x;
@@ -539,6 +539,10 @@ void voodoo_callback(void *p)
if (voodoo->line > voodoo->dirty_line_high) if (voodoo->line > voodoo->dirty_line_high)
voodoo->dirty_line_high = voodoo->line; voodoo->dirty_line_high = voodoo->line;
/* Draw left overscan. */
for (x = 0; x < 8; x++)
buffer32->line[voodoo->line + 8][x] = 0x00000000;
if (voodoo->scrfilter && voodoo->scrfilterEnabled) if (voodoo->scrfilter && voodoo->scrfilterEnabled)
{ {
uint8_t fil[(voodoo->h_disp) * 3]; /* interleaved 24-bit RGB */ uint8_t fil[(voodoo->h_disp) * 3]; /* interleaved 24-bit RGB */
@@ -560,6 +564,10 @@ void voodoo_callback(void *p)
p[x] = draw_voodoo->video_16to32[src[x]]; p[x] = draw_voodoo->video_16to32[src[x]];
} }
} }
/* Draw right overscan. */
for (x = 0; x < 8; x++)
buffer32->line[voodoo->line + 8][voodoo->h_disp + x + 8] = 0x00000000;
} }
} }
} }
@@ -574,6 +582,7 @@ skip_draw:
{ {
voodoo_t *voodoo_1 = voodoo->set->voodoos[1]; voodoo_t *voodoo_1 = voodoo->set->voodoos[1];
thread_wait_mutex(voodoo->swap_mutex);
/*Only swap if both Voodoos are waiting for buffer swap*/ /*Only swap if both Voodoos are waiting for buffer swap*/
if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval) && if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval) &&
voodoo_1->swap_pending && (voodoo_1->retrace_count > voodoo_1->swap_interval)) voodoo_1->swap_pending && (voodoo_1->retrace_count > voodoo_1->swap_interval))
@@ -591,6 +600,7 @@ skip_draw:
if (voodoo_1->swap_count > 0) if (voodoo_1->swap_count > 0)
voodoo_1->swap_count--; voodoo_1->swap_count--;
voodoo_1->swap_pending = 0; voodoo_1->swap_pending = 0;
thread_release_mutex(voodoo->swap_mutex);
thread_set_event(voodoo->wake_fifo_thread); thread_set_event(voodoo->wake_fifo_thread);
thread_set_event(voodoo_1->wake_fifo_thread); thread_set_event(voodoo_1->wake_fifo_thread);
@@ -598,22 +608,28 @@ skip_draw:
voodoo->frame_count++; voodoo->frame_count++;
voodoo_1->frame_count++; voodoo_1->frame_count++;
} }
else
thread_release_mutex(voodoo->swap_mutex);
} }
} }
else else
{ {
thread_wait_mutex(voodoo->swap_mutex);
if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval)) if (voodoo->swap_pending && (voodoo->retrace_count > voodoo->swap_interval))
{ {
voodoo->front_offset = voodoo->swap_offset; voodoo->front_offset = voodoo->swap_offset;
if (voodoo->swap_count > 0) if (voodoo->swap_count > 0)
voodoo->swap_count--; voodoo->swap_count--;
voodoo->swap_pending = 0; voodoo->swap_pending = 0;
thread_release_mutex(voodoo->swap_mutex);
memset(voodoo->dirty_line, 1, 1024); memset(voodoo->dirty_line, 1, 1024);
voodoo->retrace_count = 0; voodoo->retrace_count = 0;
thread_set_event(voodoo->wake_fifo_thread); thread_set_event(voodoo->wake_fifo_thread);
voodoo->frame_count++; voodoo->frame_count++;
} }
else
thread_release_mutex(voodoo->swap_mutex);
} }
voodoo->v_retrace = 1; voodoo->v_retrace = 1;
} }

View File

@@ -134,6 +134,7 @@ void voodoo_wait_for_swap_complete(voodoo_t *voodoo)
thread_wait_event(voodoo->wake_fifo_thread, -1); thread_wait_event(voodoo->wake_fifo_thread, -1);
thread_reset_event(voodoo->wake_fifo_thread); thread_reset_event(voodoo->wake_fifo_thread);
thread_wait_mutex(voodoo->swap_mutex);
if ((voodoo->swap_pending && voodoo->flush) || FIFO_FULL) if ((voodoo->swap_pending && voodoo->flush) || FIFO_FULL)
{ {
/*Main thread is waiting for FIFO to empty, so skip vsync wait and just swap*/ /*Main thread is waiting for FIFO to empty, so skip vsync wait and just swap*/
@@ -142,8 +143,11 @@ void voodoo_wait_for_swap_complete(voodoo_t *voodoo)
if (voodoo->swap_count > 0) if (voodoo->swap_count > 0)
voodoo->swap_count--; voodoo->swap_count--;
voodoo->swap_pending = 0; voodoo->swap_pending = 0;
thread_release_mutex(voodoo->swap_mutex);;
break; break;
} }
else
thread_release_mutex(voodoo->swap_mutex);;
} }
} }

View File

@@ -100,8 +100,10 @@ void voodoo_reg_writel(uint32_t addr, uint32_t val, void *p)
if (!(val & 1)) if (!(val & 1))
{ {
banshee_set_overlay_addr(voodoo->p, voodoo->leftOverlayBuf); banshee_set_overlay_addr(voodoo->p, voodoo->leftOverlayBuf);
thread_wait_mutex(voodoo->swap_mutex);
if (voodoo->swap_count > 0) if (voodoo->swap_count > 0)
voodoo->swap_count--; voodoo->swap_count--;
thread_release_mutex(voodoo->swap_mutex);
voodoo->frame_count++; voodoo->frame_count++;
} }
else if (TRIPLE_BUFFER) else if (TRIPLE_BUFFER)
@@ -146,8 +148,10 @@ void voodoo_reg_writel(uint32_t addr, uint32_t val, void *p)
{ {
memset(voodoo->dirty_line, 1, sizeof(voodoo->dirty_line)); memset(voodoo->dirty_line, 1, sizeof(voodoo->dirty_line));
voodoo->front_offset = voodoo->params.front_offset; voodoo->front_offset = voodoo->params.front_offset;
thread_wait_mutex(voodoo->swap_mutex);
if (voodoo->swap_count > 0) if (voodoo->swap_count > 0)
voodoo->swap_count--; voodoo->swap_count--;
thread_release_mutex(voodoo->swap_mutex);
} }
else if (TRIPLE_BUFFER) else if (TRIPLE_BUFFER)
{ {

View File

@@ -3126,13 +3126,6 @@ win_settings_hard_disks_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPar
lv1_current_sel = get_selected_hard_disk(hdlg); lv1_current_sel = get_selected_hard_disk(hdlg);
if (lv1_current_sel == old_sel) if (lv1_current_sel == old_sel)
return FALSE; return FALSE;
else if (lv1_current_sel == -1) {
ignore_change = 1;
lv1_current_sel = old_sel;
settings_listview_select(hdlg, IDC_LIST_HARD_DISKS, lv1_current_sel);
ignore_change = 0;
return FALSE;
}
ignore_change = 1; ignore_change = 1;
settings_set_cur_sel(hdlg, IDC_COMBO_HD_BUS, temp_hdd[lv1_current_sel].bus - 1); settings_set_cur_sel(hdlg, IDC_COMBO_HD_BUS, temp_hdd[lv1_current_sel].bus - 1);
recalc_location_controls(hdlg, 0, 0); recalc_location_controls(hdlg, 0, 0);
@@ -4209,13 +4202,6 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam
lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_FLOPPY_DRIVES); lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_FLOPPY_DRIVES);
if (lv1_current_sel == old_sel) if (lv1_current_sel == old_sel)
return FALSE; return FALSE;
else if (lv1_current_sel == -1) {
ignore_change = 1;
lv1_current_sel = old_sel;
settings_listview_select(hdlg, IDC_LIST_FLOPPY_DRIVES, lv1_current_sel);
ignore_change = 0;
return FALSE;
}
ignore_change = 1; ignore_change = 1;
settings_set_cur_sel(hdlg, IDC_COMBO_FD_TYPE, temp_fdd_types[lv1_current_sel]); settings_set_cur_sel(hdlg, IDC_COMBO_FD_TYPE, temp_fdd_types[lv1_current_sel]);
settings_set_check(hdlg, IDC_CHECKTURBO, temp_fdd_turbo[lv1_current_sel]); settings_set_check(hdlg, IDC_CHECKTURBO, temp_fdd_turbo[lv1_current_sel]);
@@ -4226,13 +4212,6 @@ win_settings_floppy_and_cdrom_drives_proc(HWND hdlg, UINT message, WPARAM wParam
lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES); lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_CDROM_DRIVES);
if (lv2_current_sel == old_sel) if (lv2_current_sel == old_sel)
return FALSE; return FALSE;
else if (lv2_current_sel == -1) {
ignore_change = 1;
lv2_current_sel = old_sel;
settings_listview_select(hdlg, IDC_LIST_CDROM_DRIVES, lv2_current_sel);
ignore_change = 0;
return FALSE;
}
ignore_change = 1; ignore_change = 1;
switch (temp_cdrom[lv2_current_sel].bus_type) { switch (temp_cdrom[lv2_current_sel].bus_type) {
@@ -4407,13 +4386,6 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_MO_DRIVES); lv1_current_sel = get_selected_drive(hdlg, IDC_LIST_MO_DRIVES);
if (lv1_current_sel == old_sel) if (lv1_current_sel == old_sel)
return FALSE; return FALSE;
else if (lv1_current_sel == -1) {
ignore_change = 1;
lv1_current_sel = old_sel;
settings_listview_select(hdlg, IDC_LIST_MO_DRIVES, lv1_current_sel);
ignore_change = 0;
return FALSE;
}
ignore_change = 1; ignore_change = 1;
switch (temp_mo_drives[lv1_current_sel].bus_type) { switch (temp_mo_drives[lv1_current_sel].bus_type) {
@@ -4437,13 +4409,6 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_ZIP_DRIVES); lv2_current_sel = get_selected_drive(hdlg, IDC_LIST_ZIP_DRIVES);
if (lv2_current_sel == old_sel) if (lv2_current_sel == old_sel)
return FALSE; return FALSE;
else if (lv2_current_sel == -1) {
ignore_change = 1;
lv2_current_sel = old_sel;
settings_listview_select(hdlg, IDC_LIST_ZIP_DRIVES, lv2_current_sel);
ignore_change = 0;
return FALSE;
}
ignore_change = 1; ignore_change = 1;
switch (temp_zip_drives[lv2_current_sel].bus_type) { switch (temp_zip_drives[lv2_current_sel].bus_type) {