Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into novell_keycard
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Feb 29, 2024
2 parents 96e34f9 + 0c345fd commit 8bb4778
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cpu/x86seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ taskswitch286(uint16_t seg, uint16_t *segdat, int is32)
ldt.base |= (readmemb(0, templ + 7) << 24);
}

if (!(new_cs & 0xfff8)) {
if (!(new_cs & 0xfff8) && !(new_cs & 0x0004)) {
x86ts(NULL, 0);
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/device/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,10 @@ serial_read(uint16_t addr, void *priv)
serial_update_ints(dev);
break;
case 6:
ret = dev->msr | dev->msr_set;
if (dev->mctrl & 0x10)
ret = dev->msr;
else
ret = dev->msr | dev->msr_set;
dev->msr &= ~0x0f;
dev->int_status &= ~SERIAL_INT_MSR;
serial_update_ints(dev);
Expand Down
3 changes: 2 additions & 1 deletion src/network/net_pcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,9 @@ static int
ladr_match(nic_t *dev, const uint8_t *buf, UNUSED(size_t size))
{
const struct ether_header *hdr = (const struct ether_header *) buf;
uint64_t *p = (uint64_t *) &dev->aCSR[8];

if ((hdr->ether_dhost[0] & 0x01) && ((uint64_t *) &dev->aCSR[8])[0] != 0LL) {
if ((hdr->ether_dhost[0] & 0x01) && p[0] != 0LL) {
int index;
uint8_t ladr[8];
ladr[0] = dev->aCSR[8] & 0xff;
Expand Down
11 changes: 11 additions & 0 deletions src/video/vid_mga.c
Original file line number Diff line number Diff line change
Expand Up @@ -6016,6 +6016,17 @@ mystique_hwcursor_draw(svga_t *svga, int displine)
}
break;

case XCURCTRL_CURMODE_XWIN:
for (uint8_t x = 0; x < 64; x++) {
if ((dat[1] & (1ULL << 63)))
svga->monitor->target_buffer->line[displine][(offset + svga->x_add) & 2047] = (dat[0] & (1ULL << 63)) ? (mystique->cursor.col[1]) : (mystique->cursor.col[0]);

offset++;
dat[0] <<= 1;
dat[1] <<= 1;
}
break;

default:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions src/video/vid_voodoo_banshee.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ banshee_render_16bpp_tiled(svga_t *svga)
else
addr = banshee->desktop_addr + (banshee->desktop_y & 31) * 128 + ((banshee->desktop_y >> 5) * banshee->desktop_stride_tiled);

if (addr >= svga->vram_max)
return;

for (int x = 0; x <= svga->hdisp; x += 64) {
if (svga->hwcursor_on || svga->overlay_on)
svga->changedvram[addr >> 12] = 2;
Expand Down
48 changes: 48 additions & 0 deletions src/video/vid_voodoo_banshee_blitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ PLOT(voodoo_t *voodoo, int x, int y, int pat_x, int pat_y, uint8_t pattern_mask,
uint32_t dest = voodoo->vram[addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern8[(pat_x & 7) + (pat_y & 7) * 8];

if (addr > voodoo->fb_mask)
break;

voodoo->vram[addr] = MIX(voodoo, dest, src, pattern, src_colorkey, COLORKEY_8);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -226,6 +229,9 @@ PLOT(voodoo_t *voodoo, int x, int y, int pat_x, int pat_y, uint8_t pattern_mask,
uint32_t dest = *(uint16_t *) &voodoo->vram[addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern16[(pat_x & 7) + (pat_y & 7) * 8];

if (addr > voodoo->fb_mask)
break;

*(uint16_t *) &voodoo->vram[addr] = MIX(voodoo, dest, src, pattern, src_colorkey, COLORKEY_16);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -236,6 +242,9 @@ PLOT(voodoo_t *voodoo, int x, int y, int pat_x, int pat_y, uint8_t pattern_mask,
uint32_t dest = *(uint32_t *) &voodoo->vram[addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern24[(pat_x & 7) + (pat_y & 7) * 8];

if (addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[addr] = (MIX(voodoo, dest, src, pattern, src_colorkey, COLORKEY_32) & 0xffffff) | (dest & 0xff000000);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -246,6 +255,9 @@ PLOT(voodoo_t *voodoo, int x, int y, int pat_x, int pat_y, uint8_t pattern_mask,
uint32_t dest = *(uint32_t *) &voodoo->vram[addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[addr] = MIX(voodoo, dest, src, pattern, src_colorkey, COLORKEY_32);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -265,6 +277,9 @@ PLOT_LINE(voodoo_t *voodoo, int x, int y, UNUSED(uint8_t rop), uint32_t pattern,
uint32_t addr = get_addr(voodoo, x, y, 0, 0); //(voodoo->banshee_blt.dstBaseAddr + x + y*voodoo->banshee_blt.dst_stride) & voodoo->fb_mask;
uint32_t dest = voodoo->vram[addr];

if (addr > voodoo->fb_mask)
break;

voodoo->vram[addr] = MIX(voodoo, dest, voodoo->banshee_blt.colorFore, pattern, src_colorkey, COLORKEY_8);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -274,6 +289,9 @@ PLOT_LINE(voodoo_t *voodoo, int x, int y, UNUSED(uint8_t rop), uint32_t pattern,
uint32_t addr = get_addr(voodoo, x * 2, y, 0, 0); //(voodoo->banshee_blt.dstBaseAddr + x*2 + y*voodoo->banshee_blt.dst_stride) & voodoo->fb_mask;
uint32_t dest = *(uint16_t *) &voodoo->vram[addr];

if (addr > voodoo->fb_mask)
break;

*(uint16_t *) &voodoo->vram[addr] = MIX(voodoo, dest, voodoo->banshee_blt.colorFore, pattern, src_colorkey, COLORKEY_16);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -283,6 +301,9 @@ PLOT_LINE(voodoo_t *voodoo, int x, int y, UNUSED(uint8_t rop), uint32_t pattern,
uint32_t addr = get_addr(voodoo, x * 3, y, 0, 0); //(voodoo->banshee_blt.dstBaseAddr + x*3 + y*voodoo->banshee_blt.dst_stride) & voodoo->fb_mask;
uint32_t dest = *(uint32_t *) &voodoo->vram[addr];

if (addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[addr] = (MIX(voodoo, dest, voodoo->banshee_blt.colorFore, pattern, src_colorkey, COLORKEY_32) & 0xffffff) | (dest & 0xff000000);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand All @@ -292,6 +313,9 @@ PLOT_LINE(voodoo_t *voodoo, int x, int y, UNUSED(uint8_t rop), uint32_t pattern,
uint32_t addr = get_addr(voodoo, x * 4, y, 0, 0); //(voodoo->banshee_blt.dstBaseAddr + x*4 + y*voodoo->banshee_blt.dst_stride) & voodoo->fb_mask;
uint32_t dest = *(uint32_t *) &voodoo->vram[addr];

if (addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[addr] = MIX(voodoo, dest, voodoo->banshee_blt.colorFore, pattern, src_colorkey, COLORKEY_32);
voodoo->changedvram[addr >> 12] = changeframecount;
break;
Expand Down Expand Up @@ -573,6 +597,9 @@ do_screen_to_screen_line(voodoo_t *voodoo, uint8_t *src_p, int use_x_dir, int sr
uint32_t dest = voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern8[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_8, COLORKEY_8);
voodoo->changedvram[dst_addr >> 12] = changeframecount;
break;
Expand All @@ -584,6 +611,9 @@ do_screen_to_screen_line(voodoo_t *voodoo, uint8_t *src_p, int use_x_dir, int sr
uint32_t dest = *(uint16_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern16[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint16_t *) &voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_16, COLORKEY_16);
voodoo->changedvram[dst_addr >> 12] = changeframecount;
break;
Expand All @@ -595,6 +625,9 @@ do_screen_to_screen_line(voodoo_t *voodoo, uint8_t *src_p, int use_x_dir, int sr
uint32_t dest = *(uint32_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern24[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[dst_addr] = (MIX(voodoo, dest, src, pattern, COLORKEY_32, COLORKEY_32) & 0xffffff) | (dest & 0xff000000);
voodoo->changedvram[dst_addr >> 12] = changeframecount;
break;
Expand All @@ -606,6 +639,9 @@ do_screen_to_screen_line(voodoo_t *voodoo, uint8_t *src_p, int use_x_dir, int sr
uint32_t dest = *(uint32_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : voodoo->banshee_blt.colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_32, COLORKEY_32);
voodoo->changedvram[dst_addr >> 12] = changeframecount;
break;
Expand Down Expand Up @@ -904,6 +940,9 @@ do_screen_to_screen_stretch_line(voodoo_t *voodoo, uint8_t *src_p, int src_x, in
uint32_t dest = voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_8, COLORKEY_8);
#if 0
bansheeblt_log("%i,%i : sdp=%02x,%02x,%02x res=%02x\n", voodoo->banshee_blt.cur_x, voodoo->banshee_blt.cur_y, src, dest, pattern, voodoo->vram[dst_addr]);
Expand All @@ -918,6 +957,9 @@ do_screen_to_screen_stretch_line(voodoo_t *voodoo, uint8_t *src_p, int src_x, in
uint32_t dest = *(uint16_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint16_t *) &voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_16, COLORKEY_16);
#if 0
bansheeblt_log("%i,%i : sdp=%02x,%02x,%02x res=%02x\n", voodoo->banshee_blt.cur_x, voodoo->banshee_blt.cur_y, src, dest, pattern, *(uint16_t *)&voodoo->vram[dst_addr]);
Expand All @@ -932,6 +974,9 @@ do_screen_to_screen_stretch_line(voodoo_t *voodoo, uint8_t *src_p, int src_x, in
uint32_t dest = *(uint32_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[dst_addr] = (MIX(voodoo, dest, src, pattern, COLORKEY_32, COLORKEY_32) & 0xffffff) | (*(uint32_t *) &voodoo->vram[dst_addr] & 0xff000000);
#if 0
bansheeblt_log("%i,%i : sdp=%02x,%02x,%02x res=%02x\n", voodoo->banshee_blt.cur_x, voodoo->banshee_blt.cur_y, src, dest, pattern, voodoo->vram[dst_addr]);
Expand All @@ -946,6 +991,9 @@ do_screen_to_screen_stretch_line(voodoo_t *voodoo, uint8_t *src_p, int src_x, in
uint32_t dest = *(uint32_t *) &voodoo->vram[dst_addr];
uint32_t pattern = (voodoo->banshee_blt.command & COMMAND_PATTERN_MONO) ? ((pattern_mask & (1 << (7 - (pat_x & 7)))) ? voodoo->banshee_blt.colorFore : voodoo->banshee_blt.colorBack) : colorPattern[(pat_x & 7) + (pat_y & 7) * 8];

if (dst_addr > voodoo->fb_mask)
break;

*(uint32_t *) &voodoo->vram[dst_addr] = MIX(voodoo, dest, src, pattern, COLORKEY_32, COLORKEY_32);
#if 0
bansheeblt_log("%i,%i : sdp=%02x,%02x,%02x res=%02x\n", voodoo->banshee_blt.cur_x, voodoo->banshee_blt.cur_y, src, dest, pattern, voodoo->vram[dst_addr]);
Expand Down
4 changes: 3 additions & 1 deletion src/video/vid_voodoo_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *
void
voodoo_triangle(voodoo_t *voodoo, voodoo_params_t *params, int odd_even)
{
voodoo_state_t state;
voodoo_state_t state = { 0 };
int vertexAy_adjusted;
int vertexCy_adjusted;
int dx;
Expand All @@ -1406,6 +1406,8 @@ voodoo_triangle(voodoo_t *voodoo, voodoo_params_t *params, int odd_even)
int LOD;
int lodbias;

state.dx1 = state.dx2 = 0;

voodoo->tri_count++;

dx = 8 - (params->vertexAx & 0xf);
Expand Down

0 comments on commit 8bb4778

Please sign in to comment.