Serial Passthrough
This commit is contained in:
@@ -10,13 +10,14 @@
|
||||
#
|
||||
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
#
|
||||
# Copyright 2020-2021 David Hrdlička.
|
||||
# Copyright 2020,2021 David Hrdlička.
|
||||
# Copyright 2021-2022 Jasmine Iwanek.
|
||||
#
|
||||
|
||||
enable_language(RC)
|
||||
|
||||
add_library(plat OBJECT win.c win_dynld.c win_cdrom.c win_keyboard.c
|
||||
win_mouse.c)
|
||||
win_mouse.c win_serial_passthrough.c)
|
||||
|
||||
add_library(ui OBJECT win_ui.c win_icon.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
||||
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
||||
|
||||
@@ -596,7 +596,7 @@ DEVOBJ := bugger.o cartridge.o cassette.o hasp.o hwm.o hwm_lm75.o hwm_lm78.o hwm
|
||||
mouse.o \
|
||||
mouse_bus.o \
|
||||
mouse_serial.o mouse_ps2.o \
|
||||
phoenix_486_jumper.o
|
||||
phoenix_486_jumper.o serial_passthrough.o
|
||||
|
||||
SIOOBJ := sio_acc3221.o sio_ali5123.o \
|
||||
sio_f82c710.o sio_82091aa.o sio_fdc37c6xx.o \
|
||||
@@ -749,7 +749,7 @@ VOODOOOBJ := vid_voodoo.o vid_voodoo_banshee.o \
|
||||
PLATOBJ := win.o \
|
||||
win_dynld.o \
|
||||
win_cdrom.o win_keyboard.o \
|
||||
win_mouse.o
|
||||
win_mouse.o win_serial_passthrough.o
|
||||
|
||||
UIOBJ := win_ui.o win_icon.o win_stbar.o discord.o \
|
||||
win_sdl.o win_opengl.o win_opengl_glslp.o glad.o \
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Povolit port LPT2"
|
||||
#define STR_PARALLEL3 "Povolit port LPT3"
|
||||
#define STR_PARALLEL4 "Povolit port LPT4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Řadič disku:"
|
||||
#define STR_FDC "Disketový řadič:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Parallelport 2"
|
||||
#define STR_PARALLEL3 "Parallelport 3"
|
||||
#define STR_PARALLEL4 "Parallelport 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HDD-Controller:"
|
||||
#define STR_FDC "FD-Controller:"
|
||||
|
||||
@@ -453,54 +453,78 @@ BEGIN
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT STR_LPT2, IDT_LPT2,
|
||||
CFG_HMARGIN, 28, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
CFG_HMARGIN, 24, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
COMBOBOX IDC_COMBO_LPT2,
|
||||
CFG_COMBO_BOX_LEFT, 26, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CFG_COMBO_BOX_LEFT, 22, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT STR_LPT3, IDT_LPT3,
|
||||
CFG_HMARGIN, 47, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
CFG_HMARGIN, 39, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
COMBOBOX IDC_COMBO_LPT3,
|
||||
CFG_COMBO_BOX_LEFT, 45, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CFG_COMBO_BOX_LEFT, 37, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT STR_LPT4, IDT_LPT4,
|
||||
CFG_HMARGIN, 66, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
CFG_HMARGIN, 54, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
|
||||
COMBOBOX IDC_COMBO_LPT4,
|
||||
CFG_COMBO_BOX_LEFT, 64, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CFG_COMBO_BOX_LEFT, 52, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
CONTROL STR_SERIAL1, IDC_CHECK_SERIAL1,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 83, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
CFG_HMARGIN, 71, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL2, IDC_CHECK_SERIAL2,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 102, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
CFG_HMARGIN, 86, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL3, IDC_CHECK_SERIAL3,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 121, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
CFG_HMARGIN, 101, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL4, IDC_CHECK_SERIAL4,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 140, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
CFG_HMARGIN, 116, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_PARALLEL1, IDC_CHECK_PARALLEL1,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
167, 83, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
167, 71, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_PARALLEL2, IDC_CHECK_PARALLEL2,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
167, 102, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
167, 86, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_PARALLEL3, IDC_CHECK_PARALLEL3,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
167, 121, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
167, 101, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_PARALLEL4, IDC_CHECK_PARALLEL4,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
167, 140, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
167, 116, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL_PASS1, IDC_CHECK_SERIAL_PASS1,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 134, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SERIAL_PASS1,
|
||||
CFG_COMBO_BTN_LEFT, 131, CFG_BTN_WIDTH, CFG_BTN_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL_PASS2, IDC_CHECK_SERIAL_PASS2,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 150, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SERIAL_PASS2,
|
||||
CFG_COMBO_BTN_LEFT, 147, CFG_BTN_WIDTH, CFG_BTN_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL_PASS3, IDC_CHECK_SERIAL_PASS3,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 165, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SERIAL_PASS3,
|
||||
CFG_COMBO_BTN_LEFT, 162, CFG_BTN_WIDTH, CFG_BTN_HEIGHT
|
||||
|
||||
CONTROL STR_SERIAL_PASS4, IDC_CHECK_SERIAL_PASS4,
|
||||
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
CFG_HMARGIN, 180, CFG_CHECKBOX_PRI_WIDTH, CFG_CHECKBOX_HEIGHT
|
||||
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_SERIAL_PASS4,
|
||||
CFG_COMBO_BTN_LEFT, 177, CFG_BTN_WIDTH, CFG_BTN_HEIGHT
|
||||
END
|
||||
|
||||
DLG_CFG_STORAGE DIALOG DISCARDABLE CFG_PANE_LEFT, CFG_PANE_TOP, CFG_PANE_WIDTH, CFG_PANE_HEIGHT
|
||||
@@ -996,6 +1020,10 @@ END
|
||||
#undef STR_PARALLEL2
|
||||
#undef STR_PARALLEL3
|
||||
#undef STR_PARALLEL4
|
||||
#undef STR_SERIAL_PASS1
|
||||
#undef STR_SERIAL_PASS2
|
||||
#undef STR_SERIAL_PASS3
|
||||
#undef STR_SERIAL_PASS4
|
||||
|
||||
#undef STR_HDC
|
||||
#undef STR_FDC
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Parallel port 2"
|
||||
#define STR_PARALLEL3 "Parallel port 3"
|
||||
#define STR_PARALLEL4 "Parallel port 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HD Controller:"
|
||||
#define STR_FDC "FD Controller:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Parallel port 2"
|
||||
#define STR_PARALLEL3 "Parallel port 3"
|
||||
#define STR_PARALLEL4 "Parallel port 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HD Controller:"
|
||||
#define STR_FDC "FD Controller:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Puerto paralelo 2"
|
||||
#define STR_PARALLEL3 "Puerto paralelo 3"
|
||||
#define STR_PARALLEL4 "Puerto paralelo 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Controladora HD:"
|
||||
#define STR_FDC "Controladora FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Rinnakkaisportti 2"
|
||||
#define STR_PARALLEL3 "Rinnakkaisportti 3"
|
||||
#define STR_PARALLEL4 "Rinnakkaisportti 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Kiintolevyohjain:"
|
||||
#define STR_FDC "Levykeohjain:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Port parallèle 2"
|
||||
#define STR_PARALLEL3 "Port parallèle 3"
|
||||
#define STR_PARALLEL4 "Port parallèle 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Contrôleur HD:"
|
||||
#define STR_FDC "Contrôleur FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Paralelna vrata 2"
|
||||
#define STR_PARALLEL3 "Paralelna vrata 3"
|
||||
#define STR_PARALLEL4 "Paralelna vrata 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Kontroler tvrdog diska:"
|
||||
#define STR_FDC "Kontroler diskete:"
|
||||
|
||||
@@ -333,6 +333,10 @@ END
|
||||
#define STR_PARALLEL2 "Párhuzamos port 2"
|
||||
#define STR_PARALLEL3 "Párhuzamos port 3"
|
||||
#define STR_PARALLEL4 "Párhuzamos port 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Merevl.-vezérlő:"
|
||||
#define STR_FDC "Floppy-vezérlő:"
|
||||
|
||||
@@ -329,6 +329,10 @@ END
|
||||
#define STR_PARALLEL2 "Porta parallela 2"
|
||||
#define STR_PARALLEL3 "Porta parallela 3"
|
||||
#define STR_PARALLEL4 "Porta parallela 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Controller HD:"
|
||||
#define STR_FDC "Controller FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "パラレルポート2"
|
||||
#define STR_PARALLEL3 "パラレルポート3"
|
||||
#define STR_PARALLEL4 "パラレルポート4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HDコントローラー:"
|
||||
#define STR_FDC "FDコントローラー:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "병렬 포트 2"
|
||||
#define STR_PARALLEL3 "병렬 포트 3"
|
||||
#define STR_PARALLEL4 "병렬 포트 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HD 컨트롤러:"
|
||||
#define STR_FDC "FD 컨트롤러:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Port równoległy 2"
|
||||
#define STR_PARALLEL3 "Port równoległy 3"
|
||||
#define STR_PARALLEL4 "Port równoległy 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Kontroler dysku twardego:"
|
||||
#define STR_FDC "Kontroler dyskietek:"
|
||||
|
||||
@@ -331,6 +331,10 @@ END
|
||||
#define STR_PARALLEL2 "Porta paralela 2"
|
||||
#define STR_PARALLEL3 "Porta paralela 3"
|
||||
#define STR_PARALLEL4 "Porta paralela 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Controlador HD:"
|
||||
#define STR_FDC "Controlador FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Porta paralela 2"
|
||||
#define STR_PARALLEL3 "Porta paralela 3"
|
||||
#define STR_PARALLEL4 "Porta paralela 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Controlador HD:"
|
||||
#define STR_FDC "Controlador FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Параллельный порт LPT2"
|
||||
#define STR_PARALLEL3 "Параллельный порт LPT3"
|
||||
#define STR_PARALLEL4 "Параллельный порт LPT4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Контроллер HD:"
|
||||
#define STR_FDC "Контроллер FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Paralelna vrata 2"
|
||||
#define STR_PARALLEL3 "Paralelna vrata 3"
|
||||
#define STR_PARALLEL4 "Paralelna vrata 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Krmilnik trdega diska:"
|
||||
#define STR_FDC "Krmilnik disketnika:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Paralel port 2"
|
||||
#define STR_PARALLEL3 "Paralel port 3"
|
||||
#define STR_PARALLEL4 "Paralel port 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "HD Kontrolcüsü:"
|
||||
#define STR_FDC "FD Kontrolcüsü:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "Паралельний порт LPT2"
|
||||
#define STR_PARALLEL3 "Паралельний порт LPT3"
|
||||
#define STR_PARALLEL4 "Паралельний порт LPT4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "Контролер HD:"
|
||||
#define STR_FDC "Контролер FD:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "并口 2"
|
||||
#define STR_PARALLEL3 "并口 3"
|
||||
#define STR_PARALLEL4 "并口 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "硬盘控制器:"
|
||||
#define STR_FDC "软盘控制器:"
|
||||
|
||||
@@ -328,6 +328,10 @@ END
|
||||
#define STR_PARALLEL2 "並列埠 2"
|
||||
#define STR_PARALLEL3 "並列埠 3"
|
||||
#define STR_PARALLEL4 "並列埠 4"
|
||||
#define STR_SERIAL_PASS1 "Serial port passthrough 1"
|
||||
#define STR_SERIAL_PASS2 "Serial port passthrough 2"
|
||||
#define STR_SERIAL_PASS3 "Serial port passthrough 3"
|
||||
#define STR_SERIAL_PASS4 "Serial port passthrough 4"
|
||||
|
||||
#define STR_HDC "硬碟控制器:"
|
||||
#define STR_FDC "軟碟控制器:"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_syswm.h>
|
||||
|
||||
223
src/win/win_serial_passthrough.c
Normal file
223
src/win/win_serial_passthrough.c
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Definitions for platform specific serial to host passthrough
|
||||
*
|
||||
*
|
||||
* Authors: Andreas J. Reichel <webmaster@6th-dimension.com>,
|
||||
* Jasmine Iwanek <jasmine@iwanek.co.uk>
|
||||
*
|
||||
* Copyright 2021 Andreas J. Reichel
|
||||
* Copyright 2021-2022 Jasmine Iwanek
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <86box/86box.h>
|
||||
#include <86box/log.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/serial_passthrough.h>
|
||||
#include <86box/plat_serial_passthrough.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define LOG_PREFIX "serial_passthrough: "
|
||||
|
||||
void
|
||||
plat_serpt_close(void *p)
|
||||
{
|
||||
serial_passthrough_t *dev = (serial_passthrough_t *) p;
|
||||
|
||||
// fclose(dev->master_fd);
|
||||
FlushFileBuffers((HANDLE) dev->master_fd);
|
||||
if (dev->mode == SERPT_MODE_VCON)
|
||||
DisconnectNamedPipe((HANDLE) dev->master_fd);
|
||||
if (dev->mode == SERPT_MODE_HOSTSER) {
|
||||
SetCommState((HANDLE)dev->master_fd, (DCB*)dev->backend_priv);
|
||||
free(dev->backend_priv);
|
||||
}
|
||||
CloseHandle((HANDLE) dev->master_fd);
|
||||
}
|
||||
|
||||
static void
|
||||
plat_serpt_write_vcon(serial_passthrough_t *dev, uint8_t data)
|
||||
{
|
||||
/* fd_set wrfds;
|
||||
* int res;
|
||||
*/
|
||||
|
||||
/* We cannot use select here, this would block the hypervisor! */
|
||||
/* FD_ZERO(&wrfds);
|
||||
FD_SET(ctx->master_fd, &wrfds);
|
||||
|
||||
res = select(ctx->master_fd + 1, NULL, &wrfds, NULL, NULL);
|
||||
|
||||
if (res <= 0) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
/* just write it out */
|
||||
// fwrite(dev->master_fd, &data, 1);
|
||||
DWORD bytesWritten = 0;
|
||||
WriteFile((HANDLE) dev->master_fd, &data, 1, &bytesWritten, NULL);
|
||||
if (bytesWritten == 0) {
|
||||
fatal("serial_passthrough: WriteFile pipe write-buffer full!");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
plat_serpt_set_params(void *p)
|
||||
{
|
||||
serial_passthrough_t *dev = (serial_passthrough_t *)p;
|
||||
|
||||
if (dev->mode == SERPT_MODE_HOSTSER) {
|
||||
DCB serialattr = {};
|
||||
GetCommState((HANDLE)dev->master_fd, &serialattr);
|
||||
#define BAUDRATE_RANGE(baud_rate, min, max) if (baud_rate >= min && baud_rate < max) { serialattr.BaudRate = min; }
|
||||
|
||||
BAUDRATE_RANGE(dev->baudrate, 110, 300);
|
||||
BAUDRATE_RANGE(dev->baudrate, 300, 600);
|
||||
BAUDRATE_RANGE(dev->baudrate, 600, 1200);
|
||||
BAUDRATE_RANGE(dev->baudrate, 1200, 2400);
|
||||
BAUDRATE_RANGE(dev->baudrate, 2400, 4800);
|
||||
BAUDRATE_RANGE(dev->baudrate, 4800, 9600);
|
||||
BAUDRATE_RANGE(dev->baudrate, 9600, 14400);
|
||||
BAUDRATE_RANGE(dev->baudrate, 14400, 19200);
|
||||
BAUDRATE_RANGE(dev->baudrate, 19200, 38400);
|
||||
BAUDRATE_RANGE(dev->baudrate, 38400, 57600);
|
||||
BAUDRATE_RANGE(dev->baudrate, 57600, 115200);
|
||||
BAUDRATE_RANGE(dev->baudrate, 115200, 0xFFFFFFFF);
|
||||
|
||||
serialattr.ByteSize = dev->data_bits;
|
||||
serialattr.StopBits = (dev->serial->lcr & 0x04) ? TWOSTOPBITS : ONESTOPBIT;
|
||||
if (!(dev->serial->lcr & 0x08)) {
|
||||
serialattr.fParity = 0;
|
||||
serialattr.Parity = NOPARITY;
|
||||
} else {
|
||||
serialattr.fParity = 1;
|
||||
if (dev->serial->lcr & 0x20) {
|
||||
serialattr.Parity = (MARKPARITY) + !!(dev->serial->lcr & 0x10);
|
||||
} else {
|
||||
serialattr.Parity = (ODDPARITY) + !!(dev->serial->lcr & 0x10);
|
||||
}
|
||||
}
|
||||
|
||||
SetCommState((HANDLE)dev->master_fd, &serialattr);
|
||||
#undef BAUDRATE_RANGE
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
plat_serpt_write(void *p, uint8_t data)
|
||||
{
|
||||
serial_passthrough_t *dev = (serial_passthrough_t *) p;
|
||||
|
||||
switch (dev->mode) {
|
||||
case SERPT_MODE_VCON:
|
||||
case SERPT_MODE_HOSTSER:
|
||||
plat_serpt_write_vcon(dev, data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
plat_serpt_read_vcon(serial_passthrough_t *dev, uint8_t *data)
|
||||
{
|
||||
DWORD bytesRead = 0;
|
||||
ReadFile((HANDLE) dev->master_fd, data, 1, &bytesRead, NULL);
|
||||
return !!bytesRead;
|
||||
}
|
||||
|
||||
int
|
||||
plat_serpt_read(void *p, uint8_t *data)
|
||||
{
|
||||
serial_passthrough_t *dev = (serial_passthrough_t *) p;
|
||||
int res = 0;
|
||||
|
||||
switch (dev->mode) {
|
||||
case SERPT_MODE_VCON:
|
||||
case SERPT_MODE_HOSTSER:
|
||||
res = plat_serpt_read_vcon(dev, data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static int
|
||||
open_pseudo_terminal(serial_passthrough_t *dev)
|
||||
{
|
||||
char ascii_pipe_name[1024] = { 0 };
|
||||
snprintf(ascii_pipe_name, sizeof(ascii_pipe_name), "\\\\.\\pipe\\86Box\\%s", vm_name);
|
||||
dev->master_fd = (intptr_t) CreateNamedPipeA(ascii_pipe_name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 32, 65536, 65536, NMPWAIT_USE_DEFAULT_WAIT, NULL);
|
||||
if (dev->master_fd == (intptr_t) INVALID_HANDLE_VALUE) {
|
||||
return 0;
|
||||
}
|
||||
pclog("Named Pipe @ %s\n", ascii_pipe_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
open_host_serial_port(serial_passthrough_t *dev)
|
||||
{
|
||||
COMMTIMEOUTS timeouts = {
|
||||
.ReadIntervalTimeout = MAXDWORD,
|
||||
.ReadTotalTimeoutConstant = 0,
|
||||
.ReadTotalTimeoutMultiplier = 0,
|
||||
.WriteTotalTimeoutMultiplier = 0,
|
||||
.WriteTotalTimeoutConstant = 1000
|
||||
};
|
||||
DCB* serialattr = calloc(1, sizeof(DCB));
|
||||
if (!serialattr) return 0;
|
||||
dev->master_fd = (intptr_t) CreateFileA(dev->host_serial_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (dev->master_fd == (intptr_t) INVALID_HANDLE_VALUE) {
|
||||
free(serialattr);
|
||||
return 0;
|
||||
}
|
||||
if (!SetCommTimeouts((HANDLE) dev->master_fd, &timeouts)) {
|
||||
pclog(LOG_PREFIX "error setting COM port timeouts.\n");
|
||||
CloseHandle((HANDLE) dev->master_fd);
|
||||
free(serialattr);
|
||||
return 0;
|
||||
}
|
||||
GetCommState((HANDLE)dev->master_fd, serialattr);
|
||||
dev->backend_priv = serialattr;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
plat_serpt_open_device(void *p)
|
||||
{
|
||||
serial_passthrough_t *dev = (serial_passthrough_t *) p;
|
||||
|
||||
switch (dev->mode) {
|
||||
case SERPT_MODE_VCON:
|
||||
if (open_pseudo_terminal(dev)) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case SERPT_MODE_HOSTSER:
|
||||
if (open_host_serial_port(dev)) {
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/win.h>
|
||||
#include <86box/serial_passthrough.h>
|
||||
#include "../disk/minivhd/minivhd.h"
|
||||
#include "../disk/minivhd/minivhd_util.h"
|
||||
|
||||
@@ -111,6 +112,7 @@ static char temp_pcap_dev[NET_CARD_MAX][128];
|
||||
/* Ports category */
|
||||
static int temp_lpt_devices[PARALLEL_MAX];
|
||||
static int temp_serial[SERIAL_MAX], temp_lpt[PARALLEL_MAX];
|
||||
static int temp_serial_passthrough_enabled[SERIAL_MAX];
|
||||
|
||||
/* Other peripherals category */
|
||||
static int temp_fdc_card, temp_hdc, temp_ide_ter, temp_ide_qua, temp_cassette;
|
||||
@@ -358,11 +360,13 @@ win_settings_init(void)
|
||||
|
||||
/* Ports category */
|
||||
for (i = 0; i < PARALLEL_MAX; i++) {
|
||||
temp_lpt_devices[i] = lpt_ports[i].device;
|
||||
temp_lpt[i] = lpt_ports[i].enabled;
|
||||
temp_lpt_devices[i] = lpt_ports[i].device;
|
||||
temp_lpt[i] = lpt_ports[i].enabled;
|
||||
}
|
||||
for (i = 0; i < SERIAL_MAX; i++) {
|
||||
temp_serial[i] = com_ports[i].enabled;
|
||||
temp_serial_passthrough_enabled[i] = serial_passthrough_enabled[i];
|
||||
}
|
||||
for (i = 0; i < SERIAL_MAX; i++)
|
||||
temp_serial[i] = com_ports[i].enabled;
|
||||
|
||||
/* Storage devices category */
|
||||
for (i = 0; i < SCSI_BUS_MAX; i++)
|
||||
@@ -484,8 +488,10 @@ win_settings_changed(void)
|
||||
i = i || (temp_lpt_devices[j] != lpt_ports[j].device);
|
||||
i = i || (temp_lpt[j] != lpt_ports[j].enabled);
|
||||
}
|
||||
for (j = 0; j < SERIAL_MAX; j++)
|
||||
for (j = 0; j < SERIAL_MAX; j++) {
|
||||
i = i || (temp_serial[j] != com_ports[j].enabled);
|
||||
i = i || (temp_serial_passthrough_enabled[i] != serial_passthrough_enabled[i]);
|
||||
}
|
||||
|
||||
/* Storage devices category */
|
||||
for (j = 0; j < SCSI_BUS_MAX; j++)
|
||||
@@ -578,8 +584,10 @@ win_settings_save(void)
|
||||
lpt_ports[i].device = temp_lpt_devices[i];
|
||||
lpt_ports[i].enabled = temp_lpt[i];
|
||||
}
|
||||
for (i = 0; i < SERIAL_MAX; i++)
|
||||
for (i = 0; i < SERIAL_MAX; i++) {
|
||||
com_ports[i].enabled = temp_serial[i];
|
||||
serial_passthrough_enabled[i] = temp_serial_passthrough_enabled[i];
|
||||
}
|
||||
|
||||
/* Storage devices category */
|
||||
for (i = 0; i < SCSI_BUS_MAX; i++)
|
||||
@@ -1764,8 +1772,10 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
settings_enable_window(hdlg, IDC_COMBO_LPT1 + i, temp_lpt[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < SERIAL_MAX; i++)
|
||||
for (i = 0; i < SERIAL_MAX; i++) {
|
||||
settings_set_check(hdlg, IDC_CHECK_SERIAL1 + i, temp_serial[i]);
|
||||
settings_set_check(hdlg, IDC_CHECK_SERIAL_PASS1 + i, temp_serial_passthrough_enabled[i]);
|
||||
}
|
||||
|
||||
free(lptsTemp);
|
||||
|
||||
@@ -1790,8 +1800,10 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
temp_lpt[i] = settings_get_check(hdlg, IDC_CHECK_PARALLEL1 + i);
|
||||
}
|
||||
|
||||
for (i = 0; i < SERIAL_MAX; i++)
|
||||
for (i = 0; i < SERIAL_MAX; i++) {
|
||||
temp_serial[i] = settings_get_check(hdlg, IDC_CHECK_SERIAL1 + i);
|
||||
temp_serial_passthrough_enabled[i] = settings_get_check(hdlg, IDC_CHECK_SERIAL_PASS1 + i);
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <Windows.h>
|
||||
#include <CommCtrl.h>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/resource.h>
|
||||
|
||||
Reference in New Issue
Block a user