From fe78720d420a39a62d269d30491fe605c9109f84 Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Tue, 10 Jun 2025 15:30:06 +0700 Subject: [PATCH 1/9] Assorted device fixes (Jun 30) -Make the internal video for 3302, ActionPC and ActionTower configurable - --- src/machine/m_at_286_386sx.c | 2 +- src/machine/m_at_386dx_486.c | 4 ++-- src/machine/machine_table.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 29298510c..a295f305a 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -1128,7 +1128,7 @@ machine_at_3302_init(const machine_t *model) device_add(&fdc_at_device); if (gfxcard[0] == VID_INTERNAL) - device_add(¶dise_pvga1a_ncr3302_device); + device_add(machine_get_vid_device(machine)); device_add(&keyboard_at_ncr_device); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 86a1aa087..0becae2b8 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -2447,7 +2447,7 @@ machine_at_actionpc2600_init(const machine_t *model) device_add(&keyboard_ps2_tg_ami_device); if (gfxcard[0] == VID_INTERNAL) - device_add(&tgui9440_onboard_pci_device); + device_add(machine_get_vid_device(machine)); return ret; } @@ -2479,7 +2479,7 @@ machine_at_actiontower8400_init(const machine_t *model) device_add(&intel_flash_bxt_device); // The ActionPC 2600 has this so I'm gonna assume this does too. device_add(&keyboard_ps2_ami_pci_device); if (gfxcard[0] == VID_INTERNAL) - device_add(&gd5430_onboard_pci_device); + device_add(machine_get_vid_device(machine)); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 001d9cb8c..13ac1bee1 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -3692,7 +3692,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = ¶dise_pvga1a_ncr3302_device, .snd_device = NULL, .net_device = NULL }, @@ -9235,7 +9235,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &tgui9440_onboard_pci_device, .snd_device = NULL, .net_device = NULL }, @@ -9276,7 +9276,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &gd5430_onboard_pci_device, .snd_device = NULL, .net_device = NULL }, From a28d3e53200355b99feb92cc7d31ae2748fc343e Mon Sep 17 00:00:00 2001 From: usergithub64 <58270614+usergithub64@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:58:09 +0300 Subject: [PATCH 2/9] Fixes for broken translation Fixes for broken translation --- src/device/isarom.c | 40 ++++++++++++++++++------------------- src/device/novell_cardkey.c | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/device/isarom.c b/src/device/isarom.c index 238314c87..f742a9eae 100644 --- a/src/device/isarom.c +++ b/src/device/isarom.c @@ -212,7 +212,7 @@ isarom_init(const device_t *info) static const device_config_t isarom_config[] = { { .name = "bios_fn", - .description = "BIOS File", + .description = "BIOS file", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -234,7 +234,7 @@ static const device_config_t isarom_config[] = { }, { .name = "bios_size", - .description = "BIOS Size:", + .description = "BIOS size", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -260,7 +260,7 @@ static const device_config_t isarom_config[] = { static const device_config_t isarom_dual_config[] = { { .name = "bios_fn", - .description = "BIOS File (ROM #1)", + .description = "BIOS file (ROM #1)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -271,7 +271,7 @@ static const device_config_t isarom_dual_config[] = { }, { .name = "bios_addr", - .description = "BIOS Address (ROM #1)", + .description = "BIOS address (ROM #1)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -282,7 +282,7 @@ static const device_config_t isarom_dual_config[] = { }, { .name = "bios_size", - .description = "BIOS Size (ROM #1):", + .description = "BIOS size (ROM #1)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -304,7 +304,7 @@ static const device_config_t isarom_dual_config[] = { }, { .name = "bios_fn2", - .description = "BIOS File (ROM #2)", + .description = "BIOS file (ROM #2)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -315,7 +315,7 @@ static const device_config_t isarom_dual_config[] = { }, { .name = "bios_addr2", - .description = "BIOS Address (ROM #2)", + .description = "BIOS address (ROM #2)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -326,7 +326,7 @@ static const device_config_t isarom_dual_config[] = { }, { .name = "bios_size2", - .description = "BIOS Size (ROM #2):", + .description = "BIOS size (ROM #2)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -352,7 +352,7 @@ static const device_config_t isarom_dual_config[] = { static const device_config_t isarom_quad_config[] = { { .name = "bios_fn", - .description = "BIOS File (ROM #1)", + .description = "BIOS file (ROM #1)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -363,7 +363,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_addr", - .description = "BIOS Address (ROM #1)", + .description = "BIOS address (ROM #1)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -374,7 +374,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_size", - .description = "BIOS Size (ROM #1):", + .description = "BIOS size (ROM #1)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -396,7 +396,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_fn2", - .description = "BIOS File (ROM #2)", + .description = "BIOS file (ROM #2)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -407,7 +407,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_addr2", - .description = "BIOS Address (ROM #2)", + .description = "BIOS address (ROM #2)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -418,7 +418,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_size2", - .description = "BIOS Size (ROM #2):", + .description = "BIOS size (ROM #2)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -440,7 +440,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_fn3", - .description = "BIOS File (ROM #3)", + .description = "BIOS file (ROM #3)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -451,7 +451,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_addr3", - .description = "BIOS Address (ROM #3)", + .description = "BIOS address (ROM #3)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -462,7 +462,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_size3", - .description = "BIOS Size (ROM #3):", + .description = "BIOS size (ROM #3)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, @@ -484,7 +484,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_fn4", - .description = "BIOS File (ROM #4)", + .description = "BIOS file (ROM #4)", .type = CONFIG_FNAME, .default_string = NULL, .default_int = 0, @@ -495,7 +495,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_addr4", - .description = "BIOS Address (ROM #4)", + .description = "BIOS address (ROM #4)", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 0x00000, @@ -506,7 +506,7 @@ static const device_config_t isarom_quad_config[] = { }, { .name = "bios_size4", - .description = "BIOS Size (ROM #4):", + .description = "BIOS size (ROM #4)", .type = CONFIG_INT, .default_string = NULL, .default_int = 8192, diff --git a/src/device/novell_cardkey.c b/src/device/novell_cardkey.c index 8820addde..08334e751 100644 --- a/src/device/novell_cardkey.c +++ b/src/device/novell_cardkey.c @@ -109,7 +109,7 @@ static const device_config_t keycard_config[] = { }; const device_t novell_keycard_device = { - .name = "Novell Netware 2.x Key Card", + .name = "Novell NetWare 2.x Key Card", .internal_name = "mssystems", .flags = DEVICE_ISA, .local = 0, From 23f697782efda70e59e48d3661fbaf27cda95fc8 Mon Sep 17 00:00:00 2001 From: usergithub64 <58270614+usergithub64@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:59:15 +0300 Subject: [PATCH 3/9] Fixes for broken translation Fixes for broken translation --- src/floppy/fdc_monster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/floppy/fdc_monster.c b/src/floppy/fdc_monster.c index b91d4db66..04536520f 100644 --- a/src/floppy/fdc_monster.c +++ b/src/floppy/fdc_monster.c @@ -183,7 +183,7 @@ static const device_config_t monster_fdc_config[] = { #if 0 { .name = "bios_size", - .description = "BIOS Size:", + .description = "BIOS size", .type = CONFIG_HEX20, .default_string = NULL, .default_int = 32, From fdfb338ae9d36d3e99112acf4880814867e27932 Mon Sep 17 00:00:00 2001 From: usergithub64 <58270614+usergithub64@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:00:02 +0300 Subject: [PATCH 4/9] Fixes for broken translation Fixes for broken translation --- src/video/vid_ps55da2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/vid_ps55da2.c b/src/video/vid_ps55da2.c index 567d60347..2cc993b8c 100644 --- a/src/video/vid_ps55da2.c +++ b/src/video/vid_ps55da2.c @@ -3441,7 +3441,7 @@ static const device_config_t da2_configuration[] = { // clang-format off { .name = "charset", - .description = "Charset", + .description = "Character set", .type = CONFIG_SELECTION, .default_int = DA2_DCONFIG_CHARSET_JPAN, .selection = { From b746a23768ae376b2a93fd89a5e503c9335d447d Mon Sep 17 00:00:00 2001 From: usergithub64 <58270614+usergithub64@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:00:59 +0300 Subject: [PATCH 5/9] Update the Russian translation Update the Russian translation --- src/qt/languages/ru-RU.po | 135 +++++++++++++++++++++++++++++++++++--- 1 file changed, 126 insertions(+), 9 deletions(-) diff --git a/src/qt/languages/ru-RU.po b/src/qt/languages/ru-RU.po index 19975c2c9..719e5afc0 100644 --- a/src/qt/languages/ru-RU.po +++ b/src/qt/languages/ru-RU.po @@ -598,7 +598,10 @@ msgid "ISA RTC:" msgstr "ISA RTC:" msgid "ISA Memory Expansion" -msgstr "Карта расширения памяти ISA" +msgstr "Карты расширения памяти ISA" + +msgid "ISA ROM Cards" +msgstr "Карты ПЗУ ISA" msgid "Card 1:" msgstr "Карта 1:" @@ -1237,7 +1240,7 @@ msgid "Pen" msgstr "Ручка" msgid "Host CD/DVD Drive (%1:)" -msgstr "CD/DVD-привод хоста (%1:)" +msgstr "CD/DVD Привод хоста (%1:)" msgid "&Connected" msgstr "&Кабель подключен" @@ -1249,7 +1252,7 @@ msgid "Create..." msgstr "Создать..." msgid "Host CD/DVD Drive (%1)" -msgstr "CD/DVD-привод хоста (%1)" +msgstr "CD/DVD Привод хоста (%1)" msgid "Unknown Bus" msgstr "Неизвестная шина" @@ -1413,12 +1416,54 @@ msgstr "Системный MIDI" msgid "MIDI Input Device" msgstr "Устройство ввода MIDI" +msgid "BIOS file" +msgstr "Файл BIOS" + +msgid "BIOS file (ROM #1)" +msgstr "Файл BIOS (ПЗУ #1)" + +msgid "BIOS file (ROM #2)" +msgstr "Файл BIOS (ПЗУ #2)" + +msgid "BIOS file (ROM #3)" +msgstr "Файл BIOS (ПЗУ #3)" + +msgid "BIOS file (ROM #4)" +msgstr "Файл BIOS (ПЗУ #4)" + msgid "BIOS Address" msgstr "Адрес BIOS" +msgid "BIOS address (ROM #1)" +msgstr "Адрес BIOS (ПЗУ #1)" + +msgid "BIOS address (ROM #2)" +msgstr "Адрес BIOS (ПЗУ #2)" + +msgid "BIOS address (ROM #3)" +msgstr "Адрес BIOS (ПЗУ #3)" + +msgid "BIOS address (ROM #4)" +msgstr "Адрес BIOS (ПЗУ #4)" + msgid "Enable BIOS extension ROM Writes" msgstr "Разрешить запись в ПЗУ расширения BIOS" +msgid "Enable BIOS extension ROM Writes (ROM #1)" +msgstr "Разрешить запись в ПЗУ расширения BIOS (ПЗУ #1)" + +msgid "Enable BIOS extension ROM Writes (ROM #2)" +msgstr "Разрешить запись в ПЗУ расширения BIOS (ПЗУ #2)" + +msgid "Enable BIOS extension ROM Writes (ROM #3)" +msgstr "Разрешить запись в ПЗУ расширения BIOS (ПЗУ #3)" + +msgid "Enable BIOS extension ROM Writes (ROM #4)" +msgstr "Разрешить запись в ПЗУ расширения BIOS (ПЗУ #4)" + +msgid "Linear framebuffer base" +msgstr "Линейная база кадрового буфера" + msgid "Address" msgstr "Адрес" @@ -1428,6 +1473,21 @@ msgstr "IRQ" msgid "BIOS Revision" msgstr "Версия BIOS" +msgid "BIOS Version" +msgstr "Версия BIOS" + +msgid "BIOS Versions" +msgstr "Версии BIOS" + +msgid "BIOS Language" +msgstr "Язык BIOS" + +msgid "IBM 5161 Expansion Unit" +msgstr "Блок расширения IBM 5161" + +msgid "IBM Cassette Basic" +msgstr "Кассетный бейсик IBM" + msgid "Translate 26 -> 17" msgstr "Переводить 26 -> 17" @@ -1443,6 +1503,18 @@ msgstr "Инвертировать цвета" msgid "BIOS size" msgstr "Размер BIOS" +msgid "BIOS size (ROM #1)" +msgstr "Размер BIOS (ПЗУ #1)" + +msgid "BIOS size (ROM #2)" +msgstr "Размер BIOS (ПЗУ #2)" + +msgid "BIOS size (ROM #3)" +msgstr "Размер BIOS (ПЗУ #3)" + +msgid "BIOS size (ROM #4)" +msgstr "Размер BIOS (ПЗУ #4)" + msgid "Map C0000-C7FFF as UMB" msgstr "Отображение C0000-C7FFF в качестве UMB" @@ -1518,6 +1590,9 @@ msgstr "Уровень реверберации" msgid "Interpolation Method" msgstr "Метод интерполяции" +msgid "Dynamic Sample Loading" +msgstr "Динамическая загрузка образца" + msgid "Reverb Output Gain" msgstr "Усиление выходного сигнала ревербератора" @@ -1606,7 +1681,7 @@ msgid "Enable Game port" msgstr "Включить игровой порт" msgid "Surround module" -msgstr "Модуль объемного звучания" +msgstr "Модуль объёмного звучания" msgid "CODEC" msgstr "Кодек" @@ -1617,6 +1692,9 @@ msgstr "Поднимать прерывание кодека при настро msgid "SB Address" msgstr "Адрес SB" +msgid "Use EEPROM setting" +msgstr "Использовать настройку EEPROM" + msgid "WSS IRQ" msgstr "IRQ WSS" @@ -1701,6 +1779,9 @@ msgstr "Тип RAMDAC" msgid "Blend" msgstr "Смесь" +msgid "Font" +msgstr "Шрифт" + msgid "Bilinear filtering" msgstr "Билинейная фильтрация" @@ -1746,6 +1827,33 @@ msgstr "Скорость передачи данных" msgid "EMS mode" msgstr "Режим EMS" +msgid "EMS Address" +msgstr "Адрес EMS" + +msgid "EMS 1 Address" +msgstr "Адрес EMS 1" + +msgid "EMS 2 Address" +msgstr "Адрес EMS 2" + +msgid "EMS Memory Size" +msgstr "Размер памяти EMS" + +msgid "EMS 1 Memory Size" +msgstr "Размер памяти EMS 1" + +msgid "EMS 2 Memory Size" +msgstr "Размер памяти EMS 2" + +msgid "Enable EMS" +msgstr "Включить EMS" + +msgid "Enable EMS 1" +msgstr "Включить EMS 1" + +msgid "Enable EMS 2" +msgstr "Включить EMS 2" + msgid "Address for > 2 MB" msgstr "Адрес для > 2 МБ" @@ -1765,10 +1873,10 @@ msgid "BIOS setting + Hotkeys (off during POST)" msgstr "Настройка BIOS + горячие клавиши (отключается во время POST)" msgid "64 kB starting from F0000" -msgstr "64 кБ, начиная с F0000" +msgstr "64 КБ, начиная с F0000" msgid "128 kB starting from E0000 (address MSB inverted, last 64KB first)" -msgstr "128 кБ, начиная с E0000 (адрес MSB инвертирован, сначала последние 64 КБ)" +msgstr "128 КБ, начиная с E0000 (адрес MSB инвертирован, сначала последние 64 КБ)" msgid "Sine" msgstr "Синусоидальная" @@ -1792,7 +1900,7 @@ msgid "45 Hz (JMP2 not populated)" msgstr "45 Гц (без джампера на JMP2)" msgid "Two" -msgstr "Два" +msgstr "Две" msgid "Three" msgstr "Три" @@ -1935,6 +2043,9 @@ msgstr "Янтарный" msgid "Gray" msgstr "Серый" +msgid "Grayscale" +msgstr "Монохромный" + msgid "Color" msgstr "Цветной" @@ -1950,6 +2061,12 @@ msgstr "Другие языки" msgid "Bochs latest" msgstr "Bochs последний" +msgid "Apply overscan deltas" +msgstr "Применить дельты вылетов развёртки" + +msgid "Mono Interlaced" +msgstr "Монохромный с чересстрочной развёрткой" + msgid "Mono Non-Interlaced" msgstr "Монохромный без чересстрочной развёртки" @@ -2095,7 +2212,7 @@ msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for t msgstr "Шрифты TrueType в каталоге \"roms/printer/fonts\" необходимы для эмуляции стандартного матричного принтера ESC/P." msgid "Inhibit multimedia keys" -msgstr "Перехватывать мультимедиа-клавиши" +msgstr "Перехватывать мультимедийные клавиши" msgid "Ask for confirmation before saving settings" msgstr "Запрашивать подтверждение перед сохранением настроек" @@ -2182,7 +2299,7 @@ msgid "Send Control+Alt+Escape" msgstr "Отправить Control+Alt+Escape" msgid "Toggle fullscreen" -msgstr "Переключить на полноэкранный режим" +msgstr "Переключить полноэкранный режим" msgid "Screenshot" msgstr "Скриншот" From fa0925057a26dd6b665b710b3dd8f6ecbd0b5d28 Mon Sep 17 00:00:00 2001 From: usergithub64 <58270614+usergithub64@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:17:44 +0300 Subject: [PATCH 6/9] Update src/qt/languages/ru-RU.po Co-authored-by: Alexander Babikov --- src/qt/languages/ru-RU.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/languages/ru-RU.po b/src/qt/languages/ru-RU.po index 719e5afc0..bb8a9caf5 100644 --- a/src/qt/languages/ru-RU.po +++ b/src/qt/languages/ru-RU.po @@ -1591,7 +1591,7 @@ msgid "Interpolation Method" msgstr "Метод интерполяции" msgid "Dynamic Sample Loading" -msgstr "Динамическая загрузка образца" +msgstr "Динамическая загрузка сэмплов" msgid "Reverb Output Gain" msgstr "Усиление выходного сигнала ревербератора" From 738b084148edfcfc283ad787101a2a3a2756944a Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 10 Jun 2025 18:20:35 +0200 Subject: [PATCH 7/9] Some small fixes to the Plasma (June 10th, 2025) Including a small cleanup as well. And fixes to the attributes. --- src/video/vid_cga_compaq_plasma.c | 162 ++++++++++++++++++++---------- 1 file changed, 107 insertions(+), 55 deletions(-) diff --git a/src/video/vid_cga_compaq_plasma.c b/src/video/vid_cga_compaq_plasma.c index feb9a12c8..db4218a89 100644 --- a/src/video/vid_cga_compaq_plasma.c +++ b/src/video/vid_cga_compaq_plasma.c @@ -174,7 +174,7 @@ compaq_plasma_out(uint16_t addr, uint8_t val, void *priv) Another source (Ralf Brown?) gives 4 = CGA, 5 = EGA, 7 = MDA; This leads me to believe bit 2 is not relevant to the mode. */ - if ((val & 0x03) == 0x03) + if ((val & 0x07) == 0x03) mem_mapping_set_addr(&self->cga.mapping, 0xb0000, 0x08000); else mem_mapping_set_addr(&self->cga.mapping, 0xb8000, 0x08000); @@ -182,7 +182,6 @@ compaq_plasma_out(uint16_t addr, uint8_t val, void *priv) case 0x23c6: self->port_23c6 = val; - compaq_plasma_recalcattrs(self); break; case 0x27c6: @@ -221,10 +220,6 @@ compaq_plasma_in(uint16_t addr, void *priv) case 0x13c6: ret = self->port_13c6; -#if 0 - if ((self->cga.cgamode & 0x28) == 0x00) - ret |= 0x04; -#endif break; case 0x17c6: @@ -264,11 +259,15 @@ compaq_plasma_poll(void *priv) int cursorline; int blink = 0; int underline = 0; + int cursorvisible = 0; + int cursorinvisible = 0; int c; int x; uint32_t ink = 0; uint32_t fg = (self->cga.cgacol & 0x0f) ? amber : black; uint32_t bg = black; + uint32_t black_half = black; + uint32_t amber_half = amber; uint32_t cols[2]; uint8_t dat; uint8_t pattern; @@ -304,8 +303,19 @@ compaq_plasma_poll(void *priv) if ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x60) == 0x20) cursorline = 0; - else - cursorline = (((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) << 1) <= sc) && (((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) << 1) >= sc); + else { + if ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) > 0x07) + cursorvisible = (self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) + 1; + else + cursorvisible = ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) << 1); + + if ((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) > 0x07) + cursorinvisible = (self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) + 2; + else + cursorinvisible = ((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) << 1); + + cursorline = (cursorvisible <= sc) && (cursorinvisible >= sc); + } /* for each text column */ for (x = 0; x < 80; x++) { @@ -319,12 +329,10 @@ compaq_plasma_poll(void *priv) chr = 0x00; attr = 0x00; } - uint8_t hi_bit = attr & 0x08; /* check if cursor has to be drawn */ drawcursor = ((ma == ca) && cursorline && (self->cga.cgamode & 0x08) && (self->cga.cgablink & 0x10)); /* check if character underline mode should be set */ - underline = ((attr & 0x07) == 0x01); - underline = underline || (((self->port_23c6 >> 5) == 2) && hi_bit); + underline = ((self->port_23c6 >> 5) == 1) && (attr & 0x1) && !(attr & 0x6); if (underline) { /* set forecolor to white */ attr = attr | 0x7; @@ -349,11 +357,11 @@ compaq_plasma_poll(void *priv) /* character address */ uint16_t chr_addr = ((chr * 16) + sc) & 0x0fff; - if (((self->port_23c6 >> 5) == 3) && hi_bit) + if ((self->port_23c6 >> 5) == 3) chr_addr |= 0x1000; /* character underline active and 7th row of pixels in character height being drawn */ - if (underline && (sc == 7)) { + if (underline) { /* for each pixel in character width */ for (c = 0; c < 8; c++) buffer32->line[self->cga.displine][(x << 3) + c] = mdaattr[attr][blink][1]; @@ -365,17 +373,39 @@ compaq_plasma_poll(void *priv) buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; } - if (hi_bit) { - if ((self->port_23c6 >> 5) == 1) { + if ((self->port_23c6 >> 5) == 4) { + uint8_t b = (cols[1] & 0xff) >> 1; + uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; + uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; + cols[1] = b | (g << 8) | (r << 16); + b = (cols[0] & 0xff) >> 1; + g = ((cols[0] >> 8) & 0xff) >> 1; + r = ((cols[0] >> 16) & 0xff) >> 1; + cols[0] = b | (g << 8) | (r << 16); + if (drawcursor) { + black_half = black; + amber_half = amber; + uint8_t bB = (black & 0xff) >> 1; + uint8_t gB = ((black >> 8) & 0xff) >> 1; + uint8_t rB = ((black >> 16) & 0xff) >> 1; + black_half = bB | (gB << 8) | (rB << 16); + uint8_t bA = (amber & 0xff) >> 1; + uint8_t gA = ((amber >> 8) & 0xff) >> 1; + uint8_t rA = ((amber >> 16) & 0xff) >> 1; + amber_half = bA | (gA << 8) | (rA << 16); for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 3) + c] ^= (amber ^ black); - } else if ((self->port_23c6 >> 5) == 4) { - for (c = 0; c < 8; c++) { - uint32_t b = ((buffer32->line[self->cga.displine][(x << 3) + c]) >> 1) & 0x7f; - uint32_t g = ((buffer32->line[self->cga.displine][(x << 3) + c]) >> 9) & 0x7f; - uint32_t r = ((buffer32->line[self->cga.displine][(x << 3) + c]) >> 17) & 0x7f; - buffer32->line[self->cga.displine][(x << 3) + c] = b | (g << 8) || (r << 16); - } + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; + } + } else if ((self->port_23c6 >> 5) == 2) { + if (drawcursor) { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; } } ma++; @@ -389,9 +419,20 @@ compaq_plasma_poll(void *priv) if ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x60) == 0x20) cursorline = 0; - else - cursorline = (((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) << 1) <= sc) && (((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) << 1) >= sc); + else { + if ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) > 0x07) + cursorvisible = (self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) + 1; + else + cursorvisible = ((self->cga.crtc[CGA_CRTC_CURSOR_START] & 0x0f) << 1); + if ((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) > 0x07) + cursorinvisible = (self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) + 2; + else + cursorinvisible = ((self->cga.crtc[CGA_CRTC_CURSOR_END] & 0x0f) << 1); + + cursorline = (cursorvisible <= sc) && (cursorinvisible >= sc); + } + for (x = 0; x < 40; x++) { /* video output enabled */ if (self->cga.cgamode & 0x08) { @@ -407,8 +448,7 @@ compaq_plasma_poll(void *priv) /* check if cursor has to be drawn */ drawcursor = ((ma == ca) && cursorline && (self->cga.cgamode & 0x08) && (self->cga.cgablink & 0x10)); /* check if character underline mode should be set */ - underline = ((attr & 0x07) == 0x01); - underline = underline || (((self->port_23c6 >> 5) == 2) && hi_bit); + underline = ((self->port_23c6 >> 5) == 1) && (attr & 0x1) && !(attr & 0x6); if (underline) { /* set forecolor to white */ attr = attr | 0x7; @@ -450,18 +490,41 @@ compaq_plasma_poll(void *priv) } if (hi_bit) { - if ((self->port_23c6 >> 5) == 1) - for (c = 0; c < 8; c++) { - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] ^= (amber ^ black); - buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] ^= (amber ^ black); + if ((self->port_23c6 >> 5) == 4) { + uint8_t b = (cols[1] & 0xff) >> 1; + uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; + uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; + cols[1] = b | (g << 8) | (r << 16); + b = (cols[0] & 0xff) >> 1; + g = ((cols[0] >> 8) & 0xff) >> 1; + r = ((cols[0] >> 16) & 0xff) >> 1; + cols[0] = b | (g << 8) | (r << 16); + if (drawcursor) { + black_half = black; + amber_half = amber; + uint8_t bB = (black & 0xff) >> 1; + uint8_t gB = ((black >> 8) & 0xff) >> 1; + uint8_t rB = ((black >> 16) & 0xff) >> 1; + black_half = bB | (gB << 8) | (rB << 16); + uint8_t bA = (amber & 0xff) >> 1; + uint8_t gA = ((amber >> 8) & 0xff) >> 1; + uint8_t rA = ((amber >> 16) & 0xff) >> 1; + amber_half = bA | (gA << 8) | (rA << 16); + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; } - else if ((self->port_23c6 >> 5) == 4) - for (c = 0; c < 8; c++) { - uint32_t b = ((buffer32->line[self->cga.displine][(x << 4) + (c << 1)]) >> 1) & 0x7f; - uint32_t g = ((buffer32->line[self->cga.displine][(x << 4) + (c << 1)]) >> 9) & 0x7f; - uint32_t r = ((buffer32->line[self->cga.displine][(x << 4) + (c << 1)]) >> 17) & 0x7f; - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = b | (g << 8) || (r << 16); + } else if ((self->port_23c6 >> 5) == 2) { + if (drawcursor) { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; } + } } ma++; } @@ -638,30 +701,18 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self) for (n = 0x11; n <= 0xFF; n++) { if ((n & 7) == 0) continue; - if ((self->port_23c6 >> 5) == 1) { /* Inverse */ - blinkcols[n][0] = normcols[n][0] = amber; - blinkcols[n][1] = normcols[n][1] = black; - } else { /* Normal */ - blinkcols[n][0] = normcols[n][0] = black; - blinkcols[n][1] = normcols[n][1] = amber; - } + blinkcols[n][0] = normcols[n][0] = black; + blinkcols[n][1] = normcols[n][1] = amber; } /* Set up the 01-0E range, controlled by bits 0 and 1 of the * passed value. When blinking is enabled this also affects 81-8E. */ for (n = 0x01; n <= 0x0E; n++) { if (n == 7) continue; - if ((self->port_23c6 >> 5) == 1) { - blinkcols[n][0] = normcols[n][0] = amber; - blinkcols[n][1] = normcols[n][1] = black; - blinkcols[n + 128][0] = amber; - blinkcols[n + 128][1] = black; - } else { - blinkcols[n][0] = normcols[n][0] = black; - blinkcols[n][1] = normcols[n][1] = amber; - blinkcols[n + 128][0] = black; - blinkcols[n + 128][1] = amber; - } + blinkcols[n][0] = normcols[n][0] = black; + blinkcols[n][1] = normcols[n][1] = amber; + blinkcols[n + 128][0] = black; + blinkcols[n + 128][1] = amber; } /* Colours 07 and 0F are always amber on black. If blinking is * enabled so are 87 and 8F. */ @@ -720,6 +771,7 @@ compaq_plasma_init(UNUSED(const device_t *info)) io_sethandler(0x03d0, 0x0010, compaq_plasma_in, NULL, NULL, compaq_plasma_out, NULL, NULL, self); overscan_x = overscan_y = 16; + compaq_plasma_recalcattrs(self); self->cga.rgb_type = device_get_config_int("rgb_type"); cga_palette = (self->cga.rgb_type << 1); From a8df05354b1e7d9770851d520a3b0a63e0619b98 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 10 Jun 2025 18:28:16 +0200 Subject: [PATCH 8/9] Small fix again. --- src/video/vid_cga_compaq_plasma.c | 73 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/src/video/vid_cga_compaq_plasma.c b/src/video/vid_cga_compaq_plasma.c index db4218a89..57aae2bf5 100644 --- a/src/video/vid_cga_compaq_plasma.c +++ b/src/video/vid_cga_compaq_plasma.c @@ -432,7 +432,7 @@ compaq_plasma_poll(void *priv) cursorline = (cursorvisible <= sc) && (cursorinvisible >= sc); } - + for (x = 0; x < 40; x++) { /* video output enabled */ if (self->cga.cgamode & 0x08) { @@ -444,7 +444,6 @@ compaq_plasma_poll(void *priv) chr = 0x00; attr = 0x00; } - uint8_t hi_bit = attr & 0x08; /* check if cursor has to be drawn */ drawcursor = ((ma == ca) && cursorline && (self->cga.cgamode & 0x08) && (self->cga.cgablink & 0x10)); /* check if character underline mode should be set */ @@ -473,7 +472,7 @@ compaq_plasma_poll(void *priv) /* character address */ uint16_t chr_addr = ((chr * 16) + sc) & 0x0fff; - if (((self->port_23c6 >> 5) == 3) && hi_bit) + if ((self->port_23c6 >> 5) == 3) chr_addr |= 0x1000; /* character underline active and 7th row of pixels in character height being drawn */ @@ -489,41 +488,39 @@ compaq_plasma_poll(void *priv) buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; } - if (hi_bit) { - if ((self->port_23c6 >> 5) == 4) { - uint8_t b = (cols[1] & 0xff) >> 1; - uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; - uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; - cols[1] = b | (g << 8) | (r << 16); - b = (cols[0] & 0xff) >> 1; - g = ((cols[0] >> 8) & 0xff) >> 1; - r = ((cols[0] >> 16) & 0xff) >> 1; - cols[0] = b | (g << 8) | (r << 16); - if (drawcursor) { - black_half = black; - amber_half = amber; - uint8_t bB = (black & 0xff) >> 1; - uint8_t gB = ((black >> 8) & 0xff) >> 1; - uint8_t rB = ((black >> 16) & 0xff) >> 1; - black_half = bB | (gB << 8) | (rB << 16); - uint8_t bA = (amber & 0xff) >> 1; - uint8_t gA = ((amber >> 8) & 0xff) >> 1; - uint8_t rA = ((amber >> 16) & 0xff) >> 1; - amber_half = bA | (gA << 8) | (rA << 16); - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; - } - } else if ((self->port_23c6 >> 5) == 2) { - if (drawcursor) { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; - } + if ((self->port_23c6 >> 5) == 4) { + uint8_t b = (cols[1] & 0xff) >> 1; + uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; + uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; + cols[1] = b | (g << 8) | (r << 16); + b = (cols[0] & 0xff) >> 1; + g = ((cols[0] >> 8) & 0xff) >> 1; + r = ((cols[0] >> 16) & 0xff) >> 1; + cols[0] = b | (g << 8) | (r << 16); + if (drawcursor) { + black_half = black; + amber_half = amber; + uint8_t bB = (black & 0xff) >> 1; + uint8_t gB = ((black >> 8) & 0xff) >> 1; + uint8_t rB = ((black >> 16) & 0xff) >> 1; + black_half = bB | (gB << 8) | (rB << 16); + uint8_t bA = (amber & 0xff) >> 1; + uint8_t gA = ((amber >> 8) & 0xff) >> 1; + uint8_t rA = ((amber >> 16) & 0xff) >> 1; + amber_half = bA | (gA << 8) | (rA << 16); + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; + } + } else if ((self->port_23c6 >> 5) == 2) { + if (drawcursor) { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; } } ma++; From dfb601190106e723f3061f2ce990af427ba6f6d6 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 10 Jun 2025 19:02:40 +0200 Subject: [PATCH 9/9] Restore the attribute check (bit 3 of attr) --- src/video/vid_cga_compaq_plasma.c | 150 ++++++++++++++++-------------- 1 file changed, 80 insertions(+), 70 deletions(-) diff --git a/src/video/vid_cga_compaq_plasma.c b/src/video/vid_cga_compaq_plasma.c index 57aae2bf5..5985faae6 100644 --- a/src/video/vid_cga_compaq_plasma.c +++ b/src/video/vid_cga_compaq_plasma.c @@ -329,10 +329,13 @@ compaq_plasma_poll(void *priv) chr = 0x00; attr = 0x00; } + + uint8_t hi_bit = attr & 0x08; /* check if cursor has to be drawn */ drawcursor = ((ma == ca) && cursorline && (self->cga.cgamode & 0x08) && (self->cga.cgablink & 0x10)); /* check if character underline mode should be set */ - underline = ((self->port_23c6 >> 5) == 1) && (attr & 0x1) && !(attr & 0x6); + underline = ((attr & 0x07) == 0x01); + underline = underline || (((self->port_23c6 >> 5) == 1) && hi_bit); if (underline) { /* set forecolor to white */ attr = attr | 0x7; @@ -357,7 +360,7 @@ compaq_plasma_poll(void *priv) /* character address */ uint16_t chr_addr = ((chr * 16) + sc) & 0x0fff; - if ((self->port_23c6 >> 5) == 3) + if (((self->port_23c6 >> 5) == 3) && hi_bit) chr_addr |= 0x1000; /* character underline active and 7th row of pixels in character height being drawn */ @@ -373,39 +376,41 @@ compaq_plasma_poll(void *priv) buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; } - if ((self->port_23c6 >> 5) == 4) { - uint8_t b = (cols[1] & 0xff) >> 1; - uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; - uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; - cols[1] = b | (g << 8) | (r << 16); - b = (cols[0] & 0xff) >> 1; - g = ((cols[0] >> 8) & 0xff) >> 1; - r = ((cols[0] >> 16) & 0xff) >> 1; - cols[0] = b | (g << 8) | (r << 16); - if (drawcursor) { - black_half = black; - amber_half = amber; - uint8_t bB = (black & 0xff) >> 1; - uint8_t gB = ((black >> 8) & 0xff) >> 1; - uint8_t rB = ((black >> 16) & 0xff) >> 1; - black_half = bB | (gB << 8) | (rB << 16); - uint8_t bA = (amber & 0xff) >> 1; - uint8_t gA = ((amber >> 8) & 0xff) >> 1; - uint8_t rA = ((amber >> 16) & 0xff) >> 1; - amber_half = bA | (gA << 8) | (rA << 16); - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; - } - } else if ((self->port_23c6 >> 5) == 2) { - if (drawcursor) { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; + if (hi_bit) { + if ((self->port_23c6 >> 5) == 4) { + uint8_t b = (cols[1] & 0xff) >> 1; + uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; + uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; + cols[1] = b | (g << 8) | (r << 16); + b = (cols[0] & 0xff) >> 1; + g = ((cols[0] >> 8) & 0xff) >> 1; + r = ((cols[0] >> 16) & 0xff) >> 1; + cols[0] = b | (g << 8) | (r << 16); + if (drawcursor) { + black_half = black; + amber_half = amber; + uint8_t bB = (black & 0xff) >> 1; + uint8_t gB = ((black >> 8) & 0xff) >> 1; + uint8_t rB = ((black >> 16) & 0xff) >> 1; + black_half = bB | (gB << 8) | (rB << 16); + uint8_t bA = (amber & 0xff) >> 1; + uint8_t gA = ((amber >> 8) & 0xff) >> 1; + uint8_t rA = ((amber >> 16) & 0xff) >> 1; + amber_half = bA | (gA << 8) | (rA << 16); + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; + } + } else if ((self->port_23c6 >> 5) == 2) { + if (drawcursor) { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 3) + c] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; + } } } ma++; @@ -444,10 +449,13 @@ compaq_plasma_poll(void *priv) chr = 0x00; attr = 0x00; } + + uint8_t hi_bit = attr & 0x08; /* check if cursor has to be drawn */ drawcursor = ((ma == ca) && cursorline && (self->cga.cgamode & 0x08) && (self->cga.cgablink & 0x10)); /* check if character underline mode should be set */ - underline = ((self->port_23c6 >> 5) == 1) && (attr & 0x1) && !(attr & 0x6); + underline = ((attr & 0x07) == 0x01); + underline = underline || (((self->port_23c6 >> 5) == 1) && hi_bit); if (underline) { /* set forecolor to white */ attr = attr | 0x7; @@ -472,7 +480,7 @@ compaq_plasma_poll(void *priv) /* character address */ uint16_t chr_addr = ((chr * 16) + sc) & 0x0fff; - if ((self->port_23c6 >> 5) == 3) + if (((self->port_23c6 >> 5) == 3) && hi_bit) chr_addr |= 0x1000; /* character underline active and 7th row of pixels in character height being drawn */ @@ -488,39 +496,41 @@ compaq_plasma_poll(void *priv) buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; } - if ((self->port_23c6 >> 5) == 4) { - uint8_t b = (cols[1] & 0xff) >> 1; - uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; - uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; - cols[1] = b | (g << 8) | (r << 16); - b = (cols[0] & 0xff) >> 1; - g = ((cols[0] >> 8) & 0xff) >> 1; - r = ((cols[0] >> 16) & 0xff) >> 1; - cols[0] = b | (g << 8) | (r << 16); - if (drawcursor) { - black_half = black; - amber_half = amber; - uint8_t bB = (black & 0xff) >> 1; - uint8_t gB = ((black >> 8) & 0xff) >> 1; - uint8_t rB = ((black >> 16) & 0xff) >> 1; - black_half = bB | (gB << 8) | (rB << 16); - uint8_t bA = (amber & 0xff) >> 1; - uint8_t gA = ((amber >> 8) & 0xff) >> 1; - uint8_t rA = ((amber >> 16) & 0xff) >> 1; - amber_half = bA | (gA << 8) | (rA << 16); - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; - } - } else if ((self->port_23c6 >> 5) == 2) { - if (drawcursor) { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); - } else { - for (c = 0; c < 8; c++) - buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; + if (hi_bit) { + if ((self->port_23c6 >> 5) == 4) { + uint8_t b = (cols[1] & 0xff) >> 1; + uint8_t g = ((cols[1] >> 8) & 0xff) >> 1; + uint8_t r = ((cols[1] >> 16) & 0xff) >> 1; + cols[1] = b | (g << 8) | (r << 16); + b = (cols[0] & 0xff) >> 1; + g = ((cols[0] >> 8) & 0xff) >> 1; + r = ((cols[0] >> 16) & 0xff) >> 1; + cols[0] = b | (g << 8) | (r << 16); + if (drawcursor) { + black_half = black; + amber_half = amber; + uint8_t bB = (black & 0xff) >> 1; + uint8_t gB = ((black >> 8) & 0xff) >> 1; + uint8_t rB = ((black >> 16) & 0xff) >> 1; + black_half = bB | (gB << 8) | (rB << 16); + uint8_t bA = (amber & 0xff) >> 1; + uint8_t gA = ((amber >> 8) & 0xff) >> 1; + uint8_t rA = ((amber >> 16) & 0xff) >> 1; + amber_half = bA | (gA << 8) | (rA << 16); + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber_half ^ black_half); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 1 : 0]; + } + } else if ((self->port_23c6 >> 5) == 2) { + if (drawcursor) { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1] ^ (amber ^ black); + } else { + for (c = 0; c < 8; c++) + buffer32->line[self->cga.displine][(x << 4) + (c << 1)] = buffer32->line[self->cga.displine][(x << 4) + (c << 1) + 1] = cols[(self->font_ram[chr_addr] & (1 << (c ^ 7))) ? 0 : 1]; + } } } ma++;