From 125b77ece554e878c98921a5dcbb4f49071835f1 Mon Sep 17 00:00:00 2001 From: tiseno100 <58827426+tiseno100@users.noreply.github.com> Date: Tue, 14 Apr 2020 21:56:34 +0300 Subject: [PATCH 1/5] Added the Micronics M6MI --- src/include/86box/machine.h | 1 + src/machine/m_at_socket8.c | 29 +++++++++++++++++++++++++++++ src/machine/machine_table.c | 1 + 3 files changed, 31 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index de7f0d82d..f8c19b471 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -312,6 +312,7 @@ extern const device_t *at_pb640_get_device(void); /* m_at_socket8.c */ extern int machine_at_i440fx_init(const machine_t *); extern int machine_at_s1668_init(const machine_t *); +extern int machine_at_m6mi_init(const machine_t *); /* m_at_slot1.c */ extern int machine_at_6bxc_init(const machine_t *); diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index 70ba64a4f..cd60dd91d 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -100,3 +100,32 @@ machine_at_s1668_init(const machine_t *model) return ret; } + +int +machine_at_m6mi_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/m6mi/M6MI05.ROM", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); + device_add(&i440fx_device); + device_add(&piix3_device); + device_add(&keyboard_ps2_ami_pci_device); + device_add(&fdc37c935_device); + device_add(&intel_flash_bxt_device); + + return ret; +} \ No newline at end of file diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 5cb5300f2..eb1139e93 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -240,6 +240,7 @@ const machine_t machines[] = { { "[Socket 8 FX] Tyan Titan-Pro AT", "440fx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_i440fx_init, NULL }, { "[Socket 8 FX] Tyan Titan-Pro ATX", "tpatx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_s1668_init, NULL }, + { "[Socket 8 FX] Micronics M6MI", "m6mi", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 127, machine_at_m6mi_init, NULL }, { "[Slot 1 BX] Gigabyte GA-6BXC", "6bxc", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 768, 8, 255, machine_at_6bxc_init, NULL }, { "[Slot 1 BX] ASUS P2B-LS", "p2bls", {{"Intel", cpus_PentiumII}, {"Intel/PGA370", cpus_Celeron},{"VIA", cpus_Cyrix3},{"", NULL},{"", NULL}}, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 1024, 8, 255, machine_at_p2bls_init, NULL }, From d9bc0756580b2cf03d24108d20a08e5290e37481 Mon Sep 17 00:00:00 2001 From: Daniel Gurney Date: Wed, 15 Apr 2020 13:04:02 +0300 Subject: [PATCH 2/5] Readme wording fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a51b889ee..9defdb0d2 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ guide: 6. Run `make -jN -f win/makefile.mingw` to start the actual compilation process. Substitute `N` with the number of threads you want to use for the compilation process. The optimal number depends entirely on your processor, and it is - up to you to determine the optimal number. A good starting point is the total + up to you to determine it. A good starting point is the total number of threads (AKA Logical Processors) you have available. 7. If the compilation succeeded (which it almost always should), you will find `86Box.exe` in the src directory. From cf581db7ab6f5cc08a36bfed732b1f0b7295ea7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 15 Apr 2020 23:42:20 +0200 Subject: [PATCH 3/5] prt_ps: Rewrite non-printable character processing Should fix hangs and slowdowns during printing. --- src/printer/prt_ps.c | 60 ++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index 1003907c3..ffbcdddff 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -246,45 +246,39 @@ ps_write_data(uint8_t val, void *p) dev->data = (char) val; } -static bool -process_nonprintable(ps_t *dev) -{ - switch (dev->data) { - case '\b': - dev->buffer_pos--; - break; - case '\r': - dev->buffer_pos = 0; - if (dev->autofeed) - write_buffer(dev, true); - break; - case '\v': - case '\f': - case '\n': - write_buffer(dev, true); - break; - case 0x04: // Ctrl+D - write_buffer(dev, false); - finish_document(dev); - break; - - /* Characters that should be written to the buffer as-is */ - case '\t': - return false; - } - - return true; -} - static void process_data(ps_t *dev) { + /* Check for non-printable characters */ if (dev->data < 0x20 || dev->data == 0x7F) { - if (process_nonprintable(dev)) - return; + switch (dev->data) { + /* The following characters are considered white-space + by the PostScript specification */ + case '\t': + case '\n': + case '\f': + case '\r': + break; + + /* Same with NUL, except we better change it to a space first */ + case '\0': + dev->data = ' '; + break; + + /* Ctrl+D (0x04) marks the end of the document */ + case '\4': + write_buffer(dev, false); + finish_document(dev); + return; + + /* Don't bother with the others */ + default: + return; + } } - if (dev->buffer_pos == POSTSCRIPT_BUFFER_LENGTH) { + /* Flush the buffer if we have run to its end */ + if (dev->buffer_pos == POSTSCRIPT_BUFFER_LENGTH - 1) { write_buffer(dev, false); dev->buffer_pos = 0; } From ef9fc196ed072bd205752b2c999c1e9d67c38168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 15 Apr 2020 23:46:11 +0200 Subject: [PATCH 4/5] prt_ps: Re-add error message for missing gsdll32 --- src/win/86Box.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/win/86Box.rc b/src/win/86Box.rc index f1416f3f9..30a8edfa2 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -915,6 +915,7 @@ BEGIN IDS_2120 "Unable to initialize SDL, SDL2.dll is required" IDS_2121 "Are you sure you want to hard reset the emulated machine?" IDS_2122 "Are you sure you want to quit 86Box?" + IDS_2123 "Unable to initialize Ghostscript, gsdll32.dll is required for automatic convertion of PostScript files to PDF.\n\nAny documents sent to the generic PostScript printer will be saved as PostScript files (.ps)." IDS_2124 "MO %i (%03i): %ls" IDS_2125 "MO images (*.IM?)\0*.IM?\0All files (*.*)\0*.*\0" END From 8b230b7371ecdaa68c65edf064b9aed37fa7041b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 15 Apr 2020 23:47:30 +0200 Subject: [PATCH 5/5] prt_ps: Fix two dots in PDF extension --- src/printer/prt_ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index ffbcdddff..8057213eb 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -140,7 +140,7 @@ convert_to_pdf(ps_t *dev) output_fn[0] = 0; wcscat(output_fn, input_fn); - wcscpy(output_fn + wcslen(output_fn) - 3, L".pdf"); + wcscpy(output_fn + wcslen(output_fn) - 4, L".pdf"); gsargv[0] = L""; gsargv[1] = L"-dNOPAUSE";