diff --git a/README.md b/README.md index 87b06018c..3dcf0f3a6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,13 @@ System requirements and recommendations Performance may vary depending on both host and guest configuration. Most emulation logic is executed in a single thread, therefore generally systems with better IPC (instructions per clock) should be able to emulate higher clock speeds. -It is also recommended to use the [86Box Manager](https://github.com/86Box/86BoxManager) by [daviunic](https://github.com/daviunic) (Overdoze) to manage virtual machines. However, it is also possible to use 86Box on its own with the `--vmpath`/`-P` command line option. +It is also recommended to use a manager application with 86Box for easier handling of multiple virtual machines. +* [WinBox for 86Box](https://github.com/laciba96/WinBox-for-86Box) by [Laci bá'](https://github.com/laciba96) + * The new manager with improved new user experience; installer, automatic updates of emulator files and more. +* [86Box Manager](https://github.com/86Box/86BoxManager) by [daviunic](https://github.com/daviunic) (Overdoze) + * The traditional 86Box manager with simple interface. + +However, it is also possible to use 86Box on its own with the `--vmpath`/`-P` command line option. Downloads --------- @@ -52,7 +58,7 @@ We operate an IRC channel and a Discord server for discussing 86Box, its develop Licensing --------- -86Box is released under the [GNU General Public License, version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) only. For more information, see the `COPYING` file in the root of the repository. +86Box is released under the [GNU General Public License, version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) or later. For more information, see the `COPYING` file in the root of the repository. The emulator can also optionally make use of [munt](https://github.com/munt/munt), [FluidSynth](https://www.fluidsynth.org/), [Ghostscript](https://www.ghostscript.com/) and [Discord Game SDK](https://discord.com/developers/docs/game-sdk/sdk-starter-guide), which are distributed under their respective licenses. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9926a8a6..ec001a963 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,15 +9,32 @@ # CMake build script. # # Authors: David Hrdlička, +# dob205 # # Copyright 2020,2021 David Hrdlička. +# Copyright 2021 dob205. # -# WIN32 marks us as a GUI app on Windows -add_executable(86Box WIN32 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c - dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c - device.c nvr.c nvr_at.c nvr_ps2.c) +# Prepare the macOS app bundle icon depending on the release channel +if(RELEASE_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/release/86Box.icns) +elseif(BETA_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/beta/86Box.icns) +elseif(ALPHA_BUILD) + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/dev/86Box.icns) +else() + set(APP_ICON_MACOSX ${CMAKE_CURRENT_SOURCE_DIR}/mac/icons/branch/86Box.icns) +endif() +set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources") + +# WIN32 marks us as a GUI app on Windows +# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon +add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c + dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c + device.c nvr.c nvr_at.c nvr_ps2.c ${APP_ICON_MACOSX}) + if(NEW_DYNAREC) add_compile_definitions(USE_NEW_DYNAREC) endif() @@ -63,13 +80,41 @@ if(MINGW) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dll.a") endif() +#some macOS specific configuration steps if(APPLE) - # Force using the newest library if it's installed by homebrew - set(CMAKE_FIND_FRAMEWORK LAST) + # Force using the newest library if it's installed by homebrew + set(CMAKE_FIND_FRAMEWORK LAST) + + # prepare stuff for macOS app bundles + set(CMAKE_MACOSX_BUNDLE 1) + + # setting our compilation target to macOS Mojave (macOS version 10.14), can be eventually changed to macOS 10.13 High Sierra + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") + + # set the Info.plist properly + set_target_properties(86Box PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist.in) + set(MACOSX_BUNDLE_GUI_IDENTIFIER net.86Box.86Box) + set(MACOSX_BUNDLE_BUNDLE_NAME 86Box) + set(MACOSX_BUNDLE_BUNDLE_VERSION 3.0) + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "3.0") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "3.0.0") + set(MACOSX_BUNDLE_ICON_FILE 86Box.icns) + set(MACOSX_BUNDLE_INFO_STRING "A emulator of old computers") + set(MACOSX_BUNDLE_COPYRIGHT "© 2007-2021 Sarah Walker, Miran Grča, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others") + + + # preparing the code signing for easier distribution, Apple dev certificate needed at one point + #set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES") + #set(XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") + #set(XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/mac/codesign/dev/app.entitlements) + endif() find_package(Freetype REQUIRED) include_directories(${FREETYPE_INCLUDE_DIRS}) +if(APPLE) + target_link_libraries(86Box Freetype::Freetype) # bundles freetype for the macOS app bundle +endif() find_package(OpenAL REQUIRED) include_directories(${OPENAL_INCLUDE_DIR}) @@ -119,7 +164,23 @@ if(MINITRACE) target_link_libraries(86Box minitrace) endif() -install(TARGETS 86Box) +if(APPLE) + install(TARGETS 86Box DESTINATION "bin") +else() + install(TARGETS 86Box) +endif() + + +# adjustments for macOS app bundles +if(APPLE) + set(APPS ${CMAKE_CURRENT_BINARY_DIR}/86Box.app) + install(CODE " + include(InstallRequiredSystemLibraries) + include(BundleUtilities) + fixup_bundle(\"${APPS}\" \"\" \"\")" + COMPONENT Runtime) +endif() + if(VCPKG_TOOLCHAIN) x_vcpkg_install_local_dependencies(TARGETS 86Box DESTINATION "bin") endif() diff --git a/src/config.c b/src/config.c index ec7cd7660..1df24e749 100644 --- a/src/config.c +++ b/src/config.c @@ -2333,9 +2333,8 @@ save_machine(void) else config_set_string(cat, "fpu_type", (char *) fpu_get_internal_name(cpu_f, cpu, fpu_type)); - if (mem_size == 4096) + //Write the mem_size explicitly to the setttings in order to help managers to display it without having the actual machine table config_delete_var(cat, "mem_size"); - else config_set_int(cat, "mem_size", mem_size); config_set_int(cat, "cpu_use_dynarec", cpu_use_dynarec); diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index f8016793a..72f79940b 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -497,7 +497,7 @@ fdd_load(int drive, char *fn) while (loaders[c].ext) { if (!strcasecmp(p, (char *) loaders[c].ext) && (size == loaders[c].size || loaders[c].size == -1)) { driveloaders[drive] = c; - strcpy(floppyfns[drive], fn); + if (floppyfns[drive] != fn) strcpy(floppyfns[drive], fn); d86f_setup(drive); loaders[c].load(drive, floppyfns[drive]); drive_empty[drive] = 0; diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 079463214..a986456d9 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -129,6 +129,7 @@ extern void do_start(void); extern void do_stop(void); /* Internal platform support functions. */ +extern int has_language_changed(int id); extern void set_language(int id); extern int get_vidpause(void); extern void show_cursor(int); diff --git a/src/mac/Info.plist.in b/src/mac/Info.plist.in new file mode 100644 index 000000000..e06b17ecf --- /dev/null +++ b/src/mac/Info.plist.in @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + NSPrincipalClass + NSApplication + NSHighResolutionCapable + True + + diff --git a/src/mac/icons/beta/86Box.icns b/src/mac/icons/beta/86Box.icns new file mode 100644 index 000000000..0068beeda Binary files /dev/null and b/src/mac/icons/beta/86Box.icns differ diff --git a/src/mac/icons/branch/86Box.icns b/src/mac/icons/branch/86Box.icns new file mode 100644 index 000000000..a2631c66e Binary files /dev/null and b/src/mac/icons/branch/86Box.icns differ diff --git a/src/mac/icons/dev/86Box.icns b/src/mac/icons/dev/86Box.icns new file mode 100644 index 000000000..5ff137b55 Binary files /dev/null and b/src/mac/icons/dev/86Box.icns differ diff --git a/src/mac/icons/release/86Box.icns b/src/mac/icons/release/86Box.icns new file mode 100644 index 000000000..4f15661ed Binary files /dev/null and b/src/mac/icons/release/86Box.icns differ diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index a5c9732cf..5077b3ea3 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -420,14 +420,14 @@ const machine_t machines[] = { /* Has an ALi M5042 keyboard controller with Phoenix MultiKey/42 v1.40 firmware. */ { "[ALi M1489] ESA TF-486", "tf-486", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_tf_486_init, NULL }, /* Has IBM PS/2 Type 1 KBC firmware. */ - { "[OPTi 802G] IBM PC 330 (type 6573)", "pc330_6573", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3_PC330, 0, 25000000, 33333333, 0, 0, 2.0, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_pc330_6573_init, NULL }, + { "[OPTi 802G] IBM PC 330 (type 6573)", "pc330_6573", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3_PC330, 0, 25000000, 33333333, 0, 0, 2.0, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 1024, 65536, 1024, 127, machine_at_pc330_6573_init, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[i420EX] ASUS PVI-486AP4", "486ap4", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_486ap4_init, NULL }, + { "[i420EX] ASUS PVI-486AP4", "486ap4", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_486ap4_init, NULL }, /* This has the Phoenix MultiKey KBC firmware. */ { "[i420EX] Intel Classic/PCI ED", "ninja", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 131072, 1024, 127, machine_at_ninja_init, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. Also has a SST 29EE010 Flash chip. */ - { "[i420ZX] ASUS PCI/I-486SP3G", "486sp3g", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, machine_at_486sp3g_init, NULL }, + { "[i420ZX] ASUS PCI/I-486SP3G", "486sp3g", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, machine_at_486sp3g_init, NULL }, /* I'm going to assume this as an AMIKey-2 like the other two 486SP3's. */ { "[i420TX] ASUS PCI/I-486SP3", "486sp3", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL | MACHINE_SCSI, 1024, 131072, 1024, 127, machine_at_486sp3_init, NULL }, /* This has the Phoenix MultiKey KBC firmware. */ @@ -437,7 +437,7 @@ const machine_t machines[] = { /* This has a standalone AMI Megakey 1993, which is type 'P'. */ { "[IMS 8848] Tekram G486IP", "g486ip", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, machine_at_g486ip_init, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 496] ASUS PVI-486SP3C", "486sp3c", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_486sp3c_init, NULL }, + { "[SiS 496] ASUS PVI-486SP3C", "486sp3c", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCIV | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_486sp3c_init, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ { "[SiS 496] Lucky Star LS-486E", "ls486e", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 131072, 1024, 255, machine_at_ls486e_init, NULL }, /* The BIOS does not send a single non-standard KBC command, so it has a standard PS/2 KBC. */ @@ -449,7 +449,7 @@ const machine_t machines[] = { { "[SiS 496] Soyo 4SA2", "4sa2", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4sa2_init, NULL }, /* According to MrKsoft, his real 4DPS has an AMIKey-2, which is an updated version of type 'H'. */ - { "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4dps_init, NULL }, + { "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1024, 261120, 1024, 255, machine_at_4dps_init, NULL }, /* This has the UMC 88xx on-chip KBC. */ { "[UMC 888x] A-Trend ATC-1415", "atc1415", MACHINE_TYPE_486_S3, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_PCI | MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, machine_at_atc1415_init, NULL }, /* This has an AMIKey-2, which is an updated version of type 'H'. */ @@ -517,7 +517,7 @@ const machine_t machines[] = { /* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the PS/2 "Load Security" meaning), most likely MegaKey as it sends command AF (Set Extended Controller RAM) just like the later Intel AMI BIOS'es. */ - { "[OPTi 597] AMI Excalibur VLB", "excalibur", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_VLB | MACHINE_IDE, 2048, 65536, 2048, 127, machine_at_excalibur_init, NULL }, + { "[OPTi 597] AMI Excalibur VLB", "excalibur", MACHINE_TYPE_SOCKET4, CPU_PKG_SOCKET4, 0, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_VLB | MACHINE_BUS_PS2 | MACHINE_IDE, 2048, 65536, 2048, 127, machine_at_excalibur_init, NULL }, /* OPTi 596/597/822 */ /* This has AMIKey 'F' KBC firmware. */ @@ -603,7 +603,7 @@ const machine_t machines[] = { Super I/O chip (that has the KBC firmware on it) as eg. the Advanced/EV. */ { "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, machine_at_pb640_init, at_pb640_get_device }, /* Has an AMI 'H' KBC firmware (1992). */ - { "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_WINCHIP, CPU_WINCHIP2, CPU_Cx6x86, CPU_Cx6x86L, CPU_Cx6x86MX), 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_fmb_init, NULL }, + { "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, CPU_PKG_SOCKET5_7, CPU_BLOCK(CPU_WINCHIP, CPU_WINCHIP2, CPU_Cx6x86, CPU_Cx6x86L, CPU_Cx6x86MX), 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_fmb_init, NULL }, /* 430HX */ /* I can't determine what KBC firmware this has, but given that the Acer V35N and diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 4956f7742..62fd8f310 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -1703,24 +1703,17 @@ es1371_poll(void *p) But if anything sets MIDI Input and Output together we'd have to take account of the MIDI Output case, and disable IRQ's and RX bits when MIDI Input is enabled as well but not in the MIDI Output portion */ - if (dev->uart_ctrl & UART_CTRL_TXINTEN) - dev->int_status |= INT_STATUS_UART; - else - dev->int_status &= ~INT_STATUS_UART; + dev->int_status &= ~INT_STATUS_UART; + dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY); } else if (!(dev->uart_ctrl & UART_CTRL_RXINTEN) && ((dev->uart_ctrl & UART_CTRL_TXINTEN))) { /* Or enable the UART IRQ and the respective TX bits only when the MIDI Output is enabled */ dev->int_status |= INT_STATUS_UART; + } else { + dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY); } - if (dev->uart_ctrl & UART_CTRL_RXINTEN) { - if (dev->uart_ctrl & UART_CTRL_TXINTEN) - dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY); - else - dev->uart_status &= ~(UART_STATUS_TXINT | UART_STATUS_TXRDY); - } else - dev->uart_status |= (UART_STATUS_TXINT | UART_STATUS_TXRDY); - + audiopci_log("UART control = %02x\n", dev->uart_ctrl & (UART_CTRL_RXINTEN | UART_CTRL_TXINTEN)); es1371_update_irqs(dev); } diff --git a/src/sound/snd_opl.c b/src/sound/snd_opl.c index 7708a3b59..6cd31f608 100644 --- a/src/sound/snd_opl.c +++ b/src/sound/snd_opl.c @@ -108,12 +108,10 @@ timer_control(opl_t *dev, int tmr, int start) timer_on_auto(&dev->timers[tmr], (tmr == 1) ? 320.0 : 80.0); } else { opl_log("Timer %i stopped\n", tmr); - if (!(dev->flags & FLAG_OPL3)) { - if (tmr == 1) { - dev->status &= ~STAT_TMR2_OVER; - } else - dev->status &= ~STAT_TMR1_OVER; - } + if (tmr == 1) { + dev->status &= ~STAT_TMR2_OVER; + } else + dev->status &= ~STAT_TMR1_OVER; } } diff --git a/src/unix/unix_thread.c b/src/unix/unix_thread.c index d95c337d1..f045d2820 100644 --- a/src/unix/unix_thread.c +++ b/src/unix/unix_thread.c @@ -101,11 +101,7 @@ thread_wait_event(event_t *handle, int timeout) event_pthread_t *event = (event_pthread_t *)handle; struct timespec abstime; -#ifdef HAS_TIMESPEC_GET - timespec_get(&abstime, TIME_UTC); -#else clock_gettime(CLOCK_REALTIME, &abstime); -#endif abstime.tv_nsec += (timeout % 1000) * 1000000; abstime.tv_sec += (timeout / 1000); if (abstime.tv_nsec > 1000000000) { diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 62e41a566..f4384b459 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -169,7 +169,7 @@ et4000w32p_out(uint16_t addr, uint8_t val, void *p) uint32_t add2addr = 0; if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) - addr ^= 0x60; + addr ^= 0x60; switch (addr) { case 0x3c2: @@ -311,7 +311,7 @@ et4000w32p_in(uint16_t addr, void *p) svga_t *svga = &et4000->svga; if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) - addr ^= 0x60; + addr ^= 0x60; switch (addr) { case 0x3c5: @@ -335,13 +335,25 @@ et4000w32p_in(uint16_t addr, void *p) case 0x3d5: return svga->crtc[svga->crtcreg]; + case 0x3da: + svga->attrff = 0; + + /*Bit 1 of the Input Status Register is required by OS/2 ET4000W32/I drivers to be set otherwise + the guest will loop infinitely upon reaching the GUI*/ + if (svga->cgastat & 0x01) + svga->cgastat &= ~0x32; + else + svga->cgastat ^= 0x32; + return svga->cgastat; + case 0x210a: case 0x211a: case 0x212a: case 0x213a: case 0x214a: case 0x215a: case 0x216a: case 0x217a: return et4000->index; - case 0x210B: case 0x211B: case 0x212B: case 0x213B: - case 0x214B: case 0x215B: case 0x216B: case 0x217B: - if (et4000->index == 0xec) + case 0x210B: case 0x211B: case 0x212B: case 0x213B: + case 0x214B: case 0x215B: case 0x216B: case 0x217B: + if (et4000->index == 0xec) { return (et4000->regs[0xec] & 0xf) | (et4000->rev << 4); + } if (et4000->index == 0xee) { if (svga->bpp == 8) { if ((svga->gdcreg[5] & 0x60) >= 0x40) @@ -764,7 +776,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p) svga_t *svga = &et4000->svga; int bank; uint8_t temp; - + switch (addr & 0x6000) { case 0x0000: /* MMU 0 */ case 0x2000: /* MMU 1 */ @@ -786,7 +798,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p) if ((addr&0x1fff) + et4000->mmu.base[bank] >= svga->vram_max) return 0xff; - + return svga->vram[(addr&0x1fff) + et4000->mmu.base[bank]]; case 0x6000: @@ -892,7 +904,10 @@ et4000w32_blit_start(et4000w32p_t *et4000) } et4000->acl.pattern_back = et4000->acl.pattern_addr; if (!(et4000->acl.internal.pattern_wrap & 0x40)) { - et4000->acl.pattern_y = (et4000->acl.pattern_addr / (et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7] + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.pattern_wrap >> 4) & 7] - 1); + if ((et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7] + 1) == 0x00) + et4000->acl.pattern_y = (et4000->acl.pattern_addr / (0x7f + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.pattern_wrap >> 4) & 7] - 1); + else + et4000->acl.pattern_y = (et4000->acl.pattern_addr / (et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7] + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.pattern_wrap >> 4) & 7] - 1); et4000->acl.pattern_back &= ~(((et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7] + 1) * et4000w32_wrap_y[(et4000->acl.internal.pattern_wrap >> 4) & 7]) - 1); } et4000->acl.pattern_x_back = et4000->acl.pattern_x; @@ -905,7 +920,10 @@ et4000w32_blit_start(et4000w32p_t *et4000) et4000->acl.source_back = et4000->acl.source_addr; if (!(et4000->acl.internal.source_wrap & 0x40)) { - et4000->acl.source_y = (et4000->acl.source_addr / (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.source_wrap >> 4) & 7] - 1); + if ((et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1) == 0x00) + et4000->acl.source_y = (et4000->acl.source_addr / (0x7f + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.source_wrap >> 4) & 7] - 1); + else + et4000->acl.source_y = (et4000->acl.source_addr / (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1)) & (et4000w32_wrap_y[(et4000->acl.internal.source_wrap >> 4) & 7] - 1); et4000->acl.source_back &= ~(((et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1) * et4000w32_wrap_y[(et4000->acl.internal.source_wrap >> 4) & 7]) - 1); } et4000->acl.source_x_back = et4000->acl.source_x; @@ -1658,7 +1676,7 @@ static const device_config_t et4000w32p_config[] = const device_t et4000w32_device = { - "Tseng Labs ET4000/w32", + "Tseng Labs ET4000/w32 ISA", DEVICE_ISA | DEVICE_AT, ET4000W32, et4000w32p_init, et4000w32p_close, NULL, { et4000w32_available }, @@ -1669,7 +1687,7 @@ const device_t et4000w32_device = const device_t et4000w32_onboard_device = { - "Tseng Labs ET4000/w32 (On-board)", + "Tseng Labs ET4000/w32 (ISA) (On-Board)", DEVICE_ISA | DEVICE_AT, ET4000W32, et4000w32p_init, et4000w32p_close, NULL, { et4000w32_available }, @@ -1680,7 +1698,7 @@ const device_t et4000w32_onboard_device = const device_t et4000w32i_isa_device = { - "Tseng Labs ET4000/w32i ISA", + "Tseng Labs ET4000/w32i Rev. B ISA", DEVICE_ISA | DEVICE_AT, ET4000W32I, et4000w32p_init, et4000w32p_close, NULL, { et4000w32i_isa_available }, @@ -1691,7 +1709,7 @@ const device_t et4000w32i_isa_device = const device_t et4000w32i_vlb_device = { - "Tseng Labs ET4000/w32i VLB", + "Tseng Labs ET4000/w32i Rev. B VLB", DEVICE_VLB, ET4000W32I, et4000w32p_init, et4000w32p_close, NULL, { et4000w32i_vlb_available }, @@ -1724,7 +1742,7 @@ const device_t et4000w32p_revc_pci_device = const device_t et4000w32p_noncardex_vlb_device = { - "Tseng Labs ET4000/w32p VLB", + "Tseng Labs ET4000/w32p Rev. D VLB", DEVICE_VLB, ET4000W32P, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_noncardex_available }, @@ -1735,7 +1753,7 @@ const device_t et4000w32p_noncardex_vlb_device = const device_t et4000w32p_noncardex_pci_device = { - "Tseng Labs ET4000/w32p PCI", + "Tseng Labs ET4000/w32p Rev. D PCI", DEVICE_PCI, ET4000W32P, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_noncardex_available }, @@ -1746,7 +1764,7 @@ const device_t et4000w32p_noncardex_pci_device = const device_t et4000w32p_cardex_vlb_device = { - "Tseng Labs ET4000/w32p VLB (Cardex)", + "Tseng Labs ET4000/w32p Rev. D VLB (Cardex)", DEVICE_VLB, ET4000W32P_CARDEX, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_cardex_available }, @@ -1757,7 +1775,7 @@ const device_t et4000w32p_cardex_vlb_device = const device_t et4000w32p_cardex_pci_device = { - "Tseng Labs ET4000/w32p PCI (Cardex)", + "Tseng Labs ET4000/w32p Rev. D PCI (Cardex)", DEVICE_PCI, ET4000W32P_CARDEX, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_cardex_available }, @@ -1768,7 +1786,7 @@ const device_t et4000w32p_cardex_pci_device = const device_t et4000w32p_vlb_device = { - "Tseng Labs ET4000/w32p VLB (Diamond)", + "Tseng Labs ET4000/w32p Rev. D VLB (Diamond Stealth32)", DEVICE_VLB, ET4000W32P_DIAMOND, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_available }, @@ -1779,7 +1797,7 @@ const device_t et4000w32p_vlb_device = const device_t et4000w32p_pci_device = { - "Tseng Labs ET4000/w32p PCI (Diamond)", + "Tseng Labs ET4000/w32p Rev. D PCI (Diamond Stealth32)", DEVICE_PCI, ET4000W32P_DIAMOND, et4000w32p_init, et4000w32p_close, NULL, { et4000w32p_available }, diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index 5fd0aada0..107a1773f 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -231,7 +231,7 @@ uint8_t paradise_in(uint16_t addr, void *p) case 0x3cf: if (svga->gdcaddr >= 9 && svga->gdcaddr <= 0x0e) { - if ((paradise->pr5 & 7) != 5) + if (paradise->pr5 & 0x10) return 0xff; } switch (svga->gdcaddr) { @@ -354,8 +354,11 @@ void paradise_recalctimings(svga_t *svga) } if (paradise->type < WD90C30) { - if (svga->bpp >= 8 && !svga->lowres) + if (svga->bpp >= 8 && !svga->lowres) { + if ((svga->crtc[0x17] == 0xc2) && (svga->crtc[0x14] & 0x40)) + paradise->check = 1; svga->render = svga_render_8bpp_highres; + } } else { if (svga->bpp >= 8 && !svga->lowres) { if (svga->bpp == 16) { diff --git a/src/win/assets/86Box-green.png b/src/win/assets/86Box-green.png new file mode 100644 index 000000000..c1af649a1 Binary files /dev/null and b/src/win/assets/86Box-green.png differ diff --git a/src/win/assets/86box-rb.png b/src/win/assets/86box-rb.png new file mode 100644 index 000000000..a29748b8d Binary files /dev/null and b/src/win/assets/86box-rb.png differ diff --git a/src/win/assets/86box-red.png b/src/win/assets/86box-red.png new file mode 100644 index 000000000..0ddf9d3a4 Binary files /dev/null and b/src/win/assets/86box-red.png differ diff --git a/src/win/assets/86box-yellow.png b/src/win/assets/86box-yellow.png new file mode 100644 index 000000000..d8c74def7 Binary files /dev/null and b/src/win/assets/86box-yellow.png differ diff --git a/src/win/assets/86box.png b/src/win/assets/86box.png new file mode 100644 index 000000000..a29748b8d Binary files /dev/null and b/src/win/assets/86box.png differ diff --git a/src/win/assets/status-paused.png b/src/win/assets/status-paused.png new file mode 100644 index 000000000..e913fbf6c Binary files /dev/null and b/src/win/assets/status-paused.png differ diff --git a/src/win/assets/status-running.png b/src/win/assets/status-running.png new file mode 100644 index 000000000..f6cc5fec1 Binary files /dev/null and b/src/win/assets/status-running.png differ diff --git a/src/win/win.c b/src/win/win.c index 563745ead..ee2fe4063 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -74,16 +74,16 @@ volatile int cpu_thread_run = 1; /* Local data. */ static HANDLE thMain; -static rc_str_t *lpRCstr2048, - *lpRCstr4096, - *lpRCstr4352, - *lpRCstr4608, - *lpRCstr5120, - *lpRCstr5376, - *lpRCstr5632, - *lpRCstr5888, - *lpRCstr6144, - *lpRCstr7168; +static rc_str_t *lpRCstr2048 = NULL, + *lpRCstr4096 = NULL, + *lpRCstr4352 = NULL, + *lpRCstr4608 = NULL, + *lpRCstr5120 = NULL, + *lpRCstr5376 = NULL, + *lpRCstr5632 = NULL, + *lpRCstr5888 = NULL, + *lpRCstr6144 = NULL, + *lpRCstr7168 = NULL; static int vid_api_inited = 0; static char *argbuf; static int first_use = 1; @@ -139,11 +139,31 @@ win_log(const char *fmt, ...) #endif +free_string(rc_str_t **str) +{ + if (*str != NULL) { + free(*str); + *str = NULL; + } +} + + static void LoadCommonStrings(void) { int i; + free_string(&lpRCstr7168); + free_string(&lpRCstr6144); + free_string(&lpRCstr5888); + free_string(&lpRCstr5632); + free_string(&lpRCstr5376); + free_string(&lpRCstr5120); + free_string(&lpRCstr4608); + free_string(&lpRCstr4352); + free_string(&lpRCstr4096); + free_string(&lpRCstr2048); + lpRCstr2048 = (rc_str_t *)malloc(STR_NUM_2048*sizeof(rc_str_t)); lpRCstr4096 = (rc_str_t *)malloc(STR_NUM_4096*sizeof(rc_str_t)); lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t)); @@ -221,6 +241,15 @@ size_t c16stombs(char dst[], const uint16_t src[], int len) } +int +has_language_changed(int id) +{ + LCID lcidNew = MAKELCID(id, dwSubLangID); + + return (lang_id != lcidNew); +} + + /* Set (or re-set) the language for the application. */ void set_language(int id) diff --git a/src/win/win_discord.c b/src/win/win_discord.c index 61b300341..487157af5 100644 --- a/src/win/win_discord.c +++ b/src/win/win_discord.c @@ -96,12 +96,24 @@ discord_update_activity(int paused) activity.timestamps.start = time(NULL); +/* Icon choosing for Discord based on 86Box.rc */ + #ifdef RELEASE_BUILD - strcpy(activity.assets.large_image, "86box-rb"); +/* Icon by OBattler and laciba96 (green for release builds)*/ + strcpy(activity.assets.large_image, "86box-green"); +#elif BETA_BUILD +/* Icon by OBattler and laciba96 (yellow for beta builds done by Jenkins)*/ + strcpy(activity.assets.large_image, "86box-yellow"); +#elif ALPHA_BUILD +/* Icon by OBattler and laciba96 (red for alpha builds done by Jenkins)*/ + strcpy(activity.assets.large_image, "86box-red"); #else +/* Icon by OBattler and laciba96 (gray for builds of branches and from the git master)*/ strcpy(activity.assets.large_image, "86box"); #endif +/* End of icon choosing */ + if (paused) { strcpy(activity.assets.small_image, "status-paused"); @@ -147,7 +159,7 @@ discord_init() return; DiscordCreateParamsSetDefault(¶ms); - params.client_id = 651478134352248832; + params.client_id = 906956844956782613; params.flags = DiscordCreateFlags_NoRequireDiscord; result = discord_create(DISCORD_VERSION, ¶ms, &discord_core); diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 2878a086f..2eca8fc67 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -77,6 +77,9 @@ static int first_cat = 0; static int dpi = 96; +/* Language */ +static int temp_language; + /* Machine category */ static int temp_machine_type, temp_machine, temp_cpu, temp_wait_states, temp_fpu, temp_sync; static cpu_family_t *temp_cpu_f; @@ -322,6 +325,9 @@ win_settings_init(void) { int i = 0; + /* Language */ + // TODO: Set temp_language here. + /* Machine category */ temp_machine_type = machines[machine].type; temp_machine = machine; @@ -447,6 +453,9 @@ win_settings_changed(void) { int i = 0, j = 0; + /* Language */ + // i = i || has_language_changed(temp_language); + /* Machine category */ i = i || (machine != temp_machine); i = i || (cpu_f != temp_cpu_f); @@ -537,6 +546,9 @@ win_settings_save(void) pc_reset_hard_close(); + /* Language */ + // set_language(temp_language); + /* Machine category */ machine = temp_machine; cpu_f = temp_cpu_f;