Merge branch '86Box:master' into t1000rsx

This commit is contained in:
win2kgamer
2026-02-07 19:51:47 -06:00
committed by GitHub
15 changed files with 742 additions and 677 deletions

View File

@@ -273,7 +273,7 @@ memmap_state_update(headland_t *dev)
}
}
switch (ht_cr0) {
switch (ht_cr0 & 0x18) {
case 0x18:
if ((mem_size << 10) > 0xe0000) {
mem_set_mem_state(0x0e0000, 0x20000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);

View File

@@ -27,6 +27,11 @@
* -DANSI_CFG for use on these systems.
*/
#ifdef _WIN32
# include <ws2tcpip.h>
#else
# include <arpa/inet.h>
#endif
#include <inttypes.h>
#ifdef ENABLE_CONFIG_LOG
#include <stdarg.h>
@@ -886,6 +891,25 @@ load_network(void)
} else
strcpy(nc->host_dev_name, "none");
if (nc->net_type == NET_TYPE_SLIRP) {
sprintf(temp, "net_%02i_addr", c + 1);
p = ini_section_get_string(cat, temp, "");
if (p && *p) {
struct in_addr addr;
if (inet_pton(AF_INET, p, &addr)) {
uint8_t *bytes = (uint8_t *)&addr.s_addr;
bytes[3] = 0;
sprintf(nc->slirp_net, "%d.%d.%d.0", bytes[0], bytes[1], bytes[2]);
} else {
nc->slirp_net[0] = '\0';
}
} else {
nc->slirp_net[0] = '\0';
}
} else {
nc->slirp_net[0] = '\0';
}
sprintf(temp, "net_%02i_switch_group", c + 1);
nc->switch_group = ini_section_get_int(cat, temp, NET_SWITCH_GRP_MIN);
if (nc->switch_group < NET_SWITCH_GRP_MIN)
@@ -1458,7 +1482,7 @@ load_floppy_and_cdrom_drives(void)
int c;
int d;
int count = cdrom_get_type_count();
#ifndef DISABLE_FDD_AUDIO
fdd_audio_load_profiles();
#endif
@@ -1532,7 +1556,7 @@ load_floppy_and_cdrom_drives(void)
fdd_set_audio_profile(c, d);
#else
fdd_set_audio_profile(c, 0);
#endif
#endif
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
fdd_image_history[c][i] = (char *) calloc((MAX_IMAGE_PATH_LEN + 1) << 1, sizeof(char));
@@ -2987,6 +3011,14 @@ save_network(void)
else
ini_section_set_int(cat, temp, nc->link_state);
if (nc->net_type == NET_TYPE_SLIRP && nc->slirp_net[0] != '\0') {
sprintf(temp, "net_%02i_addr", c + 1);
ini_section_set_string(cat, temp, nc->slirp_net);
} else {
sprintf(temp, "net_%02i_addr", c + 1);
ini_section_delete_var(cat, temp);
}
sprintf(temp, "net_%02i_switch_group", c + 1);
if (nc->switch_group == NET_SWITCH_GRP_MIN)
ini_section_delete_var(cat, temp);

View File

@@ -2610,8 +2610,8 @@ ide_callback(void *priv)
err = ABRT_ERR;
else {
/* Only accept after RESET or DIAG. */
if (ide->params_specified) {
ide->cfg_spt = ide->tf->secount;
if (!ide->params_specified) {
ide->cfg_spt = (ide->tf->secount == 0) ? 256 : ide->tf->secount;
ide->cfg_hpc = ide->tf->head + 1;
ide->params_specified = 1;

View File

@@ -99,6 +99,7 @@ typedef struct netcard_conf_t {
uint32_t link_state;
uint8_t switch_group;
uint8_t promisc_mode;
char slirp_net[16];
char nrs_hostname[128];
} netcard_conf_t;

View File

@@ -28,27 +28,27 @@
#define LEDGER_PAGE_HEIGHT 17.0
/* Standard A0 */
#define A0_PAGE_WIDTH 33.125
#define A0_PAGE_HEIGHT 46.75
#define A0_PAGE_WIDTH 33.110236
#define A0_PAGE_HEIGHT 46.811023
/* Standard A1 */
#define A1_PAGE_WIDTH 23.375
#define A1_PAGE_HEIGHT 33.125
#define A1_PAGE_WIDTH 23.385826
#define A1_PAGE_HEIGHT 33.110236
/* Standard A2 */
#define A2_PAGE_WIDTH 16.5
#define A2_PAGE_HEIGHT 23.375
#define A2_PAGE_WIDTH 16.535433
#define A2_PAGE_HEIGHT 23.385826
/* Standard A3 */
#define A3_PAGE_WIDTH 11.75
#define A3_PAGE_HEIGHT 16.5
#define A3_PAGE_WIDTH 11.692913
#define A3_PAGE_HEIGHT 16.535433
/* Standard A4 */
#define A4_PAGE_WIDTH 8.25
#define A4_PAGE_HEIGHT 11.75
#define A4_PAGE_WIDTH 8.267716
#define A4_PAGE_HEIGHT 11.692913
/* Standard B4 */
#define B4_PAGE_WIDTH 9.875
#define B4_PAGE_HEIGHT 13.875
#define B4_PAGE_WIDTH 9.8425197
#define B4_PAGE_HEIGHT 13.897637
#endif /*EMU_PLAT_FALLTHROUGH_H*/

View File

@@ -352,8 +352,9 @@ extern void ati8514_out(uint16_t addr, uint8_t val, void *priv);
extern uint8_t ati8514_in(uint16_t addr, void *priv);
extern void ati8514_recalctimings(svga_t *svga);
extern uint8_t ati8514_mca_read(int port, void *priv);
extern uint8_t ati8514_rom_readb(uint32_t addr, void *priv);
extern uint16_t ati8514_rom_readw(uint32_t addr, void *priv);
extern uint8_t ati8514_bios_rom_readb(uint32_t addr, void *priv);
extern uint16_t ati8514_bios_rom_readw(uint32_t addr, void *priv);
extern uint32_t ati8514_bios_rom_readl(uint32_t addr, void *priv);
extern void ati8514_mca_write(int port, uint8_t val, void *priv);
extern void ati8514_pos_write(uint16_t port, uint8_t val, void *priv);
extern void ati8514_init(svga_t *svga, void *ext8514, void *dev8514);

View File

@@ -396,6 +396,8 @@ machine_at_tuliptc38_init(const machine_t *model)
device_add(&ide_isa_device);
device_add_params(&fdc37c6xx_device, (void *) (FDC37C651 | FDC37C6XX_IDE_PRI));
video_reset(gfxcard[0]);
if (gfxcard[0] == VID_INTERNAL) {
bios_load_aux_linear("roms/machines/tuliptc38/VBIOS.BIN",
0x000c0000, 32768, 0);

View File

@@ -311,6 +311,8 @@ machine_at_dell466np_init(const machine_t *model)
machine_at_common_init(model);
device_add(&sis_85c461_device);
video_reset(gfxcard[0]);
if (gfxcard[0] == VID_INTERNAL)
device_add(machine_get_vid_device(machine));
else {
@@ -354,6 +356,8 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
video_reset(gfxcard[0]);
if (gfxcard[0] != VID_INTERNAL) {
for (uint16_t i = 0; i < 32768; i++)
rom[i] = mem_readb_phys(0x000c0000 + i);

View File

@@ -490,6 +490,8 @@ machine_at_tg486g_init(const machine_t *model)
device_add_params(machine_get_kbc_device(machine), (void *) model->kbc_params);
video_reset(gfxcard[0]);
if (gfxcard[0] != VID_INTERNAL) {
for (uint16_t i = 0; i < 32768; i++)
rom[i] = mem_readb_phys(0x000c0000 + i);

View File

@@ -43,6 +43,7 @@
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <ws2tcpip.h>
#else
# include <poll.h>
#endif
@@ -493,13 +494,30 @@ net_slirp_init(const netcard_t *card, const uint8_t *mac_addr, UNUSED(void *priv
slirp->pfd = calloc(1, slirp->pfd_size);
#endif
/* Set the IP addresses to use. */
struct in_addr net = { .s_addr = htonl(0x0a000000 | (slirp_card_num << 8)) }; /* 10.0.x.0 */
struct in_addr mask = { .s_addr = htonl(0xffffff00) }; /* 255.255.255.0 */
struct in_addr host = { .s_addr = htonl(0x0a000002 | (slirp_card_num << 8)) }; /* 10.0.x.2 */
struct in_addr dhcp = { .s_addr = htonl(0x0a00000f | (slirp_card_num << 8)) }; /* 10.0.x.15 */
struct in_addr dns = { .s_addr = htonl(0x0a000003 | (slirp_card_num << 8)) }; /* 10.0.x.3 */
struct in_addr bind = { .s_addr = htonl(0x00000000) }; /* 0.0.0.0 */
struct in_addr net;
struct in_addr host;
struct in_addr dhcp;
struct in_addr dns;
/* Set the IP addresses to use.
Use a configured address if set, otherwise 10.0.x.0 */
const char *slirp_net = net_cards_conf[card->card_num].slirp_net;
if (slirp_net[0] != '\0') {
struct in_addr addr;
inet_pton(AF_INET, slirp_net, &addr);
net.s_addr = htonl(ntohl(addr.s_addr) & 0xffffff00);
host.s_addr = htonl(ntohl(addr.s_addr) + 2);
dhcp.s_addr = htonl(ntohl(addr.s_addr) + 15);
dns.s_addr = htonl(ntohl(addr.s_addr) + 3);
} else {
net.s_addr = htonl(0x0a000000 | (slirp_card_num << 8)); /* 10.0.x.0 */
host.s_addr = htonl(0x0a000002 | (slirp_card_num << 8)); /* 10.0.x.2 */
dhcp.s_addr = htonl(0x0a00000f | (slirp_card_num << 8)); /* 10.0.x.15 */
dns.s_addr = htonl(0x0a000003 | (slirp_card_num << 8)); /* 10.0.x.3 */
}
struct in_addr mask = { .s_addr = htonl(0xffffff00) }; /* 255.255.255.0 */
struct in_addr bind = { .s_addr = htonl(0x00000000) }; /* 0.0.0.0 */
const SlirpConfig slirp_config = {
#if SLIRP_CHECK_VERSION(4, 9, 0)

View File

@@ -151,8 +151,8 @@ enum {
/* Some helper macros. */
#define PARAM16(x) (dev->esc_parms[x + 1] * 256 + dev->esc_parms[x])
#define PIXX ((unsigned) floor(dev->curr_x * dev->dpi + 0.5))
#define PIXY ((unsigned) floor(dev->curr_y * dev->dpi + 0.5))
#define PIXX ((unsigned) round(dev->curr_x * dev->dpi))
#define PIXY ((unsigned) round(dev->curr_y * dev->dpi))
typedef struct psurface_t {
int8_t dirty; /* has the page been printed on? */
@@ -204,10 +204,11 @@ typedef struct escp_t {
/* bit graphics data */
uint16_t bg_h_density; /* in dpi */
uint16_t bg_v_density; /* in dpi */
int8_t bg_adjacent; /* print adjacent pixels (ignored) */
int8_t bg_adjacent; /* print adjacent pixels */
uint8_t bg_bytes_per_column;
uint16_t bg_remaining_bytes; /* #bytes left before img is complete */
uint8_t bg_column[6]; /* #bytes of the current and last col */
uint8_t bg_previous[6]; // for non-adjacent pixels in graphics mode
uint8_t bg_bytes_read; /* #bytes read so far for current col */
/* handshake data */
@@ -265,6 +266,8 @@ typedef struct escp_t {
uint8_t ctrl;
PALETTE palcol;
uint8_t auto_lf;
} escp_t;
/* Codepage table, needed for ESC t ( */
@@ -400,13 +403,11 @@ timeout_timer(void *priv)
static void
fill_palette(uint8_t redmax, uint8_t greenmax, uint8_t bluemax, uint8_t colorID, escp_t *dev)
{
uint8_t colormask;
const uint8_t colormask = colorID <<= 5;
double red = (double) redmax / (double) 30.9;
double green = (double) greenmax / (double) 30.9;
double blue = (double) bluemax / (double) 30.9;
colormask = colorID <<= 5;
const double red = (double) redmax / (double) 30.9;
const double green = (double) greenmax / (double) 30.9;
const double blue = (double) bluemax / (double) 30.9;
for (uint8_t i = 0; i < 32; i++) {
dev->palcol[i + colormask].r = 255 - (uint8_t) floor(red * (double) i);
@@ -540,7 +541,7 @@ init_codepage(escp_t *dev, uint16_t num)
static void
reset_printer(escp_t *dev)
{
dev->top_margin = dev->left_margin = 0.0;
dev->top_margin = dev->left_margin = 1.0 / 36.0;
dev->right_margin = dev->page_width;
switch (dev->paper_size) {
case PAPER_A4:
@@ -556,7 +557,7 @@ reset_printer(escp_t *dev)
default:
dev->page_height = LETTER_PAGE_HEIGHT;
}
dev->bottom_margin = dev->page_height;
dev->bottom_margin = dev->page_height - 1.0 / 36.0;
/* TODO: these should be configurable. */
dev->color = COLOR_BLACK;
dev->curr_x = dev->curr_y = 0.0;
@@ -775,6 +776,8 @@ setup_bit_image(escp_t *dev, uint8_t density, uint16_t num_columns)
escp_log("ESC/P: Unsupported bit image density %d.\n", density);
break;
}
for (uint8_t i = 0; i < dev->bg_bytes_per_column; ++i)
dev->bg_previous[i] = 0;
dev->bg_remaining_bytes = num_columns * dev->bg_bytes_per_column;
dev->bg_bytes_read = 0;
@@ -1749,7 +1752,7 @@ process_char(escp_t *dev, uint8_t ch)
case 0x0d: /* Carriage Return (CR) */
dev->curr_x = dev->left_margin;
if (!dev->autofeed)
if (!dev->autofeed && !dev->auto_lf)
return 1;
fallthrough;
@@ -1877,10 +1880,6 @@ draw_hline(escp_t *dev, unsigned from_x, unsigned to_x, unsigned y, int8_t broke
static void
print_bit_graph(escp_t *dev, uint8_t ch)
{
uint8_t pixel_w; /* width of the "pixel" */
uint8_t pixel_h; /* height of the "pixel" */
double old_y;
dev->bg_column[dev->bg_bytes_read++] = ch;
dev->bg_remaining_bytes--;
@@ -1888,16 +1887,18 @@ print_bit_graph(escp_t *dev, uint8_t ch)
if (dev->bg_bytes_read < dev->bg_bytes_per_column)
return;
old_y = dev->curr_y;
/* vertical density is how big the dot is
* (horziontal / vertical / 2) is how many middle points between two full dots are
* if horizontal < vertical, this means a column is printed multiple times
*/
uint8_t dot_size_x;
const uint8_t dot_size_y = round((double) dev->dpi / (double) dev->bg_v_density);
if (dev->bg_h_density < dev->bg_v_density)
dot_size_x = round((double) dev->dpi / (double) dev->bg_h_density);
else
dot_size_x = dot_size_y;
pixel_w = 1;
pixel_h = 1;
if (dev->bg_adjacent) {
/* if page DPI is bigger than bitgraphics DPI, drawn pixels get "bigger" */
pixel_w = dev->dpi / dev->bg_h_density > 0 ? dev->dpi / dev->bg_h_density : 1;
pixel_h = dev->dpi / dev->bg_v_density > 0 ? dev->dpi / dev->bg_v_density : 1;
}
const double old_y = dev->curr_y;
for (uint8_t i = 0; i < dev->bg_bytes_per_column; i++) {
/* for each byte */
@@ -1906,11 +1907,21 @@ print_bit_graph(escp_t *dev, uint8_t ch)
break;
/* for each bit */
if (dev->bg_column[i] & j) {
/* draw a "pixel" */
for (uint8_t xx = 0; xx < pixel_w; xx++) {
for (uint8_t yy = 0; yy < pixel_h; yy++) {
if (((PIXX + xx) < (unsigned) dev->page->w) && ((PIXY + yy) < (unsigned) dev->page->h))
*((uint8_t *) dev->page->pixels + (PIXX + xx) + (PIXY + yy) * dev->page->pitch) |= (dev->color | 0x1f);
if (!(dev->bg_adjacent) && (dev->bg_previous[i] & j)) {
dev->bg_column[i] &= ~j;
dev->curr_y += 1.0 / (double) dev->bg_v_density;
continue;
}
/* draw a dot */
for (uint8_t xx = 0; xx < dot_size_x; ++xx) {
if ((PIXX + xx) >= (unsigned) dev->page->w)
break;
for (uint8_t yy = 0; yy < dot_size_y; ++yy) {
if ((PIXY + yy) >= (unsigned) dev->page->h)
break;
*((uint8_t *) dev->page->pixels + (PIXX + xx) + (PIXY + yy) * dev->page->pitch) |= (dev->color | 0x1f);
}
}
}
@@ -1919,6 +1930,8 @@ print_bit_graph(escp_t *dev, uint8_t ch)
}
}
memcpy(dev->bg_previous, dev->bg_column, dev->bg_bytes_per_column * sizeof(uint8_t));
/* Mark page dirty. */
dev->page->dirty = 1;
@@ -2214,7 +2227,9 @@ escp_init(const device_t *info)
dev->page_height = LETTER_PAGE_HEIGHT;
}
dev->dpi = dev->lang >= LANG_ESCP ? 360 : 240;
dev->auto_lf = device_get_config_int("auto_lf");
dev->dpi = dev->lang >= LANG_ESCP ? 360 : 240;
/* Create 8-bit grayscale buffer for the page. */
dev->page = (psurface_t *) malloc(sizeof(psurface_t));
@@ -2225,14 +2240,13 @@ escp_init(const device_t *info)
memset(dev->page->pixels, 0x00, (size_t) dev->page->pitch * dev->page->h);
/* Initialize parameters. */
/* 0 = all white needed for logic 000 */
for (uint8_t i = 0; i < 32; i++) {
dev->palcol[i].r = 255;
dev->palcol[i].g = 255;
dev->palcol[i].b = 255;
}
/* 0 = all white needed for logic 000 */
fill_palette(0, 0, 0, 1, dev);
/* 1 = magenta* 001 */
fill_palette(0, 255, 0, 1, dev);
/* 2 = cyan* 010 */
@@ -2286,11 +2300,6 @@ escp_close(void *priv)
}
// clang-format off
#if 0
static const device_config_t lpt_prt_escp_config[] = {
{ .name = "", .description = "", .type = CONFIG_END }
};
#endif
static const device_config_t lpt_prt_escp_config[] = {
{
.name = "language",
@@ -2328,6 +2337,17 @@ static const device_config_t lpt_prt_escp_config[] = {
},
.bios = { { 0 } }
},
{
.name = "auto_lf",
.description = "Auto LF",
.type = CONFIG_BINARY,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = { { 0 } },
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
};
// clang-format on

View File

@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2025-11-29 00:34+0000\n"
"Last-Translator: OBattler <oubattler@gmail.com>\n"
"PO-Revision-Date: 2026-02-06 05:57+0000\n"
"Last-Translator: Jeffrey Hope <strangercoug@hotmail.com>\n"
"Language-Team: Spanish <https://weblate.86box.net/projects/86box/86box/es/>\n"
"Language: es-ES\n"
"MIME-Version: 1.0\n"
@@ -1108,7 +1108,7 @@ msgid "Not running"
msgstr "No en ejecución"
msgid "Running"
msgstr "En ejeución"
msgstr "En ejecución"
msgid "Paused"
msgstr "En pausa"

View File

@@ -45,7 +45,7 @@
# undef CLAMP
#endif
#define BIOS_MACH8_ROM_PATH "roms/video/mach8/11301113140_ROM.BIN"
#define BIOS_MACH8_ROM_PATH "roms/video/mach8/11301113140_4k.BIN"
static void ibm8514_accel_outb(uint16_t port, uint8_t val, void *priv);
static void ibm8514_accel_outw(uint16_t port, uint16_t val, void *priv);
@@ -1197,8 +1197,7 @@ ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat
old_mix_dat = mix_dat;
if (cmd != 0)
ibm8514_log("CMD=%d, full=%04x, pixcntl=%d, filling=%02x, ssvdraw=%02x.\n", cmd, dev->accel.cmd, pixcntl, dev->accel.multifunc[0x0a] & 0x06, dev->accel.ssv_draw);
ibm8514_log("CMD=%d, full=%04x, pixcntl=%d, filling=%02x, ssvdraw=%02x.\n", cmd, dev->accel.cmd, pixcntl, dev->accel.multifunc[0x0a] & 0x06, dev->accel.ssv_draw);
/*Bit 4 of the Command register is the draw yes bit, which enables writing to memory/reading from memory when enabled.
When this bit is disabled, no writing to memory/reading from memory is allowed. (This bit is almost meaningless on
@@ -1215,41 +1214,43 @@ ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat
(dev->accel.cy >= clip_t) &&
(dev->accel.cy <= clip_b)) {
dev->subsys_stat |= INT_GE_BSY;
switch ((mix_dat & mix_mask) ? frgd_mix : bkgd_mix) {
case 0:
src_dat = bkgd_color;
break;
case 1:
src_dat = frgd_color;
break;
case 2:
src_dat = cpu_dat;
break;
case 3:
src_dat = 0;
break;
if (ibm8514_cpu_src(svga) || !cpu_input) {
switch ((mix_dat & mix_mask) ? frgd_mix : bkgd_mix) {
case 0:
src_dat = bkgd_color;
break;
case 1:
src_dat = frgd_color;
break;
case 2:
src_dat = cpu_dat;
break;
case 3:
src_dat = 0;
break;
default:
break;
}
default:
break;
}
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
if ((compare_mode == 0) ||
((compare_mode == 0x10) && (dest_dat >= compare)) ||
((compare_mode == 0x18) && (dest_dat < compare)) ||
((compare_mode == 0x20) && (dest_dat != compare)) ||
((compare_mode == 0x28) && (dest_dat == compare)) ||
((compare_mode == 0x30) && (dest_dat <= compare)) ||
((compare_mode == 0x38) && (dest_dat > compare))) {
old_dest_dat = dest_dat;
MIX(mix_dat & mix_mask, dest_dat, src_dat);
dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask);
if (dev->accel.ssv_draw) {
if ((dev->accel.cmd & 0x04) && dev->accel.ssv_len) {
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
} else if (!(dev->accel.cmd & 0x04)) {
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
if ((compare_mode == 0) ||
((compare_mode == 0x10) && (dest_dat >= compare)) ||
((compare_mode == 0x18) && (dest_dat < compare)) ||
((compare_mode == 0x20) && (dest_dat != compare)) ||
((compare_mode == 0x28) && (dest_dat == compare)) ||
((compare_mode == 0x30) && (dest_dat <= compare)) ||
((compare_mode == 0x38) && (dest_dat > compare))) {
old_dest_dat = dest_dat;
MIX(mix_dat & mix_mask, dest_dat, src_dat);
dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask);
if (dev->accel.ssv_draw) {
if ((dev->accel.cmd & 0x04) && dev->accel.ssv_len) {
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
} else if (!(dev->accel.cmd & 0x04)) {
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
}
}
}
}
@@ -1837,20 +1838,7 @@ ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat
(dev->accel.cy >= clip_t) &&
(dev->accel.cy <= clip_b)) {
dev->subsys_stat |= INT_GE_BSY;
if (ibm8514_cpu_dest(svga) && (pixcntl == 0)) {
mix_dat = mix_mask; /* Mix data = forced to foreground register. */
} else if (ibm8514_cpu_dest(svga) && (pixcntl == 3)) {
/* Mix data = current video memory value. */
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, mix_dat);
mix_dat = ((mix_dat & rd_mask) == rd_mask);
mix_dat = mix_dat ? mix_mask : 0;
}
if (ibm8514_cpu_dest(svga)) {
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, src_dat);
if (pixcntl == 3)
src_dat = ((src_dat & rd_mask) == rd_mask);
} else
if (ibm8514_cpu_src(svga) || !cpu_input) {
switch ((mix_dat & mix_mask) ? frgd_mix : bkgd_mix) {
case 0:
src_dat = bkgd_color;
@@ -1869,21 +1857,18 @@ ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat
break;
}
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
READ((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
if ((compare_mode == 0) ||
((compare_mode == 0x10) && (dest_dat >= compare)) ||
((compare_mode == 0x18) && (dest_dat < compare)) ||
((compare_mode == 0x20) && (dest_dat != compare)) ||
((compare_mode == 0x28) && (dest_dat == compare)) ||
((compare_mode == 0x30) && (dest_dat <= compare)) ||
((compare_mode == 0x38) && (dest_dat > compare))) {
old_dest_dat = dest_dat;
MIX(mix_dat & mix_mask, dest_dat, src_dat);
dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask);
if ((dev->accel.cmd & 0x04) && dev->accel.sy) {
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
} else if (!(dev->accel.cmd & 0x04)) {
if ((compare_mode == 0) ||
((compare_mode == 0x10) && (dest_dat >= compare)) ||
((compare_mode == 0x18) && (dest_dat < compare)) ||
((compare_mode == 0x20) && (dest_dat != compare)) ||
((compare_mode == 0x28) && (dest_dat == compare)) ||
((compare_mode == 0x30) && (dest_dat <= compare)) ||
((compare_mode == 0x38) && (dest_dat > compare))) {
old_dest_dat = dest_dat;
MIX(mix_dat & mix_mask, dest_dat, src_dat);
dest_dat = (dest_dat & wrt_mask) | (old_dest_dat & ~wrt_mask);
WRITE((dev->accel.cy * dev->pitch) + dev->accel.cx, dest_dat);
}
}
@@ -4038,10 +4023,8 @@ ibm8514_vblank_start(void *priv)
static void *
ibm8514_init(const device_t *info)
{
FILE *fp;
uint8_t *rom_load = NULL;
uint32_t bios_addr = 0;
uint16_t bios_rom_eeprom = 0x0000;
uint32_t bios_addr;
if (svga_get_pri() == NULL)
return NULL;
@@ -4067,37 +4050,34 @@ ibm8514_init(const device_t *info)
dev->bpp = 0;
dev->extensions = device_get_config_int("extensions");
bios_addr = device_get_config_hex20("bios_addr");
dev->bios_addr = device_get_config_hex20("bios_addr");
if (dev->type & DEVICE_MCA)
bios_addr = 0xc6800;
dev->bios_addr = 0xc6800;
switch (dev->extensions) {
case ATI:
if (rom_present(BIOS_MACH8_ROM_PATH)) {
mach_t * mach = (mach_t *) calloc(1, sizeof(mach_t));
svga->ext8514 = mach;
fp = rom_fopen(BIOS_MACH8_ROM_PATH, "rb");
if (bios_addr & 0x800)
(void) fseek(fp, 0x000, SEEK_SET);
else
(void) fseek(fp, 0x800, SEEK_SET);
bios_addr = dev->bios_addr;
rom_load = malloc(0x2000);
(void) !fread(rom_load, 0x2000, 1, fp);
(void) fclose(fp);
memset(&dev->bios_rom, 0x00, sizeof(rom_t));
dev->bios_rom.rom = malloc(0x2000);
memset(dev->bios_rom.rom, 0xff, 0x2000);
dev->bios_rom.rom = rom_load;
(void) rom_load_linear(BIOS_MACH8_ROM_PATH, bios_addr, 0x2000, 0x0000, dev->bios_rom.rom + (bios_addr & 0x0800));
dev->bios_rom.sz = 0x2000;
dev->bios_rom.mask = 0x1fff;
mem_mapping_add(&dev->bios_rom.mapping, bios_addr, 0x2000,
ati8514_rom_readb, ati8514_rom_readw, NULL,
mem_mapping_add(&dev->bios_rom.mapping, bios_addr, dev->bios_rom.sz,
ati8514_bios_rom_readb, ati8514_bios_rom_readw, ati8514_bios_rom_readl,
NULL, NULL, NULL,
dev->bios_rom.rom, MEM_MAPPING_EXTERNAL | MEM_MAPPING_ROM_WS, dev);
ati8514_init(svga, svga->ext8514, svga->dev8514);
if (dev->type & DEVICE_MCA) {
dev->accel.scratch0 = (((bios_addr >> 7) - 0x1000) >> 4);
dev->accel.scratch0 |= ((dev->accel.scratch0 + 0x01) << 8);
bios_rom_eeprom = dev->accel.scratch0;
mach->accel.scratch0 = (((dev->bios_addr >> 7) - 0x1000) >> 4);
mach->accel.scratch0 |= ((mach->accel.scratch0 + 0x01) << 8);
bios_rom_eeprom = mach->accel.scratch0;
dev->pos_regs[0] = 0x88;
dev->pos_regs[1] = 0x80;
mach->eeprom.data[1] = bios_rom_eeprom;
@@ -4105,8 +4085,9 @@ ibm8514_init(const device_t *info)
ati_eeprom_load_mach8(&mach->eeprom, "ati8514_mca.nvr", 1);
mem_mapping_disable(&dev->bios_rom.mapping);
} else {
dev->accel.scratch0 = ((bios_addr >> 7) - 0x1000) >> 4;
dev->accel.scratch0 |= ((dev->accel.scratch0 + 0x01) << 8);
mach->accel.scratch0 = ((dev->bios_addr >> 7) - 0x1000) >> 4;
mach->accel.scratch0 |= ((mach->accel.scratch0 + 0x01) << 8);
ibm8514_log("Scratch0 init val=%04x, bios=%06x, base=%06x.\n", mach->accel.scratch0, dev->bios_addr, dev->bios_rom.mapping.base);
ati_eeprom_load_mach8(&mach->eeprom, "ati8514.nvr", 0);
}
break;

File diff suppressed because it is too large Load Diff

View File

@@ -814,6 +814,7 @@ svga_recalctimings(svga_t *svga)
svga->render = svga_render_2bpp_highres;
} else {
svga->map8 = svga->pallook;
svga_log("Map8.\n");
if (svga->lowres) { /*Low res (320)*/
svga->render = svga_render_8bpp_lowres;
svga_log("8 bpp low res.\n");