2017-10-07 04:34:04 -04:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
|
|
|
|
* Implement the application's Status Bar.
|
|
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-10-07 04:34:04 -04:00
|
|
|
*
|
|
|
|
|
* Authors: Miran Grca, <mgrca8@gmail.com>
|
|
|
|
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
|
|
|
|
*
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
* Copyright 2016-2019 Miran Grca.
|
|
|
|
|
* Copyright 2017-2019 Fred N. van Kempen.
|
2017-10-07 04:34:04 -04:00
|
|
|
*/
|
|
|
|
|
#define UNICODE
|
|
|
|
|
#define BITMAP WINDOWS_BITMAP
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include <windowsx.h>
|
|
|
|
|
#include <commctrl.h>
|
|
|
|
|
#include <commdlg.h>
|
|
|
|
|
#undef BITMAP
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <wchar.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/86box.h>
|
|
|
|
|
#include <86box/config.h>
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "cpu.h"
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/device.h>
|
|
|
|
|
#include <86box/machine.h>
|
|
|
|
|
#include <86box/timer.h>
|
2021-07-27 06:12:09 +02:00
|
|
|
#include <86box/cassette.h>
|
2021-07-29 20:34:55 +02:00
|
|
|
#include <86box/cartridge.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/hdd.h>
|
|
|
|
|
#include <86box/hdc.h>
|
|
|
|
|
#include <86box/fdd.h>
|
|
|
|
|
#include <86box/fdd_86f.h>
|
|
|
|
|
#include <86box/scsi.h>
|
|
|
|
|
#include <86box/scsi_device.h>
|
|
|
|
|
#include <86box/cdrom.h>
|
|
|
|
|
#include <86box/zip.h>
|
2020-04-01 19:04:53 +02:00
|
|
|
#include <86box/mo.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/cdrom_image.h>
|
|
|
|
|
#include <86box/scsi_disk.h>
|
|
|
|
|
#include <86box/network.h>
|
|
|
|
|
#include <86box/video.h>
|
|
|
|
|
#include <86box/sound.h>
|
|
|
|
|
#include <86box/plat.h>
|
|
|
|
|
#include <86box/ui.h>
|
|
|
|
|
#include <86box/win.h>
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2017-12-13 22:39:41 +01:00
|
|
|
#ifndef GWL_WNDPROC
|
|
|
|
|
#define GWL_WNDPROC GWLP_WNDPROC
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
HWND hwndSBAR;
|
2021-12-01 20:35:29 +01:00
|
|
|
int update_icons = 1, reset_occurred = 1;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
static LONG_PTR OriginalProcedure;
|
2017-10-07 04:34:04 -04:00
|
|
|
static WCHAR **sbTips;
|
|
|
|
|
static int *iStatusWidths;
|
|
|
|
|
static int *sb_part_meanings;
|
2018-07-15 01:41:53 +02:00
|
|
|
static uint8_t *sb_part_icons;
|
2017-10-07 04:34:04 -04:00
|
|
|
static int sb_parts = 0;
|
|
|
|
|
static int sb_ready = 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
static uint8_t sb_map[256];
|
2020-09-02 11:29:16 +08:00
|
|
|
static int icon_width = 24;
|
2021-04-13 14:07:21 -03:00
|
|
|
static wchar_t sb_text[512] = L"\0";
|
|
|
|
|
static wchar_t sb_bugtext[512] = L"\0";
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
/* Also used by win_settings.c */
|
2017-12-13 22:39:41 +01:00
|
|
|
intptr_t
|
2017-10-07 04:34:04 -04:00
|
|
|
fdd_type_to_icon(int type)
|
|
|
|
|
{
|
2018-07-15 01:41:53 +02:00
|
|
|
int ret = 248;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
|
case 0:
|
|
|
|
|
break;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
case 1: case 2: case 3: case 4:
|
|
|
|
|
case 5: case 6:
|
2018-07-15 01:41:53 +02:00
|
|
|
ret = 16;
|
2017-10-07 04:34:04 -04:00
|
|
|
break;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
case 7: case 8: case 9: case 10:
|
|
|
|
|
case 11: case 12: case 13:
|
2018-07-15 01:41:53 +02:00
|
|
|
ret = 24;
|
2017-10-07 04:34:04 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* FIXME: should be hdd_count() in hdd.c */
|
|
|
|
|
static int
|
|
|
|
|
hdd_count(int bus)
|
|
|
|
|
{
|
|
|
|
|
int c = 0;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<HDD_NUM; i++) {
|
|
|
|
|
if (hdd[i].bus == bus)
|
|
|
|
|
c++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
void
|
|
|
|
|
ui_sb_timer_callback(int pane)
|
|
|
|
|
{
|
2021-12-01 20:35:29 +01:00
|
|
|
if (!(reset_occurred & 1)) {
|
|
|
|
|
sb_part_icons[pane] &= ~1;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2021-12-01 20:35:29 +01:00
|
|
|
if (sb_part_icons && sb_part_icons[pane]) {
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETICON, pane,
|
|
|
|
|
(LPARAM)hIcon[sb_part_icons[pane]]);
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
reset_occurred &= ~1;
|
2021-12-01 21:06:50 +01:00
|
|
|
|
|
|
|
|
reset_occurred &= ~2;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
/* API */
|
|
|
|
|
/* API: update one of the icons after activity. */
|
|
|
|
|
void
|
2017-10-10 03:07:29 -04:00
|
|
|
ui_sb_update_icon(int tag, int active)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t found = 0xff;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-10-19 19:10:12 +02:00
|
|
|
if (!update_icons || !sb_ready)
|
2018-02-11 20:51:42 +01:00
|
|
|
return;
|
|
|
|
|
|
2018-10-19 19:10:12 +02:00
|
|
|
if (((tag & 0xf0) >= SB_TEXT))
|
2017-10-07 04:34:04 -04:00
|
|
|
return;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
found = sb_map[tag];
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
if ((found != 0xff) && ((sb_part_icons[found] ^ active) & 1) && active) {
|
|
|
|
|
sb_part_icons[found] |= 1;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2021-04-26 16:09:50 +03:00
|
|
|
PostMessage(hwndSBAR, SB_SETICON, found,
|
2018-04-25 23:51:13 +02:00
|
|
|
(LPARAM)hIcon[sb_part_icons[found]]);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2021-12-01 20:35:29 +01:00
|
|
|
reset_occurred = 2;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
SetTimer(hwndMain, 0x8000 | found, 75, NULL);
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-04-26 16:09:50 +03:00
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
/* API: This is for the drive state indicator. */
|
|
|
|
|
void
|
2017-10-10 03:07:29 -04:00
|
|
|
ui_sb_update_icon_state(int tag, int state)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t found = 0xff;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-10-19 19:10:12 +02:00
|
|
|
if (!sb_ready || ((tag & 0xf0) >= SB_HDD))
|
2017-10-07 04:34:04 -04:00
|
|
|
return;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
found = sb_map[tag];
|
|
|
|
|
if (found != 0xff) {
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[found] &= ~128;
|
|
|
|
|
sb_part_icons[found] |= (state ? 128 : 0);
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETICON, found,
|
|
|
|
|
(LPARAM)hIcon[sb_part_icons[found]]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-07-27 06:12:09 +02:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateCassetteTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
WCHAR fn[512];
|
|
|
|
|
|
|
|
|
|
if (strlen(cassette_fname) == 0)
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2148), plat_get_string(IDS_2057));
|
|
|
|
|
else {
|
|
|
|
|
mbstoc16s(fn, cassette_fname, sizeof_w(fn));
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2148), fn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sbTips[part] != NULL) {
|
|
|
|
|
free(sbTips[part]);
|
|
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
|
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
|
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-07-29 20:34:55 +02:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateCartridgeTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
WCHAR fn[512];
|
|
|
|
|
int drive = sb_part_meanings[part] & 0xf;
|
|
|
|
|
|
|
|
|
|
if (strlen(cart_fns[drive]) == 0) {
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2150),
|
|
|
|
|
drive+1, plat_get_string(IDS_2057));
|
|
|
|
|
} else {
|
|
|
|
|
mbstoc16s(fn, cart_fns[drive], sizeof_w(fn));
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2150),
|
|
|
|
|
drive+1, fn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sbTips[part] != NULL) {
|
|
|
|
|
free(sbTips[part]);
|
|
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
|
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
|
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateFloppyTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR wtext[512];
|
|
|
|
|
WCHAR tempTip[512];
|
2021-03-14 20:35:01 +01:00
|
|
|
WCHAR fn[512];
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
int drive = sb_part_meanings[part] & 0xf;
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
mbstoc16s(wtext, fdd_getname(fdd_get_type(drive)),
|
2017-10-07 04:34:04 -04:00
|
|
|
strlen(fdd_getname(fdd_get_type(drive))) + 1);
|
2021-03-14 20:35:01 +01:00
|
|
|
if (strlen(floppyfns[drive]) == 0) {
|
2020-04-26 19:22:13 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2108),
|
2017-10-10 03:07:29 -04:00
|
|
|
drive+1, wtext, plat_get_string(IDS_2057));
|
2017-10-07 04:34:04 -04:00
|
|
|
} else {
|
2021-03-14 20:35:01 +01:00
|
|
|
mbstoc16s(fn, floppyfns[drive], sizeof_w(fn));
|
2020-04-26 19:22:13 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2108),
|
2021-03-14 20:35:01 +01:00
|
|
|
drive+1, wtext, fn);
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
|
2017-10-09 06:48:36 +02:00
|
|
|
if (sbTips[part] != NULL) {
|
2017-10-07 04:34:04 -04:00
|
|
|
free(sbTips[part]);
|
2017-10-09 06:48:36 +02:00
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
2017-10-10 03:07:29 -04:00
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
2017-10-07 04:34:04 -04:00
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
StatusBarCreateCdromTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
WCHAR *szText;
|
2021-03-14 20:35:01 +01:00
|
|
|
WCHAR fn[512];
|
2017-10-07 04:34:04 -04:00
|
|
|
int id;
|
|
|
|
|
int drive = sb_part_meanings[part] & 0xf;
|
2018-10-17 05:29:48 +02:00
|
|
|
int bus = cdrom[drive].bus_type;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
id = IDS_5377 + (bus - 1);
|
2017-10-10 03:07:29 -04:00
|
|
|
szText = plat_get_string(id);
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-10-17 05:29:48 +02:00
|
|
|
if (cdrom[drive].host_drive == 200) {
|
2021-03-14 20:35:01 +01:00
|
|
|
if (strlen(cdrom[drive].image_path) == 0) {
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_5120),
|
|
|
|
|
drive+1, szText, plat_get_string(IDS_2057));
|
|
|
|
|
} else {
|
|
|
|
|
mbstoc16s(fn, cdrom[drive].image_path, sizeof_w(fn));
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_5120),
|
|
|
|
|
drive+1, szText, fn);
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
} else
|
2017-10-10 03:07:29 -04:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_5120), drive+1, szText, plat_get_string(IDS_2057));
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2017-10-09 06:48:36 +02:00
|
|
|
if (sbTips[part] != NULL) {
|
2017-10-07 04:34:04 -04:00
|
|
|
free(sbTips[part]);
|
2017-10-09 06:48:36 +02:00
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
2018-10-10 22:33:24 +02:00
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 4);
|
2017-10-07 04:34:04 -04:00
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-01-26 22:17:09 +01:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateZIPTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
2018-04-25 23:51:13 +02:00
|
|
|
WCHAR *szText;
|
2021-03-14 20:35:01 +01:00
|
|
|
WCHAR fn[512];
|
2018-04-25 23:51:13 +02:00
|
|
|
int id;
|
2018-01-26 22:17:09 +01:00
|
|
|
int drive = sb_part_meanings[part] & 0xf;
|
2018-04-25 23:51:13 +02:00
|
|
|
int bus = zip_drives[drive].bus_type;
|
|
|
|
|
|
|
|
|
|
id = IDS_5377 + (bus - 1);
|
|
|
|
|
szText = plat_get_string(id);
|
2018-01-26 22:17:09 +01:00
|
|
|
|
|
|
|
|
int type = zip_drives[drive].is_250 ? 250 : 100;
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
if (strlen(zip_drives[drive].image_path) == 0) {
|
2018-07-15 01:41:53 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2054),
|
2018-04-25 23:51:13 +02:00
|
|
|
type, drive+1, szText, plat_get_string(IDS_2057));
|
2018-01-26 22:17:09 +01:00
|
|
|
} else {
|
2021-03-14 20:35:01 +01:00
|
|
|
mbstoc16s(fn, zip_drives[drive].image_path, sizeof_w(fn));
|
2018-07-15 01:41:53 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2054),
|
2021-03-14 20:35:01 +01:00
|
|
|
type, drive+1, szText, fn);
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
|
2017-10-09 06:48:36 +02:00
|
|
|
if (sbTips[part] != NULL) {
|
2017-10-07 04:34:04 -04:00
|
|
|
free(sbTips[part]);
|
2017-10-09 06:48:36 +02:00
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
2017-10-08 19:14:46 -04:00
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
2017-10-07 04:34:04 -04:00
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-19 06:07:58 +02:00
|
|
|
|
2020-04-01 19:04:53 +02:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateMOTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
WCHAR *szText;
|
2021-03-14 20:35:01 +01:00
|
|
|
WCHAR fn[512];
|
2020-04-01 19:04:53 +02:00
|
|
|
int id;
|
|
|
|
|
int drive = sb_part_meanings[part] & 0xf;
|
|
|
|
|
int bus = mo_drives[drive].bus_type;
|
|
|
|
|
|
|
|
|
|
id = IDS_5377 + (bus - 1);
|
|
|
|
|
szText = plat_get_string(id);
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
if (strlen(mo_drives[drive].image_path) == 0) {
|
2020-04-26 19:22:13 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2115),
|
2020-04-01 19:04:53 +02:00
|
|
|
drive+1, szText, plat_get_string(IDS_2057));
|
|
|
|
|
} else {
|
2021-03-14 20:35:01 +01:00
|
|
|
mbstoc16s(fn, mo_drives[drive].image_path, sizeof_w(fn));
|
2020-04-26 19:22:13 +02:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2115),
|
2021-06-18 18:09:46 +05:00
|
|
|
drive+1, szText, fn);
|
2020-04-01 19:04:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sbTips[part] != NULL) {
|
|
|
|
|
free(sbTips[part]);
|
|
|
|
|
sbTips[part] = NULL;
|
|
|
|
|
}
|
|
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
|
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2020-07-19 06:07:58 +02:00
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateDiskTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
WCHAR *szText;
|
|
|
|
|
int id;
|
|
|
|
|
int bus = sb_part_meanings[part] & 0xf;
|
|
|
|
|
|
|
|
|
|
id = IDS_4352 + (bus - 1);
|
2017-10-10 03:07:29 -04:00
|
|
|
szText = plat_get_string(id);
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_4096), szText);
|
2017-10-07 04:34:04 -04:00
|
|
|
if (sbTips[part] != NULL)
|
|
|
|
|
free(sbTips[part]);
|
2017-10-08 19:14:46 -04:00
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
2017-10-07 04:34:04 -04:00
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
StatusBarCreateNetworkTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2069));
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
if (sbTips[part] != NULL)
|
|
|
|
|
free(sbTips[part]);
|
2017-10-08 19:14:46 -04:00
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
2017-10-07 04:34:04 -04:00
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-02-06 19:53:34 +01:00
|
|
|
static void
|
|
|
|
|
StatusBarCreateSoundTip(int part)
|
|
|
|
|
{
|
|
|
|
|
WCHAR tempTip[512];
|
|
|
|
|
|
|
|
|
|
_swprintf(tempTip, plat_get_string(IDS_2068));
|
|
|
|
|
|
|
|
|
|
if (sbTips[part] != NULL)
|
|
|
|
|
free(sbTips[part]);
|
|
|
|
|
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
|
|
|
|
|
wcscpy(sbTips[part], tempTip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
/* API */
|
|
|
|
|
void
|
2017-10-10 03:07:29 -04:00
|
|
|
ui_sb_update_tip(int meaning)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t part = 0xff;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-10-19 19:10:12 +02:00
|
|
|
if (!sb_ready || (sb_parts == 0) || (sb_part_meanings == NULL))
|
|
|
|
|
return;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
part = sb_map[meaning];
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (part != 0xff) {
|
2017-10-07 04:34:04 -04:00
|
|
|
switch(meaning & 0xf0) {
|
2021-07-27 06:12:09 +02:00
|
|
|
case SB_CASSETTE:
|
|
|
|
|
StatusBarCreateCassetteTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2021-07-29 20:34:55 +02:00
|
|
|
case SB_CARTRIDGE:
|
|
|
|
|
StatusBarCreateCartridgeTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
case SB_FLOPPY:
|
|
|
|
|
StatusBarCreateFloppyTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SB_CDROM:
|
|
|
|
|
StatusBarCreateCdromTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-01-26 22:17:09 +01:00
|
|
|
case SB_ZIP:
|
|
|
|
|
StatusBarCreateZIPTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2020-04-01 19:04:53 +02:00
|
|
|
case SB_MO:
|
|
|
|
|
StatusBarCreateMOTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
case SB_HDD:
|
|
|
|
|
StatusBarCreateDiskTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SB_NETWORK:
|
|
|
|
|
StatusBarCreateNetworkTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-02-06 19:53:34 +01:00
|
|
|
case SB_SOUND:
|
|
|
|
|
StatusBarCreateSoundTip(part);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETTIPTEXT, part, (LPARAM)sbTips[part]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
StatusBarDestroyTips(void)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (sb_parts == 0) return;
|
|
|
|
|
|
|
|
|
|
if (! sbTips) return;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<sb_parts; i++) {
|
|
|
|
|
if (sbTips[i]) {
|
|
|
|
|
free(sbTips[i]);
|
|
|
|
|
sbTips[i] = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free(sbTips);
|
|
|
|
|
sbTips = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-10-19 19:10:12 +02:00
|
|
|
/* API: mark the status bar as not ready. */
|
2021-12-05 11:48:31 +01:00
|
|
|
/* Values: -1 - not ready, but don't clear POST text
|
|
|
|
|
0 - not ready
|
|
|
|
|
1 - ready */
|
2018-10-19 19:10:12 +02:00
|
|
|
void
|
2018-10-21 22:09:18 +02:00
|
|
|
ui_sb_set_ready(int ready)
|
2018-10-19 19:10:12 +02:00
|
|
|
{
|
2021-04-14 16:29:43 -03:00
|
|
|
if (ready == 0) {
|
|
|
|
|
ui_sb_bugui(NULL);
|
|
|
|
|
ui_sb_set_text(NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-05 11:48:31 +01:00
|
|
|
if (ready == -1)
|
|
|
|
|
ready = 0;
|
|
|
|
|
|
2018-10-21 22:09:18 +02:00
|
|
|
sb_ready = ready;
|
2018-10-19 19:10:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
/* API: update the status bar panes. */
|
|
|
|
|
void
|
2017-10-10 03:07:29 -04:00
|
|
|
ui_sb_update_panes(void)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2021-04-13 01:18:56 +02:00
|
|
|
int i, id;
|
2021-07-29 20:34:55 +02:00
|
|
|
int cart_int, mfm_int, xta_int, esdi_int, ide_int, scsi_int;
|
2017-10-07 04:34:04 -04:00
|
|
|
int edge = 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
int c_mfm, c_esdi, c_xta;
|
|
|
|
|
int c_ide, c_scsi;
|
2017-10-07 04:34:04 -04:00
|
|
|
int do_net;
|
2019-02-06 03:34:39 +01:00
|
|
|
char *hdc_name;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
if (!config_changed)
|
|
|
|
|
return;
|
|
|
|
|
|
2018-10-21 22:09:18 +02:00
|
|
|
if (sb_ready) {
|
2018-10-19 19:10:12 +02:00
|
|
|
sb_ready = 0;
|
2018-10-21 22:09:18 +02:00
|
|
|
}
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2021-12-13 01:34:01 +01:00
|
|
|
cart_int = machine_has_cartridge(machine) ? 1 : 0;
|
|
|
|
|
mfm_int = machine_has_flags(machine, MACHINE_MFM) ? 1 : 0;
|
|
|
|
|
xta_int = machine_has_flags(machine, MACHINE_XTA) ? 1 : 0;
|
|
|
|
|
esdi_int = machine_has_flags(machine, MACHINE_ESDI) ? 1 : 0;
|
|
|
|
|
ide_int = machine_has_flags(machine, MACHINE_IDE_QUAD) ? 1 : 0;
|
|
|
|
|
scsi_int = machine_has_flags(machine, MACHINE_SCSI_DUAL) ? 1 : 0;
|
2021-04-13 01:18:56 +02:00
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
c_mfm = hdd_count(HDD_BUS_MFM);
|
|
|
|
|
c_esdi = hdd_count(HDD_BUS_ESDI);
|
2018-04-25 23:51:13 +02:00
|
|
|
c_xta = hdd_count(HDD_BUS_XTA);
|
|
|
|
|
c_ide = hdd_count(HDD_BUS_IDE);
|
2017-10-07 04:34:04 -04:00
|
|
|
c_scsi = hdd_count(HDD_BUS_SCSI);
|
2017-10-29 04:20:20 -05:00
|
|
|
do_net = network_available();
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2020-04-26 17:00:45 +02:00
|
|
|
media_menu_reset();
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
if (sb_parts > 0) {
|
|
|
|
|
for (i = 0; i < sb_parts; i++)
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETICON, i, (LPARAM)NULL);
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETPARTS, (WPARAM)0, (LPARAM)NULL);
|
|
|
|
|
|
|
|
|
|
if (iStatusWidths) {
|
|
|
|
|
free(iStatusWidths);
|
|
|
|
|
iStatusWidths = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (sb_part_meanings) {
|
|
|
|
|
free(sb_part_meanings);
|
|
|
|
|
sb_part_meanings = NULL;
|
|
|
|
|
}
|
|
|
|
|
if (sb_part_icons) {
|
|
|
|
|
free(sb_part_icons);
|
|
|
|
|
sb_part_icons = NULL;
|
|
|
|
|
}
|
|
|
|
|
StatusBarDestroyTips();
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
memset(sb_map, 0xff, sizeof(sb_map));
|
|
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
sb_parts = 0;
|
2021-07-27 06:12:09 +02:00
|
|
|
if (cassette_enable)
|
|
|
|
|
sb_parts++;
|
2021-07-29 20:34:55 +02:00
|
|
|
if (cart_int)
|
|
|
|
|
sb_parts += 2;
|
2017-10-07 04:34:04 -04:00
|
|
|
for (i=0; i<FDD_NUM; i++) {
|
|
|
|
|
if (fdd_get_type(i) != 0)
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2019-02-06 03:34:39 +01:00
|
|
|
hdc_name = hdc_get_internal_name(hdc_current);
|
2017-10-07 04:34:04 -04:00
|
|
|
for (i=0; i<CDROM_NUM; i++) {
|
|
|
|
|
/* Could be Internal or External IDE.. */
|
2018-10-17 05:29:48 +02:00
|
|
|
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2017-10-07 04:34:04 -04:00
|
|
|
continue;
|
|
|
|
|
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2017-10-07 04:34:04 -04:00
|
|
|
continue;
|
2018-10-17 05:29:48 +02:00
|
|
|
if (cdrom[i].bus_type != 0)
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2018-01-26 22:17:09 +01:00
|
|
|
for (i=0; i<ZIP_NUM; i++) {
|
|
|
|
|
/* Could be Internal or External IDE.. */
|
2018-04-25 23:51:13 +02:00
|
|
|
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2018-01-26 22:17:09 +01:00
|
|
|
continue;
|
|
|
|
|
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2018-01-26 22:17:09 +01:00
|
|
|
continue;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (zip_drives[i].bus_type != 0)
|
2018-01-26 22:17:09 +01:00
|
|
|
sb_parts++;
|
2020-07-15 09:03:30 +08:00
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
for (i=0; i<MO_NUM; i++) {
|
2020-07-15 09:03:30 +08:00
|
|
|
/* Could be Internal or External IDE.. */
|
|
|
|
|
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2020-07-15 09:03:30 +08:00
|
|
|
continue;
|
|
|
|
|
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2020-07-15 09:03:30 +08:00
|
|
|
continue;
|
|
|
|
|
if (mo_drives[i].bus_type != 0)
|
|
|
|
|
sb_parts++;
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_mfm && (mfm_int || !memcmp(hdc_name, "st506", 5))) {
|
2017-10-07 04:34:04 -04:00
|
|
|
/* MFM drives, and MFM or Internal controller. */
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_esdi && (esdi_int || !memcmp(hdc_name, "esdi", 4))) {
|
2017-10-07 04:34:04 -04:00
|
|
|
/* ESDI drives, and ESDI or Internal controller. */
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_xta && (xta_int || !memcmp(hdc_name, "xta", 3)))
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_ide && (ide_int || !memcmp(hdc_name, "xtide", 5) || !memcmp(hdc_name, "ide", 3)))
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
2021-07-23 01:20:14 +02:00
|
|
|
if (c_scsi && (scsi_int || (scsi_card_current[0] != 0) || (scsi_card_current[1] != 0) ||
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[2] != 0) || (scsi_card_current[3] != 0)))
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (do_net)
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
2018-02-06 19:53:34 +01:00
|
|
|
sb_parts += 2;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
iStatusWidths = (int *)malloc(sb_parts * sizeof(int));
|
|
|
|
|
memset(iStatusWidths, 0, sb_parts * sizeof(int));
|
|
|
|
|
sb_part_meanings = (int *)malloc(sb_parts * sizeof(int));
|
|
|
|
|
memset(sb_part_meanings, 0, sb_parts * sizeof(int));
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons = (uint8_t *)malloc(sb_parts * sizeof(uint8_t));
|
|
|
|
|
memset(sb_part_icons, 0, sb_parts * sizeof(uint8_t));
|
2017-10-07 04:34:04 -04:00
|
|
|
sbTips = (WCHAR **)malloc(sb_parts * sizeof(WCHAR *));
|
|
|
|
|
memset(sbTips, 0, sb_parts * sizeof(WCHAR *));
|
|
|
|
|
|
|
|
|
|
sb_parts = 0;
|
2021-07-27 06:12:09 +02:00
|
|
|
if (cassette_enable) {
|
|
|
|
|
edge += icon_width;
|
|
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_CASSETTE;
|
|
|
|
|
sb_map[SB_CASSETTE] = sb_parts;
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-07-29 20:34:55 +02:00
|
|
|
for (i=0; i<2; i++) {
|
|
|
|
|
if (cart_int) {
|
|
|
|
|
edge += icon_width;
|
|
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_CARTRIDGE | i;
|
|
|
|
|
sb_map[SB_CARTRIDGE | i] = sb_parts;
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-07 04:34:04 -04:00
|
|
|
for (i=0; i<FDD_NUM; i++) {
|
|
|
|
|
if (fdd_get_type(i) != 0) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_FLOPPY | i;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_FLOPPY | i] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (i=0; i<CDROM_NUM; i++) {
|
|
|
|
|
/* Could be Internal or External IDE.. */
|
2018-10-17 05:29:48 +02:00
|
|
|
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2017-10-07 04:34:04 -04:00
|
|
|
continue;
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2017-10-07 04:34:04 -04:00
|
|
|
continue;
|
2018-10-17 05:29:48 +02:00
|
|
|
if (cdrom[i].bus_type != 0) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_CDROM | i;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_CDROM | i] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-01-26 22:17:09 +01:00
|
|
|
for (i=0; i<ZIP_NUM; i++) {
|
|
|
|
|
/* Could be Internal or External IDE.. */
|
2018-04-25 23:51:13 +02:00
|
|
|
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2018-01-26 22:17:09 +01:00
|
|
|
continue;
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2018-01-26 22:17:09 +01:00
|
|
|
continue;
|
|
|
|
|
if (zip_drives[i].bus_type != 0) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2018-01-26 22:17:09 +01:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_ZIP | i;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_ZIP | i] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-01 19:04:53 +02:00
|
|
|
for (i=0; i<MO_NUM; i++) {
|
|
|
|
|
/* Could be Internal or External IDE.. */
|
|
|
|
|
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) &&
|
2021-11-19 05:12:51 +05:00
|
|
|
!ide_int && memcmp(hdc_name, "xtide", 5) && memcmp(hdc_name, "ide", 3))
|
2020-04-01 19:04:53 +02:00
|
|
|
continue;
|
2021-07-23 01:20:14 +02:00
|
|
|
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !scsi_int &&
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[0] == 0) && (scsi_card_current[1] == 0) &&
|
|
|
|
|
(scsi_card_current[2] == 0) && (scsi_card_current[3] == 0))
|
2020-04-01 19:04:53 +02:00
|
|
|
continue;
|
|
|
|
|
if (mo_drives[i].bus_type != 0) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2020-04-01 19:04:53 +02:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_MO | i;
|
|
|
|
|
sb_map[SB_MO | i] = sb_parts;
|
|
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_mfm && (mfm_int || !memcmp(hdc_name, "st506", 5))) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_MFM;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_HDD | HDD_BUS_MFM] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_esdi && (esdi_int || !memcmp(hdc_name, "esdi", 4))) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_ESDI;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_HDD | HDD_BUS_ESDI] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_xta && (xta_int || !memcmp(hdc_name, "xta", 3))) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_XTA;
|
|
|
|
|
sb_map[SB_HDD | HDD_BUS_XTA] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-04-13 01:18:56 +02:00
|
|
|
if (c_ide && (ide_int || !memcmp(hdc_name, "xtide", 5) || !memcmp(hdc_name, "ide", 3))) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_IDE;
|
|
|
|
|
sb_map[SB_HDD | HDD_BUS_IDE] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
2021-07-23 01:20:14 +02:00
|
|
|
if (c_scsi && (scsi_int || (scsi_card_current[0] != 0) || (scsi_card_current[1] != 0) ||
|
2021-07-22 20:13:44 +02:00
|
|
|
(scsi_card_current[2] != 0) || (scsi_card_current[3] != 0))) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_SCSI;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_HDD | HDD_BUS_SCSI] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
if (do_net) {
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2017-10-07 04:34:04 -04:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_NETWORK;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_NETWORK] = sb_parts;
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts++;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 11:29:16 +08:00
|
|
|
edge += icon_width;
|
2018-02-06 19:53:34 +01:00
|
|
|
iStatusWidths[sb_parts] = edge;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_SOUND;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_SOUND] = sb_parts;
|
2018-02-06 19:53:34 +01:00
|
|
|
sb_parts++;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
if (sb_parts)
|
|
|
|
|
iStatusWidths[sb_parts] = -1;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_TEXT;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_map[SB_TEXT] = sb_parts;
|
2018-02-06 19:53:34 +01:00
|
|
|
sb_parts ++;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETPARTS, (WPARAM)sb_parts, (LPARAM)iStatusWidths);
|
|
|
|
|
|
|
|
|
|
for (i=0; i<sb_parts; i++) {
|
|
|
|
|
switch (sb_part_meanings[i] & 0xf0) {
|
2021-07-27 06:12:09 +02:00
|
|
|
case SB_CASSETTE: /* Cassette */
|
|
|
|
|
sb_part_icons[i] = (strlen(cassette_fname) == 0) ? 128 : 0;
|
|
|
|
|
sb_part_icons[i] |= 64;
|
|
|
|
|
StatusBarCreateCassetteTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
2021-07-29 20:34:55 +02:00
|
|
|
case SB_CARTRIDGE: /* Cartridge */
|
|
|
|
|
sb_part_icons[i] = (strlen(cart_fns[sb_part_meanings[i] & 0xf]) == 0) ? 128 : 0;
|
|
|
|
|
sb_part_icons[i] |= 104;
|
|
|
|
|
StatusBarCreateCartridgeTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
case SB_FLOPPY: /* Floppy */
|
2021-03-14 20:35:01 +01:00
|
|
|
sb_part_icons[i] = (strlen(floppyfns[sb_part_meanings[i] & 0xf]) == 0) ? 128 : 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
sb_part_icons[i] |= fdd_type_to_icon(fdd_get_type(sb_part_meanings[i] & 0xf));
|
2017-10-07 04:34:04 -04:00
|
|
|
StatusBarCreateFloppyTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SB_CDROM: /* CD-ROM */
|
|
|
|
|
id = sb_part_meanings[i] & 0xf;
|
2018-10-17 05:29:48 +02:00
|
|
|
if (cdrom[id].host_drive == 200)
|
2021-03-14 20:35:01 +01:00
|
|
|
sb_part_icons[i] = (strlen(cdrom[id].image_path) == 0) ? 128 : 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[i] = 128;
|
|
|
|
|
sb_part_icons[i] |= 32;
|
2017-10-07 04:34:04 -04:00
|
|
|
StatusBarCreateCdromTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-01-26 22:17:09 +01:00
|
|
|
case SB_ZIP: /* Iomega ZIP */
|
2021-03-14 20:35:01 +01:00
|
|
|
sb_part_icons[i] = (strlen(zip_drives[sb_part_meanings[i] & 0xf].image_path) == 0) ? 128 : 0;
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[i] |= 48;
|
2018-01-26 22:17:09 +01:00
|
|
|
StatusBarCreateZIPTip(i);
|
|
|
|
|
break;
|
2020-04-01 19:04:53 +02:00
|
|
|
|
|
|
|
|
case SB_MO: /* Magneto-Optical disk */
|
2021-03-14 20:35:01 +01:00
|
|
|
sb_part_icons[i] = (strlen(mo_drives[sb_part_meanings[i] & 0xf].image_path) == 0) ? 128 : 0;
|
2020-04-01 19:04:53 +02:00
|
|
|
sb_part_icons[i] |= 56;
|
|
|
|
|
StatusBarCreateMOTip(i);
|
|
|
|
|
break;
|
2018-01-26 22:17:09 +01:00
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
case SB_HDD: /* Hard disk */
|
2020-07-19 06:07:58 +02:00
|
|
|
sb_part_icons[i] = 80;
|
2017-10-07 04:34:04 -04:00
|
|
|
StatusBarCreateDiskTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SB_NETWORK: /* Network */
|
2020-07-19 06:07:58 +02:00
|
|
|
sb_part_icons[i] = 96;
|
2017-10-07 04:34:04 -04:00
|
|
|
StatusBarCreateNetworkTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-02-06 19:53:34 +01:00
|
|
|
case SB_SOUND: /* Sound */
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[i] = 243;
|
2018-02-06 19:53:34 +01:00
|
|
|
StatusBarCreateSoundTip(i);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
case SB_TEXT: /* Status text */
|
2017-10-09 03:18:50 -04:00
|
|
|
SendMessage(hwndSBAR, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM)L"");
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[i] = 255;
|
2017-10-07 04:34:04 -04:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
if (sb_part_icons[i] != 255) {
|
2017-10-09 06:55:14 +02:00
|
|
|
SendMessage(hwndSBAR, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM)L"");
|
2017-10-07 04:34:04 -04:00
|
|
|
SendMessage(hwndSBAR, SB_SETICON, i, (LPARAM)hIcon[sb_part_icons[i]]);
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETTIPTEXT, i, (LPARAM)sbTips[i]);
|
2018-04-25 23:51:13 +02:00
|
|
|
} else
|
2017-10-07 04:34:04 -04:00
|
|
|
SendMessage(hwndSBAR, SB_SETICON, i, (LPARAM)NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sb_ready = 1;
|
2021-12-01 20:35:29 +01:00
|
|
|
if (reset_occurred & 2)
|
|
|
|
|
reset_occurred |= 1;
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static VOID APIENTRY
|
|
|
|
|
StatusBarPopupMenu(HWND hwnd, POINT pt, int id)
|
|
|
|
|
{
|
2020-04-26 17:59:17 +02:00
|
|
|
HMENU menu;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
if (id >= (sb_parts - 1)) return;
|
|
|
|
|
|
2020-09-02 11:29:16 +08:00
|
|
|
pt.x = id * icon_width; /* Justify to the left. */
|
2017-10-07 04:34:04 -04:00
|
|
|
pt.y = 0; /* Justify to the top. */
|
|
|
|
|
ClientToScreen(hwnd, (LPPOINT) &pt);
|
2020-04-26 17:59:17 +02:00
|
|
|
|
|
|
|
|
switch(sb_part_meanings[id] & 0xF0) {
|
2021-07-27 06:12:09 +02:00
|
|
|
case SB_CASSETTE:
|
|
|
|
|
menu = media_menu_get_cassette();
|
|
|
|
|
break;
|
2021-07-29 20:34:55 +02:00
|
|
|
case SB_CARTRIDGE:
|
|
|
|
|
menu = media_menu_get_cartridge(sb_part_meanings[id] & 0x0F);
|
|
|
|
|
break;
|
2020-04-26 17:59:17 +02:00
|
|
|
case SB_FLOPPY:
|
|
|
|
|
menu = media_menu_get_floppy(sb_part_meanings[id] & 0x0F);
|
|
|
|
|
break;
|
|
|
|
|
case SB_CDROM:
|
|
|
|
|
menu = media_menu_get_cdrom(sb_part_meanings[id] & 0x0F);
|
|
|
|
|
break;
|
|
|
|
|
case SB_ZIP:
|
|
|
|
|
menu = media_menu_get_zip(sb_part_meanings[id] & 0x0F);
|
|
|
|
|
break;
|
|
|
|
|
case SB_MO:
|
|
|
|
|
menu = media_menu_get_mo(sb_part_meanings[id] & 0x0F);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TrackPopupMenu(menu,
|
2017-10-07 04:34:04 -04:00
|
|
|
TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON,
|
|
|
|
|
pt.x, pt.y, 0, hwndSBAR, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 11:29:16 +08:00
|
|
|
/* API: Load status bar icons */
|
|
|
|
|
void
|
|
|
|
|
StatusBarLoadIcon(HINSTANCE hInst) {
|
2021-11-17 19:02:19 +01:00
|
|
|
win_load_icon_set();
|
2020-09-02 11:29:16 +08:00
|
|
|
}
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2020-04-23 01:24:01 +02:00
|
|
|
/* Handle messages for the Status Bar window. */
|
|
|
|
|
#if defined(__amd64__) || defined(__aarch64__)
|
|
|
|
|
static LRESULT CALLBACK
|
|
|
|
|
#else
|
|
|
|
|
static BOOL CALLBACK
|
|
|
|
|
#endif
|
|
|
|
|
StatusBarProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
|
{
|
|
|
|
|
RECT rc;
|
|
|
|
|
POINT pt;
|
|
|
|
|
int item_id = 0;
|
2020-09-02 11:29:16 +08:00
|
|
|
int i;
|
|
|
|
|
HINSTANCE hInst;
|
2020-04-23 01:24:01 +02:00
|
|
|
|
|
|
|
|
switch (message) {
|
|
|
|
|
case WM_COMMAND:
|
2020-04-26 17:59:17 +02:00
|
|
|
media_menu_proc(hwnd, message, wParam, lParam);
|
2017-10-07 04:34:04 -04:00
|
|
|
return(0);
|
|
|
|
|
|
|
|
|
|
case WM_LBUTTONDOWN:
|
|
|
|
|
case WM_RBUTTONDOWN:
|
|
|
|
|
GetClientRect(hwnd, (LPRECT)& rc);
|
|
|
|
|
pt.x = GET_X_LPARAM(lParam);
|
|
|
|
|
pt.y = GET_Y_LPARAM(lParam);
|
|
|
|
|
if (PtInRect((LPRECT) &rc, pt))
|
2020-09-02 11:29:16 +08:00
|
|
|
StatusBarPopupMenu(hwnd, pt, (pt.x / icon_width));
|
2017-10-07 04:34:04 -04:00
|
|
|
break;
|
|
|
|
|
|
2018-02-06 19:53:34 +01:00
|
|
|
case WM_LBUTTONDBLCLK:
|
|
|
|
|
GetClientRect(hwnd, (LPRECT)& rc);
|
|
|
|
|
pt.x = GET_X_LPARAM(lParam);
|
|
|
|
|
pt.y = GET_Y_LPARAM(lParam);
|
2020-09-02 11:29:16 +08:00
|
|
|
item_id = (pt.x / icon_width);
|
2018-02-06 19:53:34 +01:00
|
|
|
if (PtInRect((LPRECT) &rc, pt) && (item_id < sb_parts)) {
|
|
|
|
|
if (sb_part_meanings[item_id] == SB_SOUND)
|
|
|
|
|
SoundGainDialogCreate(hwndMain);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2020-09-02 11:29:16 +08:00
|
|
|
case WM_DPICHANGED_AFTERPARENT:
|
|
|
|
|
/* DPI changed, reload icons */
|
|
|
|
|
hInst = (HINSTANCE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE);
|
|
|
|
|
dpi = win_get_dpi(hwnd);
|
|
|
|
|
icon_width = MulDiv(SB_ICON_WIDTH, dpi, 96);
|
|
|
|
|
StatusBarLoadIcon(hInst);
|
|
|
|
|
|
|
|
|
|
for (i=0; i<sb_parts; i++) {
|
|
|
|
|
if (sb_part_icons[i] != 255) {
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETICON, i, (LPARAM)hIcon[sb_part_icons[i]]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iStatusWidths[i] = (i+1)*icon_width;
|
|
|
|
|
}
|
|
|
|
|
iStatusWidths[i-1] = -1;
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETPARTS, (WPARAM)sb_parts, (LPARAM)iStatusWidths);
|
|
|
|
|
break;
|
|
|
|
|
|
2017-10-07 04:34:04 -04:00
|
|
|
default:
|
2017-10-10 03:07:29 -04:00
|
|
|
return(CallWindowProc((WNDPROC)OriginalProcedure,
|
2017-10-07 04:34:04 -04:00
|
|
|
hwnd, message, wParam, lParam));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* API: Create and set up the Status Bar window. */
|
|
|
|
|
void
|
2017-12-13 22:39:41 +01:00
|
|
|
StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
|
|
|
|
RECT rectDialog;
|
2017-12-13 22:39:41 +01:00
|
|
|
int dw, dh;
|
2020-09-02 11:29:16 +08:00
|
|
|
|
|
|
|
|
/* Get current DPI and calculate icon sizes */
|
|
|
|
|
dpi = win_get_dpi(hwndParent);
|
|
|
|
|
icon_width = MulDiv(SB_ICON_WIDTH, dpi, 96);
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
/* Load our icons into the cache for faster access. */
|
2020-09-02 11:29:16 +08:00
|
|
|
StatusBarLoadIcon(hInst);
|
2017-10-07 04:34:04 -04:00
|
|
|
|
|
|
|
|
GetWindowRect(hwndParent, &rectDialog);
|
|
|
|
|
dw = rectDialog.right - rectDialog.left;
|
|
|
|
|
dh = rectDialog.bottom - rectDialog.top;
|
|
|
|
|
|
|
|
|
|
/* Load the Common Controls DLL if needed. */
|
|
|
|
|
InitCommonControls();
|
|
|
|
|
|
|
|
|
|
/* Create the window, and make sure it's using the STATUS class. */
|
|
|
|
|
hwndSBAR = CreateWindowEx(0,
|
|
|
|
|
STATUSCLASSNAME,
|
|
|
|
|
(LPCTSTR)NULL,
|
|
|
|
|
SBARS_SIZEGRIP|WS_CHILD|WS_VISIBLE|SBT_TOOLTIPS,
|
|
|
|
|
0, dh-17, dw, 17,
|
|
|
|
|
hwndParent,
|
|
|
|
|
(HMENU)idStatus, hInst, NULL);
|
|
|
|
|
|
|
|
|
|
/* Replace the original procedure with ours. */
|
2017-10-10 03:07:29 -04:00
|
|
|
OriginalProcedure = GetWindowLongPtr(hwndSBAR, GWLP_WNDPROC);
|
2017-10-07 04:34:04 -04:00
|
|
|
SetWindowLongPtr(hwndSBAR, GWL_WNDPROC, (LONG_PTR)&StatusBarProcedure);
|
|
|
|
|
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETMINHEIGHT, (WPARAM)17, (LPARAM)0);
|
|
|
|
|
|
|
|
|
|
/* Align the window with the parent (main) window. */
|
|
|
|
|
GetWindowRect(hwndSBAR, &rectDialog);
|
|
|
|
|
SetWindowPos(hwndSBAR,
|
|
|
|
|
HWND_TOPMOST,
|
|
|
|
|
rectDialog.left, rectDialog.top,
|
|
|
|
|
rectDialog.right-rectDialog.left,
|
|
|
|
|
rectDialog.bottom-rectDialog.top,
|
|
|
|
|
SWP_SHOWWINDOW);
|
|
|
|
|
|
2017-10-29 04:20:20 -05:00
|
|
|
/* Initialize the status bar. This is clumsy. */
|
|
|
|
|
sb_parts = 1;
|
|
|
|
|
iStatusWidths = (int *)malloc(sb_parts * sizeof(int));
|
|
|
|
|
memset(iStatusWidths, 0, sb_parts * sizeof(int));
|
|
|
|
|
sb_part_meanings = (int *)malloc(sb_parts * sizeof(int));
|
|
|
|
|
memset(sb_part_meanings, 0, sb_parts * sizeof(int));
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons = (uint8_t *)malloc(sb_parts * sizeof(uint8_t));
|
|
|
|
|
memset(sb_part_icons, 0, sb_parts * sizeof(uint8_t));
|
2017-10-29 04:20:20 -05:00
|
|
|
sbTips = (WCHAR **)malloc(sb_parts * sizeof(WCHAR *));
|
|
|
|
|
memset(sbTips, 0, sb_parts * sizeof(WCHAR *));
|
2017-10-07 04:34:04 -04:00
|
|
|
sb_parts = 0;
|
2017-10-29 04:20:20 -05:00
|
|
|
iStatusWidths[sb_parts] = -1;
|
|
|
|
|
sb_part_meanings[sb_parts] = SB_TEXT;
|
2018-07-15 01:41:53 +02:00
|
|
|
sb_part_icons[sb_parts] = 255;
|
2017-10-29 04:20:20 -05:00
|
|
|
sb_parts++;
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETPARTS, (WPARAM)sb_parts, (LPARAM)iStatusWidths);
|
|
|
|
|
SendMessage(hwndSBAR, SB_SETTEXT, 0 | SBT_NOBORDERS,
|
2020-04-26 19:22:13 +02:00
|
|
|
(LPARAM)plat_get_string(IDS_2117));
|
2020-04-23 01:24:01 +02:00
|
|
|
|
2017-10-29 04:20:20 -05:00
|
|
|
sb_ready = 1;
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-12-05 11:48:31 +01:00
|
|
|
void
|
2021-04-13 14:07:21 -03:00
|
|
|
ui_sb_update_text()
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t part = 0xff;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (!sb_ready || (sb_parts == 0) || (sb_part_meanings == NULL))
|
|
|
|
|
return;
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
part = sb_map[SB_TEXT];
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (part != 0xff)
|
2021-04-13 14:07:21 -03:00
|
|
|
SendMessage(hwndSBAR, SB_SETTEXT, part | SBT_NOBORDERS, (LPARAM)((sb_text[0] != L'\0') ? sb_text : sb_bugtext));
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* API */
|
|
|
|
|
void
|
2021-04-13 14:07:21 -03:00
|
|
|
ui_sb_set_text_w(wchar_t *wstr)
|
2017-10-07 04:34:04 -04:00
|
|
|
{
|
2021-04-13 14:07:21 -03:00
|
|
|
if (wstr)
|
|
|
|
|
wcscpy(sb_text, wstr);
|
|
|
|
|
else
|
|
|
|
|
memset(sb_text, 0x00, sizeof(sb_text));
|
|
|
|
|
ui_sb_update_text();
|
|
|
|
|
}
|
2017-10-07 04:34:04 -04:00
|
|
|
|
2021-04-13 14:07:21 -03:00
|
|
|
|
|
|
|
|
/* API */
|
|
|
|
|
void
|
|
|
|
|
ui_sb_set_text(char *str)
|
|
|
|
|
{
|
|
|
|
|
if (str)
|
|
|
|
|
mbstowcs(sb_text, str, strlen(str) + 1);
|
|
|
|
|
else
|
|
|
|
|
memset(sb_text, 0x00, sizeof(sb_text));
|
|
|
|
|
ui_sb_update_text();
|
2017-11-02 02:28:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* API */
|
|
|
|
|
void
|
|
|
|
|
ui_sb_bugui(char *str)
|
|
|
|
|
{
|
2021-04-13 14:07:21 -03:00
|
|
|
if (str)
|
|
|
|
|
mbstowcs(sb_bugtext, str, strlen(str) + 1);
|
|
|
|
|
else
|
|
|
|
|
memset(sb_bugtext, 0x00, sizeof(sb_bugtext));
|
|
|
|
|
ui_sb_update_text();
|
2017-10-07 04:34:04 -04:00
|
|
|
}
|