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. diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index de429ef3e..6614a2883 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 f0aa632d7..45308bfd4 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -239,6 +239,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 }, diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index 1003907c3..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"; @@ -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; } 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