Large changes to configuration files again (the old ones might break, be careful);

Applied the mainline PCem slight CPU emulation speedup commit;
Added emulation of removable SCSI hard disks;
CD-ROM image handler now uses C FILE's (with the 64-bit size calls) instead of C++ iostreams, ISO images bigger than 2 GB should work properly again;
Split RLL/ESDI and XT IDE disks to their own bus types;
Turned status bar pane meaning and hard disks and CD-ROM BUS numbers to #define's;
Other miscellaneous cleanups.
This commit is contained in:
OBattler
2017-05-27 03:53:32 +02:00
parent 94680da416
commit a36720f174
56 changed files with 4736 additions and 2682 deletions

View File

@@ -32,194 +32,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STATUSBARMENU MENU DISCARDABLE
BEGIN
POPUP "FDD 1"
BEGIN
MENUITEM "&Change...", IDM_DISC_1
MENUITEM "Change FDD 1 (&Write-protected)...", IDM_DISC_1_WP
MENUITEM "&Eject FDD 1", IDM_EJECT_1
END
POPUP "FDD 2"
BEGIN
MENUITEM "&Change...", IDM_DISC_2
MENUITEM "Change FDD 2 (&Write-protected)...", IDM_DISC_2_WP
MENUITEM "&Eject FDD 2", IDM_EJECT_2
END
POPUP "FDD 3"
BEGIN
MENUITEM "&Change...", IDM_DISC_3
MENUITEM "Change FDD 3 (&Write-protected)...", IDM_DISC_3_WP
MENUITEM "&Eject FDD 3", IDM_EJECT_3
END
POPUP "FDD 4"
BEGIN
MENUITEM "&Change...", IDM_DISC_4
MENUITEM "Change FDD 4 (&Write-protected)...", IDM_DISC_4_WP
MENUITEM "&Eject FDD 4", IDM_EJECT_4
END
POPUP "CD-ROM 1"
BEGIN
MENUITEM "&Mute", IDM_CDROM_1_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_1_EMPTY
MENUITEM "&Reload previous image", IDM_CDROM_1_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_CDROM_1_IMAGE
END
POPUP "CD-ROM 2"
BEGIN
MENUITEM "&Mute", IDM_CDROM_2_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_2_EMPTY
MENUITEM "&Reload previous image", IDM_CDROM_2_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_CDROM_2_IMAGE
END
POPUP "CD-ROM 3"
BEGIN
MENUITEM "&Mute", IDM_CDROM_3_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_3_EMPTY
MENUITEM "&Reload previous image", IDM_CDROM_3_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_CDROM_3_IMAGE
END
POPUP "CD-ROM 4"
BEGIN
MENUITEM "&Mute", IDM_CDROM_4_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_4_EMPTY
MENUITEM "&Reload previous image", IDM_CDROM_4_RELOAD
MENUITEM SEPARATOR
MENUITEM "&Image...", IDM_CDROM_4_IMAGE
END
POPUP "Removable disk 01"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_01_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_01_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_01_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_01_EIMAGE
END
POPUP "Removable disk 02"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_02_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_02_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_02_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_02_EIMAGE
END
POPUP "Removable disk 03"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_03_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_03_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_03_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_03_EIMAGE
END
POPUP "Removable disk 04"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_04_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_04_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_04_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_04_EIMAGE
END
POPUP "Removable disk 05"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_05_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_05_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_05_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_05_EIMAGE
END
POPUP "Removable disk 06"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_06_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_06_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_06_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_06_EIMAGE
END
POPUP "Removable disk 07"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_07_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_07_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_07_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_07_EIMAGE
END
POPUP "Removable disk 08"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_08_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_08_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_08_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_08_EIMAGE
END
POPUP "Removable disk 09"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_09_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_09_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_09_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_09_EIMAGE
END
POPUP "Removable disk 10"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_10_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_10_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_10_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_10_EIMAGE
END
POPUP "Removable disk 11"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_11_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_11_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_11_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_11_EIMAGE
END
POPUP "Removable disk 12"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_12_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_12_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_12_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_12_EIMAGE
END
POPUP "Removable disk 13"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_13_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_13_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_13_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_13_EIMAGE
END
POPUP "Removable disk 14"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_14_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_14_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_14_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_14_EIMAGE
END
POPUP "Removable disk 15"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_15_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_15_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_15_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_15_EIMAGE
END
POPUP "Removable disk 16"
BEGIN
MENUITEM "E&mpty", IDM_RDISK_16_EMPTY
MENUITEM "&Reload previous image", IDM_RDISK_16_RELOAD
MENUITEM SEPARATOR
MENUITEM "&New image...", IDM_RDISK_16_IMAGE
MENUITEM "&Existing image...", IDM_RDISK_16_EIMAGE
END
END
MAINMENU MENU DISCARDABLE
@@ -254,7 +66,7 @@ BEGIN
MENUITEM "&2x", IDM_VID_SCALE_4X
END
MENUITEM SEPARATOR
MENUITEM "&Fullscreen", IDM_VID_FULLSCREEN
MENUITEM "&Fullscreen\tCtrl+Alt+PageUP", IDM_VID_FULLSCREEN
POPUP "Fullscreen &stretch mode"
BEGIN
MENUITEM "&Full screen stretch", IDM_VID_FS_FULL
@@ -346,6 +158,7 @@ BEGIN
#ifdef ENABLE_LOG_BREAKPOINT
VK_F10, IDM_LOG_BREAKPOINT, CONTROL, VIRTKEY
#endif
VK_PRIOR, IDM_VID_FULLSCREEN, VIRTKEY, CONTROL , ALT
VK_F11, IDM_VID_SCREENSHOT, VIRTKEY, CONTROL
VK_F12, IDM_FILE_RESET_CAD, VIRTKEY, CONTROL
END
@@ -668,12 +481,16 @@ END
177 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_active.ico"
192 ICON DISCARDABLE "ICONS/hard_disk_mfm.ico"
193 ICON DISCARDABLE "ICONS/hard_disk_mfm_active.ico"
194 ICON DISCARDABLE "ICONS/hard_disk.ico"
195 ICON DISCARDABLE "ICONS/hard_disk_active.ico"
196 ICON DISCARDABLE "ICONS/hard_disk_ide.ico"
197 ICON DISCARDABLE "ICONS/hard_disk_ide_active.ico"
198 ICON DISCARDABLE "ICONS/hard_disk_scsi.ico"
199 ICON DISCARDABLE "ICONS/hard_disk_scsi_active.ico"
194 ICON DISCARDABLE "ICONS/hard_disk_xtide.ico"
195 ICON DISCARDABLE "ICONS/hard_disk_xtide_active.ico"
196 ICON DISCARDABLE "ICONS/hard_disk_rll.ico"
197 ICON DISCARDABLE "ICONS/hard_disk_rll_active.ico"
198 ICON DISCARDABLE "ICONS/hard_disk.ico"
199 ICON DISCARDABLE "ICONS/hard_disk_active.ico"
200 ICON DISCARDABLE "ICONS/hard_disk_ide.ico"
201 ICON DISCARDABLE "ICONS/hard_disk_ide_active.ico"
202 ICON DISCARDABLE "ICONS/hard_disk_scsi.ico"
203 ICON DISCARDABLE "ICONS/hard_disk_scsi_active.ico"
256 ICON DISCARDABLE "ICONS/machine.ico"
257 ICON DISCARDABLE "ICONS/video.ico"
258 ICON DISCARDABLE "ICONS/input_devices.ico"
@@ -972,9 +789,9 @@ BEGIN
2163 "Attempting to create a spuriously large hard disk image"
2164 "Invalid number of sectors (valid values are between 1 and 99)"
2165 "MFM"
2166 "IDE (PIO-only)"
2167 "IDE (PIO and DMA)"
2168 "SCSI"
2166 "XT IDE"
2167 "RLL"
2168 "IDE (PIO-only)"
2169 "%01i:%01i"
2170 "Custom..."
2171 "%" PRIu64 " MB (CHS: %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")"
@@ -1004,13 +821,30 @@ BEGIN
2195 "IDE (PIO-only) (%01i:%01i)"
2196 "Add New Hard Disk"
2197 "Add Existing Hard Disk"
2198 "Removable disk %i: %s"
2198 "SCSI removable disk %i: %s"
2199 "USB is not yet supported"
2200 "Invalid PCap device"
2201 "SCSI removable disk: %ws"
2202 "<Placeholder string>"
2203 "English (United States)"
2201 "&Notify disk change"
2202 "SCSI (removable)"
2203 "SCSI (removable) (%02i:%02i)"
2204 "Pcap Library Not Available"
2205 "RLL (%01i:%01i)"
2206 "XT IDE (%01i:%01i)"
2207 "RLL hard disk"
2208 "XT IDE hard disk"
2209 "IDE (PIO and DMA)"
2210 "SCSI"
2211 "&New image..."
2212 "Existing image..."
2213 "Existing image (&Write-protected)..."
2214 "E&ject"
2215 "&Mute"
2216 "E&mpty"
2217 "&Reload previous image"
2218 "&Image..."
2219 "PCap failed to set up because it may not be initialized"
2220 "Image (&Write-protected)..."
2221 "English (United States)"
END

5
src/WIN/plat_iodev.h Normal file
View File

@@ -0,0 +1,5 @@
extern void cdrom_eject(uint8_t id);
extern void cdrom_reload(uint8_t id);
extern void removable_disk_unload(uint8_t id);
extern void removable_disk_eject(uint8_t id);
extern void removable_disk_reload(uint8_t id);

View File

@@ -117,19 +117,6 @@
#define IDM_ABOUT 40001
#define IDC_ABOUT_ICON 65535
#define IDM_DISC_1 40000
#define IDM_DISC_2 40001
#define IDM_DISC_3 40002
#define IDM_DISC_4 40003
#define IDM_DISC_1_WP 40004
#define IDM_DISC_2_WP 40005
#define IDM_DISC_3_WP 40006
#define IDM_DISC_4_WP 40007
#define IDM_EJECT_1 40008
#define IDM_EJECT_2 40009
#define IDM_EJECT_3 40010
#define IDM_EJECT_4 40011
#define IDM_FILE_RESET 40015
#define IDM_FILE_HRESET 40016
#define IDM_FILE_EXIT 40017
@@ -159,92 +146,6 @@
#define IDM_VID_SCREENSHOT 40078
#define IDM_VID_INVERT 40079
#define IDM_CDROM_1_MUTE 40128
#define IDM_CDROM_1_IMAGE 40144
#define IDM_CDROM_1_RELOAD 40160
#define IDM_CDROM_1_EMPTY 40176
#define IDM_CDROM_1_REAL 40192
#define IDM_CDROM_2_MUTE 40129
#define IDM_CDROM_2_IMAGE 40145
#define IDM_CDROM_2_RELOAD 40161
#define IDM_CDROM_2_EMPTY 40177
#define IDM_CDROM_2_REAL 40193
#define IDM_CDROM_3_MUTE 40130
#define IDM_CDROM_3_IMAGE 40146
#define IDM_CDROM_3_RELOAD 40162
#define IDM_CDROM_3_EMPTY 40178
#define IDM_CDROM_3_REAL 40194
#define IDM_CDROM_4_MUTE 40131
#define IDM_CDROM_4_IMAGE 40147
#define IDM_CDROM_4_RELOAD 40163
#define IDM_CDROM_4_EMPTY 40179
#define IDM_CDROM_4_REAL 40195
#define IDM_RDISK_01_IMAGE 3200
#define IDM_RDISK_01_EIMAGE 3216
#define IDM_RDISK_01_RELOAD 3232
#define IDM_RDISK_01_EMPTY 3248
#define IDM_RDISK_02_IMAGE 3201
#define IDM_RDISK_02_EIMAGE 3217
#define IDM_RDISK_02_RELOAD 3233
#define IDM_RDISK_02_EMPTY 3249
#define IDM_RDISK_03_IMAGE 3202
#define IDM_RDISK_03_EIMAGE 3218
#define IDM_RDISK_03_RELOAD 3234
#define IDM_RDISK_03_EMPTY 3250
#define IDM_RDISK_04_IMAGE 3203
#define IDM_RDISK_04_EIMAGE 3219
#define IDM_RDISK_04_RELOAD 3235
#define IDM_RDISK_04_EMPTY 3251
#define IDM_RDISK_05_IMAGE 3204
#define IDM_RDISK_05_EIMAGE 3220
#define IDM_RDISK_05_RELOAD 3236
#define IDM_RDISK_05_EMPTY 3252
#define IDM_RDISK_06_IMAGE 3205
#define IDM_RDISK_06_EIMAGE 3221
#define IDM_RDISK_06_RELOAD 3237
#define IDM_RDISK_06_EMPTY 3253
#define IDM_RDISK_07_IMAGE 3206
#define IDM_RDISK_07_EIMAGE 3222
#define IDM_RDISK_07_RELOAD 3238
#define IDM_RDISK_07_EMPTY 3254
#define IDM_RDISK_08_IMAGE 3207
#define IDM_RDISK_08_EIMAGE 3223
#define IDM_RDISK_08_RELOAD 3239
#define IDM_RDISK_08_EMPTY 3255
#define IDM_RDISK_09_IMAGE 3208
#define IDM_RDISK_09_EIMAGE 3224
#define IDM_RDISK_09_RELOAD 3240
#define IDM_RDISK_09_EMPTY 3256
#define IDM_RDISK_10_IMAGE 3209
#define IDM_RDISK_10_EIMAGE 3225
#define IDM_RDISK_10_RELOAD 3241
#define IDM_RDISK_10_EMPTY 3257
#define IDM_RDISK_11_IMAGE 3210
#define IDM_RDISK_11_EIMAGE 3226
#define IDM_RDISK_11_RELOAD 3242
#define IDM_RDISK_11_EMPTY 3258
#define IDM_RDISK_12_IMAGE 3211
#define IDM_RDISK_12_EIMAGE 3227
#define IDM_RDISK_12_RELOAD 3243
#define IDM_RDISK_12_EMPTY 3259
#define IDM_RDISK_13_IMAGE 3212
#define IDM_RDISK_13_EIMAGE 3228
#define IDM_RDISK_13_RELOAD 3244
#define IDM_RDISK_13_EMPTY 3260
#define IDM_RDISK_14_IMAGE 3213
#define IDM_RDISK_14_EIMAGE 3229
#define IDM_RDISK_14_RELOAD 3245
#define IDM_RDISK_14_EMPTY 3261
#define IDM_RDISK_15_IMAGE 3214
#define IDM_RDISK_15_EIMAGE 3230
#define IDM_RDISK_15_RELOAD 3246
#define IDM_RDISK_15_EMPTY 3262
#define IDM_RDISK_16_IMAGE 3215
#define IDM_RDISK_16_EIMAGE 3231
#define IDM_RDISK_16_RELOAD 3247
#define IDM_RDISK_16_EMPTY 3263
#define IDM_IDE_TER_ENABLED 44000
#define IDM_IDE_TER_IRQ9 44009
#define IDM_IDE_TER_IRQ10 44010
@@ -326,85 +227,7 @@
#define IDC_EDIT6 1035
#define IDC_COMBOHDT 1036
#define IDC_EJECTC 1040
#define IDC_EDITC 1050
#define IDC_CFILE 1060
#define IDC_CNEW 1070
#define IDC_EDIT_C_SPT 1200
#define IDC_EDIT_C_HPC 1210
#define IDC_EDIT_C_CYL 1220
#define IDC_EDIT_C_FN 1230
#define IDC_TEXT_C_SIZE 1240
#define IDC_EJECTD 1041
#define IDC_EDITD 1051
#define IDC_DFILE 1061
#define IDC_DNEW 1071
#define IDC_EDIT_D_SPT 1201
#define IDC_EDIT_D_HPC 1211
#define IDC_EDIT_D_CYL 1221
#define IDC_EDIT_D_FN 1231
#define IDC_TEXT_D_SIZE 1241
#define IDC_EJECTE 1042
#define IDC_EDITE 1052
#define IDC_EFILE 1062
#define IDC_ENEW 1072
#define IDC_EDIT_E_SPT 1202
#define IDC_EDIT_E_HPC 1212
#define IDC_EDIT_E_CYL 1222
#define IDC_EDIT_E_FN 1232
#define IDC_TEXT_E_SIZE 1242
#define IDC_EJECTF 1043
#define IDC_EDITF 1053
#define IDC_FFILE 1063
#define IDC_FNEW 1073
#define IDC_EDIT_F_SPT 1203
#define IDC_EDIT_F_HPC 1213
#define IDC_EDIT_F_CYL 1223
#define IDC_EDIT_F_FN 1233
#define IDC_TEXT_F_SIZE 1243
#define IDC_EJECTG 1044
#define IDC_EDITG 1054
#define IDC_GFILE 1064
#define IDC_GNEW 1074
#define IDC_EDIT_G_SPT 1204
#define IDC_EDIT_G_HPC 1214
#define IDC_EDIT_G_CYL 1224
#define IDC_EDIT_G_FN 1234
#define IDC_TEXT_G_SIZE 1244
#define IDC_EJECTH 1045
#define IDC_EDITH 1055
#define IDC_HFILE 1065
#define IDC_HNEW 1075
#define IDC_EDIT_H_SPT 1205
#define IDC_EDIT_H_HPC 1215
#define IDC_EDIT_H_CYL 1225
#define IDC_EDIT_H_FN 1235
#define IDC_TEXT_H_SIZE 1245
#define IDC_EJECTI 1046
#define IDC_EDITI 1056
#define IDC_IFILE 1066
#define IDC_INEW 1076
#define IDC_EDIT_I_SPT 1206
#define IDC_EDIT_I_HPC 1216
#define IDC_EDIT_I_CYL 1226
#define IDC_EDIT_I_FN 1236
#define IDC_TEXT_I_SIZE 1246
#define IDC_EJECTJ 1047
#define IDC_EDITJ 1057
#define IDC_JFILE 1067
#define IDC_JNEW 1077
#define IDC_EDIT_J_SPT 1207
#define IDC_EDIT_J_HPC 1217
#define IDC_EDIT_J_CYL 1227
#define IDC_EDIT_J_FN 1237
#define IDC_TEXT_J_SIZE 1247
#define IDC_HDTYPE 1280
@@ -441,47 +264,26 @@
#define IDC_CONFIG_BASE 1200
#define WM_RESETD3D WM_USER
#define WM_LEAVEFULLSCREEN WM_USER + 1
/* The biggest amount of low bits needed for CD-ROMS (2 bits for ID and 5 bits for host drive, so 7 bits),
and removable disks (5 bits for ID), so we choose an 256-entry spacing for convenience. */
#define C_BASE 6
#define D_BASE 44
#define E_BASE 82
#define F_BASE 120
#define G_BASE 158
#define H_BASE 196
#define I_BASE 234
#define J_BASE 272
#define CMD_BASE 314
#define DLG_HEIGHT 346
#define IDM_FLOPPY_IMAGE_NEW 0x1200
#define IDM_FLOPPY_IMAGE_EXISTING 0x1300
#define IDM_FLOPPY_IMAGE_EXISTING_WP 0x1400
#define IDM_FLOPPY_DUMP_86F 0x1500
#define IDM_FLOPPY_EJECT 0x1600
#define IDC_CHECK_CDROM_1_ENABLED 1536
#define IDC_COMBO_CDROM_1_BUS 1544
#define IDC_COMBO_CDROM_1_CHANNEL 1552
#define IDC_CHECK_CDROM_1_DMA_ENABLED 1560
#define IDC_COMBO_CDROM_1_SCSI_ID 1568
#define IDC_COMBO_CDROM_1_SCSI_LUN 1576
#define IDM_CDROM_MUTE 0x2200
#define IDM_CDROM_EMPTY 0x2300
#define IDM_CDROM_RELOAD 0x2400
#define IDM_CDROM_IMAGE 0x2500
#define IDM_CDROM_HOST_DRIVE 0x2600
#define IDC_CHECK_CDROM_2_ENABLED 1537
#define IDC_COMBO_CDROM_2_BUS 1545
#define IDC_COMBO_CDROM_2_CHANNEL 1553
#define IDC_CHECK_CDROM_2_DMA_ENABLED 1561
#define IDC_COMBO_CDROM_2_SCSI_ID 1569
#define IDC_COMBO_CDROM_2_SCSI_LUN 1577
#define IDC_CHECK_CDROM_3_ENABLED 1538
#define IDC_COMBO_CDROM_3_BUS 1546
#define IDC_COMBO_CDROM_3_CHANNEL 1554
#define IDC_CHECK_CDROM_3_DMA_ENABLED 1562
#define IDC_COMBO_CDROM_3_SCSI_ID 1570
#define IDC_COMBO_CDROM_3_SCSI_LUN 1578
#define IDC_CHECK_CDROM_4_ENABLED 1539
#define IDC_COMBO_CDROM_4_BUS 1547
#define IDC_COMBO_CDROM_4_CHANNEL 1555
#define IDC_CHECK_CDROM_4_DMA_ENABLED 1563
#define IDC_COMBO_CDROM_4_SCSI_ID 1571
#define IDC_COMBO_CDROM_4_SCSI_LUN 1579
#define IDM_RDISK_EJECT 0x3200
#define IDM_RDISK_RELOAD 0x3300
#define IDM_RDISK_SEND_CHANGE 0x3400
#define IDM_RDISK_IMAGE 0x3500
#define IDM_RDISK_IMAGE_WP 0x3600
#define IDC_STATIC 1792
@@ -495,3 +297,5 @@
# define _APS_NEXT_SYMED_VALUE 101
# endif
#endif
#define STRINGS_NUM 174

File diff suppressed because it is too large Load Diff

View File

@@ -8,14 +8,15 @@
*/
#ifndef BOX_WIN_H
# define BOX_WIN_H
# ifndef NO_UNICODE
# define UNICODE
# endif
# define BITMAP WINDOWS_BITMAP
//# ifdef _WIN32_WINNT
//# undef _WIN32_WINNT
//# define _WIN32_WINNT 0x0501
//# endif
/* # ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
# endif */
# include <windows.h>
# undef BITMAP
@@ -25,6 +26,14 @@
#define szStatusBarClassName L"86BoxStatusBar"
#define WM_RESETD3D WM_USER
#define WM_LEAVEFULLSCREEN WM_USER + 1
#define WM_SAVESETTINGS 0x8888 /* 86Box-specific message, used to tell the child dialog to save the currently specified settings. */
#define SB_ICON_WIDTH 24
extern HINSTANCE hinstance;
extern HWND ghwnd;
extern HWND status_hwnd;
@@ -37,6 +46,9 @@ extern WCHAR wopenfilestring[260];
extern int pause;
extern HMENU smenu;
extern HMENU *sb_menu_handles;
#ifdef __cplusplus
extern "C" {
@@ -66,6 +78,15 @@ extern void update_status_bar_panes(HWND hwnds);
extern int fdd_type_to_icon(int type);
extern void hard_disk_add_open(HWND hwnd, int is_existing);
extern int hard_disk_was_added(void);
extern void get_registry_key_map(void);
extern void process_raw_input(LPARAM lParam, int infocus);
extern int find_status_bar_part(int tag);
extern void cdrom_close(uint8_t id);
extern void update_tip(int meaning);
#ifdef __cplusplus
}

View File

@@ -42,7 +42,7 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id++;
break;
case CONFIG_SELECTION:
val_int = config_get_int(config_device->name, config->name, config->default_int);
@@ -58,6 +58,38 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id += 2;
break;
case CONFIG_HEX16:
val_int = config_get_hex16(config_device->name, config->name, config->default_int);
c = 0;
while (selection->description[0])
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)selection->description);
if (val_int == selection->value)
SendMessage(h, CB_SETCURSEL, c, 0);
selection++;
c++;
}
id += 2;
break;
case CONFIG_HEX20:
val_int = config_get_hex20(config_device->name, config->name, config->default_int);
c = 0;
while (selection->description[0])
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)selection->description);
if (val_int == selection->value)
SendMessage(h, CB_SETCURSEL, c, 0);
selection++;
c++;
}
id += 2;
break;
}
config++;
}
@@ -89,7 +121,7 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id++;
break;
case CONFIG_SELECTION:
val_int = config_get_int(config_device->name, config->name, config->default_int);
@@ -103,6 +135,34 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id += 2;
break;
case CONFIG_HEX16:
val_int = config_get_hex16(config_device->name, config->name, config->default_int);
c = SendMessage(h, CB_GETCURSEL, 0, 0);
for (; c > 0; c--)
selection++;
if (val_int != selection->value)
changed = 1;
id += 2;
break;
case CONFIG_HEX20:
val_int = config_get_hex20(config_device->name, config->name, config->default_int);
c = SendMessage(h, CB_GETCURSEL, 0, 0);
for (; c > 0; c--)
selection++;
if (val_int != selection->value)
changed = 1;
id += 2;
break;
}
config++;
}
@@ -134,7 +194,7 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id++;
break;
case CONFIG_SELECTION:
c = SendMessage(h, CB_GETCURSEL, 0, 0);
for (; c > 0; c--)
@@ -143,6 +203,24 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
id += 2;
break;
case CONFIG_HEX16:
c = SendMessage(h, CB_GETCURSEL, 0, 0);
for (; c > 0; c--)
selection++;
config_set_hex16(config_device->name, config->name, selection->value);
id += 2;
break;
case CONFIG_HEX20:
c = SendMessage(h, CB_GETCURSEL, 0, 0);
for (; c > 0; c--)
selection++;
config_set_hex20(config_device->name, config->name, selection->value);
id += 2;
break;
}
config++;
}
@@ -219,6 +297,8 @@ void deviceconfig_open(HWND hwnd, device_t *device)
break;
case CONFIG_SELECTION:
case CONFIG_HEX16:
case CONFIG_HEX20:
/*Combo box*/
item = (DLGITEMTEMPLATE *)data;
item->x = 70;

171
src/WIN/win_iodev.c Normal file
View File

@@ -0,0 +1,171 @@
#define UNICODE
#define _WIN32_WINNT 0x0501
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#undef BITMAP
#include <commctrl.h>
#include <commdlg.h>
#include <process.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
#include "../ibm.h"
#include "../device.h"
#include "../cdrom.h"
#include "../cdrom_image.h"
#include "../cdrom_ioctl.h"
#include "../cdrom_null.h"
#include "../scsi_disk.h"
#include "plat_iodev.h"
#include "resource.h"
#include "win.h"
void cdrom_eject(uint8_t id)
{
int part;
part = find_status_bar_part(SB_CDROM | id);
if ((part == -1) || (sb_menu_handles == NULL))
{
return;
}
if (cdrom_drives[id].host_drive == 0)
{
/* Switch from empty to empty. Do nothing. */
return;
}
cdrom_drives[id].handler->exit(id);
cdrom_close(id);
cdrom_null_open(id, 0);
if (cdrom_drives[id].bus_type)
{
/* Signal disc change to the emulated machine. */
cdrom_insert(id);
}
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_IMAGE | id, MF_UNCHECKED);
if ((cdrom_drives[id].host_drive >= 65) && (cdrom_drives[id].host_drive <= 90))
{
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_HOST_DRIVE | id | (cdrom_drive << 3), MF_UNCHECKED);
}
cdrom_drives[id].prev_host_drive = cdrom_drives[id].host_drive;
cdrom_drives[id].host_drive=0;
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_EMPTY | id, MF_CHECKED);
update_status_bar_icon_state(SB_CDROM | id, 1);
EnableMenuItem(sb_menu_handles[part], IDM_CDROM_RELOAD | id, MF_BYCOMMAND | MF_ENABLED);
update_tip(SB_CDROM | id);
saveconfig();
}
void cdrom_reload(uint8_t id)
{
int part;
int new_cdrom_drive;
part = find_status_bar_part(SB_CDROM | id);
if ((part == -1) || (sb_menu_handles == NULL))
{
return;
}
if ((cdrom_drives[id].host_drive == cdrom_drives[id].prev_host_drive) || (cdrom_drives[id].prev_host_drive == 0) || (cdrom_drives[id].host_drive != 0))
{
/* Switch from empty to empty. Do nothing. */
return;
}
cdrom_close(id);
if (cdrom_drives[id].prev_host_drive == 200)
{
image_open(id, cdrom_image[id].image_path);
if (cdrom_drives[id].bus_type)
{
/* Signal disc change to the emulated machine. */
cdrom_insert(id);
}
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_EMPTY | id, MF_UNCHECKED);
cdrom_drives[id].host_drive = 200;
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_IMAGE | id, MF_CHECKED);
}
else
{
new_cdrom_drive = cdrom_drives[id].prev_host_drive;
ioctl_open(id, new_cdrom_drive);
if (cdrom_drives[id].bus_type)
{
/* Signal disc change to the emulated machine. */
cdrom_insert(id);
}
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_EMPTY | id, MF_UNCHECKED);
cdrom_drive = new_cdrom_drive;
CheckMenuItem(sb_menu_handles[part], IDM_CDROM_HOST_DRIVE | id | (cdrom_drives[id].host_drive << 3), MF_CHECKED);
}
update_status_bar_icon_state(SB_CDROM | id, 0);
EnableMenuItem(sb_menu_handles[part], IDM_CDROM_RELOAD | id, MF_BYCOMMAND | MF_GRAYED);
update_tip(SB_CDROM | id);
saveconfig();
}
void removable_disk_unload(uint8_t id)
{
if (wcslen(hdc[id].fn) == 0)
{
/* Switch from empty to empty. Do nothing. */
return;
}
scsi_unloadhd(hdc[id].scsi_id, hdc[id].scsi_lun, id);
scsi_disk_insert(id);
}
void removable_disk_eject(uint8_t id)
{
int part = 0;
part = find_status_bar_part(SB_CDROM | id);
if ((part == -1) || (sb_menu_handles == NULL))
{
return;
}
removable_disk_unload(id);
update_status_bar_icon_state(SB_RDISK | id, 1);
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_EJECT | id, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_RELOAD | id, MF_BYCOMMAND | MF_ENABLED);
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_SEND_CHANGE | id, MF_BYCOMMAND | MF_GRAYED);
update_tip(SB_RDISK | id);
saveconfig();
}
void removable_disk_reload(uint8_t id)
{
int part = 0;
part = find_status_bar_part(SB_CDROM | id);
if ((part == -1) || (sb_menu_handles == NULL))
{
return;
}
if (wcslen(hdc[id].fn) != 0)
{
/* Attempting to reload while an image is already loaded. Do nothing. */
return;
}
scsi_reloadhd(id);
/* scsi_disk_insert(id); */
update_status_bar_icon_state(SB_RDISK | id, wcslen(hdc[id].fn) ? 0 : 1);
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_EJECT | id, MF_BYCOMMAND | (wcslen(hdc[id].fn) ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_RELOAD | id, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem(sb_menu_handles[part], IDM_RDISK_SEND_CHANGE | id, MF_BYCOMMAND | (wcslen(hdc[id].fn) ? MF_ENABLED : MF_GRAYED));
update_tip(SB_RDISK | id);
saveconfig();
}

195
src/WIN/win_keyboard.c Normal file
View File

@@ -0,0 +1,195 @@
#define UNICODE
#define _WIN32_WINNT 0x0501
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#undef BITMAP
#include <commctrl.h>
#include <commdlg.h>
#include <process.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
#include "../device.h"
#include "plat_keyboard.h"
#include "win.h"
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
#endif
static uint16_t scancode_map[65536];
/* This is so we can disambiguate scan codes that would otherwise conflict and get
passed on incorrectly. */
UINT16 convert_scan_code(UINT16 scan_code)
{
switch (scan_code)
{
case 0xE001:
return 0xF001;
case 0xE002:
return 0xF002;
case 0xE0AA:
return 0xF003;
case 0xE005:
return 0xF005;
case 0xE006:
return 0xF006;
case 0xE007:
return 0xF007;
case 0xE071:
return 0xF008;
case 0xE072:
return 0xF009;
case 0xE07F:
return 0xF00A;
case 0xE0E1:
return 0xF00B;
case 0xE0EE:
return 0xF00C;
case 0xE0F1:
return 0xF00D;
case 0xE0FE:
return 0xF00E;
case 0xE0EF:
return 0xF00F;
default:
return scan_code;
}
}
void get_registry_key_map()
{
WCHAR *keyName = L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout";
WCHAR *valueName = L"Scancode Map";
unsigned char buf[32768];
DWORD bufSize;
HKEY hKey;
int j;
UINT32 *bufEx2;
int scMapCount;
UINT16 *bufEx;
int scancode_unmapped;
int scancode_mapped;
/* First, prepare the default scan code map list which is 1:1.
Remappings will be inserted directly into it.
65536 bytes so scan codes fit in easily and it's easy to find what each maps too,
since each array element is a scan code and provides for E0, etc. ones too. */
for (j = 0; j < 65536; j++)
scancode_map[j] = convert_scan_code(j);
bufSize = 32768;
/* Get the scan code remappings from:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, 1, &hKey) == ERROR_SUCCESS)
{
if(RegQueryValueEx(hKey, valueName, NULL, NULL, buf, &bufSize) == ERROR_SUCCESS)
{
bufEx2 = (UINT32 *) buf;
scMapCount = bufEx2[2];
if ((bufSize != 0) && (scMapCount != 0))
{
bufEx = (UINT16 *) (buf + 12);
for (j = 0; j < scMapCount*2; j += 2)
{
/* Each scan code is 32-bit: 16 bits of remapped scan code,
and 16 bits of original scan code. */
scancode_unmapped = bufEx[j + 1];
scancode_mapped = bufEx[j];
scancode_mapped = convert_scan_code(scancode_mapped);
/* Fixes scan code map logging. */
scancode_map[scancode_unmapped] = scancode_mapped;
}
}
}
RegCloseKey(hKey);
}
}
void process_raw_input(LPARAM lParam, int infocus)
{
uint32_t ri_size = 0;
UINT size;
RAWINPUT *raw;
USHORT scancode;
if (!infocus)
{
return;
}
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &size, sizeof(RAWINPUTHEADER));
raw = malloc(size);
if (raw == NULL)
{
return;
}
/* Here we read the raw input data for the keyboard */
ri_size = GetRawInputData((HRAWINPUT)(lParam), RID_INPUT, raw, &size, sizeof(RAWINPUTHEADER));
if(ri_size != size)
{
return;
}
/* If the input is keyboard, we process it */
if (raw->header.dwType == RIM_TYPEKEYBOARD)
{
RAWKEYBOARD rawKB = raw->data.keyboard;
scancode = rawKB.MakeCode;
/* If it's not a scan code that starts with 0xE1 */
if (!(rawKB.Flags & RI_KEY_E1))
{
if (rawKB.Flags & RI_KEY_E0)
{
scancode |= (0xE0 << 8);
}
/* Remap it according to the list from the Registry */
scancode = scancode_map[scancode];
if ((scancode >> 8) == 0xF0)
{
scancode |= 0x100; /* Extended key code in disambiguated format */
}
else if ((scancode >> 8) == 0xE0)
{
scancode |= 0x80; /* Normal extended key code */
}
/* If it's not 0 (therefore not 0xE1, 0xE2, etc),
then pass it on to the rawinputkey array */
if (!(scancode & 0xf00))
{
recv_key[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK);
}
}
else
{
if (rawKB.MakeCode == 0x1D)
{
scancode = 0xFF;
}
if (!(scancode & 0xf00))
{
recv_key[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK);
}
}
}
free(raw);
}

View File

@@ -21,8 +21,6 @@ LCID dwLanguage;
uint32_t dwLangID, dwSubLangID;
#define STRINGS_NUM 157 /* FIXME: should be in resource.h !! --FvK */
WCHAR lpResourceString[STRINGS_NUM][512];
char openfilestring[260];

View File

@@ -3,6 +3,7 @@
*/
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <stdint.h>
#include "plat_mouse.h"
#include "win.h"

File diff suppressed because it is too large Load Diff